The daily check that proves the Binderdex download links exist started failing for the most annoying reason: the links worked.
One of the checker's commands, bdx api, has a --no-follow mode that fetches a URL and reports the status without following it. The daily maintenance run checks the download routes that way and asserts each one redirects somewhere sensible. But ok was computed as "status is 2xx", so a 308 Permanent Redirect, the correct healthy answer, came back ok:false and exited 1. Loud failure, nothing actually broken.
A redirect is an answer
The whole fix is one function:
export function apiResultOk(status, { noFollow = false, location } = {}) {
if (status >= 200 && status < 300) return true;
return Boolean(noFollow && location && status >= 300 && status < 400);
}
With --no-follow, a redirect that names its destination is the answer you asked for. Without the flag, or on 4xx and 5xx, nothing changes. The check went green again, so the proof that the app links work stays automated instead of depending on somebody eyeballing the page.
Stop fighting the repo
The second catch was subtler. bdx down tears the dev server down and restores the tree, and it was dirtying one file every single run: the dev server injects an agent-rules block into a doc, and cleanup dutifully stripped that block out. The problem was that a recent change had committed the block on purpose, so cleanup kept undoing a deliberate commit, morning after morning.
The new logic is "strip only what git doesn't already have":
export function stripUncommittedAgentRules(content, committedContent) {
if (!hasAgentRulesBlock(content)) return null;
if (committedContent != null && hasAgentRulesBlock(committedContent)) return null;
return content.replace(BLOCK, "\n");
}
Returning null means leave the file alone. Cleanup can't fight the repo anymore, whatever the repo decided to commit. The lesson generalizes to any teardown script: "restore to the committed state" should consult the committed file, never a memory of what the file ought to look like.