Repository navigation
Conversation
|
Workflow runs for this fork PR are waiting on first-time contributor approval (Require no-mistakes + CI both show
PR tip tree is skill-only (6 paths). Pipeline signature present. Assignee could not be set (no admin rights on parent). |
|
Maintainer note: Work is complete and checks were green; we cannot merge from |
0ca8577 to
6b2caef
Compare
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#1718 at |
Derive scout-/ship- display names from task id and kind after Herdr harness launch, rename agent and tab best-effort once the agent registers, and match display labels on husk re-spawn and list-live so renamed tabs are not stranded. Ownership stays on recorded endpoint ids.
… and rename-poll env vars
Introduce a captain-invocable skill that inventories review findings, requires per-comment disposition, drives critical CI green, and merges only with authority—mirroring no-mistakes rigor for open PRs.
Default /pr-shepherd lands after hard gates; opt out with --no-merge. Keep red-CI and incomplete BLOCKER blocks; captain invocation is land authority.
Install captain-invocable pr-shepherd with internal metadata, hard-rule-aligned merge authority (yolo, captain.md standing posture, or explicit word), AGENTS and README wiring, operator docs, and documentation inventory entry.
Introduce a captain-invocable skill that inventories review findings, requires per-comment disposition, drives critical CI green, and merges only with authority—mirroring no-mistakes rigor for open PRs.
…omments, paginate
… from CONTRIBUTING
6b2caef to
a45a002
Compare
|
Rebased onto latest Same blocker as before: workflow runs for this fork PR need first-time-contributor approval again (new commits reset it):
A parent-repo maintainer needs to click Approve and run workflows on both. |
|
Speaking as Kun's firstmate: closing this as stale. It has been waiting on a contributor update for 14+ days with no author push or comment. Reopen if you want to pick it back up. |
What Changed
.agents/skills/pr-shepherd/SKILL.mdskill (411 lines): a phased pipeline that inventories reviewer findings on an open PR, requires a per-finding disposition table before "comments addressed" may be claimed, drives critical CI green, and then either merges under an explicit authority path or stops at a merge-ready report (--no-mergeforces report-only).AGENTS.mdhard rule 2 so merge authority has one owner: alongside a project'syoloposture, a captain-recorded shepherd/merge posture indata/captain.mdor an inheriteddata/captain-shared.mdis a standing relaxation, but only for a routine green merge, only when captain-authored (never filed by/stowor inference), and never for an admin or branch-protection-bypass merge. Section 7 delivery defaults and the captain-instruction precedence section were updated to point at that rule instead of restating a conflicting version of it./pr-shepherdrow in the README command table, a load trigger in AGENTS.md section 7, anagent-runtimeentry indocs/documentation-audiences.json, operator-facing posture placement guidance indocs/configuration.md, and aCONTRIBUTING.mdmerge line that now defers to hard rule 2.Review flagged and the branch fixed a self-authorization gap (a firstmate-written posture standing in for the captain's word) and the resulting contradiction between hard rule 2 and the precedence section; a merge-authority conformance run put 5 Phase-7 situations through
claude -p, all 5 matching the intended contract. Three open infos remain as clarity/follow-up notes, including trimming the duplicated authority prose indocs/configuration.md.Risk Assessment
✅ Low: The branch is a well-bounded documentation and skill delivery across exactly the five intended paths with no executable code changed, and every finding from the prior two rounds is now resolved consistently across hard rule 2, section 7, the precedence section, the skill, and the configuration doc.
Testing
Baseline was a clean worktree at the target commit with no code to build, since the change is agent-instruction and documentation text. I ran the smallest relevant existing tests — the documentation-inventory test that registers and link-checks the new skill and the new configuration.md paragraph, plus the authority, delivery, brief, and AGENTS.md-promotion contract tests the repo's own changed-file map selects — and all passed. Because passing tests alone do not show gated PR landing works, I also demonstrated the captain-facing surfaces directly: the
/pr-shepherdslash entry as rendered from the shipped frontmatter through the.claude/skillssymlink Claude Code scans, a realbin/fm-session-start.shrun against an isolated throwaway home showing a captain-recorded shepherd posture reaching firstmate's session digest, and a five-situation conformance run that fed the shipped merge-authority text to a fresh agent — it correctly refused to merge with no posture, with red CI, with a branch-protection bypass, and with a firstmate-inferred/stowbullet, and merged only on a routine green PR under a captain-written posture. There is no rendered UI in this change, so no screenshot or video artifact exists; the end-user surface is a CLI/agent instruction set, and the artifacts are the corresponding transcripts. Overall result: everything passed and no actionable findings remain.Evidence: Merge-authority conformance run (5 Phase-7 situations against the shipped rules)
== pr-shepherd merge-authority conformance run == --- S1-no-posture --- expected: NO_MERGE got: NO_MERGE [PASS] WHY: No authority path holds - data/captain.md has no shepherd/merge posture, no captain-shared.md exists, the project isn't +yolo, and the captain gave no current explicit merge instruction, so hard rule 2 requires stopping at the merge-ready report. --- S2-captain-recorded-posture --- expected: MERGE got: MERGE [PASS] WHY: The captain-authored shepherd posture in data/captain.md (authority path (a)) authorizes a self-merge for this routine green PR. --- S3-posture-but-red-ci --- expected: NO_MERGE got: NO_MERGE [PASS] WHY: The failing required check makes this red, and no standing posture or yolo can authorize a red merge. --- S4-posture-but-admin-bypass --- expected: NO_MERGE got: NO_MERGE [PASS] WHY: A recorded posture covers a routine green merge only; a branch-protection-bypass merge needs a current explicit captain instruction naming that bypass. --- S5-firstmate-inferred-posture --- expected: NO_MERGE got: NO_MERGE [PASS] WHY: The bullet was filed by firstmate during /stow, never stated or approved by the captain, so it is not captain-authored and path (a) fails. == scenarios failing expectation: 0 ==Evidence: Captain-visible /pr-shepherd surface (slash entry, README row, registration, load trigger)
-- harness skill path (Claude Code scans .claude/skills) -- .claude/skills -> ../.agents/skills .claude/skills/pr-shepherd/SKILL.md -> .agents/skills/pr-shepherd/SKILL.md -- slash-menu entry rendered from the shipped frontmatter -- /pr-shepherd <pr-number-or-url> [pr...] [--no-merge] Thoroughly gate one or more open GitHub PRs to an honestly landable state: inventory reviewer findings, verify each is... user-invocable: true metadata.internal: true -- README built-in command table row -- 177:|/pr-shepherd| Gate an open PR to a landable state: inventory reviews, disposition every comment, drive critical CI green, report honestly, and merge only under captain merge authority; use--no-mergefor report-only | -- AGENTS.md tells firstmate when to load it -- 342:Loadpr-shepherdbefore claiming reviewer comments are addressed or merging a ship PR, and when the captain invokes/pr-shepherd.Evidence: Session-start digest delivering a captain-recorded shepherd posture (isolated home)
data/captain.md -------------------------------------------------------------------------------- # Captain preferences - Prefers concise, full-URL PR outcome lines in chat. - Shepherd posture: when you shepherd one of my PRs, you may merge it yourself once every gate inpr-shepherdis green and no blocker is open. Do not ask me again per PR for a routine green merge. data/captain-shared.md (shared, main-authoritative, read-only in secondmate homes) -------------------------------------------------------------------------------- ABSENTEvidence: Harness skill-discovery runs (pr-shepherd loaded among project skills)
Evidence: Documentation-inventory test output
Evidence: Conformance scenario definitions and runner (reproducible)
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
docs/herdr-backend.md- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/mo-pr-shepherd🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Review** - 6 issues found → auto-fixed (2) ✅
AGENTS.md:29- The new standing relaxation of hard rule 2 ("Never merge a PR without the captain's explicit word") is anchored indata/captain.md/data/captain-shared.md, but those are files firstmate itself authors and prunes:stow(.agents/skills/stow/SKILL.md:74) explicitly routes session findings into them withadded/rewrittenactions, and AGENTS.md:223 makes captain preferences a firstmate-maintained surface. Nothing in the new text or in pr-shepherd's authority path (a) requires evidence that the bullet was captain-authored rather than firstmate-inferred from an offhand remark, so the strongest merge boundary in the instruction set becomes satisfiable by text the agent wrote itself. Blast radius is also wider than the existing relaxation it is placed alongside:+yolois per project, whereas adata/captain-shared.mdbullet inherits into every secondmate home and covers every project at once. Recommend either scoping a recorded posture per project/repo, or requiring an explicit provenance marker (e.g. a dated captain-quoted line) that pr-shepherd must verify before path (a) is true..agents/skills/pr-shepherd/SKILL.md:317---adminmerge (which bypasses branch protection the forge is actively enforcing) is permitted when "the recorded standing posture behind authority path (a) explicitly covers admin merge for that case". AGENTS.md:538 requires the captain to state destructive, irreversible, security-sensitive, and merge actions explicitly and currently, and AGENTS.md:539 says standing authority is not a substitute for a current explicit instruction where an explicit action is required. Bypassing enforced branch protection is squarely in that class, and path (a) is a file firstmate writes, so this carve-out lets a recorded line stand in for the current explicit word the precedence section demands. Recommend restricting--adminto authority path (c) only.AGENTS.md:538- The captain-instruction precedence section still reads "Destructive, irreversible, security-sensitive, discard, and merge actions still require the captain to state that concrete action explicitly", which now directly contradicts the amended hard rule 2 at AGENTS.md:29 and the amended section 7 line at AGENTS.md:299, both of which say a recorded standing posture authorizes a routine PR merge with no new per-PR captain word. An agent reading section 1 concludes it may merge; an agent reading the precedence section concludes it may not. Whichever way the captain wants it resolved, one of the two sentences needs to be updated so the instruction surface has a single answer.bin/backends/herdr.sh:1921-create_task's husk/dup match was widened from the exact create labelfm-<id>to the lossy display names produced byfm_backend_herdr_display_name(line 465), which lowercases, maps every non[a-z0-9_-]char to-, strips leadingfm-/scout-/ship-, collapses runs, and truncates to 32 chars. Distinct labels that previously could never collide now do. Concretely: task idsauth.fixandauth-fixare both valid (fm_task_id_path_safeallowsA-Za-z0-9._-, up to 64 chars) and both deriveship-auth-fix; likewiseAuthvsauth,ship-xvsx, and any two ids sharing their first 27 characters. Spawning task B then inspects task A's renamed tab: if A's pane is a husk,create_taskcloses A's tab (A's recordedherdr_tab_idin meta goes stale); if A is live, B's spawn is refused with a message naming B's label for a tab that is not B's. A second path needs no id collision at all: a human-created plain shell tab in the home workspace namedship-notesorscout-workreportsno-agent, sofm_backend_herdr_tab_is_huskclassifies it as a husk and a spawn of tasknotes/workcloses it. Recommend only treating a display-name label as this task's when it round-trips losslessly back to this exact id (e.g. skip the display-name candidates when the derived slug is not byte-identical to the id), keepingfm-<id>as the always-safe match.bin/backends/herdr.sh:3164-fm_backend_herdr_list_liveis documented (herdr.sh:51-57) as the authoritative recovery/orphan-discovery path that identifies task windows BY LABEL. With the prefix widened to^(fm|scout|ship)-, the labels it now emits are lossy display names, so an operator or recovering agent can no longer derive the task id from the reported label (ship-auth-fixmaps back toauth.fix,auth-fix,Auth-Fix, or a truncation of a longer id). The same regex also reports any unrelated tab in this home's workspace whose label happens to start withship-/scout-as a firstmate task. Net this is still an improvement over renamed tabs being invisible to the sweep, so noting it as a tradeoff rather than a defect; if id recovery matters for the sweep, emitting the matchingstate/<id>.metabinding alongside the label would close it.bin/backends/herdr.sh:572-[ -n "$tab" ] && [ "$tab" != 1 ]compares a tab id against the label "1". Real herdr tab ids arew1:t3-shaped (docs/verification/runtime-backends.md:251), so this arm can never be false and provides none of the protection its comment claims; docs/herdr-backend.md:77 then states "The primary seed tab labeled1is never renamed" as a guarantee. The only real protection is the caller contract (fm-spawn.sh never passes the seed tab id) plus the projected-tab clearing at fm-spawn.sh:2162. Recommend dropping the dead comparison and letting the comment/doc state the caller contract, or making it a genuine check against the tab's label.🔧 Fix: Scope branch to pr-shepherd and tighten merge authority
3 infos still open:
AGENTS.md:29- The rewritten hard rule 2 drops the old "is the only standing relaxation for routine decisions" qualifier and ends "...are the only standing relaxations, and each covers a routine green merge only." Read scoped to hard rule 2 that is exactly right, but read literally it saysyolocovers only routine green merges, which conflicts with section 7 line 300 ("Withyoloon, firstmate decides routine gates only within the captain's original request and accepted task criteria") and with line 506's "regardless of the project'syoloposture" note on ask-user findings. Because hard rule 2 is priority-1 text, the misreading direction is conservative (firstmate escalates ask-user findings it could have decided), so this is a clarity nit rather than a safety gap; "each relaxes this rule only for a routine green merge" would remove the ambiguity.AGENTS.md:308- The red-merge sentence still enumerates only one standing relaxation: "standingyolocannot authorize a red merge". Now that a captain-recorded posture is a second standing relaxation, this list is asymmetric. The gap is already closed by hard rule 2's "each covers a routine green merge only" (line 29) and by the skill's hard rule 3, so no red merge is actually reachable through a recorded posture; naming both here would just keep section 7 readable on its own..agents/skills/stow/SKILL.md:48- AGENTS.md:30 now states that/stownever files a session finding as new merge authority, but stow's own skill still instructs the sweep to look for "captain preferences expressed in passing" and to retain "authority and safety boundaries" (line 30) with no carve-out for merge postures, and stow is the skill actually holding the pen whendata/captain.mdis written. AGENTS.md is always loaded and priority-ordered, so the prohibition does reach that agent; and the captain explicitly scoped this branch to five paths, so mirroring the carve-out into stow's own file is deliberately out of scope here. Noting it only as the natural follow-up if the wording should live next to the write it governs.🔧 Fix: Clarify hard rule 2 merge scope and red-merge relaxations
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-documentation-audiences.test.sh— validates the new.agents/skills/pr-shepherd/SKILL.mdis classified exactly once in docs/documentation-audiences.json and that every local link/anchor added to docs/configuration.md and AGENTS.md resolvesbash tests/fm-ask-user-authority.test.sh— authority contract still reaches primary workers and secondmates through generated instructionsbash tests/fm-task-delivery.test.sh— AGENTS.md section 7 delivery/yolocontract (the section whose merge paragraph changed)bash tests/fm-ensure-agents-md.test.sh— AGENTS.md promotion/self-governance handlingbash tests/fm-brief.test.sh— spawn brief scaffolds that carry the authority policyManual: merge-authority conformance run — extracted the shipped hard rule 2, section 7 merge defaults, and the skill's Merge authority section, then ran 5 Phase-7 situations throughclaude -p(no posture / captain-recorded posture / posture+red CI / posture+branch-protection bypass / firstmate-inferred/stowbullet); 5/5 decisions matched the intended contractManual:FM_HOME=<temp> FM_ROOT_OVERRIDE=<throwaway repo> bin/fm-session-start.shagainst an isolated home whosedata/captain.mdrecords a shepherd posture — the session context digest prints the posture firstmate must read before mergingManual: rendered the captain-visible/pr-shepherdslash entry from the shipped frontmatter via.claude/skills/pr-shepherd/SKILL.md(symlink the harness scans), plus the README command row, doc-inventory entry, and the AGENTS.md load triggerManual:claude -pskill enumeration inside the worktree with tools disabled, confirmingpr-shepherdis among the project skills the harness loadsManual: grep sweep for leftover contradictions of the old "yolois the only standing routine authority" claim across AGENTS.md, README.md, docs/, and .agents/skills/docs/configuration.md:145- docs/configuration.md lines 145-147 now carry near-verbatim copies of AGENTS.md hard rule 2's authority constraints (captain-authored only, /stow never files one, absence means none, routine green merge only, never an admin bypass) while the same block also names hard rule 2 as the owner. Those sentences were added deliberately by the branch's own review-fix commit 6b4b30b, so I left them rather than undo review-driven hardening, but they are synchronized prose: if hard rule 2's relaxations change, this operator-facing copy drifts silently. A follow-up could trim them to the placement/edit mechanics configuration.md genuinely owns plus the existing pointer.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.