fix(spawn): refuse a stale no-mistakes delivery target before it can push #7

Merged
john merged 1 commit from fm/wlg-nm-target-defect into main 2026-08-10 14:41:35 +00:00
Owner

What happened

no-mistakes stores a repository push target independent of git remotes, captured at run creation and held in its own state.sqlite.

wishlist-galore's clone had origin pointing at the GitHub mirror instead of Forgejo. I corrected the clone, its linked worktrees, and the tool's bare mirror, verified all three with git remote -v, and reported it fixed.

It was not fixed. Two pipelines pushed branches and opened a pull request on GitHub afterwards, against the captain's Forgejo-only rule. Then a brand-new run still captured GitHub with every git remote correct — reproducible, not a fluke. The tool's own eject + init rebuilt the record and fixed it.

What this adds

bin/fm-spawn.sh now compares the stored no-mistakes delivery target against the project's origin before spawning a no-mistakes ship task, and refuses on a mismatch rather than warning.

Two refusal cases, both fail-closed:

  • No readable origin remote → refuse.
  • No readable state.sqlite, or sqlite3 unavailable → refuse before an unverified pipeline can push, rather than assuming the target is fine.

The diagnostic names the repair (no-mistakes doctor, then no-mistakes init) instead of leaving the operator to work it out.

The decision worth understanding

The check deliberately does not rely on git remote -v. That is precisely the evidence that lied: every remote was correct while the tool still pushed to GitHub. A guard reading only the remotes would have passed the exact situation it exists to catch.

tests/fm-spawn-nm-target.test.sh reproduces that shape directly — Forgejo origin, GitHub still recorded in the tool's database — and asserts the refusal. That is the case that actually occurred, not a synthetic one.

The lesson, recorded rather than just fixed

"I fixed the configuration" and "the system now behaves correctly" are different claims requiring different evidence. A correct setting proves nothing about a process already running against the old one. That gap cost two mirror violations and an hour, and the guard exists so the next person does not repay it.

Scope

Deliberately small — a guard, not a subsystem. No no-mistakes internals touched, no state.sqlite written, no daemon restarted; it serves every lane on this machine.

Note

Shipped direct-PR rather than through the full pipeline. My judgement was that a small internal tooling guard does not warrant it — flagged to the captain as a rigor reduction that is theirs to overrule.

## What happened `no-mistakes` stores a repository push target **independent of git remotes**, captured at run creation and held in its own `state.sqlite`. wishlist-galore's clone had `origin` pointing at the GitHub mirror instead of Forgejo. I corrected the clone, its linked worktrees, and the tool's bare mirror, verified all three with `git remote -v`, and reported it fixed. **It was not fixed.** Two pipelines pushed branches and opened a pull request on GitHub afterwards, against the captain's Forgejo-only rule. Then a **brand-new** run still captured GitHub with every git remote correct — reproducible, not a fluke. The tool's own `eject` + `init` rebuilt the record and fixed it. ## What this adds `bin/fm-spawn.sh` now compares the stored no-mistakes delivery target against the project's `origin` before spawning a no-mistakes ship task, and **refuses** on a mismatch rather than warning. Two refusal cases, both fail-closed: - No readable `origin` remote → refuse. - No readable `state.sqlite`, or `sqlite3` unavailable → refuse **before an unverified pipeline can push**, rather than assuming the target is fine. The diagnostic names the repair (`no-mistakes doctor`, then `no-mistakes init`) instead of leaving the operator to work it out. ## The decision worth understanding **The check deliberately does not rely on `git remote -v`.** That is precisely the evidence that lied: every remote was correct while the tool still pushed to GitHub. A guard reading only the remotes would have passed the exact situation it exists to catch. `tests/fm-spawn-nm-target.test.sh` reproduces that shape directly — Forgejo origin, GitHub still recorded in the tool's database — and asserts the refusal. That is the case that actually occurred, not a synthetic one. ## The lesson, recorded rather than just fixed "I fixed the configuration" and "the system now behaves correctly" are different claims requiring different evidence. A correct setting proves nothing about a process already running against the old one. That gap cost two mirror violations and an hour, and the guard exists so the next person does not repay it. ## Scope Deliberately small — a guard, not a subsystem. No `no-mistakes` internals touched, no `state.sqlite` written, no daemon restarted; it serves every lane on this machine. ## Note Shipped `direct-PR` rather than through the full pipeline. My judgement was that a small internal tooling guard does not warrant it — flagged to the captain as a rigor reduction that is theirs to overrule.
fix(spawn): refuse stale no-mistakes targets
Some checks failed
CI / Lint shell scripts (pull_request) Has been cancelled
CI / Test coverage guard (pull_request) Has been cancelled
CI / Behavior portable parallel 1 (pull_request) Has been cancelled
CI / Behavior portable parallel 2 (pull_request) Has been cancelled
CI / Behavior portable serial 1 (pull_request) Has been cancelled
CI / Behavior portable serial 2 (pull_request) Has been cancelled
CI / Behavior portable serial 3 (pull_request) Has been cancelled
CI / Behavior portable serial 4 (pull_request) Has been cancelled
CI / Behavior tests (Herdr) (pull_request) Has been cancelled
CI / Behavior timing aggregate (pull_request) Has been cancelled
CI / Stock macOS Bash snapshot compatibility (pull_request) Has been cancelled
CI / Repo invariants (pull_request) Has been cancelled
Require no-mistakes / PR must be raised via no-mistakes (pull_request) Has been cancelled
b386fd7f4a
john merged commit 49ed0ce824 into main 2026-08-10 14:41:35 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
john/firstmate!7
No description provided.