Skip to content

fix: remind supervisors to refresh backlog after teardown - #32

Merged
kunchenguid merged 2 commits into
mainfrom
fm/fm-teardown-reminder-r3
Jun 21, 2026
Merged

kunchenguid merged 2 commits into
mainfrom
fm/fm-teardown-reminder-r3

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Add a plain backlog-refresh reminder to firstmate so queued-item readiness stops going stale. The requested scope is intentionally minimal: after successful fm-teardown.sh completion, print a plain stdout reminder telling the supervisor to update data/backlog.md, move the finished id to Done, keep Done to the 10 most recent, re-scan Queued for items unblocked by the finished id or now time-due, and dispatch ready work. Also tighten one AGENTS.md backlog/supervision line to explicitly include time/date-gated queued items whose date has arrived. Do not add grep or auto-scan logic, structured ready-when or blocked-by machine fields, cron jobs, or new scripts.

What Changed

  • Updates bin/fm-teardown.sh to print a post-teardown reminder to refresh data/backlog.md, prune Done entries, re-scan queued work, and dispatch anything ready.
  • Tightens firstmate supervision docs in AGENTS.md to call out time/date-gated queued items whose date has arrived.
  • Keeps the README teardown guidance aligned with the new backlog-refresh reminder.

Risk Assessment

✅ Low: Captain, the change is a narrow reminder/documentation update that runs only after the existing teardown path succeeds and does not alter teardown safety logic.

Testing

Captain, I inspected the intent, ran the existing shell behavior tests, then exercised the successful fm-teardown.sh path with reviewer-visible stdout evidence; stderr was empty, transient worktree fixtures were removed, and the working tree was clean afterward.

Evidence: fm-teardown reminder transcript

$ bin/fm-teardown.sh test-backlog-r3 teardown test-backlog-r3 complete ... 🌱 Backlog: test-backlog-r3 just finished. Update data/backlog.md - move test-backlog-r3 to Done (keep Done to the 10 most recent), then re-scan Queued for items now unblocked ... or now time-due, and dispatch what's ready.

$ bin/fm-teardown.sh test-backlog-r3
teardown test-backlog-r3 complete (window fm-test-backlog-r3, worktree /Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KVNPEVJAYB1NBBC5A3KT98YG/.test-tmp/test-backlog-r3/worktree)
🌱 Backlog: test-backlog-r3 just finished. Update data/backlog.md - move test-backlog-r3 to Done (keep Done to the 10 most recent), then re-scan Queued for items now unblocked (a "blocked-by: test-backlog-r3" may have just cleared) or now time-due, and dispatch what's ready.
$ test ! -e state/test-backlog-r3.meta && echo "state cleanup: meta removed"
state cleanup: meta removed
$ cat .test-tmp/test-backlog-r3/treehouse-call.log
treehouse return --force /Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KVNPEVJAYB1NBBC5A3KT98YG/.test-tmp/test-backlog-r3/worktree
Evidence: AGENTS backlog instruction snippet

AGENTS.md line 489: Re-evaluate Queued on every teardown and every heartbeat: anything whose blocker is gone gets dispatched, and time/date-gated items whose date has arrived get dispatched too.

   473	`data/backlog.md` is the durable queue.
   474	Update it on every dispatch, completion, and decision.
   475	
   476	`` `markdown
   477	## In flight
   478	- [ ] <id> - <one line> (repo: <name>, since <date>)
   479	
   480	## Queued
   481	- [ ] <id> - <one line> (repo: <name>) blocked-by: <id> - <reason>
   482	
   483	## Done
   484	- [x] <id> - <one line> - <https://github.com/owner/repo/pull/number> (merged <date>)
   485	- [x] <id> - <one line> - local main (merged <date>)
   486	- [x] <id> - <one line> - data/<id>/report.md (reported <date>)
   487	`` `
   488	
   489	Re-evaluate Queued on every teardown and every heartbeat: anything whose blocker is gone gets dispatched, and time/date-gated items whose date has arrived get dispatched too.
   490	
   491	Keep Done to the 10 most recent entries; prune older ones whenever you add to the section.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • tests/fm-wake-queue.test.sh
  • Created a temporary scout-style teardown fixture for test-backlog-r3, ran bin/fm-teardown.sh test-backlog-r3 with a fake treehouse return --force on PATH, captured stdout/stderr, and grepped stdout for the completion line plus the Done pruning, blocked-by, time-due, and dispatch reminder text.
  • nl -ba AGENTS.md | sed -n &#39;473,491p&#39; &gt; /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KVNPEVJAYB1NBBC5A3KT98YG/agents-backlog-instruction.txt plus a targeted grep -F for the time/date-gated queued-item instruction.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid
kunchenguid merged commit 15812b5 into main Jun 21, 2026
4 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-teardown-reminder-r3 branch June 21, 2026 18:28
vipentti pushed a commit to vipentti/firstmate that referenced this pull request Aug 5, 2026
…d#32)

* remind supervisor to refresh backlog

* no-mistakes(document): Sync teardown backlog docs
This was referenced Aug 7, 2026
@bpsf

bpsf commented Sep 7, 2026

Copy link
Copy Markdown

Independent review of head a92a5362

Verdict: mergeable with one listed open item.

