Skip to content

feat(bin): gate upstream PRs on a prior-art duplicate check - #44

Merged
jazz127 merged 21 commits into
housefrom
fm/firstmate-upstream-prior-art-check-r1
Sep 26, 2026
Merged

jazz127 merged 21 commits into
housefrom
fm/firstmate-upstream-prior-art-check-r1

Conversation

@jazz127

@jazz127 jazz127 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Intent

i think we should build a check somewhere into all of this that people submitting PRs to his repos have somehow checked there's no existing PRs. All his automation is swamped and we just saw like tons of dupes and probabl have done our own

Context: while inventorying two Firstmate bugs on 2026-09-26, the fleet found about ten open, unmerged upstream PRs from different contributors attacking the same "paused worker flagged as stale" bug, and several more for the Pi composer restart bug - duplicate work that swamps the maintainer's (Kun's) triage automation on kunchenguid/* repositories. The fleet itself contributes to kunchenguid/quota-axi and may one day contribute to kunchenguid/firstmate, and may have filed duplicates too. Upstream contributions from this fleet only happen on the captain's explicit order, through the fork's house-line guard for upstream contribution branches (fork PR #21) and the pending Bosun workflow (fork PR #38, not yet merged).

What Changed

  • Adds bin/fm-upstream-prior-art.py with five operations: scan, decide, check, publish and verify. scan searches the target GitHub repo for open PRs and issues, plus recent closed unmerged PRs, that look like duplicates. It builds its searches from linked issues and from keywords in the title, summary and changed symbols, and checks changed-file overlap only on the candidates that search returns. It saves a local JSON receipt that:

    • marks the scan incomplete if it hits the request or time budget, and discloses any search results it did not read;
    • requires a verdict: none-found, distinct with a reason for each candidate, or overlaps with the captain's recorded decision.

    publish rechecks the receipt right before calling gh-axi pr create and adds a Prior art checked section to the PR body. It refuses a receipt that is missing, over one hour old, incomplete or unresolved, or whose head, diff, title or summary has changed.

  • Adds these checks for PRs to GitHub repos the fleet does not own:

    • A new bin/fm-upstream-push-guard.sh runs from a shipping task's pre-push hook. It blocks a push to a GitHub repo other than the worktree's origin unless the receipt is fresh and matches that repo and head.
    • fm-git-strip-ai-trailers.sh install now accepts an optional pre-push guard command and runs it before the repo's own pre-push hook. fm-spawn.sh installs it for tasks of kind ship whose mode is not local-only.
    • fm-pr-check.sh and done-acceptance in fm-dod-lib.sh now run verify --published on the receipt. It accepts the scanned head, or a published head the forge reports as strictly ahead of it, and refuses a force-push or rewrite.
  • Updates the delivery-contract text in fm-dod-lib.sh:

    • direct-PR tasks that target upstream repos must publish through the guarded publish path;
    • no-mistakes tasks that target upstream repos must pass scan, decide and check before the run starts.

    PRs to repos the fleet owns still use the old path. docs/fork-house-branch.md and AGENTS.md document the gate, its search limits and the pipeline push paths the pre-push hook does not cover.

🤖 Generated with Claude Code

Risk Assessment

🚨 High: The new spawn-time core.hooksPath override applies to every non-local ship task and stops project hooks (husky, git-lfs pre-push) from running, and the published-head equality check likely refuses registration for normal no-mistakes upstream runs.

Testing

I ran the three focused behavioural suites (prior-art CLI with the offline fake forge, AI-trailer hook installer, DoD library); all passed. Two scenarios ran against real GitHub, read-only with nothing written to the forge: the scan of kunchenguid/firstmate and the published-head check through GitHub's compare API. The decide/check, push-guard, backstop and brief runs are offline: local runs of the real scripts over the real receipt, with the pre-push hook invoked the way git invokes it rather than pushing to GitHub. A read-only scan of kunchenguid/firstmate finished in 58s with 68 candidates, 17 of them paused-worker duplicates. Decide and check refused a missing verdict, a "distinct" claim over overlapping candidates, overlaps without a captain decision, and a branch that moved after the scan. The installed pre-push hook refused upstream pushes with no receipt or an unscanned SHA, passed owned-fork and non-GitHub pushes, and ran the project's husky-style hooks after each pass but never after a refusal. verify --published and the registration backstop accepted the live PR #44 head, which descends from the scanned head per GitHub's compare API, and refused diverged and behind heads. The brief blocks render /tmp/fm-<id>/prior-art.json, which matches spawn's TASK_TMP. I did not drive a real fm-spawn of a ship task in a lab primary. The scratch clone was removed; evidence is in the evidence directory.

  • Live validation: ✅ go - 2 of 10 scenarios driven live against the product (the read-only upstream scan and the GitHub compare check); seven more ran offline as local runs of the real scripts, and one is untested
Scenario Result Live Evidence
A worker scans kunchenguid/firstmate before contributing a paused-worker-stale fix and gets a receipt listing the existing duplicate PRs and issues within practical time ✅ pass live live-scan-firstmate.txt (exit 0, 58s, 68 candidates, 77 requests); live-paused-worker-candidates.tsv (17 paused-worker PRs/issues from many contributors, e.g. kunchenguid#2451, kunchenguid#5084, kunchenguid#5649)
The worker cannot clear the gate without judging every candidate: missing verdicts, 'distinct' over overlapping candidates, and overlaps without a captain decision are refused; with a captain decision… ✅ pass offline live-decide-check.txt cases 1-4
A receipt goes stale when the branch moves after the scan, and check/publish refuse it; publish also refuses a missing or incomplete receipt before any forge write ✅ pass offline live-decide-check.txt case 6; live-publish-refusals.txt (the pr-create safety shim was never reached)
Adversarial: a worker pushes to the upstream repo with no receipt, or pushes a SHA it never scanned; the installed pre-push hook refuses and the project's pre-push does not run ✅ pass offline live-push-guard.txt (upstream NO receipt -> exit 1; unscanned HEAD~1 -> exit 1; project hook log empty both times)
The push guard does not break project hooks: with core.hooksPath=.husky, a real commit runs the project's pre-commit, and every allowed push runs the project's pre-push with the same refs on stdin ✅ pass offline live-push-guard.txt (pre-commit ran; project pre-push got identical ref lines after each passing guard)
Tasks that do not target an upstream repo are unaffected: real push to a local remote, push to the owned fork, and upstream branch deletion all pass without a receipt ✅ pass offline live-push-guard.txt; live-registration-backstop.txt (owned repo -> exit 0)
After the pipeline adds commits, PR registration and done acceptance accept a forge head that descends from the scanned head, and refuse a rewritten (diverged) or behind head ✅ pass live live-verify-published.txt (GitHub compare: ahead -> ok, diverged/behind -> refused); live-registration-backstop.txt (fm_dod_upstream_receipt_check with the live PR #44 head -> ok; rewritten -> refused…
Receipt repository matching ignores case (e.g. KunChenGuid/FirstMate, Jazz127/FirstMate) ✅ pass offline live-decide-check.txt case 5; live-verify-published.txt mixed-case case
Worker briefs name the exact record path the guard and backstop read ✅ pass offline live-registration-backstop.txt: both blocks render --record /tmp/fm-demo-7/prior-art.json, matching fm-spawn.sh TASK_TMP=/tmp/fm-$ID
A real fm-spawn of an upstream ship task in a lab home installs the guarded pre-push in the worker pane ⏸️ untested no This needs a disposable lab home with a live harness primary (per the runbook, bin/fm-lab-home.sh create plus a claude primary on the fm-lab tmux socket) to spawn a real ship worker. That full lif…
Evidence: Live kunchenguid/firstmate scan transcript (58s, 68 candidates)

Source: Live kunchenguid/firstmate scan transcript (58s, 68 candidates)

$ fm-upstream-prior-art.py scan --repo kunchenguid/firstmate --title "fix: don't flag paused worker as stale" --summary-file summary.txt --record prior-art.json --base base
2026-09-26T00:56:13Z
prior-art scan recorded 68 candidates: /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-pa-live.L5PvhV/prior-art.json
exit=0 elapsed=58s
Evidence: Paused-worker duplicate PRs/issues surfaced by the live scan

Source: Paused-worker duplicate PRs/issues surfaced by the live scan

open	https://github.com/kunchenguid/firstmate/issues/2713	tiago-peixoto	Watcher: agent liveness suppresses a declared paused: wait, so healthy parked workers are surfaced and exited ones are not
open	https://github.com/kunchenguid/firstmate/issues/3942	sunildeesu	Declared `paused:` external wait does not suppress the watcher's pane-based stale alarm
open	https://github.com/kunchenguid/firstmate/issues/4154	josecarvallo	Watcher wedge-escalates a paused: crew forever when its run step is stalled on the same external wait
open	https://github.com/kunchenguid/firstmate/issues/5415	gilrallo	Watcher re-surfaces a live worker's declared paused: wait as stale every few polls
open	https://github.com/kunchenguid/firstmate/pull/2451	victorkardel	watch paused suppression
open	https://github.com/kunchenguid/firstmate/pull/2552	pm-justinm	fix: keep paused decision keys open
closed	https://github.com/kunchenguid/firstmate/pull/3878	wjkawecki-jt	fix: prevent stale paused-task wakes from triggering false stalls
open	https://github.com/kunchenguid/firstmate/pull/4070	jackChallis	test: pin paused status as nonterminal
open	https://github.com/kunchenguid/firstmate/pull/4420	VedantAnand17	feat(brief): add Lavish-loop paused rule to every scaffold brief
open	https://github.com/kunchenguid/firstmate/pull/4430	NewAiCoder	fix(supervision): revalidate paused no-mistakes claims via registered out-of-worktree clones
open	https://github.com/kunchenguid/firstmate/pull/4811	tiago-peixoto	fix(bin): keep a declared pause on the bounded cadence whatever the agent's liveness
open	https://github.com/kunchenguid/firstmate/pull/4893	tiago-peixoto	fix(bin): declare captain holds on the worker status log so watchers track the pause
open	https://github.com/kunchenguid/firstmate/pull/5084	matsui85	fix(bin): escalate overdue paused rechecks to the short stale cadence
open	https://github.com/kunchenguid/firstmate/pull/5111	matsui85	fix(fm-watch): advance a task's own status log when a paused-until recheck fires
open	https://github.com/kunchenguid/firstmate/pull/5286	connectwithclayton	fix(bin): keep GitHub readers paused across re-registration
open	https://github.com/kunchenguid/firstmate/pull/5571	g-rallo	fix(bin): bound a held task's paused: last line with the captain hold
open	https://github.com/kunchenguid/firstmate/pull/5649	Xelanor	fix(bin): annotate first stale of a live paused worker
Evidence: Live receipt for kunchenguid/firstmate

Source: Live receipt for kunchenguid/firstmate

{
  "candidates": [
    {
      "author": "tiago-peixoto",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker",
        "shared keywords: paused, watcher, workers"
      ],
      "state": "open",
      "title": "Watcher: agent liveness suppresses a declared paused: wait, so healthy parked workers are surfaced and exited ones are not",
      "url": "https://github.com/kunchenguid/firstmate/issues/2713",
      "verdict": "overlaps"
    },
    {
      "author": "sunildeesu",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker",
        "shared keywords: paused, stale, watcher"
      ],
      "state": "open",
      "title": "Declared `paused:` external wait does not suppress the watcher's pane-based stale alarm",
      "url": "https://github.com/kunchenguid/firstmate/issues/3942",
      "verdict": "overlaps"
    },
    {
      "author": "josecarvallo",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker",
        "shared keywords: paused, watcher"
      ],
      "state": "open",
      "title": "Watcher wedge-escalates a paused: crew forever when its run step is stalled on the same external wait",
      "url": "https://github.com/kunchenguid/firstmate/issues/4154",
      "verdict": "overlaps"
    },
    {
      "author": "tiago-peixoto",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker"
      ],
      "state": "open",
      "title": "Voice status reader still uses the last line of a multi-line status record",
      "url": "https://github.com/kunchenguid/firstmate/issues/4756",
      "verdict": "distinct"
    },
    {
      "author": "tiago-peixoto",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker"
      ],
      "state": "open",
      "title": "Holding or releasing a task for the operator never reaches the worker status log",
      "url": "https://github.com/kunchenguid/firstmate/issues/4766",
      "verdict": "distinct"
    },
    {
      "author": "tiago-peixoto",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker"
      ],
      "state": "open",
      "title": "The supervisor's own append to a task status file publishes a signal wake back to the supervisor",
      "url": "https://github.com/kunchenguid/firstmate/issues/4767",
      "verdict": "distinct"
    },
    {
      "author": "gilrallo",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker",
        "shared keywords: paused, stale, watcher, worker"
      ],
      "state": "open",
      "title": "Watcher re-surfaces a live worker's declared paused: wait as stale every few polls",
      "url": "https://github.com/kunchenguid/firstmate/issues/5415",
      "verdict": "overlaps"
    },
    {
      "author": "MatevzKlancar",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): worker",
        "shared keywords: worker, workers"
      ],
      "state": "open",
      "title": "Workers get the full launch brief in argv, so one worker's pkill -f of any brief text kills its siblings",
      "url": "https://github.com/kunchenguid/firstmate/issues/5656",
      "verdict": "distinct"
    },
    {
      "author": "WTF-Am-ID",
      "kind": "issue",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag"
      ],
      "state": "open",
      "title": "fm-control relaunch drops the flags of a raw launch named after an adapter",
      "url": "https://github.com/kunchenguid/firstmate/issues/5681",
      "verdict": "distinct"
    },
    {
      "author": "victorkardel",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): paused",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "open",
      "title": "watch paused suppression",
      "url": "https://github.com/kunchenguid/firstmate/pull/2451",
      "verdict": "overlaps"
    },
    {
      "author": "pm-justinm",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): paused"
      ],
      "state": "open",
      "title": "fix: keep paused decision keys open",
      "url": "https://github.com/kunchenguid/firstmate/pull/2552",
      "verdict": "overlaps"
    },
    {
      "author": "RajeshRajendiran",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag paused worker",
        "search (closed-unmerged): paused",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "closed",
      "title": "fix(watcher): defer wedge alarms when a crew's own pipeline run shows progress",
      "url": "https://github.com/kunchenguid/firstmate/pull/3094",
      "verdict": "distinct"
    },
    {
      "author": "NicholasACTran",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): paused workers wrongly"
      ],
      "state": "open",
      "title": "feat(bin): add structural-zero stop rule to generated task briefs",
      "url": "https://github.com/kunchenguid/firstmate/pull/3204",
      "verdict": "distinct"
    },
    {
      "author": "shimpa1",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag"
      ],
      "state": "open",
      "title": "feat(bin): add +unsynced registry flag to skip fleet-sync entirely",
      "url": "https://github.com/kunchenguid/firstmate/pull/3339",
      "verdict": "distinct"
    },
    {
      "author": "kynjal26",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): paused"
      ],
      "state": "closed",
      "title": "fix: bound home-summary endpoint snapshots",
      "url": "https://github.com/kunchenguid/firstmate/pull/3432",
      "verdict": "distinct"
    },
    {
      "author": "krakns",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag"
      ],
      "state": "open",
      "title": "fix(bin): detect away mode flagged with no live supervisor daemon",
      "url": "https://github.com/kunchenguid/firstmate/pull/3676",
      "verdict": "distinct"
    },
    {
      "author": "hassanmohaideen",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "closed",
      "title": "feat(spawn): add optional advisor-model axis to crewmate dispatch",
      "url": "https://github.com/kunchenguid/firstmate/pull/3792",
      "verdict": "distinct"
    },
    {
      "author": "wjkawecki-jt",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): paused",
        "shared keywords: paused, stale",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "closed",
      "title": "fix: prevent stale paused-task wakes from triggering false stalls",
      "url": "https://github.com/kunchenguid/firstmate/pull/3878",
      "verdict": "overlaps"
    },
    {
      "author": "tpeixinho",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag paused worker",
        "search (closed-unmerged): paused"
      ],
      "state": "closed",
      "title": "fix(bin): make the PR the finish line in the no-mistakes and direct-PR definitions of done",
      "url": "https://github.com/kunchenguid/firstmate/pull/3981",
      "verdict": "distinct"
    },
    {
      "author": "AgardnerAU",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag"
      ],
      "state": "open",
      "title": "fix: flag unrunnable validation checks as environment faults",
      "url": "https://github.com/kunchenguid/firstmate/pull/3989",
      "verdict": "distinct"
    },
    {
      "author": "pedromuller-del",
    

... [12345 bytes truncated] ...

n": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag",
        "search (closed-unmerged): worker",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "closed",
      "title": "fix(spawn): launch OpenCode workers with opencode mini",
      "url": "https://github.com/kunchenguid/firstmate/pull/5218",
      "verdict": "distinct"
    },
    {
      "author": "sdivanl",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): paused workers wrongly"
      ],
      "state": "open",
      "title": "fix(bin): name a completed run's outcome when the run inventory is unreadable",
      "url": "https://github.com/kunchenguid/firstmate/pull/5245",
      "verdict": "distinct"
    },
    {
      "author": "rajivhere",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag"
      ],
      "state": "closed",
      "title": "fix(bin): refuse to launch a fresh secondmate home that has not converged",
      "url": "https://github.com/kunchenguid/firstmate/pull/5247",
      "verdict": "distinct"
    },
    {
      "author": "Arobotmaster",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): worker"
      ],
      "state": "open",
      "title": "Add Mirasim Claude worker adapter",
      "url": "https://github.com/kunchenguid/firstmate/pull/5272",
      "verdict": "distinct"
    },
    {
      "author": "akierat",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag"
      ],
      "state": "closed",
      "title": "fix(bin): stop using --slurp with gh api --paginate in fm-contributions",
      "url": "https://github.com/kunchenguid/firstmate/pull/5284",
      "verdict": "distinct"
    },
    {
      "author": "connectwithclayton",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): paused",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "open",
      "title": "fix(bin): keep GitHub readers paused across re-registration",
      "url": "https://github.com/kunchenguid/firstmate/pull/5286",
      "verdict": "overlaps"
    },
    {
      "author": "geme-lector",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): worker"
      ],
      "state": "closed",
      "title": "Require ClickUp updates before worker completion",
      "url": "https://github.com/kunchenguid/firstmate/pull/5393",
      "verdict": "distinct"
    },
    {
      "author": "maxhuettl-ai",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): worker"
      ],
      "state": "open",
      "title": "fix(bin): recover missing tmux worker endpoints safely",
      "url": "https://github.com/kunchenguid/firstmate/pull/5429",
      "verdict": "distinct"
    },
    {
      "author": "zachsibert",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag"
      ],
      "state": "closed",
      "title": "feat(bin): let a home opt its launched agents in to the compact adviser",
      "url": "https://github.com/kunchenguid/firstmate/pull/5451",
      "verdict": "distinct"
    },
    {
      "author": "beyourahi",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): flag"
      ],
      "state": "closed",
      "title": "feat(frontend): route installed UI skills per task",
      "url": "https://github.com/kunchenguid/firstmate/pull/5454",
      "verdict": "distinct"
    },
    {
      "author": "lockhartheavyindustries",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "open",
      "title": "feat(bin): flag leftover state that needs cleanup on the heartbeat review",
      "url": "https://github.com/kunchenguid/firstmate/pull/5463",
      "verdict": "distinct"
    },
    {
      "author": "g-rallo",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): paused",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "open",
      "title": "fix(bin): bound a held task's paused: last line with the captain hold",
      "url": "https://github.com/kunchenguid/firstmate/pull/5571",
      "verdict": "overlaps"
    },
    {
      "author": "jfrisch76",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): worker"
      ],
      "state": "open",
      "title": "Guard persistent shell configuration in worker instructions",
      "url": "https://github.com/kunchenguid/firstmate/pull/5614",
      "verdict": "distinct"
    },
    {
      "author": "twilwa",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag"
      ],
      "state": "open",
      "title": "fix(bin): refuse unknown flags and stray --key arguments in fm-send",
      "url": "https://github.com/kunchenguid/firstmate/pull/5634",
      "verdict": "distinct"
    },
    {
      "author": "Xelanor",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag paused worker",
        "search (open): paused",
        "shared keywords: paused, stale, worker",
        "shared files: bin/fm-watch.sh"
      ],
      "state": "open",
      "title": "fix(bin): annotate first stale of a live paused worker",
      "url": "https://github.com/kunchenguid/firstmate/pull/5649",
      "verdict": "overlaps"
    },
    {
      "author": "Xelanor",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): flag"
      ],
      "state": "open",
      "title": "fix(bin): flag queued records whose report exists or linked PR merged",
      "url": "https://github.com/kunchenguid/firstmate/pull/5654",
      "verdict": "distinct"
    }
  ],
  "captain_decision": "captain: proceed; ours supersedes #2451 and links it",
  "captured_at": "2026-09-26T00:56:13.818030+00:00",
  "closed_window_days": 30,
  "complete": true,
  "context": {
    "base": "base",
    "diff_sha256": "f749cec35234a7f31928d2f1d23460e5a0c1062d0e3066978b8f79b4d736a758",
    "files": [
      "bin/fm-watch.sh"
    ],
    "head": "55f64ec41dc5a65785bffc08a3a195559d36e63b",
    "kind": "pr",
    "repo": "kunchenguid/firstmate",
    "summary": "Paused workers are wrongly flagged as stale by the watcher",
    "title": "fix: don't flag paused worker as stale"
  },
  "coverage": {
    "dropped_queries": [],
    "requests": 77,
    "searches": [
      {
        "query": "flag paused worker",
        "read": 10,
        "scope": "open",
        "total": 69
      },
      {
        "query": "flag paused worker",
        "read": 5,
        "scope": "closed-unmerged",
        "total": 5
      },
      {
        "query": "paused workers wrongly",
        "read": 2,
        "scope": "open",
        "total": 2
      },
      {
        "query": "paused workers wrongly",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "flag",
        "read": 10,
        "scope": "open",
        "total": 683
      },
      {
        "query": "flag",
        "read": 10,
        "scope": "closed-unmerged",
        "total": 70
      },
      {
        "query": "paused",
        "read": 10,
        "scope": "open",
        "total": 190
      },
      {
        "query": "paused",
        "read": 10,
        "scope": "closed-unmerged",
        "total": 12
      },
      {
        "query": "worker",
        "read": 10,
        "scope": "open",
        "total": 869
      },
      {
        "query": "worker",
        "read": 10,
        "scope": "closed-unmerged",
        "total": 89
      }
    ],
    "stopped": "",
    "truncated": true
  },
  "open_prs": {
    "listed": 1350,
    "matched": 32
  },
  "queries": [
    "flag paused worker",
    "paused workers wrongly",
    "flag",
    "paused",
    "worker"
  ],
  "schema": "fm-upstream-prior-art.v1",
  "verdict": "overlaps"
}
Evidence: decide/check/verify gate matrix on the live receipt

Source: decide/check/verify gate matrix on the live receipt

## 1. distinct without a verdict for every candidate -> refused
prior-art refused: decisions must cover every candidate URL exactly once
exit=1
## 2. claim "distinct" while marking the paused-worker duplicates as overlaps -> refused
prior-art refused: overall verdict must match candidate overlap verdicts
exit=1
## 3. overlaps with no captain decision -> decide records it, check refuses
prior-art verdict recorded: overlaps
exit=0
prior-art refused: prior-art overlaps require a recorded captain decision
exit=1
## 4. overlaps with captain decision -> check passes
prior-art verdict recorded: overlaps
exit=0
prior-art check ok
exit=0
## 5. verify at scanned head with differently-cased repo (push-guard path)
prior-art receipt ok
exit=0
## 6. new commit after scan -> check refuses (stale)
prior-art refused: prior-art record is stale: target, text, branch head, base, or diff changed
exit=1
Evidence: Installed pre-push guard: refusals, passes, and project-hook chaining

Source: Installed pre-push guard: refusals, passes, and project-hook chaining

worker HEAD=55f64ec41dc5a65785bffc08a3a195559d36e63b; pane core.hooksPath=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-pa-live.L5PvhV/state/task.git-hooks; project core.hooksPath=.husky
$ git commit (project pre-commit must still run)
exit=0
project hook log: project pre-commit ran

$ real git push to a non-GitHub remote (not upstream) with NO receipt
exit=0
project hook log: project(husky/lfs-style) pre-push ran: remote=local refs=HEAD 55f64ec41dc5a65785bffc08a3a195559d36e63b refs/heads/fix 0000000000000000000000000000000000000000

$ pre-push as git invokes it: push to owned fork git@github.com:jazz127/firstmate.git, NO receipt
exit=0
project hook log: project(husky/lfs-style) pre-push ran: remote=origin refs=refs/heads/fix 55f64ec41dc5a65785bffc08a3a195559d36e63b refs/heads/fix 0000000000000000000000000000000000000000

$ pre-push: push to UPSTREAM https://github.com/kunchenguid/firstmate.git, NO receipt
prior-art refused: record is missing or unsafe: /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-pa-live.L5PvhV/task-tmp/prior-art.json
upstream push refused: prior-art receipt does not match kunchenguid/firstmate@55f64ec41dc5a65785bffc08a3a195559d36e63b
exit=1
project hook log: 

$ pre-push: push to UPSTREAM with the live decided receipt at task record path
prior-art receipt ok
exit=0
project hook log: project(husky/lfs-style) pre-push ran: remote=upstream refs=refs/heads/fix 55f64ec41dc5a65785bffc08a3a195559d36e63b refs/heads/fix 0000000000000000000000000000000000000000

$ pre-push: push an UNSCANNED sha (HEAD~1) to UPSTREAM with that receipt
prior-art refused: prior-art receipt is stale: published head changed
upstream push refused: prior-art receipt does not match kunchenguid/firstmate@bb9538ed51a277d00aa2f86608cff8441c3cf2f9
exit=1
project hook log: 

$ pre-push: branch deletion to UPSTREAM (zero sha) is not a publication
exit=0
project hook log: project(husky/lfs-style) pre-push ran: remote=upstream refs=(delete) 0000000000000000000000000000000000000000 refs/heads/fix 55f64ec41dc5a65785bffc08a3a195559d36e63b
Evidence: verify --published against GitHub compare (ahead/diverged/behind)

Source: verify --published against GitHub compare (ahead/diverged/behind)

## scan the fleet's own fork (read-only) at scanned head 2c95ca7e (base = its parent)
prior-art scan recorded 4 candidates: /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-pa-live.L5PvhV/fork.json
exit=0
prior-art verdict recorded: distinct
exit=0
{"repo":"jazz127/firstmate","head":"2c95ca7e277b306b8f35f9ab306cb90aabb003fc"}
## forge PR #44 head 08b76956 descends from scanned head (GitHub compare) -> accept
prior-art receipt ok
exit=0
## forge head == scanned head, repo in different case -> accept
prior-art receipt ok
exit=0
## forge head = house 26323676 (not a descendant of the scanned head: rewritten/other line) -> refuse
prior-art refused: prior-art receipt is stale: published head does not descend from the scanned head
exit=1
## forge head = parent of the scanned head (behind) -> refuse
prior-art refused: prior-art receipt is stale: published head does not descend from the scanned head
exit=1
GitHub compare statuses for reference:
08b76956fab0789ee701c445ad6a2eb5abdb6dd7 -> api_response:
  body: ahead
  truncated: false
263236767382997d00f00a33411c2fe77ab66cb1 -> api_response:
  body: diverged
  truncated: false
59b1313edb66c2bfcec5c6db6b1a5ebb06da0118 -> api_response:
  body: behind
  truncated: false
Evidence: Registration/done backstop with the live PR #44 head, plus brief record path

Source: Registration/done backstop with the live PR #44 head, plus brief record path

forge PR #44 head (live): 08b76956fab0789ee701c445ad6a2eb5abdb6dd7; receipt scanned head: 2c95ca7e277b306b8f35f9ab306cb90aabb003fc
## registration/done backstop with the live forge head (descendant, pipeline added commits)
prior-art receipt ok
exit=0
## same backstop, forge head replaced by a non-descendant (force-push/rewrite)
prior-art refused: prior-art receipt is stale: published head does not descend from the scanned head
upstream prior-art receipt refused: receipt does not match the published work
exit=1
## same backstop, receipt missing from the task record path
upstream prior-art receipt refused: missing /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-pa-live.L5PvhV/task44/prior-art.json
exit=1
## owned repo (origin == PR repo): backstop does not apply
exit=0
## worker brief renders the task record path (task id demo-7)
--record /tmp/fm-demo-7/prior-art.json
--record /tmp/fm-demo-7/prior-art.json
Evidence: publish refusals before the forge write

Source: publish refusals before the forge write

## publish to kunchenguid/firstmate after the branch moved past the scanned head -> refused before any forge write
prior-art refused: prior-art record is stale: target, text, branch head, base, or diff changed
exit=1
## publish with no receipt -> refused
prior-art refused: record is missing or unsafe: /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-pa-live.L5PvhV/none.json
exit=1
## publish with an incomplete (budget-truncated) receipt -> refused
prior-art refused: prior-art scan was incomplete; rerun the scan
exit=1
Evidence: Live receipt for jazz127/firstmate (published-head scenarios)

Source: Live receipt for jazz127/firstmate (published-head scenarios)

{
  "candidates": [
    {
      "author": "jazz127",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): REPO",
        "search (open): feat"
      ],
      "state": "open",
      "title": "feat: add deterministic Captain Chart fleet maps",
      "url": "https://github.com/jazz127/firstmate/pull/23",
      "verdict": "distinct"
    },
    {
      "author": "jazz127",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (closed-unmerged): FILE",
        "search (closed-unmerged): feat",
        "shared files: AGENTS.md, docs/fork-house-branch.md"
      ],
      "state": "closed",
      "title": "[SUPERSEDED] feat: add host-backed supervision and branch dispatch",
      "url": "https://github.com/jazz127/firstmate/pull/26",
      "verdict": "distinct"
    },
    {
      "author": "jazz127",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): #4",
        "search (open): feat gate upstream",
        "search (open): OWNER",
        "search (open): FILE",
        "search (open): feat",
        "shared keywords: feat, upstream",
        "shared files: AGENTS.md, docs/fork-house-branch.md"
      ],
      "state": "open",
      "title": "feat: add Bosun upstream contribution workflow",
      "url": "https://github.com/jazz127/firstmate/pull/38",
      "verdict": "distinct"
    },
    {
      "author": "jazz127",
      "kind": "pr",
      "reason": "reviewed live",
      "reasons": [
        "search (open): #4",
        "search (open): feat gate upstream",
        "search (open): gate upstream prior",
        "search (open): REPO",
        "search (open): TEXT",
        "search (open): FILE",
        "search (open): feat",
        "shared keywords: check, duplicate, feat, gate, prior, upstream",
        "shared files: AGENTS.md, bin/fm-upstream-prior-art.py, docs/fork-house-branch.md, tests/fm-upstream-prior-art.test.sh"
      ],
      "state": "open",
      "title": "feat(bin): gate upstream PRs on a prior-art duplicate check",
      "url": "https://github.com/jazz127/firstmate/pull/44",
      "verdict": "distinct"
    }
  ],
  "captain_decision": "",
  "captured_at": "2026-09-26T00:58:44.831716+00:00",
  "closed_window_days": 30,
  "complete": true,
  "context": {
    "base": "2c95ca7e^",
    "diff_sha256": "20eab8345751383a6c9f912fbbb171306e7f5812076251d537daf0a43c115851",
    "files": [
      "AGENTS.md",
      "bin/fm-upstream-prior-art.py",
      "docs/fork-house-branch.md",
      "tests/fm-upstream-prior-art.test.sh"
    ],
    "head": "2c95ca7e277b306b8f35f9ab306cb90aabb003fc",
    "kind": "pr",
    "repo": "jazz127/firstmate",
    "summary": "Gate upstream PRs on a prior-art duplicate check",
    "title": "feat: gate upstream submissions on prior art"
  },
  "coverage": {
    "dropped_queries": [
      "gate",
      "upstream"
    ],
    "requests": 21,
    "searches": [
      {
        "query": "#4",
        "read": 2,
        "scope": "open",
        "total": 2
      },
      {
        "query": "#4",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "feat gate upstream",
        "read": 2,
        "scope": "open",
        "total": 2
      },
      {
        "query": "feat gate upstream",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "gate upstream prior",
        "read": 1,
        "scope": "open",
        "total": 1
      },
      {
        "query": "gate upstream prior",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "OWNER",
        "read": 1,
        "scope": "open",
        "total": 1
      },
      {
        "query": "OWNER",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "REPO",
        "read": 2,
        "scope": "open",
        "total": 2
      },
      {
        "query": "REPO",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "TEXT",
        "read": 1,
        "scope": "open",
        "total": 1
      },
      {
        "query": "TEXT",
        "read": 0,
        "scope": "closed-unmerged",
        "total": 0
      },
      {
        "query": "FILE",
        "read": 2,
        "scope": "open",
        "total": 2
      },
      {
        "query": "FILE",
        "read": 1,
        "scope": "closed-unmerged",
        "total": 1
      },
      {
        "query": "feat",
        "read": 3,
        "scope": "open",
        "total": 3
      },
      {
        "query": "feat",
        "read": 1,
        "scope": "closed-unmerged",
        "total": 1
      }
    ],
    "stopped": "",
    "truncated": true
  },
  "open_prs": {
    "listed": 3,
    "matched": 3
  },
  "queries": [
    "#4",
    "feat gate upstream",
    "gate upstream prior",
    "OWNER",
    "REPO",
    "TEXT",
    "FILE",
    "feat"
  ],
  "schema": "fm-upstream-prior-art.v1",
  "verdict": "distinct"
}
Evidence: Focused suite logs

Source: Focused suite logs

ok - publication refuses a missing record
ok - incomplete search fails closed without a record
ok - changed-symbol search finds a PR with no shared file or title words
ok - scan tolerates PRs closing mid-read and waits out search rate limits
ok - scan stops at its request budget and records an incomplete, unpublishable receipt
ok - a truncated scan is never usable as none-found
ok - search-driven scan records open PRs and issues plus recent closed unmerged PRs with match reasons
ok - real selectors pass through jq and search PR rows are recorded as PRs
ok - scan reads long bodies and file lists within the gh-axi output limit
ok - malformed decisions and candidate records fail cleanly
prior-art refused: record is missing or unsafe: /private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-upstream-prior-art.QtVn7x/missing.json
upstream push refused: prior-art receipt does not match upstream/demo@85b062cd4c7bcae704390fee72201f12c1091d58
prior-art refused: record is missing or unsafe: /private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-upstream-prior-art.QtVn7x/missing.json
upstream push refused: prior-art receipt does not match upstream/demo@85b062cd4c7bcae704390fee72201f12c1091d58
prior-art receipt ok
ok - pre-push boundary gates external targets and permits owned or checked pushes
ok - fresh distinct receipt permits publication and adds author credit
ok - freshness is enforced before the push but not after publication
ok - a receipt whose capture time has no timezone is refused cleanly
ok - search truncation is disclosed in the receipt and required before a distinct verdict
ok - publication refuses a scan older than the freshness window
ok - overlap blocks publication until a captain decision is recorded
ok - branch head movement stales the prior-art receipt
ok - published head verification does not read back the worker checkout
ok - published verification accepts descendant forge heads and refuses rewritten ones
all fm-upstream-prior-art tests passed
bash tests/fm-upstream-prior-art.test.sh  14.06s user 8.13s system 69% cpu 31.881 total
exit 0
- Outcome: ⚠️ 1 info across 1 run (5m51s)

The cited bundle holds the read-only kunchenguid/firstmate scan transcript and the published-head check with its GitHub compare responses.

evidence-artifact: /tmp/fm-firstmate-upstream-prior-art-check-r1/evidence/pr44-github-readonly-evidence.txt
evidence-command: fm-upstream-prior-art.py scan --repo kunchenguid/firstmate --title "fix: don't flag paused worker as stale" --summary-file summary.txt --record prior-art.json --base base
evidence-captured: 2026-09-26T00:57:11Z

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • 🚨 bin/fm-spawn.sh:4357 - For every ship task that is not local-only (not just upstream ones), the new block sets the worktree config core.hooksPath to $WT/.fm-hooks, and that directory holds only pre-push. The pane's AI-trailer strip wrappers from bin/fm-git-strip-ai-trailers.sh clear GIT_CONFIG_*, then chain to git rev-parse --git-path hooks. That now resolves to .fm-hooks, not the project's real hooks (.git/hooks, or a .husky path set in local config). The new .fm-hooks/pre-push does not chain on either. Concrete path: a project with git-lfs (.git/hooks/pre-push) or husky (core.hooksPath=.husky with pre-commit/commit-msg) is spawned as a direct-PR or no-mistakes ship. In the worker pane, git commit skips the project's pre-commit and commit-msg hooks, and git push skips git lfs pre-push, so LFS objects are never uploaded. This silently breaks the chaining invariant that the strip installer's header documents (it keeps chaining because git-lfs installs pre-push and husky installs commit hooks). The same override also hides the prior hooks from the scratch hook's PRIOR_PRE_PUSH chain. Fix: record the previous git rev-parse --git-path hooks before overriding it. Then either make .fm-hooks a full wrapper set that execs the prior hook of the same name after the guard, or skip core.hooksPath entirely and call fm-upstream-push-guard.sh from the existing scratch and strip pre-push wrappers. Separately, git config extensions.worktreeConfig true (:4356) persistently rewrites the shared config of the project's main clone and is never undone at teardown.
  • ⚠️ bin/fm-upstream-prior-art.py:477 - verify --published requires the receipt's scanned head to equal the forge's PR head exactly. In no-mistakes mode, the worker scans and checks at its own HEAD (per fm_upstream_pr_preflight_block) and then starts /no-mistakes. The pipeline's review, lint, and test rounds routinely add auto-fix commits, as they did on this branch, and push a head the worker never scanned (fm_dod_forge_head_is_named_head documents this). fm-pr-check.sh:126 then refuses registration with "published head changed", and fm_dod_accept_ship_done refuses done. The only repair is to fetch the pipeline head and rescan after the upstream PR already exists, and that rescan lists the worker's own PR as a candidate. So the documented no-mistakes upstream path fails in its normal case. Choosing a remedy is a policy decision: accept a forge head that descends from the receipt head without a force-push, rescope the receipt to the base and summary, or require a rescan and document it in the preflight block.
  • ⚠️ bin/fm-dod-lib.sh:729 - The pre-push hook (fm-spawn.sh:4359) and the registration and done backstop (fm_dod_upstream_receipt_check, :961) only look for the receipt at $TASK_TMP/prior-art.json. The worker briefs (fm_upstream_pr_publish_block and fm_upstream_pr_preflight_block) instead tell the worker to choose &lt;RECORD&gt; freely. A worker who writes the receipt anywhere else passes check and publish, then has pushes refused and the published PR's registration refused with "missing …/prior-art.json". Fix: interpolate the task's actual record path into both blocks, in place of the &lt;RECORD&gt; placeholder.
  • ℹ️ bin/fm-upstream-push-guard.sh:25 - The push guard lowercases the target repository before passing it to verify --repo. verify_receipt (fm-upstream-prior-art.py:473) then compares it case-sensitively with the context.repo the scan recorded. fm_dod_upstream_receipt_check passes the URL's original case. So if a receipt scanned with --repo Owner/Repo for an upstream repo whose name has capitals, the push guard refuses every push. Compare case-insensitively in verify_receipt. Also, verify_args in fm_dod_upstream_receipt_check is not declared local.

🔧 Fix applied.
1 info still open:

  • ℹ️ bin/fm-upstream-push-guard.sh:25 - The push guard lowercases the target repository before passing it to verify --repo. verify_receipt (fm-upstream-prior-art.py:473) then compares it case-sensitively with the context.repo the scan recorded. fm_dod_upstream_receipt_check passes the URL's original case. So if a receipt scanned with --repo Owner/Repo for an upstream repo whose name has capitals, the push guard refuses every push. Compare case-insensitively in verify_receipt. Also, verify_args in fm_dod_upstream_receipt_check is not declared local.
⚠️ **Test** - 1 info
  • ℹ️ bin/fm-upstream-prior-art.py:15 - The usage docstring says the decisions file has 'items keyed by candidate URL', but decide requires items to be a list of objects, each with url, verdict and reason. The worker briefs give no other format, and a URL-keyed object is refused with 'decisions must cover every candidate URL exactly once'. This happened during live testing. It fails closed, so it is not a safety issue, but workers will be confused. Suggested wording: 'items: a list of {url, verdict, reason}, one per candidate'.
  • Live validation: ✅ go - 2 of 10 scenarios driven live against the product (the read-only upstream scan and the GitHub compare check); seven more ran offline as local runs of the real scripts, and one is untested
Scenario Result Live Evidence
A worker scans kunchenguid/firstmate before contributing a paused-worker-stale fix and gets a receipt listing the existing duplicate PRs and issues within practical time ✅ pass live live-scan-firstmate.txt (exit 0, 58s, 68 candidates, 77 requests); live-paused-worker-candidates.tsv (17 paused-worker PRs/issues from many contributors, e.g. kunchenguid#2451, kunchenguid#5084, kunchenguid#5649)
The worker cannot clear the gate without judging every candidate: missing verdicts, 'distinct' over overlapping candidates, and overlaps without a captain decision are refused; with a captain decision… ✅ pass offline live-decide-check.txt cases 1-4
A receipt goes stale when the branch moves after the scan, and check/publish refuse it; publish also refuses a missing or incomplete receipt before any forge write ✅ pass offline live-decide-check.txt case 6; live-publish-refusals.txt (the pr-create safety shim was never reached)
Adversarial: a worker pushes to the upstream repo with no receipt, or pushes a SHA it never scanned; the installed pre-push hook refuses and the project's pre-push does not run ✅ pass offline live-push-guard.txt (upstream NO receipt -> exit 1; unscanned HEAD~1 -> exit 1; project hook log empty both times)
The push guard does not break project hooks: with core.hooksPath=.husky, a real commit runs the project's pre-commit, and every allowed push runs the project's pre-push with the same refs on stdin ✅ pass offline live-push-guard.txt (pre-commit ran; project pre-push got identical ref lines after each passing guard)
Tasks that do not target an upstream repo are unaffected: real push to a local remote, push to the owned fork, and upstream branch deletion all pass without a receipt ✅ pass offline live-push-guard.txt; live-registration-backstop.txt (owned repo -> exit 0)
After the pipeline adds commits, PR registration and done acceptance accept a forge head that descends from the scanned head, and refuse a rewritten (diverged) or behind head ✅ pass live live-verify-published.txt (GitHub compare: ahead -> ok, diverged/behind -> refused); live-registration-backstop.txt (fm_dod_upstream_receipt_check with the live PR #44 head -> ok; rewritten -> refused…
Receipt repository matching ignores case (e.g. KunChenGuid/FirstMate, Jazz127/FirstMate) ✅ pass offline live-decide-check.txt case 5; live-verify-published.txt mixed-case case
Worker briefs name the exact record path the guard and backstop read ✅ pass offline live-registration-backstop.txt: both blocks render --record /tmp/fm-demo-7/prior-art.json, matching fm-spawn.sh TASK_TMP=/tmp/fm-$ID
A real fm-spawn of an upstream ship task in a lab home installs the guarded pre-push in the worker pane ⏸️ untested no This needs a disposable lab home with a live harness primary (per the runbook, bin/fm-lab-home.sh create plus a claude primary on the fm-lab tmux socket) to spawn a real ship worker. That full lif…
  • bash tests/fm-upstream-prior-art.test.sh (offline fake forge; includes descendant-accepted / rewritten-refused)
  • bash tests/fm-git-strip-ai-trailers.test.sh (includes pre-push guard chaining with husky hooksPath)
  • bash tests/fm-dod-lib.test.sh
  • Live read-only fm-upstream-prior-art.py scan --repo kunchenguid/firstmate on a scratch clone with a paused-worker-stale change to bin/fm-watch.sh, timed
  • Live decide / check / verify refusal and acceptance matrix against that real receipt
  • Installed the real hook set with fm-git-strip-ai-trailers.sh install &lt;hooks&gt; &lt;wt&gt; bin/fm-upstream-push-guard.sh &lt;root&gt; &lt;task-tmp&gt;/prior-art.json (same args fm-spawn passes) in a clone with core.hooksPath=.husky; drove a real git commit, a real git push to a local bare remote, and git-style pre-push invocations for owned fork / upstream-no-receipt / upstream-valid-receipt / upstream-unscanned-SHA / branch deletion
  • Live read-only scan of jazz127/firstmate at 2c95ca7e, then verify --published against GitHub's compare API for the PR #44 head (ahead), same head in mixed case, house (diverged), and parent (behind)
  • Sourced bin/fm-dod-lib.sh and ran fm_dod_upstream_receipt_check with the live PR #44 URL and forge head (descendant, rewritten, missing record, owned repo)
  • Rendered fm_upstream_pr_publish_block demo-7 and fm_upstream_pr_preflight_block demo-7 and compared the record path with fm-spawn's TASK_TMP
  • publish to kunchenguid/firstmate with a stale, a missing, and an incomplete receipt, behind a PATH shim that blocks any real pr create
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…m-prior-art-check-r1

# Conflicts:
#	bin/fm-dod-lib.sh
…ncation, fixed published freshness

(cherry picked from commit 48f68cf9c9879b9f03dcbb5fe838d4a1e21cfd3c)
…ture times

(cherry picked from commit 7420a3171179af589e9782456525cb69069baa75)
… prior-art header

(cherry picked from commit 6c80f3070bcdc6af14bf4c854b139e8229301c0f)
@jazz127
jazz127 merged commit 854257f into house Sep 26, 2026
1 check passed
jazz127 added a commit that referenced this pull request Sep 26, 2026
…e check fails only on the PR's merge with `house`; this branch alone passes. **Cause:** `house` (PR #44) added `fm_dod_upstream_receipt_check` to `fm_dod_accept_ship_done`. It runs before the recorded-PR early return and deliberately refuses any GitHub PR URL when the worktree is missing ("upstream prior-art receipt refused: worktree is unavailable"). This branch's new test `test_recorded_pr_with_missing_worktree_is_accepted` used a recorded GitHub PR with no worktree, so after the merge it hit house's intended refusal. The code in both is working as designed; the test's input conflicts with house's rule. **Invariant:** the worktree scratch check must not make a recorded PR fail just because its worktree is missing. The scratch check guards on the worktree existing, so the invariant holds in the code. Only the test's choice of URL crossed house's separate GitHub receipt rule. **Fix:** in `tests/fm-dod-lib.test.sh`, the test now uses a recorded Gerrit change (`https://review.example.test/c/o/r/+/5`) instead of a GitHub PR. House's receipt check doesn't apply to Gerrit, so the test still covers exactly what it was written for. No production code changed. **Verified:** - On this branch, `tests/fm-dod-lib.test.sh` passes: "all fm-dod-lib tests passed". - On a local merge with `origin/house` plus the fix, the same suite passes, including house's "external PR ready signals require receipts" test and "a recorded PR with a missing worktree is still accepted". - `bin/fm-lint.sh tests/fm-dod-lib.test.sh` is clean
@jazz127 jazz127 added the house-only Part of our own line by design - not intended for upstream label Sep 26, 2026
@jazz127
jazz127 deleted the fm/firstmate-upstream-prior-art-check-r1 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

house-only Part of our own line by design - not intended for upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant