AGENT SKILL

shared-repo-push-gates

Shared-repo push blocked? Know the gates that block you.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 4
Forks
1

01 前言 Front Matter

name
shared-repo-push-gates
author
Steadfaste Fleet (Esther)
license
MIT
version
1.2.0
metadata
{ "hermes": { "tags": [ "git", "push", "governance", "dogfood", "concurrent", "pii", "enforcement" ], "related_skills": [ "change-checklist", "survey-before-action", "git-deployment-workflow" ] } }
platforms
[ "linux", "macos" ]
description
Shared-repo push blocked? Know the gates that block you.

02 资源文件 3

03 SKILL.md 正文

Shared-Repo Push Gates

Two gates that block AFTER a clean close — each names its own remedy

A rebase invalidates the receipt. The receipt binds tip+base, so any history rewrite (git pull --rebase, an amend) moves both and the gate answers "no clean review receipt for THIS range". Re-close the cycle after the rebase: per-blob verdicts are keyed by CONTENT, so they survive and only the blobs the rebase brought in need judging. An index conflict (docs/*INDEX*) is usually two sides adding rows — resolve to the UNION, then GIT_EDITOR=true git rebase --continue.

The deploy-sync check runs before the push. Deploy sync ❌ with several Checksum: <file> lines means the deployed tree is behind the repo — typical after a rebase pulled in a peer's edits. The gate prints its own remedy (bash ~/.steadfaste-fleet/scripts/fleet-dogfood.sh --force); run it, never hand-copy files into the deploy tree.

ORDER: close, then push BARE — do not open a cycle to "hold the lock" while you push. end_change releases the lock and a CLEAN receipt bound to the tip authorises the push on its own, so the bare git push right after the close is the normal order and usually succeeds with no lock at all. Open a publish cycle only if that bare push actually REFUSES, and then diagnose the RANGE before assuming the missing lock is the cause — a cycle opened on the assumption costs a cycle plus a close, and its own close answers No review receipt — HEAD is already origin/main … nothing to push, which is the tell that the push had already gone through on the receipt alone. Full rule and the carve-out's own output line are under A lock is required to git push below.

A stale MCP daemon answers closes with OLD rules. Compare its start time against the deployed module's mtime:

ps -o lstart= -p $(pgrep -f tools/loop-governance/loop-gov-mcp.py)
stat -c %y ~/.steadfaste-fleet/tools/loop-governance/loop-gov-mcp.py 2>/dev/null \
  || stat -f '%Sm' ~/.steadfaste-fleet/tools/loop-governance/loop-gov-mcp.py   # GNU, else BSD

A daemon started BEFORE your deploy keeps refusing on rules you have already fixed, and the refusal reads as authoritative. Only a gateway restart replaces it, and you cannot restart the gateway from inside it. ops/scripts/loop-gov.py is NOT a substitute: it resolves its own session id and answers "No governance session active".

The shared fleet repo enforces commit/push gates. Know how they behave BEFORE pushing — most rejections are environmental (another session's working tree), not a problem with your diff.

When to Use

  • Any git commit/push in ~/steadfaste-fleet (the shared fleet repo)
  • A push or commit was rejected and the cause isn't obvious
  • Writing docs or scripts to the shared surface (repo or ~/.hermes/skills)

The Gates (verified behavior, 2026-08-24; review-receipt gate added 2026-10-07)

Review receipt gate. A push whose range touches an always-review path needs a CLEAN review receipt for THAT range (tip AND base must match). Ordinary commits are exempt. The receipt is written automatically when a cycle closes successfully — including a cycle that changed no code (its review is skipped as "simple", but the close still writes the receipt). Every new commit moves the tip and invalidates the receipt, so push immediately after closing. Full detail: docs/review-receipt-gate.md.

  • Read the receipt's BASE off the file — it is the PUSH range's base, git merge-base origin/main HEAD, not the closing cycle's own start. So one close authorises every unpushed commit behind it, and a run of cycles closed one after another needs only the LAST close before the push; you do not need one receipt per cycle. Confirm what a receipt actually covers before citing it: python3 -c "import json,sys;d=json.load(open(sys.argv[1]));print(d['verdict'],d['base_sha'][:8],d['tip_sha'][:8])" <receipt>.

  • Integrating a peer's commits moves the tip, so the receipt must be RE-MINTED by another close before the push. After a rejected push: fetch, confirm your local commit is a fast-forward over origin/main, integrate, then take a fresh lock and close a cycle — an empty one is fine, its review is skipped as simple and the close still writes the receipt for the new tip — deploy, push. Skipping the re-close leaves a CLEAN receipt that no longer matches, and the gate refuses with no obvious cause.

  • A receipt is bound to ONE tip, and the gate re-reads HEAD on every attempt — so a peer committing between your close and your push invalidates a receipt that was valid a minute ago, and the refusal names the tip it now wants. Do not answer that by minting receipts in a loop: check whether the peer is still committing (git log -3 --format='%h %ad %s' --date=iso) and, if so, stop — your commit is already an ancestor of whatever they push, so it publishes with their push. Report "committed + deployed locally, push rides the peer's next push" with your SHA rather than looping or claiming a push that did not land.

  • Look for a receipt on the CURRENT tip BEFORE minting one — a peer's recent close may already authorise your push. A close writes the receipt with BASE = git merge-base origin/main HEAD, so a peer session that just closed its own cycle has written a CLEAN receipt covering every unpushed commit behind it, yours included, even though they have not pushed yet. Check before looping: ls ~/.steadfaste-fleet/state/.reviewed-steadfaste-fleet-<tip>*.json and read its verdict/base_sha/tip_sha. A receipt found this way can let the push through with no new cycle at all.

  • A PERMITTED close that writes NO receipt means the lock had no repo identity — re-take the lock in the SAME session and close again. The receipt writer bails silently when the lock's repo_path is empty, which is what the FIRST begin_change() of an interactive agent session produces; a LATER begin_change() in that same session resolves the repo from cwd. Symptom: end_change reports success and releases the lock, the push refuses with "touches an always-review path and carries no clean review receipt", and NO .reviewed-<slug>-<tip>.json exists for the tip. Diagnose before looping on the push: read the lock file (repo_slug / repo_path) and the adversarial_reviews row for the closing cycle — a review that RAN and returned only info findings is a permitted close, so the range was reviewed and only the receipt is missing. Recovery: begin_change() again (the new lock carries the repo), close, then check the receipt exists before pushing. Re-taking a lock to make a missing receipt WRITE is legitimate; it is NOT the prohibited "empty cycle after the work is done" trick, which manufactures coverage for a range no cycle ever reviewed — say which of the two you are doing in the cycle note, and name the plumbing bug in an issue record instead of pushing around it.

  • A CLEAN receipt can be HOLLOW — prove the review RAN before trusting it. When the range's commits predate your lock (an earlier session authored them and ended, or the work was already committed), the close measures the WINDOW rather than the range as a few lines, SKIPS the review, and still writes verdict: CLEAN bound to base..tip. The gate then accepts a whole unpushed range nobody judged — and on an always-review path that is the entire point of the binding thrown away. Two cheap reads separate a real receipt from a hollow one: the gate log (grep -e '<cycle id>' -e 'simple' ~/.steadfaste-fleet/logs/loop-governance.log; a line reading self-adversarial review: cycle N simple (L lines, F files) — skip means NOTHING was judged, and L/F are the WINDOW's numbers, never the range's) and the receipt's own reviewed_blobs — an empty map beside a reviewed_files list naming every file of the range is the tell, because the writer records the file list whether or not anything was reviewed. Remedy, in this order: submit the range's real material to the RECORDED reviewer — python3 ops/scripts/orch-bus/adversarial-review.py --cycle-id <cycle> --review --material "$(cat <material-file>)" — with the material file carrying a factual provenance block (range, commit subjects, diffstat, the per-commit static gate, the committed evidence path) plus the FULL git diff <base>..HEAD; it judges the merged range the window never saw. Act on its findings, then close AGAIN over the commits carrying the fixes — the window is finally non-empty, so the per-blob pass runs and the receipt it writes is backed by a real review. Never push merely because the gate accepted the hollow one: a gate that accepts is exactly the thing the receipt exists to make meaningful. A SECOND hollow shape, and it is the one a WIDE RANGE hits. When the range is too wide for one whole-range call the gate logs splitting to REQUIRED per-blob coverage instead of one range call and then close refused for cycle N (REVIEW_INCOMPLETE) — marker written to the lock, and on THAT path the lock is RELEASED and a receipt is still minted for the tip with an empty reviewed_blobs. So the documented wide-range retry loop (the one that prints Cannot close yet: N blob(s) of the push range still carry no review verdict) is NOT available to you here: there is no live session left to re-call. Same remedy, same order as above — submit the range's material to the recorded reviewer, act on its findings, commit the fixes, then close a NEW cycle so the receipt binds the new tip — and say in that cycle's note which review covers which commits. Grep the gate log for the cycle id and read WHICH refusal you got before deciding which receipt shape you are holding.

  • Prefer MERGE over rebase when a peer's commits land under your unpushed work and the checkout carries a foreign WIP you may not stash. git pull --rebase refuses outright on a dirty tree ("cannot pull with rebase: You have unstaged changes"), and every stash variant moves files that are not yours (SOUL P9). A merge needs neither and leaves your commits' identities intact. Check for collisions FIRST — git diff --name-only HEAD...origin/main against your own changed paths — because a merge only avoids the WIP it does not touch. A merge is still REFUSED by a peer's STAGED files, and collision checking does not predict it: git merge origin/main stops with "Your local changes to the following files would be overwritten by merge" when another session has entries in the INDEX on any path the merge updates — the INDEX is what blocks it, not the worktree, and it blocks paths a plain git diff HEAD...origin/main shows no collision in. The only sanctioned moves are to wait for that session to land its own work, or to report the blocking paths and ask; never unstage, stash or commit theirs to clear it. Prove the diagnosis before you touch anything: the paths it names need not exist in origin/main AT ALL. git ls-tree --name-only origin/main -- <those paths> printing nothing (while git status --short shows them A) is the proof the INDEX is the cause and there is no real collision — do not go looking for an incoming edit that does not exist, and do not read it as a worktree problem. With the operator's EXPLICIT authorisation to take the peer's work over, the clear is git reset -q -- <paths> — index only. It leaves the worktree content byte-identical (so nothing is lost, unlike a stash) and the paths become untracked, which no longer blocks a merge that does not touch them; verify with git status --short that they read ?? and the files are still on disk before merging. Keep the unattended default above (wait or ask): this carve-out needs a human saying the work is theirs to land, and it does not license a stash, a checkout, or committing someone else's content. Publishing meanwhile is a LANDING BRANCH, which never touches the blocked checkout: git worktree add --detach /tmp/land origin/main, cherry-pick your own SHAs onto it in order, run the suites THERE, then git push origin HEAD:main from that clean tree. Give the landing tip a durable ref the moment it exists (git branch <name> <sha>) — a detached worktree's commits are reachable only through the reflog, so a git worktree prune plus reflog expiry is enough to lose a landing nobody pushed. Check first that your files are untouched upstream (git log <base>..origin/main -- <your paths> empty): if a peer edited them the cherry-pick conflicts and the landing branch is the wrong tool. A merge TIMEOUT can still have COMMITTED — the message file vanished, not the merge. git merge origin/main -m "…" that hits the caller's timeout may have already produced the merge commit (the post-merge hook — a full fleet deploy + doctor — is what kept running past the deadline), leaving .git/MERGE_HEAD stale while HEAD shows the 2-parent commit. Diagnose before concluding you must restart: git show -s --format="%H %P" HEAD (TWO parents = the merge landed) and git merge-base --is-ancestor <origin-tip> HEAD (origin already inside). If both hold, the state is clean except the leftover marker: git merge --quit clears exactly that (never a git reset, which would drop the landed merge). The merge commit itself needs NO second commit — the merge created it; just verify git status reads clean and continue to deploy/close/push.

  • A GENERATED file that both sides regenerated resolves by REGENERATING, never by hand-merging the conflict. Git can auto-merge such a file into a state that looks merged and is inconsistent — one side's row beside the other side's count. Run the generator over the MERGED source, then confirm with the generator's own --check: an auto-merge that reports no conflict is not evidence the file is correct.

  • A MERGE COMMIT is HUMAN-ONLY — an agent can prepare it fully but never commit it. The bare-commit guard (pre-commit-score _commit_scope_guard) refuses a bare commit from an AGENT ancestry (a hermes process in the parent chain), and git refuses a partial commit during a merge ("cannot do a partial commit during a merge"), so no agent-shaped merge commit exists. The workflow that lands one:

    1. begin_change an integration cycle and keep the lock LIVE through the operator's commit — the reflexion gate verifies the repo's ACTIVE lock's session loaded the ritual skills, so a human commit made while YOUR lock is held passes (a no-session commit in the HC repo is refused). If the TTL expires first, re-acquire before the operator commits.
    2. git fetch + git merge origin/main --no-edit; resolve every conflict (a generated file both sides regenerated resolves by taking the newer side while KEEPING your swept prose — git checkout --theirs re-imports the stale tokens the other side never swept, count them first); git add everything.
    3. Verify the staged set (git diff --cached --name-status) and PRE-RUN the adversarial gate on each staged file — the operator's commit runs the hook's gates (it scans every staged file, human or not), so prove they pass first.
    4. Hand the operator ONE command: cd ~/steadfaste-fleet && git commit --no-edit (an ssh/login session is spared by the guard, and the merge's staged files were already adversarial-passed). The merge then completes and the push range is fast-forwardable.
    5. Score + close the cycle yourself (the close judges the resolved blobs), then bare git push.
  • Size the remaining close loop from the FIRST end_change output, never from the begin_change scope advisory or a handoff's blob count. The begin_change "REVIEW SCOPE — N file(s) carry no verdict" advisory lists the whole range formulaically (it printed 929 then 927 for a range whose actual pending set was 4+1). Verdicts are cached by blob CONTENT, so a range reviewed across earlier sessions and cycles closes in far fewer calls than N/4 predicts; the first end_change's "still need a verdict" list IS the actual loop size.

  • Issue git push BARE — a pipe or any compound makes it unprovable. The carve-out recognises only a lone git push: git push origin main 2>&1 | tail -3 is classified as write-capable needing a lock. Do not append a follow-up command (&& git log, a redirect) to the same line; run the push alone and read its output in the next call. CHECK THE COMMAND SHAPE BEFORE YOU DIAGNOSE A LOCK BUG: the refusal for a compound push is the GENERIC gate-2 text ("GOVERNANCE LOCK REQUIRED"), with no mention of the compound, so a piped push is indistinguishable from a genuinely missing lock. Read your own command's shape first — that check takes seconds, while trusting the message sends you to edit the enforcer for a bug it never had (and every attempted fix is measured against a push that keeps failing for the unchanged reason). The classifier reads SHAPE, not intent, so READ-ONLY probes get refused the same way. Any interpreter one-liner (python3 -c "…", bash -c …), a redirect or $( ), a bare newline, and — easily missed — an alternation metacharacter inside a QUOTED pattern (grep -rln "a\|b" …) all classify as write-capable, with the same generic gate-2 text and no mention of why. When a read probe is refused with no lock held, switch TOOL rather than rewording it: read_file and search_files are lock-free and cover the same ground (a grep over file contents, a listing that includes dotfiles). Rewording the same probe burns the call twice and teaches nothing. The sanctioned lock-free carve-outs match the BARE command only — the enforcer's own DOGFOOD-REQUIRED remedy (bash ~/steadfaste-fleet/ops/scripts/fleet-update.sh) runs without a lock, but … | tail -5 or any compound is classified write-capable and refused with the generic gate-2 text, which reads like a missing lock. Run the sanctioned command ALONE, then read its output in the next call.

  • A refusal naming reviewed_blobs means the receipt carries no blob list. The receipt writer loads a range-blob helper by a repo-relative path resolved against the DEPLOYED root; if that file was never registered for deploy it is absent there, the receipt is written without reviewed_blobs, and the gate refuses because the blob list cannot cover the range. A file present in the repo proves nothing about the deployed tree — make the helper deployable, then re-close so a fresh receipt lists the range's files. Resolve the helper across candidate roots (the repo layout, the configured repo, the deploy root) and LOG which one won: a single guessed root is right in the repo and wrong deployed (the module sits under <deploy>/tools/<server>/, so a repo-relative path resolves to a directory that never exists), and an absent helper is then indistinguishable from a working one.

  • A null blob list is the STRICTER authorisation, not a bypass — read the CONSUMER before calling it a hole. review-receipt-check.py is the one implementation both gates call, and its contract is: authorise by EXACT tip_sha+base_sha first, and by content coverage only when reviewed_blobs exist — "a receipt with no reviewed_blobs is only ever accepted by rule 1", and every other case prints 0. So a degraded blob list costs REBASE-TOLERANCE (a rewritten tip stops matching), never enforcement. A review that reads the WRITER and reports its degraded output as a push bypass is a claim about a consumer it never opened; check the acceptance path before believing it, and never "fix" a fail-closed gate into a weaker one to answer it.

  • A "refusal" whose text is a payload FIELD NAME is a false refusal — grep the payload for which marker matched before touching any code. loop-gov.py's is_refusal() enumerates phrasings across the whole serialized result, so a lock record carrying a close_refused field makes a SUCCESSFUL read-only check_lock exit 1 — and a caller gating on that code (the Pi write gate) reads an availability check that succeeded as a governance refusal. Print the matching marker and its neighbourhood before writing anything up; the fix belongs in is_refusal() (match refusal PHRASES in content strings, never across data keys). The trigger is usually a SYNTHETIC lock left in the LIVE state dir by a test run: a lock file whose name carries an EMPTY session id, with repo_slug: no-such-repo and an epoch started_at, is test junk the doctor reports as a legacy lock — remove it via the rm -f line the doctor prints, and fix the test to redirect its state dir.

The review material is BOUNDED, and that is what makes a big cycle unshippable. The self-adversarial review sees at most 12,000 characters of the range's diff — 60,000 only when EVERY path is .md/.txt/.rst AND no path is always-review, and that relaxation is COMPUTED from the diff headers, never granted by a note claiming "docs only". Past the budget the omitted middle is reported as unverifiable, which is a MEDIUM-or-above finding, which REFUSES the close. The close is also what releases the lock, and a lock is required to run git push at all — so a refused close blocks the push even when the receipt gate itself does not apply.

  • Close a cycle per slice WHILE the work is happening. The review window is the commits since the cycle started, so work accumulated across many turns lands in ONE oversized window that no reviewer can see and no close can accept. Plan large changes as reviewable slices from the start; once every commit already exists, no new cycle can cover them.
  • Never "fix" an oversized range by opening a fresh cycle after the work is done. The new window is empty, the review is skipped as simple, and the close writes a CLEAN receipt for a range no cycle ever reviewed — a hollow authorisation, which is exactly what binding a receipt to base AND tip exists to prevent. The documented answer to an unreviewable range is to SPLIT it; if it can no longer be split, report the blocker (and the local SHAs) to the operator instead of manufacturing the receipt.
  • A range too wide for the whole-range review still closes — by RE-CALLING end_change, not by re-opening a cycle. The refusal reads ⏳ Cannot close yet: N blob(s) of the push range still carry no review verdict, and it names the unreviewed paths plus the per-close budget (15 blobs / 240s). Each call judges another handful — measured 11 → 7 → 3 → closed in four calls on a SMALL range. The per-call credit is small and roughly FIXED, about 4 blobs, so the cost scales with the RANGE'S FILE COUNT rather than with the size of the change: a 115-file range took ~29 calls of four apiece, and the stated 15/240s budget is not what one call achieves. That is the arithmetic behind "close per slice" — a wide range costs an MCP round-trip per four files, so land a bulk recovery in WAVES sized to that budget. Verdicts are keyed by blob CONTENT, so a retry CONTINUES rather than redoing, and Cannot close yet does NOT release the lock. Keep calling the same end_change(task_id=…) until it prints 🔓 … closed; the receipt is written by THAT call. Never escape the loop by opening a fresh cycle — its window is empty and its receipt hollow (the rule directly above).
  • The close review's own SCOPE NOTE is a pre-close checklist — satisfy it BEFORE calling end_change, because it tells you what the per-blob pass will ask for. Read it as a to-do list, not as commentary: a blob that CITES a measurement must point at its record (the cycle id, the evidence path) instead of asserting the number; a blob that NAMES another file must state that sibling's CONTRACT in place, because the sibling is judged in its own window and the reviewer cannot follow a reference; a blob that CARRIES A DATE must say where the fact is recorded. Answering these first costs one edit; answering them after a refusal costs a round-trip per blob and re-runs the whole pass. Add the CONTRACT line by REGENERATING the transcript, never by hand-editing it — re-run the battery/emitter with the added header so the file is still the run's own output; a hand-edited transcript is a transcription, and byte-identity with the run is the whole of its evidential value. Regeneration is cheap and the numbers come out the same.
  • A claim the reviewer cannot check from the window is a HIGH unverified-claim finding that refuses the close — commit the ARTIFACT, never cite it in prose. The reviewer sees the range's diff plus your note, and nothing else: "ran the suite (N passed)", "dogfood PASSED", "proven on the live unit" are all unverifiable there, and each one comes back as a finding. Put the evidence INSIDE the range as a file — the test-output log, the journal capture, the acceptance transcript — and cite that path. Adding the artifact as a NEW commit to the SAME already-open cycle is the cheapest fix and is NOT the hollow-receipt trick above: the next close re-reads the window with the evidence now in it. Claims about a tool RUN (a deploy, a doctor, a dogfood script) need a committed transcript for the same reason — the reviewer cannot see your terminal.
    • A script's SCOPE or EXEMPTION claim must be implemented IN the script, not only in the calling hook — hook-level scoping is invisible to the close reviewer (it flags the docstring's claim as HIGH unverified-claim) and to direct invocation. When a close finding flags a docstring that declares an exemption ("this repo is covered elsewhere"), implement the check in the script itself (early-return PASS for the exempted slug), then regenerate any test asserting it; editing the comment alone cannot clear a per-blob verdict — the changed script IS the new blob judged next round.
    • A REFUSED close releases the lock, so the artifact lands in a NEW cycle — and that cycle's receipt covers the commit the review refused. Say so in the note. You cannot re-open the refused window: end_change refused, the lock is gone, and a fresh begin_change() starts a window that excludes the commit under review. Push the artifacts there anyway — the receipt it writes is bound to git merge-base origin/main HEAD, so it authorises the WHOLE unpushed range, refused commit included. That is precisely the case where silence would read as laundering, so state it explicitly: name the refused commit, the cycle id and its findings, and say the artifacts are its remedy. Done that way it is a fixed finding, not a manufactured receipt; done silently it is the trick the gate exists to stop.
    • Ship the artifacts as a re-runnable CAPTURE SCRIPT plus the transcript it emits, not as a hand-written log: print each command immediately above its own output, record the command's OWN rc (measured bare — a piped rc=$? reports the pipe's last stage), and let the reviewer re-run one line to reproduce one block. Include the blocks every claim needs — the doctor run, the checks called directly, the live-vs-committed comparison, the test runs (the file alone AND in the wider selection), one adversarial gate per changed file, and any deploy-vs-load fact. When a block carries a self-inflicted warning (a Repo clean warn that is the uncommitted artifact itself), say so in the artifact's header instead of re-capturing to hide it — a re-capture only moves the same warn to the next run, and the disclosure is what makes the rest of the transcript credible.
      • An evidence emitter that cannot FAIL is a false-green generator — prove it can fail. Two ways one lies silently: every line is piped through the redactor and the status is read AFTER the pipe, so ownership rc=0 reports the redactor's rc for a check that failed; and the script ends on an echo (always rc 0), so the transcript exists and the exit code looks clean whatever the checks said. Capture output into a variable, read $? / ${PIPESTATUS[0]} BEFORE running anything else, and end on an explicit verdict block that exits non-zero when any check failed. Then DISCRIMINATE it: run the emitter once against a deliberately broken input (a bogus $HOME, an absent path) and show the non-zero rc. A generator that has never failed on bad input has not been tested, and it is the artifact the reviewer is asked to trust.
      • The emitter's interpreter must be able to RUN what it invokes. A PATH python3 may be a venv without pytest, and the transcript then records No module named pytest while the script exits 0 — an artifact proving nothing about the suite. Resolve it explicitly (the fleet venv, or an env override) and refuse with the could-not-verify code when the runner is not importable, rather than emitting a confident empty transcript.
  • A peer's commits landing inside your cycle's window are attributed to YOU. A push/verify cycle whose window picked up a peer's new file is refused as scope-drift ("a push-only cycle should not add new test code"), and its diff stat will describe THEIR file as your change. Name the peer's SHAs in the note and state plainly that your cycle changed no source — or wait for the peer's stream to pause so the window holds only your own commit. A peer SESSION on the same host is not separable by authorship (one host, one git identity), so the close scopes by a FLEET-Session: commit trailer instead: commits carrying a DIFFERENT session's trailer stay out of the material and are disclosed as [OTHER SESSIONS' COMMITS … DISCLOSED, NOT REVIEWED]. Check the trailer before re-arguing authorship — git log --format='%h %s %(trailers:key=FLEET-Session,valueonly)' <base>..HEAD — and note it fails CLOSED: a commit with no trailer (a cron, an ungoverned committer) is still judged as yours. The trailer's PRODUCER must read the LIVE lock, never an env var the agent can export — a value settable from prose is not a discriminator. The prepare-commit-msg hook resolves the session from the repo's live lock file, REPLACES any hand-written trailer (so a forged one cannot survive a governed commit), and exits 0 on every path: it runs in EVERY repo on the host, so a hook that can block a commit is a fleet-wide outage.
  • The reviewer reads the cycle's DIFF, so a CORRECTIVE commit is judged as ADDING the text it removed. Deleting an offending passage to fix a finding comes back as the SAME finding ("the file still shows <the removed text>"): the material is the range's diff, so removed lines are in it and the file's UNCHANGED sections — a transcript captured earlier, a count on another line — are invisible to the reviewer. Before burning another round, test the finding against the file rather than the diff: grep -c '<flagged string>' <file> (0 matches at HEAD while the diff shows the removal = the reviewer is reading the removal), and confirm the evidence it says is missing is actually present (grep -n '<command>' <file> shows the captured transcript and its rc=).
  • When findings are demonstrably false, STOP re-reviewing — record the blocker and let the lock expire. Each re-review returns a variation of the same finding at full cost; the sanctioned exit is to record the issue with the measurement that refutes it, leave the lock to TTL-release, and report the substantive state (committed, deployed, pushed, verified) with SHAs. Never feedback_override to get past it and never re-mint a receipt to hide it — an ops/verify cycle whose window is ANOTHER session's commit can be uncloseable by construction, and a TTL-released lock is the documented outcome, not a failure to try harder. Say which commits are yours and which are the peer's in the issue record.
  • Splitting a deploy/installer file into its own later commit is legitimate, not gaming: ops/scripts/fleet-update.sh and friends force a receipt for the WHOLE range they sit in, so moving that one file (and its one line) into its own small commit removes the requirement and gives it a range a reviewer can actually read.
  • A deploy purges the session lock, and without a lock EVERY terminal call fails closed — including git status, git log and systemctl is-active, which are otherwise lock-free read primitives. So run all read-only verification BEFORE the deploy.
    • end_change() releases the lock too, so capture the doctor/verify transcripts BEFORE closing — immediately after a close, commands that look read-only are refused as write-capable: python3 <script> (even a pure reporter like the doctor), anything compound (cd <dir> && …), and git log with a -C <dir> prefix. The push itself is the exception (the receipt authorises it), so land the push FIRST and treat the post-push state as unverifiable from the session rather than re-acquiring a lock just to re-read it.
    • Inspecting state after a close: read_file/search_files still work with no lock — but search_files does NOT match a glob whose pattern starts with .. Query the name WITHOUT the dot (*governance*, not .governance-*) or it returns zero files, which reads as "no state exists" rather than "the probe cannot see it". And keep the call a SINGLE clean command: ls <dir>; echo ---; ls <other> is a compound and is refused as write-capable, so combine nothing. The dotfiles in that dir are also invisible to a shell listing — ls omits dotfiles, so a grep over plain ls output prints NOTHING and reads as "no receipt exists", which sends you to mint one you did not need. Use search_files(target="files", pattern="*<name>*"), which lists absolutely; if you must probe from the shell, ls -a and keep any leading dot OUT of the grep pattern.
    • Do not assume begin_change() is the way back from a purge. The purge removes the lock FILE while the governance SESSION can still be live in loop-governance's own state, so the two disagree: check_lock answers active: false, and begin_change then REFUSES — "a governance session is already active … call end_change first". Read that refusal instead of retrying the re-acquire: the exit is end_change(<task_id>) on the live session, which is also what runs its self-adversarial review.
    • A lock is required to git push at all (the pre-push hook refuses without one), and end_change RELEASES it — so decide the push BEFORE closing. Closing first strands an already-reviewed commit and costs a fresh cycle just to publish it; full order and the refusal semantics live in governance-closeout.
      • A CLEAN receipt authorises the push on its own, so close-then-push is the normal order for a cycle that closed once. After end_change the push succeeds with NO active lock — it prints ✅ No active governance lock, but a CLEAN review receipt covers this range: .reviewed-<slug>-<tip>.json. Do not re-take a lock just to push. Test that first: issue the BARE git push immediately after the close. The enforcer blocks write-class commands without a lock, and a bare push carrying a covering receipt is the carve-out — so a publish cycle opened "to hold the lock while I push" is usually wasted work: it costs a cycle and a close, and that close answers No review receipt — HEAD is already origin/main … nothing to push, which is the tell that the push had already succeeded on the receipt alone. Only take a lock when the bare push actually refuses, and then check the push range rather than assuming the missing lock is the cause.
      • Pushing from outside the repo: use the terminal tool's workdir, never cd … &&. cd /path/to/repo && git push is refused as a compound (write-class) command, and the refusal is the generic gate-2 text, so it reads like a missing lock. Set the tool's workdir to the repo and issue a BARE git push — that is the shape the carve-out recognises.
    • end_change refused as REVIEWER-UNAVAILABLE is infrastructure, not a finding — fix the cause and RETRY end_change, do not open a new cycle. The tell is a refusal that says the reviewer returned no usable content (finish_reason=length, max_tokens=16000): a reasoning model spent the whole output budget thinking. The documented knob is REVIEWER_MAX_TOKENS, read at CALL time (never at import), so raising it takes effect on the retry with no restart: append REVIEWER_MAX_TOKENS=<n> to the fleet .env ($HOME/steadfaste-fleet/.env, or $FLEET_ENV_FILE; the reader also checks the deploy root and ~/.hermes/.env). Ceiling is 128000 — a value above it is clamped and warned. Then call end_change again on the SAME session: the refused close leaves the lock FILE removed while the governance SESSION stays live, so begin_change refuses with "A governance session is already active … call end_change first" — that refusal names the exit, it does not mean the close was lost. Retrying on the live session closed the cycle and wrote a CLEAN receipt covering the whole unpushed range.
    • A TIMEOUT on end_change is NOT a failure — the close may have completed. The call can exceed the MCP client's deadline while the server is still running the review; the lock is released and the receipt written on the server side. Do not re-call it, and do not assume the close was lost. Determine the OUTCOME instead: if the session lock file is gone the lock was released, and the decisive test is a bare git push — a receipt written by that close authorises the range and prints ✅ No active governance lock, but a CLEAN review receipt covers this range.
  1. Pre-push dogfood gate diffs the WORKING TREE, not the push range. The hook runs git diff HEAD --name-only, so a concurrent session's unstaged/untracked files (e.g. a peer's in-flight script in ops/scripts/) trip "code changes without docs" + "doctor reports N failure" and block even a clean docs-only push. The dogfood run it triggers then fails its own git pull --rebase step on those same unstaged changes.

  2. PII gate blocks unknown public URL hosts on shared-surface writes (write_file/skill_manage into the repo or ~/.hermes/skills). A legitimate public site not on the allowlist gets flagged (2026-08-24: a doc referencing a new public site was blocked as "non-public server URL host"). Workaround: reference the site in prose without the scheme, and use allowlisted hosts (github.com) for real links. Never try to bypass the gate. The guard is PATTERN-based, so it also fires on digit-dense identifiers that are not personal data at all — a session key or UUID (20261008_152408_ab12cd34) reads as a phone number. Generalize it in the text (<a real session>, 10:49Z) instead of arguing with the gate: a wall-clock time is fine, a long unbroken digit run is not. A row of LINE-NUMBER references trips it identically — the guard ignores separators (colons, dashes, commas), so path:L-NNN entries cited back to back concatenate into one long digit run and the write is refused as a phone number. Cite code by SYMBOL or function name rather than by line: it reads better, and it does not rot when the file shifts.

  3. adversarial-verifier skill required for commits while any ops/scripts/ working-tree change exists — even for docs-only commits. Load the skill, run python3 ~/.steadfaste-fleet/scripts/adversarial-verify.py --file <your-staged-files> --level A2 --gate, then commit.

    • The scan judges the whole FILE, so an OLD file's pre-existing findings block a one-line change to it — attribute before you edit. Measured on a 1,300-line CLI: adding a single subcommand was refused by 1 High (cheat-detection pattern count — empty except blocks anywhere in the file) plus 4 Medium fuzz findings against two functions the change never touched. Check attribution FIRST: re-run with --json and look at each finding's shape — a fuzz finding carries target as path:function() and names someone else's symbol, while a pattern finding carries only pattern/detail and is FILE-WIDE, so it cannot be fixed at your call site at all. If no finding names your symbol, the choice is to clear the file's existing debt in the same change (fix the swallowed exceptions, add the input guards) or to expect the block and report it with that attribution — never to bypass it, and never to report it as a problem your change introduced.
    • A TEST file is scanned at A4 too, and dynamic code in it BLOCKS the commit. A test that loads the module under test by building its source (exec(compile(...)), a string-eval seam) comes back as Medium findings and the commit is refused with a bare ❌ Adversarial scan blocked: 1 file(s) have findings — the file-level --gate run can pass while the hook's staged-file scan still blocks, so a green explicit run is not the hook's verdict. Assert against the real source instead of executing it (ast.parse + ast.get_source_segment for the properties you care about; note in the docstring that the helper is pinned by source assertions because importing the server needs a live session), or drive an importable seam. Do not answer it with a bypass flag — the scan is right, and a test that executes generated code is the thing it exists to catch.
  4. Orphaned PENDING cycles block push (verified 2026-08-27, again 2026-09-02). The doctor FAILs on PENDING cycles from FINISHED tasks (no active lock) — e.g. a cycle created by begin_change in a session whose lock was later purged by restart/fleet-update, OR a cycle created by a BACKGROUND/delegation session (bg_* session id) that finished without scoring.

    • A THIRD source is your OWN test suite: a test that calls the real begin_change / feedback_accept writes a row into the LIVE store. Tests are run casually and repeatedly, and because the doctor counts an unscored PENDING cycle as a FAILURE the leak blocks the push for EVERY agent on the host until someone finds the row and scores it. Point such a test at a temp state dir (and assert what the tool wrote THERE) or drive the extracted helper, never the tool; a fixture written to a path the reader does not read is exactly how the live store gets written while the test still looks hermetic. Symptom: push blocked with "doctor reports N failure" + ❌ PENDING cycles, even after dogfood passes. Fix: query mcp__review__cycle_query(unreviewed=true), feedback_accept (or feedback_override) every orphaned PENDING cycle, re-run doctor to 0 fail, then push. The current task's own cycle (lock held) is INFO, not a blocker.
    • Score a foreign row BY ID, not by task id. feedback_accept(task_id='<another task>') is REFUSED — the resolver only reaches YOUR session's own PENDING cycle, so the row the doctor named looks unreachable. Read the id from the doctor's own line (<task>#<cycle_num>) or from cycle_query, then pass cycle_id=<id> plus an unscored_reason that says where the row came from and why it holds no work. Without that you loop on the same FAIL, and the push stays blocked for every agent on the host. This task's OWN earlier cycle is the other orphan source, and it looks unreachable. A lock that EXPIRES at its TTL mid-session leaves its cycle PENDING with no lock file; the next begin_change() for that task SUCCEEDS (unlike the deploy-purge case above) and mints a SECOND pending cycle — so one piece of work owns two ids. Score the EARLIER one by cycle_id with a note saying the work continued under the later cycle, or the doctor's ❌ Orphan-cycle resolution FAILs and blocks every push on the host. Confirm in the DB rather than by task id: SELECT id, task_id, decision FROM loop_cycles WHERE task_id='<task>' ORDER BY id.
    • Per-task cycle_query(task_id=...) does NOT show other tasks' leaked cycles — if the doctor still reports PENDING after scoring your own, find the leak directly: python3 -c "import sqlite3; c=sqlite3.connect('$HOME/.steadfaste-fleet/data/loop-governance.db'); [print(r) for r in c.execute(\"SELECT id, task_id, session_id FROM loop_cycles WHERE decision='PENDING'\")]" (DB table is loop_cycles, not cycles.) 2026-09-02: the blocker was bus-poison-filter from bg session bg_090100_065b51 — an async delegation's cycle never scored.
    • When the MCP bridge mangles a long governance write, use the CLI — not raw SQL. Build the payload with json.dumps in a script and invoke the SAME implementation the MCP calls: loop-gov.py feedback_accept '<json>', record_issue '<json>', end_change '<json>' — the CLI exec_modules loop-governance's own handlers, so the ledger entry is identical and no SQL is hand-written. LONG PROSE ARGUMENTS are what break the bridge; a short one-key call is reliable. The raw UPDATE below is the LAST resort, only after the CLI refuses too.
    • Scoring fallback when the loop-governance MCP bridge drops its arguments (repeated "cycle_id or task_id is required"): write the score the MCP would have — UPDATE loop_cycles SET completeness=1, quality=1, progress=1, composite=1, decision='STOP', outcome_note='<verification evidence>' WHERE id=<cycle_id>; then delete the session lock ~/.steadfaste-fleet/state/.governance-<session>.json. Last resort only (3 MCP retries max) — it writes the same fields feedback_accept writes; never skip the score, and state the workaround in your report.
  5. Deploy-sync gate fires before push. The push gate requires deployed state == repo source — it surfaces as ❌ Deploy sync, ❌ <plugin> content, or the checksum form ❌ Checksum: <file> right after committing a changed installer or deployable (install-crons.sh, install-orch-crons.sh, registered scripts). The fix is the same for every form: run bash ops/scripts/fleet-update.sh (deploy), then push. Order is always commit → fleet-update → push. For the full dogfood (pull → deploy → doctor → verify): bash ~/.steadfaste-fleet/scripts/fleet-dogfood.sh --force. (Its own pull step SKIPS itself when unpushed local commits exist — it prints (unpushed local commits present — skipping pull; local work is what we verify) — so the deploy+doctor run against YOUR tree with no peer merge; read that line rather than reporting a pull that did not happen.)

    • Deploy yourself — a push that LANDED is not evidence the deploy ran. A push made with an active lock went through with no deploy at all: the output was only the ref update, and the deployed copy of a changed skill was still the previous revision afterwards (deployed != repo, content compared with the deploy banner stripped from both sides). The gate's dogfood step is not guaranteed for every push shape, and the omission surfaces later as ❌ Deploy sync — HEAD ahead of last deploy on the NEXT push. So after any push that touches a deploy-map file, compare the deployed copy against repo source and run bash ops/scripts/fleet-update.sh when they differ — report the deployed state from that comparison, never from the push having succeeded.
    • A tracked GENERATED file that keeps getting rewritten is committed as its OWN commit, naming the generator in the message. This is what keeps the tree clean for the doctor and for the gate's working-tree diff while keeping generated churn out of the change under review. Leaving it dirty is not neutral: the doctor's Repo clean warning fires, the dogfood gate diffs the working tree, and its pull step can refuse on an unstaged file. Say which generator wrote it and that it is not part of the cycle's diff, so a reviewer does not read it as scope drift.
    • A merge/pull IS a deploy in this repo, so do not deploy twice. git pull --no-rebase fires the post-merge hook, which runs the deploy and then the doctor — its output (framed post-merge: auto-deploying to match new HEAD … post-merge: deploy complete) is your Deploy-sync evidence, and a further dogfood run on top of it is redundant. Redirect that pull to a file: the doctor's overall line inside it is what tells you whether the gate will pass, and re-reading a 3-line summary beats a second 30-minute deploy. A mid-push deploy may itself report cost-tracking marker FAILs inside scheduler/cronjob files; re-run fleet-dogfood.sh — if it ends with ✅ DOGFOOD PASSED, the deploy is clean and the push succeeds on retry.
    • A ❌ Deploy sync with NO code change you can account for is usually SKILL DRIFT: a deployed skill copy is newer than its repo source, because skill_manage — and the skill/lesson pipeline, with you running nothing at all — writes ONLY the deployed copy ($HOME/.hermes/skills/...; confirm the root from the doctor's own paths rather than assuming, some builds use ~/.steadfaste-fleet/skills) and leaves the repo file untouched — so a lesson that is not copied back and committed stays on one host, and a commit message claiming it rode along is false while the diff shows nothing. Verify with diff skills/<cat>/<name>/SKILL.md ~/.steadfaste-fleet/skills/<cat>/<name>/SKILL.md before believing a lesson shipped. The deploy's own ⚠ SKILL DRIFT: <skill> warning is the tell, and the cure is to cp the deployed SKILL.md back to skills/<cat>/<name>/SKILL.md and commit it BEFORE the deploy+push — never to re-deploy on top of it. Symptom, fix and the standing habit are in references/skill-drift-gate-2026-08-27.md: after ANY skill_manage patch in this repo, sync the deployed copy back to repo source in the same cycle. The full two-class recovery walkthrough (SKILL.md supersets vs parity-absent references/templates, with the delete-vs-commit decision for each) is references/skill-drift-recovery.md. Treating it as "pre-existing drift I cannot explain" wastes the cycle — it is always the skill you just edited, OR a peer's in-flight skill work (never cp over a skill another session is mid-edit on — it is theirs to land, and its diff is the tell). A THIRD source writes skills NOBODY touched: a background lesson/curation pipeline writes the DEPLOYED copies while you work. Drift then appears on skills outside your change and REAPPEARS after you reconcile them — the same two skills drifted three times in one session, the last time mid-deploy. Treat it as routine maintenance, not as a failure of your change, and KNOW that the pure-superset class now recovers ITSELF: the agent-skill-drift-reconcile no_agent cron (every 2h, systemd bridge) runs reconcile-stranded-skills.py --apply and commits+pulls the supersets, so a pure-superset strand usually resolves within two hours without you touching it. Your remaining duty when the doctor still shows skill drift: (a) the need-review/DROP class — the reconciler REFUSES it, so a deployed copy that REPLACES lines must be merged by hand (check the DROP by PHRASE before merging); and (b) verify the reconciler is running, not silently failing — grep its run log for a surfaced reconcile-stranded-skills.py --apply failed or a stuck git state before you hand-reconcile something the cron would have done. Only hand-run python3 ops/scripts/manage/reconcile-stranded-skills.py --apply when you need the recovery NOW or the reconciler is down. When you DO run it, remember it applies the pure-superset class only and NAMES any file needing a real merge — a file whose deployed side REPLACES lines must be merged by hand, after reading the removals to confirm each is a stale lesson being rewritten rather than information being dropped. Then re-run The NAMED DROP is usually a FALSE POSITIVE — check it by PHRASE before you hand-merge. A deployed copy that REWROTE a paragraph reports as a line REMOVAL, so grep the deployed file for a distinctive phrase from the dropped line rather than comparing lines: grep -n '<distinctive phrase>' <deployed copy>. Phrase present — reflowed, and typically EXTENDED with the newer rule — means the deployed side is the superset and you take it; only a phrase that is genuinely ABSENT is information being dropped, and only that file needs a real merge. Copy the accepted side and assert the result (sha256sum equality) in the same pass — a copy you did not verify is a claim, not a fix. Two classes the --apply summary does NOT cover, so read the parity report for them. A path that exists ONLY deployed while a repo SKILL.md ROUTES to it (the report lists these as never-committed) is a dangling route the fleet can never follow — recover it too, even though the tool's own counters may read missing=0. And the end-to-end proof that the guardrail is clear is the DEPLOY's own line: Skills: 0 updated, N unchanged, 0 stale removed, 0 preserved (deployed-only, not auto-deleted) — that last number is exactly where the stranded files sat, so it going to 0, plus check-skill-drift-parity.py exiting 0 with the report's stranded/absent rows at 0, is the verification. The tool's own claim is not. check-skill-drift-parity.py to regenerate the committed table and --check to confirm: STALE artifact - regenerate means the recorded table no longer matches the live derivation, and the checker refuses a stale artifact — so regenerate it in the SAME cycle as the deploy that invalidated it. Quantify it before diagnosing: python3 ops/scripts/manage/check-skill-drift-parity.py prints a verdict plus the DEPLOYED-ONLY ("stranded") file list — content that exists only on the deployed copy because a lesson was written there and never copied back — and the doctor exits non-zero while any remain, which blocks every push on the host until it is resolved or explicitly recorded as its own task. Before editing ANY skill in this repo, check the target is currently IN SYNC — pick a skill whose deployed and repo copies already match, or reconcile the drift first in its own cycle. Editing an already-DRIFTED skill compounds the strand: the repo copy falls further behind, and a plain deploy cannot repair it (the drift guardrail skips a deployed file that is newer than its source), so the lesson never reaches the fleet. Run check-skill-drift-parity.py and choose your target from its output before writing.
    • The strand/parity tools only see a file the repo LACKS ENTIRELY — they are BLIND to the common case, where both copies exist and the deployed one is a SUPERSET. Measured: the tool the doctor's own hint names printed Detector verdict: FAIL · stranded: 0 — Nothing stranded: repo and deployed trees agree on content while the doctor simultaneously reported 14 drifted skills. That all-clear reads as "nothing to do", so the operator stops, and every lesson stays on one host until a deploy overwrites it. The doctor's check is CONTENT-based (it compares file hashes; direction — deployed-newer vs repo-newer — comes from mtime with a ~1-minute tolerance), so when the two disagree, believe the DOCTOR, not the tool its hint points at. Diagnose the doctor's list yourself, one skill at a time: cmp -s skills/<cat>/<n>/SKILL.md "$HOME/.hermes/skills/<cat>/<n>/SKILL.md". Then propagate DEPLOYED → repo (that is the direction the doctor prescribes, "commit the repo source before fleet-update overwrites it"), and VERIFY each copy in the same pass by comparing sha256sum of both sides — a copy you did not verify is a claim, not a fix. A deploy cannot repair this drift: the deploy itself runs repo → deployed.
    • Diff a superset before copying it; its removals are usually REWRITES, not losses. A deployed copy that is larger still REPLACES lines — the pipeline consolidates as it appends. Read the removals (difflib/diff on the two files) and confirm each is a stale lesson being replaced, not information being dropped. The ones worth catching are substantive corrections: a skill still teaching a rule the operator has since overturned, or a rule dropped from one file in favour of a better home. Say which removals were rewrites in the commit message, so a reviewer reading a -30 diff does not read it as loss. A pipeline-written lesson is a SUMMARY, and its forward references may dangle — make them self-contained when you backport. The deployed addition can cite see <skill> pitfall N (or "full diagnostic in <skill>") where the target does not exist — the pipeline wrote the lesson but not the pitfall it points at (a deployed lesson once cited a non-existent pitfall 12 in a skill that had 11). Copying it verbatim bakes a dead cross-reference into the fleet's docs. When a backported lesson carries such a reference, either write the missing target in the SAME pass (if it is yours to author) or drop/repoint the pointer — never ship the dangling link, and never duplicate the full text into the second skill purely to resolve a numbering habit: make the reference name the skill, not a pitfall number that shifts.
    • A ❌ Checksum: <file> you did not cause by committing late is a RACE: you edited a registered file while the deploy was still copying it. The doctor compares repo source to the deployed copy, so an edit that lands mid-copy makes them disagree and the deploy ends FAIL — then the push is rejected even though nothing is broken. Do not diagnose it as drift and do not re-deploy on top of another edit: finish and COMMIT the edits, confirm the running deploy has exited (it is a background process — poll it), then deploy once more and push. Rule: never patch a file the deploy is about to copy.
  6. DOCS AUDIT blocks a new doc that is not in docs/DOCS-INDEX.md. Adding (or moving) a file under docs/ fails the commit with <file> changed but docs/DOCS-INDEX.md was not updated. Add the index row in the SAME commit; the index also dictates WHICH directory a doc belongs in (cycle/decommission evidence goes under docs/evidence/, not a scratch or reports path). Two more gates hit on the same writes: a hardcoded /home/<user>/ path in a new doc or test (use $HOME / Path.home()), and a GENERATED file edited by hand — such a file carries a "do NOT edit by hand" banner plus its own --check test (generate-harnesses.py --check, gen-skills-manifest.py), so fix the source it is generated from and re-run the generator.

    • Editing ANY skill fires the audit for docs/SKILLS-MANIFEST.md. The manifest is generated from the skills tree, so a skill edit makes the committed copy stale and the commit reports it (DOCS AUDIT: skills/ changed but docs/SKILLS-MANIFEST.md is stale). Regenerate with the WRAPPER, never a bare python3: the wrapper picks an interpreter that has PyYAML, and the raw generator on a host whose PATH python3 lacks it exits non-zero, which the audit reads as CHECK-FAILED rather than stale — bash ops/scripts/manage/gen-skills-manifest.sh. Commit the result as its OWN commit naming the generator (same rule as the generated-file note under the deploy-sync gate). Prove the regeneration is reproducible before committing: a second run must print fresh and change nothing. A big diff of reordered rows and re-truncated descriptions is what a manifest predating the generator's current logic looks like — the audit is reporting pre-existing drift, not something your edit caused, so do not hand-merge it back.
  7. Removing an INDEXED resource trips the expectation checks — fix the expectation side in the SAME change. Every health check that holds a list of "what should exist" (the cron manifest, the doctor's expected-cron arrays, a register/MAP of deployed files) FAILs the push the moment you remove the thing it declares, surfacing as ❌ Cron manifest missing (<name>), <thing> missing, or a bare ❌ Deploy sync. The REMOVAL is usually correct; the stale EXPECTATION is the bug. Teach the check the new owner/state (e.g. skip names now hosted by another scheduler) rather than restoring the resource — restoring re-creates the duplicate the removal was fixing.

    Corollary — before removing a resource, make its CREATE path aware. A removal on its own is a trap whenever something recreates what is missing: create_cron in the installers recreates any absent cron, so a removal without a guard silently resurrects a second owner and the job then runs twice. Guard the create path first (skip anything already owned elsewhere), then remove — and prove it by running the installer and asserting the count did not grow.

Building a NEW deployable instrument: measure first, then ship it fleet-wide

When a question needs data that only EXISTS on other hosts' local state (cost, review volume, doctor output), the answer is never a guess and never a one-off message to the peer: ship a small READ-ONLY instrument through the register map, then EXEC it on every host. The cost4 crew proved the pattern with cron-cost-metrics.py; a sibling for governance review volume is review-volume-metrics.py (2026-11-10). The full sequence, with the traps each step carries:

  1. Write the script mirroring cron-cost-metrics.py's shape: host-derived identity from agent.env (AGENT_NAME — the bus EXEC passes no --agent), read-only sqlite (mode=ro), and an unreadable store reported as an ERROR (exit 2), never as a zero. Empty tables on an older host = absent, not 0.
  2. Register it in fleet-update.sh beside its sibling (register "ops/scripts/manage/<name>.py" "${FLEET_DEPLOY_HOME}/scripts/<name>.py"). A new shared file is NOT deployed unless registered.
  3. Deploy the repo copy (bash ops/scripts/fleet-update.sh), then verify the DEPLOYED copy runs and matches the repo copy modulo the SOURCE header: diff shows only the 3 header lines the deploy prepends.
  4. Write a test — the TDD gate refuses production code without one. The file name carries DASHES (deploy convention), so a plain import review_volume_metrics fails: load by importlib.util.spec_from_file_location like dogfood-reviewer-tiering.py does, expose the module as a pytest fixture.
  5. Commit, then close the governed cycle (end_change) to mint the receipt, then push — the full push gate sequence applies like any other change.
  6. Dispatch UPDATE_REQUEST to the worker hosts (they pull the new script via their fleet-update), then fleet exec <host> <script>.py --json-summary (the deployed-copy path on THEIR host; round-trip can be 150s+ on macOS workers). The script must exist under ~/.steadfaste-fleet/scripts/ on the TARGET.

The commit message file belongs in $HOME/.hermes/cache/scratch/, not /tmp. The scratch dir is what the environment keeps for the session; /tmp gets cleaned mid-session and the message file vanishes between the message-write and the commit, failing the commit with an opaque fatal: could not read log file. Write it once into scratch and reuse the same path for retries.

Two LAYERS refuse a bare commit — diagnose WHICH before editing anything. The enforcer PLUGIN (~/.hermes/plugins/governance-enforcer/__init__.py, _check_commit_scope_gate) judges the COMMAND TEXT your terminal tool issues and refuses a bare git commit (or a message that reads bare after splitting); the git HOOK (pre-commit-score, _commit_scope_guard) judges PROCESS ANCESTRY and the deployed index. A refusal that names "BARE COMMIT REFUSED — name the paths" at terminal-tool time is the ENFORCER's text classifier, and the fix for a misjudged multi-line -m lives in the enforcer source (then deploy + gateway restart), NOT in pre-commit-score — editing the hook does nothing for a command-text reading. A pre-commit hook refusal is ancestry/partial-index based and reads differently. Attribute the refusal to its layer before patching; patching the wrong one costs a session of BARE REFUSED that never clears for the unchanged reason.

The commit-scope guard splits on top-level separators, so a separator INSIDE quotes no longer reads as BARE. Since 2026-11-12 the enforcer's splitter tracks single/double quotes (with backslash escapes), so a multi-line -m body keeps its newline and the -- <paths> spec stays readable on the same segment. A pathspec commit with a multi-line message or a ;/| inside the message now PASSES (covered by TestCommitScopeGate). The genuinely bare form — a git commit with NO -- <paths> anywhere, even beside a scoped sibling in a compound — is still refused. Best practice for a long message remains git commit -F <message-file> -- <paths> (put the message in a file, not the command line); --only/--git-dir=.git are fallbacks only while the running gateway still holds the pre-fix enforcer (restart the gateway to load the quote-aware splitter).

Fleet-Active Push Races (verified 2026-09-01)

On a busy fleet, other agents push between your fetch and your push. Signature: dogfood prints ✅ DOGFOOD PASSED then error: failed to push some refs — repeatedly, with no diff problem on your side. The dogfood run is fine; the REF UPDATE lost the race.

git fetch origin main
git log --oneline HEAD..origin/main        # who won while you worked
git pull --rebase --autostash origin main  # rebase onto the new head
git push origin main

May need several rounds on active days; each round's dogfood re-runs clean.

  • Autostash is the sanctioned way to rebase over a peer's unstaged change — git pull --rebase --autostash shelves the foreign file (autostash ref), rebases, and restores it. Verify git status after that the foreign file is back ( M ops/... present). A MANUAL git stash push <their-file> is the prohibited variant — autostash is git-managed and restores automatically. Manual stash push/pop is only acceptable when autostash is unavailable (plain git rebase origin/main on an already-fetched ref), and then ONLY on files whose diff you inspected and confirmed unrelated to your change.
  • A peer's COMPLETED, intentional change that blocks you (mtime old, coherent diff, matches known design): commit it as its OWN commit with clear attribution in the message ("Completed <date> session, committed now to unblock the push gate") rather than looping on the race — then the tree is clean and the gate passes. Only for finished work, never a mid-edit file.
    • An uncommitted edit is UNVERIFIED work, so RUN ITS TESTS before landing it — "coherent diff" is not "finished". A change can be half-applied in the way a line-based diff never shows: the edit changed a function's RETURN SHAPE while the test file still asserts the old one, so committing it as it stood turns a clean tree into a RED suite and attributes the failures to your commit. Find the consumers and the test file for the changed symbol (grep -rln <symbol>), run them, and FINISH the edit in the same commit when the gap is mechanical — update the stale assertions, add the case for the capability the edit actually added — saying in the message that you completed a taken-over edit and which contract the assertions now pin. Run the tests in the interpreter that can run them (the fleet venv, not a bare PATH python3), and re-run a LONE failure once before attributing it: a test that passes on the retry was a race with the previous run, not a consequence of your change.
  • ❌ Deploy sync after a successful dogfood race-recovery: if you commit AGAIN after a deploy ran (the raced push deployed your first commit; the second commit is now undeployed), the gate flips to Deploy-sync. Run bash ~/steadfaste-fleet/ops/scripts/fleet-update.sh (deploy), confirm Updated: <sha> → <sha>, then push. Order is always commit → deploy → push.
  • Deploy-sync can LIVELOCK against a peer's commit stream. On a host where another session keeps committing, every fleet-update.sh is invalidated by the next peer commit and the gate reports ❌ Deploy sync — HEAD (<sha>) ahead of last deploy (<sha>) round after round. Before spending another deploy, check whether the peer is still active (git log -3 --format='%h %ad %s' --date=iso) — your commits sit on the SAME branch, so the peer's own push publishes yours; confirm with git log --oneline -1 origin/main instead of looping. While the peer is mid-stream, report "committed + deployed locally, push rides the peer's next push" with the SHA rather than claiming a push that did not land.
  • Every NEW deployable file needs its own register line in fleet-update.sh — a new shared module imported by an already- registered script (e.g. a doctor helper module) is NOT deployed unless registered itself. The deploy "succeeds" on your host only because the untracked file already exists in the deployed dir; the next host or the doctor then fails with ModuleNotFoundError. After adding any file to a deployed package, grep its package siblings in the register block.
    • A NEW HOOK also needs its SYMLINK, and the hooks dir is IMMUTABLE. Registering the source script is only half the deploy: the global core.hooksPath directory carries chattr +i, so ln -sf into it fails (Operation not permitted) while the deploy still reports success for the script — the file lands in scripts/ and is NEVER invoked. Create the link in the same deploy step as unlock → link → relock, and resolve the lock helper the way the rest of the deploy does (command -v hermes-plugin-lock first, the deploy-home copy only as a fallback — they are different paths and are not equally permitted to unlock). VERIFY the resulting link (readlink, not the command's exit status), and report a failed unlock and a failed RELOCK as separate warnings: a left-open hooks dir weakens every hook on the host, and a missing link silently leaves the fleet without the new behaviour. Nothing in a no-op branch will catch this — the other hooks are already correct, so only a NEW one ever exercises it.

Concurrent-Session Discipline

  • Before pushing: git status --short. Foreign unstaged/untracked files present → expect the gate to block; plan for a later push.
  • Do NOT stash, clean, or commit a peer's in-flight files (SOUL P9 — don't race a peer's in-flight update). Stand down, state the block in your delivery, push after the tree clears.
  • Stage only YOUR files (git add <yours>) — never git add -A in a shared tree. A generated file that a cron or peer writes into the tree is swept in by -A, lands in your commit and in the reviewed range, and then conflicts when the peer's own version arrives: the resolution is to take the UPSTREAM side for a file that is not yours — in a REBASE --ours means the branch being rebased ONTO, so git checkout --ours -- <path> keeps theirs and drops your unintended edit — then git add it and GIT_EDITOR=true git rebase --continue. Read what -A staged BEFORE committing (git diff --cached --name-only): an evidence directory full of generated files is exactly where a foreign file hides.
  • Verify the file set that actually LANDED, not the one you staged. Even with an explicit git add <yours>, a gated commit can sweep a file a peer session had modified into your commit. Run git show --stat HEAD and confirm it matches your intended paths. If a peer's file is present, do not rewrite history to drop it (that discards real work) — record whose change it is and continue; the owning session's own commit normally lands on origin anyway.
  • To land another agent's staged work (a cross-host proposal to "commit, push, deploy"), ship the BYTES, never a re-implementation of a forwarded summary. A summary — even one that calls the work "staged and verified / tested both ways" — is not the diff, and reconstructing from it diverges from what they actually tested and muddies attribution (SOUL P8). Get the exact staged diff (git diff --cached -- <paths> plus git status --short) or the files themselves, apply them verbatim, then RE-PROBE BOTH WAYS on THIS host before committing — "tested on their box" is not "tested here": a peer's host-local check can carry an environment defect that only your session's contaminated environment surfaces (e.g. an inherited PYTHONPATH making a healthy entry report BROKEN), which you find only by running its healthy AND refusal branches locally. Add a hermetic test for a new guard/check script in the same landing (a config-sourced interpreter needs its branches pinned, not just its happy path). If you cannot obtain the bytes, state that honestly and offer to re-implement from the agreed plan rather than silently recreating their file. When your re-probe changes their file, say so plainly in the commit (a hardening, not a rewrite of authorship).
  • Tag your work while a concurrent session is active (git tag -f <name> <sha>) so a later reset --hard or rebase-rewrite in the other session cannot orphan your commits. Report "committed locally + deployed, not yet pushed" with that SHA — never claim a push that did not land.
  • A peer's rebase-rewrite shows up as non-fast-forward with identical messages. When origin's tip has the same subject as your local HEAD under a different SHA, the other session rewrote shared history; fetch and rebase onto it rather than force-pushing anything.

Drift-Resolution Direction for a Peer's Unstaged Change

When a peer's unstaged change blocks the gate, resolve by EVIDENCE, not by age:

  1. git diff <file> and compare against the DEPLOYED copy plus the live runtime the script patches (diff deployed repo, grep the deployed upstream for the symbol).
  2. If the unstaged change MATCHES deployed/live truth (e.g. a marker string aligned to the running code), commit it as its own commit with clear attribution — that is drift resolution, not racing.
  3. If it matches nothing verifiable, leave it unstaged; use git fetch + push-only instead of pull --rebase --autostash on a tree you can't characterize.
  4. If the doctor's only FAIL is HEAD ahead of last deploy, just run fleet-update.sh and push again — commits must be deployed before the gate accepts them.

Header pollution trap: after cp from a DEPLOYED file into the repo, strip the # SOURCE: / # Do NOT edit this file deploy header (first 2 lines) before committing — the doctor hashes repo source WITHOUT the header, so a headered repo copy fails every checksum/script-content check.

Pitfalls

Review receipt gate: deploy ≠ load. The receipt is written by the MCP server (loop-gov-mcp.py). A running MCP child started before that file changed holds the old revision and CANNOT write receipts — so the gate refuses and nothing says why. After deploying loop-gov-mcp.py the gateway must restart; agents cannot do it (lifecycle guard), so the deploy banner is the signal. Related trap: the writer resolves the lock from tool-call args, and an early version called _read_lock(None) — which resolves nothing, silently, so no receipt was ever written while every code path looked correct.

  • A commit message must not cite a number the artifact it touches contradicts. A reviewer reads the commit SUBJECT and the diff together: "regenerate the suite results (N passing)" beside a file whose own measured: line says something else is a fabrication finding, and while it stands the cycle cannot close. Before writing a count into a commit message, read the number OUT of the file being committed.
  • A measured count inside a generated artifact must carry its SCOPE. A "126 passed" line with no scope reads as the total for whatever the artifact is about; the next reader (or reviewer) will disagree with your summary and neither of you is wrong. Label it in the artifact (parity suites: N, whole surface: M), have the generator measure both, and assert one can never exceed the other so the two lists cannot drift apart.
  • Editing an always-skill mid-cycle invalidates the skills-loaded marker. The enforcer's marker pins a fingerprint of the 7 always-skill CONTENTS (content hash since 2026-09-23; mtimes before that, which fired on redeploys that changed nothing) — any skill_manage/patch on one of them (e.g. a conciseness trim) makes the stored fingerprint stale. The NEXT write tool call fails with "session skills not fully loaded" even though all 7 show ✅ loaded (the ✅ reflects the in-memory set, the block reflects the stale marker). The block message now names the skills whose content changed: re-load THOSE via skill_view() (serial; the 7th of a full set regenerates the marker) BEFORE continuing the push sequence. A deploy (fleet-update) only has this effect when the deployed skill CONTENT actually changed. Verified 2026-09-02 (change-checklist trim → push gate blocked mid-sequence); mechanism corrected 2026-09-23.
  • "Push blocked" after a clean commit is usually the OTHER session's tree, not your diff. Check git status --short before debugging your commit.
  • ANY doctor FAIL blocks push, not just Deploy sync — e.g. ❌ Systemd stale units from failed units. Fix the host debt, then re-push; do not retry past a FAIL. For failed VENDOR/static units (loaded from /usr/lib, no user override file — check ls ~/.config/systemd/user/ first), systemctl --user reset-failed <unit> clears the state; the doctor's disable --now && rm ~/.config/systemd/user/<unit> suggestion only applies when a user unit file actually exists. The FAIL need not touch your diff, or even this repo: a doc-freshness FAIL on a DIFFERENT repo on the same host (❌ AGENTS.md (<other repo>)) blocks every push on that host until it clears — read WHICH check failed before debugging your commit, and re-run the deploy gate first, since deploying your own change is what usually retires a stale ❌ Deploy sync. Clearing such a FAIL can be outside your authority — an AGENTS.md or CLAUDE.md refresh is an approval-gated write to an agent-instruction file, and a TIMED-OUT approval prompt is NO consent: the block states the user has NOT consented and forbids re-attempting the edit via another path (terminal, execute_code, a fresh begin_change). So commit the rest locally, report the blocking check plus the local SHA ("committed locally, not yet pushed"), and wait for the operator's explicit authorization — the doctor's CLAUDE.md (dev repos) reconcile stays WARN until then. Never bypass the gate or delete the check to silence it.
  • The dogfood gate auto-runs fleet-update; its pull step failing with "cannot pull with rebase: You have unstaged changes" is a second fingerprint of the concurrent tree.
  • Stash-and-restore is the repeatable pattern for rebase-with-peer-changes when --autostash is unavailable (plain git rebase origin/main after a fetch). Same session, repeated rounds: git stash push -m '<label>' <the-3-foreign-files> → rebase → push → git stash pop, verify git status shows the foreign files back unstaged. Confirmed safe for files whose diffs were inspected and are unrelated; keep the same file list every round and never add files to it.
  • A new sub-patch to an already-deployed import can surface as MULTIPLE checksum failures at once (Checksum: <new-module> alongside checksums of peer-modified files) — after deploy, re-check the doctor output for which failures REMAIN before assuming your fix was incomplete.
  • Docs-only changes are deploy-exempt (fleet-update does not deploy docs/) — no deploy step needed after a docs push.
  • Never pass a multi-line or backtick-bearing body to git commit -m. A shell-quoted -m "..." is expanded by the shell BEFORE git sees it, so backticks in the body run as COMMAND SUBSTITUTION: a message that merely mentions code, a log line, or a filename can truncate itself, corrupt the rest of the command line (observed: a chained deploy invocation that then exited 127 with no output at all), or create a stray file named after the fragment — which a later commit then sweeps in as scope drift. Write the message to a temp file and use git commit -F <file>; -m is safe only for a one-line subject carrying no shell metacharacters. After a malformed-commit cleanup, git status --short before the next git add and look for junk paths (a bare =, a fragment word) at the repo root.
  • A gate-blocked git commit -F <file> commits with a STALE subject on retry. The enforcer rejects the WHOLE compound command — printf "...msg" > /tmp/msg && git commit -F /tmp/msg is blocked before the printf runs, so /tmp/msg still holds the PREVIOUS task's message. After you satisfy the gate (load adversarial-verifier, etc.) and re-run the bare git commit -F /tmp/msg, the commit lands with the wrong subject and the pre-commit hook scores it under a misleading task name. Use a UNIQUE temp message file per commit, and after any gated commit verify git log -1 --format=%s matches what you meant — git commit --amend -F <correct-file> if it does not. A blocked compound ran NONE of its stages, so the retry fails for a reason that looks unrelated: git add <path> && git commit … refused for a missing skill (or any gate) leaves the path UNSTAGED, and the next git commit -- <path> answers error: pathspec '<path>' did not match any file(s) known to git — which reads like a missing file rather than a stage that never ran. After clearing a block, re-issue the stages one at a time and confirm with git diff --cached --name-only before committing. The SAME pathspec error has a second cause: the path is UNTRACKED. A bare git commit in a shared tree is refused outright (❌ BARE COMMIT REFUSED — it would commit whatever is staged … name the paths you changed), so every commit carries an explicit path list — and a NEW path cannot appear in that list until it is staged: git add <new path> first, then commit naming the full list. Name the files INDIVIDUALLY rather than passing a directory: a directory pathspec sweeps in whatever else is staged, which is exactly what the bare-commit gate exists to prevent. An empty git diff --cached --name-only right after a refused commit means the index is clean — re-stage rather than re-diagnosing, since a peer session sharing the tree can reset it too. A SEMICOLON (or |, &&, or newline) IN THE COMMIT MESSAGE makes a correctly-scoped commit read as BARE, and the refusal then looks like a staging problem. The gate judges the raw command TEXT and splits it on ;, |, ||, && and newlines BEFORE looking for the -- <paths> separator, so a message containing any of those cuts the command at the punctuation and the scan of the tail segment — the one carrying -- path — never runs the pathspec match (measured 2026-10-23: git commit -m '…parity can regress same-day; fleet-update.sh lives at ops/scripts' -- <path> was refused twice, identically, while the same command with a + instead of the ; committed on the first try). Removing the punctuation from the message is the fix; do NOT re-stage or re-diagnose the index, and do not reach for -o/--only — the message is what is wrong. A MULTI-LINE -m BODY is the same trap, and --only is the correct escape there — a newline-bearing body (normal for a subject+body message) splits the command text the same way, so the scoped form git commit -m '<subject>\n\n<body>' -- <paths> is refused as BARE even though the pathspec is right. git commit --only -m … -- <paths> forces git to build the temporary index the guard's "partial" verdict requires, so it passes without mutating the message; then verify git log -1 --format=%s shows the intended subject. Prefer -F <message-file> for any body you control, but when a multi-line -m is the shape, --only is the structural fix, not a bypass. git --git-dir=.git commit … -- <paths> is the verified working shape for a multi-line body on this host. When even a correctly-separated git commit -m '<subject>\n\n<body>' -- <paths> is refused as BARE (the newline in the body splits the command text into a no-paths tail), prefix --git-dir=.git: it makes the scope guard resolve the temp index as "partial" and passes, with the pathspec on the same segment. Confirmed 2026-11-10; the plain -m-with-paths form was refused twice before --git-dir=.git produced the commit. Verify subject with git log -1 --format=%s. Prefer -F <message-file> whenever you control the file, but --git-dir=.git + pathspec is the reliable fallback when a multi-line body is already composed. A pathspec built from git diff --cached --name-only --no-renames COLLAPSES renames and silently drops the sibling content edits. The --no-renames list shows a rename as one added path, so git commit -F <msg> -- $(…) lands the rename ('1 file changed') and leaves the edited content files UNSTAGED — measured twice in one session. After ANY commit that used a generated pathspec, git status --short must be EMPTY; when edits remain, commit them with explicit paths (same message file) rather than re-running the generator.

Verification

  • Blocked push: confirm the working tree is clear of foreign changes, then git push origin main succeeds unchanged.
  • PII-blocked write: retry with prose references (no scheme) — the write lands.

04 同仓库更多 Skills