Skip to content

fix(brief): require PR with green CI as no-mistakes terminal condition - #2667

Open
jgrizon wants to merge 15 commits into
kunchenguid:mainfrom
jgrizon:fm/fm-brief-nomistakes-done
Open

fix(brief): require PR with green CI as no-mistakes terminal condition#2667
jgrizon wants to merge 15 commits into
kunchenguid:mainfrom
jgrizon:fm/fm-brief-nomistakes-done

Conversation

@jgrizon

@jgrizon jgrizon commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Fix the no-mistakes definition of done in bin/fm-brief.sh so crewmate worker briefs specify a PR with green CI as the only terminal condition, and explicitly state that a local commit, green local test suite, and completed pipeline step are all NOT done.

Generated no-mistakes section

Before

# Definition of done
Delivery contract: mode=no-mistakes
The task is complete only when committed on your branch.
When you believe it is complete, append `done: {summary}` to the status file and stop.
Firstmate will then instruct you to run /no-mistakes to validate and ship a PR.

You drive no-mistakes by responding to its gates, not by implementing fixes.
Follow the guidance no-mistakes itself provides for the mechanics: it loads when you invoke /no-mistakes, and `no-mistakes axi run --help` plus the `help` lines in each `axi` response are authoritative and version-matched to the installed binary.
When starting no-mistakes, make `--intent` preserve all relevant content from this brief's `# Task` section plus every later accepted Firstmate requirement, clarification, constraint, exclusion, and supersession, carrying only each requirement's current accepted form; retain direct requirements instead of substituting a diff summary, and exclude generic operational, status, delivery, and other scaffold boilerplate unless it is task-specific.
Do not hand-edit, commit, or fix findings yourself while a run is active - the pipeline applies every fix.

Two firstmate-specific rules layer on top of that guidance:
- ask-user findings are never yours to answer: escalate to firstmate (rule 6) and stop.
  Firstmate applies the authority contract in its `AGENTS.md` and obtains any required captain decision.
  When the decision comes back, feed it to the gate with `no-mistakes axi respond` and let the pipeline apply it - do not route the question to "the user" or implement the fix yourself.
- Avoid `--yes`: it would silently bypass firstmate's authority check and any required captain escalation.

After /no-mistakes reports CI green (the CI-ready return point - do not wait for it to keep monitoring in the background until merge), append `done: PR {url} checks green` and stop. You are finished.

After

# Definition of done
Delivery contract: mode=no-mistakes
This task ships via **/no-mistakes**.
The task is done only when a PR exists and its CI is green (`done: PR {url} checks green`), never when a local test run passed.
A local commit, a green local suite, and a completed pipeline step are all NOT done.
When your changes are ready, run /no-mistakes to validate and ship a PR.

You drive no-mistakes by responding to its gates, not by implementing fixes.
Follow the guidance no-mistakes itself provides for the mechanics: it loads when you invoke /no-mistakes, and `no-mistakes axi run --help` plus the `help` lines in each `axi` response are authoritative and version-matched to the installed binary.
When starting no-mistakes, make `--intent` preserve all relevant content from this brief's `# Task` section plus every later accepted Firstmate requirement, clarification, constraint, exclusion, and supersession, carrying only each requirement's current accepted form; retain direct requirements instead of substituting a diff summary, and exclude generic operational, status, delivery, and other scaffold boilerplate unless it is task-specific.
Do not hand-edit, commit, or fix findings yourself while a run is active - the pipeline applies every fix.

Two firstmate-specific rules layer on top of that guidance:
- ask-user findings are never yours to answer: escalate to firstmate (rule 6) and stop.
  Firstmate applies the authority contract in its `AGENTS.md` and obtains any required captain decision.
  When the decision comes back, feed it to the gate with `no-mistakes axi respond` and let the pipeline apply it - do not route the question to "the user" or implement the fix yourself.
- Avoid `--yes`: it would silently bypass firstmate's authority check and any required captain escalation.

After /no-mistakes reports CI green (the CI-ready return point - do not wait for it to keep monitoring in the background until merge), append `done: PR {url} checks green` and stop. You are finished.

Verification

  • bin/fm-lint.sh passes cleanly (ShellCheck 0.11.0, actionlint 1.7.12).
  • tests/fm-brief.test.sh passes all 20 behavior checks including updated and new assertions for no-mistakes terminal conditions and false-finish exclusions.
  • bash tests/fm-ask-user-authority.test.sh passes.