The PR delivers the story: explicit --mode direct-pr, no-mistakes unchanged as default, run optional only in direct-PR mode, run validation still refused in pipeline mode, byte-identical rendering on the existing pipeline path, honest labels, forge-head binding, sanitization, unknown timing, and an honest mixed-mode aggregate. No schema bump is needed because identity.no_mistakes_run already existed and main never read it.

Finding 1 (medium): direct-PR receipt records a ci_step duration the report says does not exist

  • bin/fm-delivery-report.sh: the direct-PR override (ci_step=unknown; parked=unknown) lives only in render_report (~L521). write_receipt (~L735) recomputes ci_step=$(duration_or_status ci_step ci) with no mode branch.
  • Trigger: render --mode direct-pr --timeline t.json where the timeline has no no_mistakes_run but its stages include {"name":"ci_step","duration_seconds":2538}. The script accepts it.
  • Observed: report row | CI step | unknown - direct-PR has no no-mistakes pipeline stage |; receipt "ci_step_seconds":"2538" with "no_mistakes_run":"unknown". The receipt is what aggregate consumes, so a direct-PR receipt carries a pipeline-stage duration under a report that denies one exists.
  • Coverage: the new direct-PR test uses no timeline, so deleting the override entirely leaves both new tests green (mutation probe).
  • Smallest remedy: add the same mode branch in write_receipt (or hoist both lines into one helper used by both), and add one assertion to the direct-PR test with a timeline that carries a ci_step stage: report CI step | unknown and receipt .durations.ci_step_seconds == "unknown". If the timeline should win instead, apply that in both outputs and reconcile the report note. Either way the two outputs must agree.
  • Today aggregate does not read ci_step_seconds, so no current aggregate line is wrong; the receipt is.

Verified (suite + targeted probes only, from disposable copies of main and this head)

  • tests/fm-delivery-report.test.sh: 38 ok at this head; main also green.
  • Byte identity vs main (cmp): minimal-args render (report + receipt), explicit --mode no-mistakes render, baseline-timeline render (report + receipt), publish against an attested body (published body + stdout). All identical.
  • Direct-PR render/publish without --run: succeeds, fake no-mistakes never invoked, Validation: direct-PR, receipt schema still fm-delivery-receipt-v1.
  • Forge-head binding in direct-PR mode: stale forge head refused, matching head publishes with Publication binding: GitHub forge head; a CI run on a different head is refused; hostile gate fixture leaves no secret or path in report or body.
  • Pipeline mode refusals: no --run, timeline without no_mistakes_run, --run unknown, timeline no_mistakes_run: "unknown" all refused, so "unknown" in a receipt can only come from direct-PR mode.
  • Aggregate over pipeline + direct-PR + legacy receipt lacking the field: no-mistakes=1 · direct-PR=1 · unknown=1; main's aggregate still reads the same receipts.
  • Mutation probes against the two new tests: reverting the minimal-timeline run requirement, the collect guard, the identity gate, --mode parsing, the aggregate line, or the direct-PR label each fails a test. Removing the render-side ci_step/parked override does not (finding 1).
  • docs/scripts.md row and the script header are accurate.

Full report with commands and outputs is recorded in the Firstmate home (data/fm-29-review/report.md).

Independent review (Firstmate scout, cursor-bugbot-review)

iscooter added a commit to iscooter/firstmate that referenced this pull request Sep 21, 2026
…gates

Fourteen tasks, TDD throughout. Task 0 captures the real PRs kunchenguid#27, kunchenguid#32
and kunchenguid#37 as fixtures first, so every gate is written against genuine
GitHub payloads rather than imagined ones — those three give a full
pass, a classification rejection, and a non-bot rejection.

Task 1 proves the deploy gate by breaking the rules file on purpose and
watching the build fail, rather than asserting it works.

Glob matching gets its own task: only three pattern forms are used, so
a dependency is not worth it, but a subtly wrong inlined matcher fails
open on exactly the path rules that matter.

Rendering is split from the gate logic because PLAT-1190's readability
criterion is a human judgement and deserves its own review surface —
Task 8 ends by printing all three rationales to read as a stranger.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
iscooter added a commit to iscooter/firstmate that referenced this pull request Sep 21, 2026
Six tasks, one per fix plus a regression pin and QA confirmation.
Written against v1.5.0's actual code - the exact line being replaced in
each of the three functions is quoted, so the implementer is editing
what is there rather than what a spec imagined.

The load-bearing test is the conclusion table: all eight of GitHub's
check conclusions asserted into exactly one bucket, so a future added
value surfaces as a failure rather than silently grading low.

Task 5 pins PR kunchenguid#27 and kunchenguid#32's verdicts explicitly. Every fix here makes
the service stricter, and a stricter service that flips the one pull
request demonstrating a pass has broken something - the plan says to
treat that as the fix being wrong, not the fixture.

Task 6 Step 3 warns that the risk grade may legitimately move if a
scanner came back cancelled this run. That is the A1 fix working, and
without the warning it reads as a regression.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
NewAiCoder added a commit to NewAiCoder/firstmate that referenced this pull request Sep 26, 2026
…tream-4

feat(bin): merge upstream firstmate into fork main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants