Skip to content

feat: add authoritative review diff helper - #17

Merged
kunchenguid merged 2 commits into
mainfrom
fm/fm-review-diff-r5
Jun 14, 2026
Merged

kunchenguid merged 2 commits into
mainfrom
fm/fm-review-diff-r5

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Add a read-only bin/fm-review-diff.sh helper so firstmate reviews crewmate branches against the authoritative base instead of a stale pooled clone local default ref. The helper should resolve worktree and project from state/.meta, detect the default branch with the same origin/HEAD then main/master fallback used by fm-merge-local.sh and fm-teardown.sh, verify fm/ or fall back to the worktree current branch, fetch only origin/ for remote-backed projects, use the local default branch for local-only projects, print a header naming the base, support --stat mode, show no changes gracefully, and avoid pulls, merges, or working-tree mutation. Update AGENTS.md so local-only review and general branch diff review use the helper, with a concise stale-local-ref note, while matching existing bin script conventions.

What Changed

  • Adds bin/fm-review-diff.sh, a read-only helper that resolves a task worktree from state/<id>.meta, compares fm/<id> or the current branch against the authoritative default branch, and supports full patch or --stat output.
  • Handles remote-backed projects by fetching only origin/<default>, handles local-only projects against the local default branch, and reports unchanged branches gracefully.
  • Updates firstmate documentation to use the helper for local-only and general branch diff reviews so stale pooled-clone default refs do not skew review diffs.

Risk Assessment

✅ Low: The change is a small, bounded read-only review helper plus documentation updates, and it follows the existing default-branch and guard conventions without introducing material risks.

Testing

Baseline inspection confirmed only AGENTS.md and bin/fm-review-diff.sh changed; end-to-end CLI fixtures exercised remote-backed stale-base fetching, local-only review, no-change output, current-branch fallback, --stat, default full diff, and master fallback successfully, with temporary working-tree artifacts cleaned up afterward.

Evidence: fm-review-diff end-to-end CLI transcript

Transcript shows stale origin/main before helper, updated origin/main after helper, correct diff bases for remote/local/master, no-change handling, current-branch fallback, stat output, and full patch output. Guard warnings appear because the isolated test created fake task metadata without running the normal supervisor loop; they did not affect helper behavior.

== Remote-backed project fetches authoritative default branch ==
origin/main before helper: 7d5b9658301e3630064a852a71dc980c791fdcd2
remote main: 28c618f892ceb6fd21b9019f10c8dfffc9c4b3d0
WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.
diff base: origin/main
 feature.txt | 1 +
 1 file changed, 1 insertion(+)
origin/main after helper: 28c618f892ceb6fd21b9019f10c8dfffc9c4b3d0

== No changes are reported gracefully ==
WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.
diff base: origin/main
no changes vs origin/main

== Local-only project uses local default branch ==
WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.
diff base: main
 local-feature.txt | 1 +
 1 file changed, 1 insertion(+)

== Missing fm/<id> falls back to current branch ==
WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.
diff base: main
 fallback.txt | 1 +
 1 file changed, 1 insertion(+)

All fm-review-diff behavior checks passed.

== Default output prints stat plus full diff and master fallback ==
WARNING: tasks are in flight but no watcher has ever run (no liveness beacon).
Restart it NOW, before anything else: run bin/fm-watch.sh as a background task.
diff base: master
 readme.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/readme.txt b/readme.txt
index 90be1f3..294186e 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1 +1 @@
-before
+after

Additional full-diff behavior check passed.

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.

  • git status --short && git diff --stat 1d1db259114a47af8a7190f051dc8de94bec4905..21fb0fde44252c8059811df0e587090fe8c551d1
  • Temporary remote-backed git fixture: created a stale local origin/main, ran ./bin/fm-review-diff.sh remote-stale --stat, and verified the helper fetched only the authoritative default branch before diffing fm/remote-stale.
  • Temporary remote-backed no-change fixture: ran ./bin/fm-review-diff.sh no-change and verified it printed no changes vs origin/main gracefully.
  • Temporary local-only fixture: ran ./bin/fm-review-diff.sh local-only --stat and verified it used local main as the base without a remote fetch.
  • Temporary fallback fixture: ran ./bin/fm-review-diff.sh fallback --stat with no fm/fallback branch and verified it diffed the current branch against main.
  • Temporary master fallback/full-output fixture: ran ./bin/fm-review-diff.sh master-full and verified default output included both stat and full patch against master.
  • git status --short after testing to verify transient working-tree artifacts were removed.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid
kunchenguid merged commit 363fa89 into main Jun 14, 2026
3 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-review-diff-r5 branch June 14, 2026 20:52
vipentti pushed a commit to vipentti/firstmate that referenced this pull request Aug 5, 2026
* Add authoritative review diff helper

* no-mistakes(document): Document fm-review-diff helper
@bingb0t5

Copy link
Copy Markdown

Rebased onto current main; no-mistakes attestation parked until Codex reset 2026-09-15 08:24 ICT.

NewAiCoder pushed a commit to NewAiCoder/firstmate that referenced this pull request Sep 26, 2026
…henguid#17)

fm-spawn.sh launch_template() now includes attribution commit/pr empty and sessionUrl false in the inline --settings JSON for the minimal-surface and full claude launch variants, so spawned workers never write attribution trailers. Test on the rendered launch command.
@pragyancf

Copy link
Copy Markdown

What this does

WS-2/T0 golden-epic decomposition eval: the measuring stick every later Shop Lead prompt gets scored against. Versioned golden-epic fixtures plus a human-judged rubric for plan quality (task boundaries, workbench assignments, verification coverage, escalation honesty), with a harness for running a plan against the rubric.

Review path (in this order)

  1. docs/decomp-eval.md — start here. The rubric dimensions and scoring method; your opinion matters most on whether the dimensions capture what makes a decomposition good.
  2. tools/decomp-eval/fixtures/epics/ — the three golden epics (including the Redis pool-leak shape: audit, rewrite, hammer). Ask: do these cover the shapes Leads will actually face?
  3. tools/decomp-eval/src/rubric.ts + eval.ts — scoring mechanics.
  4. tools/decomp-eval/test/ — golden and rubric tests.

How to verify

  • npm run ci green (required check on this PR).

Decisions to opine on

  • Rubric dimensions: anything missing (cost-awareness? risk flagging?) before Leads get scored against it?
  • Fixture coverage: are three epics enough, or do you want a failure-shaped epic (un-decomposable, must escalate) in the set?

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
)

* fix(afk): deliver escalations on Claude framed composers

The Pi incomplete-separator wipe was clearing Claude's live bare ❯ when
full-width frame rules sat below it, so away-mode injection deferred
forever (0 deliveries). Keep bare agent glyphs, refuse idle+unknown at
daemon startup, and clear .afk on refused starts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): add bounded retries to startup delivery probe on transient unknown

* fix(composer): make idle glyph classify locale-safe under LC_ALL=C

Bracket-class bare-prompt matching and ${var#??} glyph strips walked UTF-8
bytes under C locale, so box-drawing borders and ❯ placeholders misread as
pending and blocked away-mode delivery classification.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): defer away-mode delivery probe to first idle cycle

* no-mistakes(review): reap watcher child on deferred delivery probe abort

* test: stub compatible tasks-axi for scout teardown under sanitized PATH

Gate worktrees often lack host nvm tasks-axi, so fm-decision-hold verify
refused Orca/zellij/backend scout teardown success cases. Install a shared
compatible stub into those fixtures' fakebins.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…ream-catchup-2026-11-01

feat(bin): merge upstream firstmate through 49dc31b
ghazni101 pushed a commit to ghazni101/firstmate-dsh that referenced this pull request Nov 19, 2026
…estore spawn suites' (kunchenguid#17) from fm/spawn-surfaces-green into 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.

3 participants