ok - fm-brief.sh: bash -n succeeds
ok - fm-brief.sh: no heredoc is nested inside a command substitution (Bash 3.2 parse-safe)
ok - fm-brief.sh: --help renders the complete header
ok - fm-brief.sh: no-mistakes/direct-PR/local-only briefs generate cleanly
ok - fm-brief.sh: ship --mode is required and closed-set validated
ok - fm-brief.sh: the explicit ship mode wins over the registered posture
ok - fm-brief.sh: --yolo and scout/secondmate --mode are refused, never silently dropped
ok - fm-brief.sh: faster paths use configured authority without stacked review
ok - fm-brief.sh: no-mistakes DOD keeps its apostrophe prose, now parse-safe
ok - fm-brief.sh: ship project-memory wording carries the AGENTS.md authoring bar
ok - fm-brief.sh: --herdr-lab emits the complete hard safety contract
ok - fm-brief.sh: --herdr-lab uses its quoted Firstmate-owned helper path
ok - fm-brief.sh: ship and scout scaffolds make omitted Herdr intent fail-visible
ok - fm-brief.sh: Herdr lab contract covers scouts and rejects secondmate misuse
ok - fm-brief.sh: --no-projects scaffolds a project-less charter and guards misuse
ok - fm-brief.sh: marked requests avoid generic acknowledgements and preserve material reporting
ok - fm-brief.sh: relative directory inputs ignore CDPATH, render stable absolute charter paths, or fail loudly
ok - fm-brief.sh: custom pause verb renders in every scaffold
ok - fm-brief.sh: investigation and visual-review completions load the shared decision policy
ok - fm-brief: scout and secondmate code paths still scaffold well-formed briefs

jgrizon added 15 commits August 20, 2026 09:25
…dapter

agy runs crewmate and scout work only, on a Gemini quota pool separate from
the Claude subscription, with Flash ids cheap enough for mechanical tasks.
It is refused for a secondmate the same way muse is: its Stop hook is a plain
notification with no blocking channel a primary's turn-end guard could hold a
turn open with.

Every fact recorded here was observed live against agy 1.1.15 on macOS arm64;
docs/verification/runtime-backends.md carries the captures.

Launch is `agy --dangerously-skip-permissions --add-dir <worktree> [--model] -i`.
`--add-dir` is load-bearing rather than cosmetic: agy's hook payload carries
workspacePaths, and that array is empty without it even from a git repo root,
so the per-task guard could never match. The separate `--effort` flag is
deliberately omitted because agy's own catalog encodes the level in the model
id, and emitting both would allow a contradictory pair.

Turn-end and busy state ride one firstmate-owned key in the shared global
~/.gemini/config/hooks.json, because agy's only project-scope hook surface
needs a folder-trust grant firstmate will not write. bin/fm-agy-config.sh owns
that edit surgically and refuses on a symlink, malformed JSON, or a non-object
top level. The hook is inert for any session firstmate did not register: it
fires only when a workspace in the payload holds a token pointer resolving to
an entry in a private 0700 registry, and only when Stop reports fullyIdle.
The registry entry, never the worktree pointer the agent can edit, carries the
marker path and busy-event coordinates.

The same installer declares the user-level skills root in skills.json, without
which an agy crewmate cannot see no-mistakes at all - agy scans neither
~/.claude/skills nor ~/.agents/skills, and its documented "~/" entry form is
accepted but not resolved in the global config.

--dangerously-skip-permissions does not suppress agy's folder-trust dialog and
there is no --trust flag, so the spawn accepts it in the pane, but only once
the dialog's own text is on screen and only when the trusting option is the
selected one.

agy's composer is pi's separated shape with a `>` prompt glyph, so it reaches
the existing identity-gated verdict rather than a new shape. Two narrow
additions: the glyph strip is scoped to an agy identity, because applied to pi
it would read a real line beginning "> " as an empty composer; and the scan now
keeps the separator pair holding the cursor, because agy draws a second pair
below its composer while a background task runs.

Teardown's grok/kimi cleanup is generalized to one table and two helpers rather
than a third copy, which also fixes the orca branch's missing fm-busy-state.js
removal.
feat(harness): add the Antigravity CLI (agy) as a verified crewmate adapter
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.

1 participant