Skip to content

fix(bin): preflight PR evidence bodies - #37

Merged
jazz127 merged 2 commits into
housefrom
fm/firstmate-pr-evidence-format-recurring-c1
Sep 25, 2026
Merged

jazz127 merged 2 commits into
housefrom
fm/firstmate-pr-evidence-format-recurring-c1

Conversation

@jazz127

@jazz127 jazz127 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Intent

Workers keep publishing PR descriptions the evidence check rejects. Observed 2026-09-25 on six PRs in one session: quota-axi PR 19, firstmate PRs 33 and 35, and jorgsupercore PRs 544 (twice) and 546. Each failed bin/fm-dod-lib.sh evidence validation only at registration, after the PR was already published, and each needed a manual correction round.

The failures were: missing evidence-artifact lines; "live" labels on mocked-fetch runs; non-ISO evidence-captured times such as "2026-09-25 08:39:26 UTC"; artifacts outside the worktree or task temp dir; and duplicate metadata blocks. The checker accepts exactly one evidence-artifact, one evidence-command and one evidence-captured line in the whole body, while workers naturally write one block per claim. The no-mistakes-generated "N of M scenarios driven live" line itself triggers the claim detector.

Fix idea: have the worker, or the no-mistakes PR step via the brief, run the same evidence validation on the body before publishing, and put the exact line format, the one-block rule and the artifact-location rule in the brief's reporting section.

What Changed

  • Added PR body preflight validation for draft bodies and published GitHub PR readbacks using the shared evidence validator.
  • Updated ship briefs with evidence metadata formatting, single-block, timestamp, artifact-location, and pre-publication/readback requirements.
  • Added documentation and regression coverage for the new preflight workflow and refusal cases.

Risk Assessment

✅ Low: The change is bounded to pre-publication evidence validation, brief instructions, and executable-interface coverage; no source-verifiable defects or intent contradictions were found.

Testing

Ran the preflight and brief-generation CLIs against synthetic local fixtures covering missing and bullet-prefixed metadata, mocked-fetch labels, non-ISO timestamps, outside artifacts, duplicate blocks, valid pipeline-shaped bodies, and a simulated published-body correction flow. After publication, a GitHub readback of this PR exposed missing evidence metadata in the generated description; the description was corrected before reporting ready.

  • Synthetic/offline CLI validation: 2 local scenarios passed; the initial GitHub body readback was refused.
Scenario Result Mode Evidence
Worker runs the draft PR-body preflight and receives acceptance for one valid metadata block while reported malformed evidence bodies are rejected. ✅ pass synthetic/offline bash tests/fm-pr-body-preflight.test.sh; PR-body preflight evidence
Publishing briefs include the exact evidence format, one-block rule, artifact-location rule, and generated live-scenario warning. ✅ pass synthetic/offline bash tests/fm-brief.test.sh; Brief rendering evidence
No-mistakes reads this published PR body back from GitHub before reporting done. ✅ observed forge readback The initial generated body was refused for missing metadata; the corrected description is checked before the ready report.

The initial published-body readback was refused by the shared evidence validator.
evidence-artifact: /tmp/fm-firstmate-pr-evidence-format-recurring-c1/initial-forge-readback-validation.txt
evidence-command: { gh-axi pr view 37 -R jazz127/firstmate --hostname github.com --full; bin/fm-pr-body-preflight.sh --gh-url #37 '/tmp/fm-firstmate-pr-evidence-format-recurring-c1/initial-pr-body.md' '/Users/jarad/.treehouse/firstmate-570371/4/firstmate' '/tmp/fm-firstmate-pr-evidence-format-recurring-c1'; } > '/tmp/fm-firstmate-pr-evidence-format-recurring-c1/initial-forge-readback-validation.txt' 2>&1
evidence-captured: 2026-09-25T10:21:05Z

Evidence: PR-body preflight evidence

Source: PR-body preflight evidence

ok - valid draft body passes preflight
ok - missing artifact: preflight preserves the evidence validator refusal
ok - bullet-prefixed metadata: preflight preserves the evidence validator refusal
ok - mocked fetch labelled live without provenance: preflight preserves the evidence validator refusal
ok - non-ISO capture time: preflight preserves the evidence validator refusal
ok - artifact outside allowed roots: preflight preserves the evidence validator refusal
ok - duplicate metadata blocks: preflight preserves the evidence validator refusal
ok - pipeline-shaped body can mechanically pass with one metadata block
ok - published-body readback refuses a bad body and saves it for correction
ok - corrected published-body readback passes the same validator
all fm-pr-body-preflight tests passed
Evidence: Brief rendering evidence

Source: Brief rendering evidence

ok - fm-brief: scaffolds leave the worker role scope to the launch boundary and keep the secondmate contract
ok - fm-brief.sh: bash -n succeeds
/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-brief.1XeEdS/heredoc-in-substitution.sh:2
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 and bans --yes outright
ok - fm-brief.sh: publishing briefs render the draft-body preflight contract
ok - fm-brief.sh: no-mistakes DOD detects a green PR from the drive call, not a status poll
ok - fm-brief.sh: PR-based done requires a non-draft PR; a deliberate draft declares a wait
ok - fm-brief.sh: no-mistakes ask-user findings use one event plus a verbatim snapshot
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: the documented {TASK} and {FIRSTMATE_SPEC} fills cannot corrupt the Herdr safety gate
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: ship and scout scaffolds teach validation-round pauses
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
ok - fm-brief.sh: scout Lavish hosting follows the bootstrap lavish-axi floor
ok - fm-brief.sh: the home brief include lands last on ship and scout, verbatim, and fails closed
ok - fm-brief.sh: --branch-prefix omitted defaults every ship mode to fm/<task-id>
ok - fm-brief.sh: a --branch-prefix override renders identically across every generated section
ok - fm-brief.sh: an empty --branch-prefix override resolves to a bare <task-id> branch
ok - fm-brief.sh: --branch-prefix is refused on scout and secondmate scaffolds
ok - fm-brief.sh: --branch-prefix value is validated against embedded spaces and a leading dash
Switched to a new branch '$(touch${IFS}/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-brief.1XeEdS/branch-prefix-shell-safe-marker)brief-branch-safe-g3'
ok - fm-brief.sh: ref-format-valid shell metacharacters stay literal in generated branch commands

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.

  • Synthetic/offline CLI validation: 2 local scenarios passed; the initial GitHub body readback was refused.
Scenario Result Mode Evidence
Worker runs the draft PR-body preflight and receives acceptance for one valid metadata block while reported malformed evidence bodies are rejected. ✅ pass synthetic/offline bash tests/fm-pr-body-preflight.test.sh; PR-body preflight evidence
Publishing briefs include the exact evidence format, one-block rule, artifact-location rule, and generated live-scenario warning. ✅ pass synthetic/offline bash tests/fm-brief.test.sh; Brief rendering evidence
No-mistakes reads this published PR body back from GitHub before reporting done. ✅ observed forge readback The initial generated body was refused for missing metadata; the corrected description is checked before the ready report.
  • bash tests/fm-pr-body-preflight.test.sh
  • bash tests/fm-brief.test.sh
  • Captured both command outputs under ~/.no-mistakes/evidence/01M3C08SB9JXHE7RGYCNW204TG
  • Verified the worktree remained unchanged with git status --short
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@jazz127
jazz127 merged commit 7774ba7 into house Sep 25, 2026
1 check passed
@jazz127 jazz127 added the upstream-candidate Worth offering upstream someday - needs the captain's word plus a clean validated cut from main label Sep 26, 2026
@jazz127
jazz127 deleted the fm/firstmate-pr-evidence-format-recurring-c1 branch September 28, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream-candidate Worth offering upstream someday - needs the captain's word plus a clean validated cut from main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant