[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CE2AZC8SR86K5574A6W8P":3,"skill-same:01M78CE2AZC8SR86K5574A6W8P":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M78CE2AZC8SR86K5574A6W8P","swarm-pr-feedback",null,"Ingest and resolve known pull request feedback with skeptical source verification. Use when addressing pasted PR feedback, GitHub review comments or threads, requested changes, CI\u002Fcheck failures, merge conflicts, stale PR branches, or PR follow-up work that must close all known issues without dropping findings. Supports multi-round bot reviews when the repo uses an auto-review bot that posts a new review after every push, via the iterative pattern documented in the body. Stage A (structural pre-checks) and Stage B (reviewer + test_engineer) gates and the reviewer + critic closeout gate are MANDATORY for any change made as part of this process.","zaxbysauce\u002Fzmem","zaxbysauce","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10211642?v=4","01M78CD0J751DPXGF3YVNH6VCH","01M78CD0JZPBW7BJHV1MST3CTZ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-pr-feedback\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: swarm-pr-feedback\naudience: swarm-plugin\ndescription: >\n  Ingest and resolve known pull request feedback with skeptical source verification.\n  Use when addressing pasted PR feedback, GitHub review comments or threads,\n  requested changes, CI\u002Fcheck failures, merge conflicts, stale PR branches, or\n  PR follow-up work that must close all known issues without dropping findings.\n  Supports multi-round bot reviews when the repo uses an auto-review bot that\n  posts a new review after every push, via the iterative pattern documented in\n  the body. Stage A\n  (structural pre-checks) and Stage B (reviewer + test_engineer) gates and the\n  reviewer + critic closeout gate are MANDATORY for any change made as part of\n  this process.\nswarm-contract-digest: 143d9443a82d\n---\n\n# Swarm PR Feedback\n\nUse this skill to close known PR feedback. This is not a fresh broad PR review.\nRepository-specific bot names and examples below are illustrative; substitute the repo's actual bot and branch-state surfaces when they differ.\n`swarm-pr-review` discovers new findings; `swarm-pr-feedback` ingests existing\nfeedback surfaces, verifies each claim, clusters related problems, fixes confirmed\nissues, validates the branch, and reports closure status for every item.\n\n**Mandatory gate contract.** Stage A (structural pre-checks) and Stage B\n(reviewer + test_engineer) gates and the reviewer + critic closeout gate are\nMANDATORY for any change made as part of this process. No fix lands, no closure\nledger row is marked FIXED, and no PR is published until all three gates pass on\nthe current diff. There is no speed, efficiency, or time exception. See\n\"Mandatory Gates\" below for the full protocol.\n\nWhen the work starts from a prior Profile-A `swarm-pr-review` run, use the exact\nuser command `\u002Fswarm pr-feedback \u003CPR_URL> continue from\n.swarm\u002Fpr-review\u002F\u003Crun_id>\u002Ffeedback-handoff.json`. The controller validates the\nterminal review and artifact before atomically creating an unbound feedback\ngate; the artifact alone is not write authorization. Profiles B\u002FC ingest their\ntask-workspace handoff directly before triage.\nCarry forward the original review finding IDs, classifications, reviewer\u002Fcritic\nprovenance, and any operational blockers instead of renumbering them as new\ndiscoveries.\n\nFeedback closure is not the end of the PR lifecycle: when PR monitoring is\nenabled (`pr_monitor.enabled`), the PR remains subscribed and monitored under\n`..\u002Fswarm-pr-subscribe\u002FSKILL.md` until it is merged or closed. Events that\narrive after closure (a new bot round, a CI change, fresh review activity) are\ntriaged through that skill and route back into this discipline when they need\nfixes.\n\n## Multi-Round Bot Reviews (Iterative Pattern)\n\nWhen the repo uses an auto-review bot that posts a new review comment after\n**every push** to the PR branch, identify that bot from the repository contract\nand apply this pattern (for example `hermes-pr-review` in this repo). Expect N\nrounds of review for N pushes, and budget for it.\n\n**Round N+1 deltas vs Round N:**\n- Fresh `FB-###` ledger IDs for new findings (do not reuse IDs from earlier rounds)\n- Findings from prior rounds that remain unfixed will reappear with the same evidence\n- Findings you marked DISPROVED with new evidence may reappear if the bot disagrees\n- New findings may be introduced that the prior round did not see (the bot's read scope\n  is the new commit, not the full diff history)\n\n**Operating principles for multi-round triage:**\n\n1. **Continue the ledger, do not start over.** Append to the same `FB-###` counter\n   across rounds. Track each finding's state per round (open, fixed, disproved,\n   awaiting-decision, repeated).\n2. **Carry forward unresolved items.** Findings you marked `PARTIAL` or `NEEDS_USER_DECISION`\n   in round N will still be open in round N+1. The closure ledger should show their\n   evolution (e.g., \"PARTIAL round 1 → CONFIRMED round 2 after evidence collected\").\n3. **Apply the 3-strikes evidence-escalation rule.** When the same finding is\n   raised 3+ times across rounds, re-run source verification with a fresh\n   reviewer context and surface the disagreement explicitly. Add a\n   defense-in-depth change only when that fresh verification proves the change\n   is correct, preserves the real invariant, and adds meaningful protection.\n   Repetition, time, token cost, and reviewer persistence are never substitutes\n   for evidence. Document any parent-vs-inner relationship inline so future\n   readers see the rationale.\n   **Do not add the repeated suggestion:** If it would add incorrect or\n   misleading code about existing guards — e.g., an outer guard that already exists at an\n   inner scope and whose addition would imply the inner guard is absent, a type\n   narrowing that masks a real error class, or a check whose presence asserts a\n   false invariant — do not add the change. A wrong fix embedded in the code is\n   harder to remove than a repeated rebuttal in a comment thread. When the\n   repeated finding is misleading about existing guards, apply item 6's\n   \"surface to user\" path instead of 3-strikes; otherwise the 3-strikes rule\n   applies.\n4. **Verify bot fix-direction suggestions against actual file structure.** Bots\n   read files linearly and can miss parent-block guards. For any \"add an X check\"\n   suggestion, read the surrounding function\u002Fblock to confirm the check is genuinely\n   missing or already exists at a higher scope.\n5. **Each round produces its own closure ledger as a PR comment.** Prefix with\n   \"Round N\" so the bot and reviewers can see progression. Maintain a running\n   summary table at the end of each comment showing totals across rounds\n   (confirmed+fixed \u002F disproved \u002F partial \u002F awaiting-decision).\n6. **Stop the cycle deliberately.** If a finding is disproved with code evidence 3+\n   times and the bot keeps re-raising it, leave the comment, post the closure\n   ledger with the cumulative evidence, and surface the disagreement to the user\n   rather than continuing to push fixes. The user can resolve persistent\n   reviewer-AI disagreement.\n\n**Why this matters:** Without the multi-round pattern, each round looks like\n\"start over, re-triage everything.\" With it, the rounds become incremental:\neach round's work is bounded by new findings + carried-forward items only.\nThis matches how the bot actually behaves and avoids wasted cycles.\n\n### Bot and Security Claim Verification\n\nBefore trusting automated review findings (SAST bots, security scanners, AI reviewers), apply the verification protocol in `references\u002Fbot-claim-verification.md`. Key principle: every bot claim is unverified until you reproduce the exact finding against the current HEAD with the exact tool and rule it names.\n\n## Operating Stance\n\nTreat every review comment, CI failure, bot summary, PR body claim, and pasted note\nas a claim until source evidence proves it. Do not silently drop, defer, or mark\nitems out of scope. Ask the user only for product or scope decisions that cannot\nbe proven from the PR, repo, or explicit instructions.\n\nDo not run a fresh broad PR review while addressing existing feedback. Inspect\nadjacent code only as needed to verify reachability, dependencies, shared root\ncauses, regression risk, or sibling changes required by a confirmed item.\n\nGitHub review-thread resolution is user-controlled. Do not resolve or mark review\nthreads resolved unless the user explicitly instructs you to do so.\n\nDo not act on review-discovered findings from a prior `swarm-pr-review` run\nunless the user has explicitly approved the transition into `swarm-pr-feedback`.\nThe handoff artifact is triage input, not standing authorization to change code.\n\n## Runtime Capability Profiles\n\nThis skill runs on any agent harness. Detect the active profile from the\nactual tool list before triage — the same three profiles defined in\n`..\u002Fswarm-pr-review\u002FSKILL.md` (Runtime Capability Profiles):\n\n- **Profile A — mechanical PR-feedback controller.** The plugin's tools are\n  present in this session: `dispatch_lanes_async`, `collect_lane_results`,\n  `retrieve_lane_output`, `prepare_pr_feedback_scope`,\n  `run_pr_feedback_stage_a`, `complete_pr_workflow`. The controller's\n  fail-closed accounting (immutable inventory, ordered gate lanes, content\n  digests, arming, bound push) is authoritative; bypassing it — direct\n  subagent calls, blocking dispatch, prose verdicts — is BLOCKED while it is\n  active.\n- **Profile B — native parallel subagents, no controller.** Run the same\n  intake → verify → fix → gate → publish discipline using your harness's\n  subagent tool for verification lanes and gate roles; you maintain the\n  ledger, the ownership partition, and the digest accounting yourself in\n  session\u002Ftask workspace files (never under `.swarm\u002F`, which belongs to the\n  plugin runtime).\n- **Profile C — single context, no subagents.** Same discipline as strictly\n  separated sequential passes that re-derive rather than restate earlier\n  reasoning, plus explicit disclosure in the closure ledger that gate\n  independence was procedural.\n\nController-tool absence is NOT a blocker; Profiles B and C are first-class\nexecution paths. BLOCKED is reserved for bypassing an active controller and\nfor verification or coverage gaps that stay unclosable after bounded retries.\n\n## Pre-flight: Check Out the PR Branch Locally\n\nBefore verifying any claim or making any fix, ensure the PR branch is the working\ntree:\n\n- If `head_ref` is a remote branch that is not checked out locally, fetch it\n  (`git fetch origin \u003Chead_ref>`).\n- **Check for parallel work first.** Before checkout, use the repository or\n  runtime's parallel-work check. When the bundled\n  `parallel-work-check` skill exists, it is one conditional implementation to\n  detect concurrent pushes from other agents (for example the repo's\n  auto-review bot following up, a maintainer pushing fixes, or parallel swarm\n  work). If remote has new commits: read `git log local..remote`, evaluate whether the parallel work\n  supersedes your planned fixes, and prefer the parallel work if it's more\n  comprehensive (more tests, better edge coverage, clearer error handling).\n  Abort your rebase, take the remote state, then add minor improvements on top.\n- Verify the working tree is clean first (`git status --porcelain`). If any\n  tracked or untracked changes exist, call `prepare_pr_workflow_checkout`\n  before binding (Profile A). Omit `paths` to auto-discover and atomically\n  preserve every dirty path, including untracked files; pass explicit `paths`\n  only for an exact bounded tracked-file set. It creates an auditable stash\n  receipt containing the original branch\u002FHEAD and a structured\n  `operation: \"restore\"` recovery instruction. Do not issue `git stash`\n  through shell.\n  Without the controller, surface dirty state to the user or abort the checkout\n  — do not blind-stash.\n- Treat `recovery-required` and `indeterminate` controller results as terminal\n  for the current attempt: report the typed `required_action`, abort\u002Fclear any\n  already-active gate, and stop. Only `stashable` permits one preparation call;\n  retry only when the controller explicitly returns `retryable: true`.\n- **Check out the head branch locally before dispatching feedback lanes.** Feedback verification reads the working-tree\n  filesystem (`Read`\u002F`Glob`\u002F`Grep`), and fixes must land on the PR branch — without a\n  checkout you would verify and patch the base branch's code instead. Record the\n  exact `merge_base...head_ref` range for diff-scoped inspection.\n - Pass the exact `merge_base...head_ref` commit range in every read-only verification or\n   explorer\u002Fadvisory-lane delegation so lane agents can inspect specific revisions\n   with `git show` when needed.\n- If no PR reference was provided (a pasted-feedback session on the current branch),\n   confirm the current branch is the intended PR branch before editing.\n- A detached checkout at the authoritative full PR head is a valid pre-bind\n  intake state. On the first Profile-A bind, the controller attaches it only\n  when Git reports exactly one safe candidate: an existing local branch at\n  that SHA whose upstream is an exact remote ref at the same SHA, or one exact\n  remote-tracking ref. It never guesses a remote\u002Fname boundary. Zero\n  candidates, multiple candidates, a linked-worktree-owned local branch, or an\n  existing mismatched upstream fails closed without publishing the bind. Retry\n  is idempotent if switching succeeded but state persistence failed.\n- The existing constrained tracked-branch and safe `gh pr checkout` pre-bind\n  forms remain supported on every profile after proving the exact SHA and a\n  unique intended remote ref. Never use force, submodule-recursive, or detached\n  `gh pr checkout` variants.\n- Immediately after the first bind and before feedback verification dispatch,\n  prove that `git rev-parse HEAD` equals the authoritative full `pr_head_sha`,\n  `git status --porcelain` is empty, and the current branch tracks the intended\n  PR head remote\u002Fbranch. A detached exact-head checkout is intake-only; the\n  bind must attach it before feedback dispatch or publication.\n\nWhen a verification lane result includes `output_ref`, treat `output` as a\npreview and call `retrieve_lane_output` before using it to classify, resolve,\ndisprove, or group feedback items. If the result is `output_degraded`,\n`transcript_incomplete`, or truncated without a usable ref, keep the affected\nledger items as `NEEDS_MORE_EVIDENCE` or re-dispatch a narrower read-only lane.\n(Profile A. On Profiles B\u002FC, read each verification subagent's or pass's full\nreport directly — a truncated or summary-only report is a preview, not\nverification evidence, and keeps its items open the same way.)\n\n## Pre-flight: Dirty Worktree Handling\n\nBefore staging any files for the PR commit, check the working tree state:\n\n**The problem:** `git add -A` stages every uncommitted change in the working tree,\nincluding pre-existing changes from other branches or prior work.\n\n**The check:** Run `git status --porcelain` first. If output is non-empty, identify\nwhich files are PR-related vs pre-existing uncommitted changes.\n\n**The rule:** Stage files explicitly by path when the working tree contains files\nunrelated to the PR. For example:\n\n```bash\ngit add src\u002Ffoo.ts tests\u002Ffoo.test.ts\n```\n\nNever use `git add -A` when the working tree has pre-existing changes from other\nbranches or prior work sessions.\n\n## Batch Collection (mandatory before any fix)\n\nWhen the runtime provides a CI-failure-batching workflow, load it before\nproceeding. The bundled `ci-failure-batching` skill is one conditional\nimplementation; otherwise apply the host-neutral complete-ledger protocol\nbelow.\n\nFor the detailed 6-step batch collection protocol, read `file:.swarm\u002Fbundled-skills\u002Fci-failure-batching\u002FSKILL.md`. The steps below are a summary:\n\n1. `gh pr checks \u003Cnumber> --json name,bucket,state,link` to collect all check results\n2. Filter to `bucket == \"fail\"` or `bucket == \"cancel\"`\n3. `gh run view \u003Cid> --log-failed` for each failing run\n4. Group failures by root cause before fixing\n\n**Rule:** The complete failure ledger must be collected before any\nmodification is proposed. Verifying the ledger is complete is a prerequisite\nfor the Fix Planning step.\n\n## Pre-flight: Scope Discipline\n\nWhen the plugin's mechanical controller is available, every coder Task must be\npreceded by `prepare_pr_feedback_scope({ task_id, files })`. The controller is\navailable only after the immutable feedback-verification lanes have settled and\nbinds the exact file set to the current feedback revision, parent session, and\nnext matching Task call. The coder prompt must use the same numeric `task_id`,\ncontain matching `FILE:` directives, and include a literal `ACCEPTANCE:` line.\nOnce a Task consumes that scope, its `task_id` is immutable for the current\nfeedback revision. Any retry must prepare and dispatch a fresh nested numeric\ntask identity (for example `1.1.1`), never re-declare the consumed ID.\n\nDo not create a synthetic `save_plan` merely to authorize feedback work, and do\nnot use `declare_scope`; those tools belong to the normal implementation-plan\nlifecycle. There is no one-file or single-function carve-out from the dedicated\nPR-feedback scope controller.\n\nIn runtimes without this controller, use the native scope mechanism. If none\nexists, put exact allowed files and non-goals in the delegation and verify the\nresulting diff mechanically. Never bypass an available scope controller merely\nto reduce ceremony.\n\n## Intake Surfaces\n\nBuild a complete feedback ledger before editing. Include every available source:\n\n- validated findings and operational blockers handed off from `swarm-pr-review`,\n- pasted user or reviewer feedback,\n- GitHub review threads, inline review comments, and review summaries,\n- PR issue comments and requested-changes reviews,\n- CI\u002Fcheck failures, check annotations, and relevant logs,\n- mergeability, conflicts, base drift, and stale PR branch state,\n- local validation failures,\n- PR body checkboxes, test-plan claims, linked issues, and acceptance criteria,\n- commit history and bot\u002Fapp commits on the PR branch.\n\nIf a source is unavailable, retry with alternative access paths. If unavailable after retry, the source is a coverage gap that must be reported to the user — do not silently \"record that limitation\" and proceed as if the source doesn't matter.\n\n### Async advisory verification lanes\n\nAfter the complete feedback ledger exists and before editing, run independent\nread-only verification lanes. Under Profile A, use\n`dispatch_lanes_async` with `mode: \"swarm-pr-feedback:verification\"`, the\ncomplete immutable `feedback_inventory` ID list, the exact current\n`pr_head_sha`, and each lane's exact\n`feedback_item_ids` ownership list for independent read-only verification lanes:\ncomment classification, CI\u002Flog root-cause inspection, test impact mapping,\nrelease\u002Fdocs claim checks, and stale-branch\u002Fconflict analysis. Partition the\nledger so each `FB-###` item is owned by exactly one verification lane and the\nunion of lanes covers the entire ledger — no feedback item may be left\nunassigned to a lane; state each lane's owned IDs both structurally and in its\nprompt. The runtime rejects missing, duplicate, overlapping, or unknown item\nownership and blocks mutation until the verification batch settles. Scale\nthe lane count to the ledger size: a 1–3 item round may use a single combined\nlane, while a large multi-round intake may warrant one lane per category above.\nCap each `dispatch_lanes_async` batch at 8 lanes (`MAX_LANES`); if the ledger\nneeds more than 8 verification lanes, dispatch in sequential batches and settle\neach batch's COVERAGE GATE before the next — do not over-spawn lanes for a\ntrivial round. Record each returned `batch_id`, then continue only ledger-safe\narchitect work: normalize feedback IDs, gather deterministic PR metadata, prepare\nreproduction commands, and plan likely fix groups. Do not edit, close items, or\nmark feedback resolved from running lanes.\n\nEvery verification lane must end with one parseable row for each owned item:\n\n```text\n[FEEDBACK-VERIFIED] | FB-### | CONFIRMED\u002FPARTIAL\u002FDISPROVED\u002FPRE_EXISTING\u002FNEEDS_MORE_EVIDENCE\u002FNEEDS_USER_DECISION | evidence\n```\n\nNon-empty prose without this marker contract is not a settled verification\nartifact and cannot unlock mutation.\n\nBefore the Verification step can mark any item `CONFIRMED`, `PARTIAL`,\n`DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`,\nevery open verification batch must be fully settled. Poll with\n`collect_lane_results` (wait omitted or `false`) to process settled lanes\nincrementally — clustering confirmed items and pre-reading files for settled\nfindings while ledger-safe work remains — then issue a final\n`collect_lane_results` with `wait: true` per batch once independent work is\nexhausted, to confirm every lane is settled.\nMissing, stale, cancelled, or failed lanes are coverage gaps that must be closed\nbefore marking any item CONFIRMED\u002FPARTIAL\u002FDISPROVED\u002FPRE_EXISTING. Apply the\nCOVERAGE GATE:\nretry failed lanes (max 2) as another\n`swarm-pr-feedback:verification` async batch with the same immutable inventory,\nexact `pr_head_sha`, agent type, prompt, scope, and isolation, or stop and\nsurface the lane failure to the user as BLOCKED. Under Profile A, blocking and\ndirect-Task fallbacks are rejected because they cannot satisfy the durable\nownership and head-provenance gate.\nDo not proceed with \"blocking verification and record that async advisory lanes\nwere unavailable\" — record-and-continue is not coverage closure.\n\nUnder Profile B, partition the same immutable inventory across fresh read-only\nverification subagents — every `FB-###` item owned by exactly one lane and the\nunion of lanes covering the entire ledger — with each prompt stating its owned\nIDs and the exact `pr_head_sha`, and each lane returning one\n`[FEEDBACK-VERIFIED]` row per owned item. Under Profile C, verify the ledger\nin sequential category passes with the same one-row-per-item contract. On\nevery profile, no item may be classified until its verification lane or pass\nhas settled, and unclosable verification gaps are surfaced as BLOCKED.\n\n### CI matrix cascade check (do this before fixing)\n\nWhen the PR's `unit` job is a matrix across multiple OSes and downstream jobs\n(`integration`, `smoke`) have `needs: unit`, an OS leg failure blocks the\nentire pipeline. Before triaging, check:\n\n1. Are `integration` or `smoke` jobs in `skipped` or `cancelled` state rather\n   than `failed`? That signals a unit matrix cascade — the unit job failed\n   on one OS leg, blocking the downstream jobs from running on the current\n   HEAD.\n2. If a unit OS leg is the blocker, classify the failure:\n   - **Code issue** — the test itself fails. Reproduce locally; if the\n     test passes locally, the runner is the problem.\n   - **Runner performance** — the test step exceeds the configured timeout.\n     Run all files in the step locally with per-file timing; if cumulative\n     local runtime is \u003C10 min and the runner can't complete in 60+ min, the\n     issue is runner performance. Bump the CI timeout as a stopgap and file\n     a follow-up issue for parallelization. Do not loop bumping the timeout\n     past 90 min without filing the follow-up.\n3. Surface cascade failures to the user explicitly. The downstream jobs'\n   results don't exist; the code's coverage of the current HEAD cannot be\n   confirmed by CI alone.\n\n### PR body claim verification\n\nThe `.swarm\u002Fevidence\u002F` paths below apply only when the reviewed repository uses\nthis plugin's council evidence contract. For any other repository, locate the\nauthoritative CI attestation, code-host review record, or repository-declared\nevidence store; the universal rule is that an approval claim needs a real,\nretrievable provenance artifact.\n\nPR body text like \"PHASE 2 council APPROVED (5\u002F5, round 2)\" or \"Final council\nAPPROVED\" must be backed by an evidence file under `.swarm\u002Fevidence\u002F` — phase\ncouncils write `.swarm\u002Fevidence\u002F{phaseNumber}\u002Fphase-council.json`; the final\ncouncil writes the flat `.swarm\u002Fevidence\u002Ffinal-council.json`. Bot-generated PR\nbodies commonly auto-fill these claims without real review. Before accepting\nsuch a claim as part of triage:\n\n1. Check whether the corresponding evidence file exists with `verdict:APPROVED`.\n2. If the claim is unsupported, mark the closure ledger item as\n   `NEEDS_MORE_EVIDENCE` rather than `CONFIRMED`. Do not silently drop the\n   claim — it indicates the PR body was generated without a real review.\n\n## Feedback Ledger\n\nNormalize each item before triage:\n\n```text\nFB-001 | source | author\u002Ftool | status: UNTRIAGED | location | claim | raw link\u002Fquote | depends_on\n```\n\nRules:\n\n- Preserve prior `F-###`, `CI-###`, `CONFLICT-###`, `STALE-###`, and similar\n  IDs from a review handoff when they already exist. Only mint fresh `FB-###`\n  IDs for new feedback discovered after the handoff.\n- Preserve reviewer\u002Fcritic provenance from the handoff artifact so the closure\n  ledger can show which items were review-validated before fix work began.\n- Preserve exact reviewer wording or log summary when practical.\n- Split compound comments into separate ledger items only when they require\n  different evidence or fixes.\n- Keep duplicate symptoms linked to one root cause rather than deleting them.\n- Include conflicts, stale branch state, obsolete older-head CI,\n  generated-output (`dist\u002F`) drift, and other CI failures as first-class ledger\n  items.\n- Use explicit IDs for non-review feedback when useful, for example\n  `CONFLICT-001` for merge\u002Fbase drift and `CI-001` for check failures, so PR\n  bodies can show exactly how operational blockers were closed.\n\n### Mandatory: integrate all PR comments with feedback or findings before branch validation (Stage A)\n\n**Before branch validation (Stage A) can begin, every PR comment that contains feedback\nor findings MUST be integrated into the total feedback ledger as a\n`FB-###` item.** This is a hard requirement, not a best-effort step.\n\nWhat counts as \"feedback or findings\":\n- A reviewer request for a code change (\"please rename this\", \"add a test for\n  X\", \"this should call `_internals.foo`\")\n- A reviewer claim about correctness, security, or style (\"this is\n  incorrect\", \"X will leak\")\n- A bot reviewer's findings table entries\n- A CI failure with a specific file:line root cause\n- A reviewer question that implies a code change is needed (\"why is this\n  static?\")\n- PR review summaries or aggregate comments\n\nWhat does NOT count (and is therefore not required to be a ledger item):\n- Pure acknowledgements (\"LGTM\", \"looks good\")\n- PR-level metadata changes (title, label, milestone)\n- Force-push acknowledgements\n\nRules:\n- **No finding may be addressed outside the ledger.** If you fix something a\n  reviewer mentioned, the corresponding `FB-###` item MUST be in the ledger\n  before the fix. If you skip the fix, the `FB-###` item MUST be in the\n  ledger with a `DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or\n  `NEEDS_USER_DECISION` status before branch validation (Stage A) can begin.\n- **Status semantics for unaddressed items:**\n  - `CONFIRMED` and `PARTIAL` items must be addressed (fixed or\n    disproved) before branch validation (Stage A) can begin. A `CONFIRMED` item that is\n    left unaddressed is a regression against the review.\n  - `DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, and\n    `NEEDS_USER_DECISION` items may remain open at branch-validation (Stage A) time, but\n    each must be explicitly justified in the closure ledger.\n- **The closure ledger at the end of the run must account for every `FB-###`\n  item** with a final status (fixed \u002F disproved \u002F pre-existing \u002F needs user\n  decision \u002F needs more evidence).\n- **Comments from the latest bot round take precedence over earlier rounds**\n  for the same finding; the earlier-round `FB-###` item is updated with the\n  new evidence rather than a new item being created.\n- **Multi-round pattern continues to apply** (see \"Multi-Round Bot Reviews\"\n  section). A new bot round adds new `FB-###` items for findings that\n  weren't in the prior round; the prior round's items are carried forward\n  and updated with the new evidence.\n\nRationale: silently addressing a review comment without a corresponding\nledger item means the closure summary at the end of the run cannot\ndemonstrate that every review comment was considered. The closure summary\nis the only artifact the user\u002Fmaintainer reads to confirm the PR is ready\nto merge. Missing items in the ledger = missing items in the closure = a\nPR that ships with unreviewed feedback.\n\n## Verification\n\nClassify every ledger item before fixing:\n\n| Status | Meaning |\n|---|---|\n| `CONFIRMED` | The issue is real, reachable or structurally proven, and introduced or exposed by the PR. |\n| `PARTIAL` | The comment points at a real concern, but the framing, severity, or requested fix is incomplete. |\n| `DISPROVED` | Source, tests, or execution context prove the claim is false, unreachable, or already mitigated. |\n| `PRE_EXISTING` | The issue exists on the base branch and is not materially worsened by the PR. |\n| `NEEDS_MORE_EVIDENCE` | The claim (e.g., \"council APPROVED\") is unsupported by stored evidence (e.g., a missing or failed `.swarm\u002Fevidence\u002F` artifact); more information is required before triage. |\n| `NEEDS_USER_DECISION` | The item requires a product, UX, compatibility, or scope choice that cannot be inferred. |\n\nVerification checklist:\n\n- Read the referenced file and surrounding code.\n- Check caller context, reachability, feature flags, schema validation, guards,\n  state-machine rules, and permission boundaries.\n- Determine whether the issue is PR-introduced, pre-existing, or unresolved.\n- Check related tests and whether a failing\u002Fproposed test would prove the item.\n- Check whether multiple feedback items share one root cause.\n\n### DI seam migration validation\n\nWhen the repository uses `_internals` seam \u002F `mock.module()` patterns, apply the validation protocol in `references\u002Foperational-gotchas.md`.\n\n## Fix Planning\n\nCluster ledger items by root cause before coding. Fix in this order unless a user\ninstruction or dependency requires otherwise:\n\n1. Merge conflicts, stale branch state, and base drift.\n2. Deterministic CI, build, typecheck, formatting, and test failures.\n3. Confirmed correctness, security, data-loss, persistence, git\u002Fwrite-safety, and\n   permission issues.\n4. Test gaps needed to prove confirmed fixes.\n5. Docs, release notes, PR body, and migration guidance.\n6. Reviewer communication and closure summaries.\n\nFor each cluster, record:\n\n```text\nROOT-001 | ledger items: FB-001, FB-004 | files | fix approach | tests | docs | risk\n```\n\nDo not make scope decisions yourself. If the right fix depends on product intent\nor compatibility policy, mark the item `NEEDS_USER_DECISION` and ask.\n\n## Implementation Rules\n\n- Patch only confirmed or partial items, plus required tests\u002Fdocs.\n- Do not implement speculative cleanup while feedback remains unclosed.\n- Never ship unwired code. Any new command, tool, skill, config, docs surface, or\n  generated artifact must be fully registered and validated.\n- Never defer work or declare it out of scope without explicit user instruction.\n- Keep invalid or disproved findings in the closure ledger with the evidence.\n- For CI failures, verify the failing job belongs to the current PR head before\n  treating it as current evidence.\n- For generated output or dist failures, inspect the failing log before rebuilding\n  and commit regenerated files only when the PR touches the source surface.\n- When `main` has a merge queue enabled, do not rebase or force-push a PR only\n  because `main` advanced. Once required checks and review are green, queue the PR\n  and let the merge queue perform final current-base validation. Still resolve real\n   merge conflicts and SHA-dependent review threads before queuing.\n\n### Conditional runtime\u002Fhost gotchas\n\nFor portability gotchas (plan identity, stale gate evidence, PowerShell comment posting, same-file batching), read `references\u002Foperational-gotchas.md`.\n\n## Mandatory Gates\n\n**Stage A and Stage B gates and the reviewer + critic closeout gate are\nMANDATORY for any change made as part of the PR-feedback process.** No fix\nlands, no closure ledger row is marked FIXED, and no PR is published until all\nthree gates pass on the current diff. This section uses the repository's\nestablished Stage A\u002FB meaning: Stage A = `pre_check_batch`-equivalent structural\npre-checks; Stage B = `reviewer` + `test_engineer` per-task gates (consistent\nwith `execute`, `plan`, `specify`, `brainstorm`, `docs\u002Fswarm-briefing.md`, and\n`docs\u002Fcouncil\u002FREADME.md`).\n\n**Mechanical controller contract (Profile A).** Prose acknowledgements, direct `Task` calls,\nblocking dispatch, reused conversations, and free-form `APPROVE`\u002F`PASS` text do\nnot satisfy these gates while the controller is active. The durable controller requires this exact sequence on\none content digest:\n\nController authority follows the parent\u002Fchild session ancestry. Coder and\nnested child tool calls inherit the parent feedback gate; delegation never\ngrants early commit, push, remote-write, checkout, or protected-evidence\nauthority.\n\n1. `run_pr_feedback_stage_a` with array-form commands for every concrete\n   workspace\u002Fcategory\u002Fsource build, typecheck, and lint\u002Fformat obligation\n   mechanically discovered from the repository's manifests, configs, scripts,\n   or bounded `.pr-validation.json` contract, plus exact\n   `[\"git\", \"diff\", \"--check\"]`. A category with no repository-local signal is\n   not invented merely to reach a fixed command count.\n   Add one required proof command: use the exact failing CI\u002Ftest reproduction\n   when the immutable inventory includes a defect or CI\u002Ftest failure; otherwise\n   add a repo-appropriate targeted regression\u002Ftest command that exercises the\n   changed behavior. The tool executes the commands; naming a category without\n   executing it is not evidence. The controller binds that reproduction receipt\n   to the complete immutable feedback inventory, so no feedback item can reach\n   Stage B with an unrelated or unowned Stage A receipt.\n2. One `dispatch_lanes_async` lane with\n   `mode: \"swarm-pr-feedback:stage-b-reviewer\"`,\n   `workflow_lane: \"stage-b-reviewer\"`, every immutable\n   `feedback_item_ids`, and `max_concurrent: 1`.\n3. After that lane settles positively, one fresh `test_engineer` lane with\n   `mode: \"swarm-pr-feedback:stage-b-test\"`, matching `workflow_lane`, the\n   complete inventory, and `max_concurrent: 1`.\n4. After Stage B settles, one separate fresh reviewer lane with\n   `mode: \"swarm-pr-feedback:closeout-reviewer\"`, then one separate fresh\n   critic lane with `mode: \"swarm-pr-feedback:closeout-critic\"`. Each owns the\n   complete inventory and uses `max_concurrent: 1`.\n\nEvery gate lane emits exactly one fully populated row per feedback ID:\n\n```text\n[STAGE-B-REVIEW] | FB-001 | APPROVE|NEEDS_REVISION|BLOCKED | evidence\n[STAGE-B-TEST] | FB-001 | PASS|FAIL|BLOCKED | evidence\n[CLOSEOUT-REVIEW] | FB-001 | APPROVE|NEEDS_REVISION|BLOCKED | evidence\n[CLOSEOUT-CRITIC] | FB-001 | APPROVE|NEEDS_REVISION|BLOCKED | evidence\n```\n\nOnly exact positive verdict fields pass. A sentence containing “not APPROVE,” a\nheader without item rows, duplicate rows, missing IDs, degraded\u002Ftruncated\nartifacts, wrong roles, stale content digests, parallel or out-of-order phases,\nand reused pre-edit approvals all fail closed. Any content change after Stage A\ninvalidates Stage A and every later gate; restart at step 1. See\n\"Re-recording Stage A on an unchanged revision\" below for the one retention\nexception, which applies only when the revision digest itself did not change.\nPublication tools\nand `git commit`\u002F`git push` remain blocked until all four ordered lane phases\nsettle on the Stage-A digest. After they settle, only one standalone `git commit`\ncommand may create the reviewed commit; push and remote publication remain\nblocked until that exact commit is armed. The first completion requires a clean\nindex\u002Fworktree and a non-merge direct child commit whose sole parent is the\nimmutable intake head, so multiple commits, merge commits,\namend\u002Fnon-descendant histories,\n`--allow-empty`, and partially committed reviewed content fail closed. There is no speed, efficiency, token, or time exception.\n\n**Verified no-change terminal (issue #2131 C1).** When the ENTIRE immutable\ninventory is verified as a no-change outcome — every `FB-###` item classified\n`DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`\nin the settled verification lanes — a correct workflow needs NO content commit.\nAfter every ordered gate settles, call `complete_pr_workflow` with the intake\n`pr_head_sha` while HEAD still equals that intake head and the tree is clean:\nit returns `verified-no-change` and clears the gate terminally (nothing to\npublish; an empty or `--allow-empty` commit is still forbidden). Any item\nclassified `CONFIRMED`\u002F`PARTIAL` requires the ordinary exactly-one-reviewed-\ncommit path above.\n\n**Base-sync\u002Frebind (issue #2131 C2).** When base drift or merge conflicts force\na merge\u002Frebase, the repaired history is no longer a direct child of the intake\nhead and the ordinary publication path can never be satisfied. Do NOT abort\nad-hoc: finish the repair, fetch the new authoritative PR head, check it out,\nthen call `rebind_pr_feedback_head` with the new full PR head SHA. It moves the\nimmutable intake head to the new head, preserves the immutable inventory, and\ninvalidates every ancestry-bound receipt (Stage A, verification, ordered\ngates) — re-run the entire mechanical ladder on the new ancestry. It refuses a\nno-op rebind, refuses while publication is armed, and refuses while lanes are\nin flight.\n\n**Without the controller (Profiles B\u002FC).** The same gates run in the same\norder with the same one-row-per-feedback-ID verdict contracts; what changes is\nthe executor. Stage A: run the repository's discovered build, typecheck, and\nlint\u002Fformat obligations, exact `git diff --check`, and one targeted\nreproduction\u002Fregression command yourself, recording each command and its\noutput as a receipt in the ledger; track the content digest manually (for\nexample `git rev-parse HEAD` plus a working-tree diff hash) so stale receipts\nare detectable, and re-run the whole set after any content change. Stage B:\none fresh reviewer subagent, then one fresh test-engineer-role subagent\n(Profile B), or two strictly separated re-derivation passes (Profile C).\nCloseout: a separate fresh reviewer, then a separate fresh critic, per the\nswarm closeout contract. Emit the same `[STAGE-B-REVIEW]`, `[STAGE-B-TEST]`,\n`[CLOSEOUT-REVIEW]`, and `[CLOSEOUT-CRITIC]` rows, record the verdicts in the\nsession task-gates artifact, and disclose Profile C's procedural independence\nin the closure ledger. Any edit after a gate verdict invalidates that verdict\nand every later one; restart at Stage A.\n\nIf a gate failure is suspected pre-existing, prove it on the base branch or\nlabel it `UNVERIFIED`. Do not call the branch green while required checks are\nnon-green.\n\n### Stage A — structural pre-checks (mandatory before Stage B)\n\nRun for every changed surface. No \"where relevant\" — every PR-feedback change\nruns these; if a surface is genuinely untouched, state that explicitly rather\nthan skipping silently.\n\n- the repository's actual build validation for the changed surface — must\n  succeed when that surface participates in a build,\n- the repository's actual typecheck\u002Fstatic-analysis validation for the changed\n  surface — must pass when such a check exists,\n- the repository's actual lint\u002Fformat validation for the changed surface — must\n  pass when such a check exists,\n- `git diff --check` — no whitespace or merge-marker errors.\n- one proof command is mandatory on every run:\n  - use the exact failing CI\u002Ftest command when a ledger item is rooted in a\n    defect or CI\u002Ftest failure; the reproduction must fail on the pre-fix tree\n    and pass after the fix.\n  - otherwise run a repo-appropriate targeted regression\u002Ftest command that\n    exercises the changed behavior and passes on the post-fix tree.\n\nExecute these through `run_pr_feedback_stage_a` when available. Its bounded\narray-form commands are not arbitrary shell escape hatches: diff-check and a\ntargeted reproduction are unconditional, every mechanically discovered\nworkspace\u002Fcategory\u002Fsource obligation is also required, and each command must\nmatch its declared build\u002Ftypecheck\u002Flint\u002Fdiff-check\u002Freproduction intent. Multiple\ncommands in one category are mandatory when polyglot or monorepo discovery\nproduces multiple obligations; use the exact `working_directory` and\n`obligation_id` for each. Every obligation ID gets exactly one independently\nexecuted receipt; identical commands remain separate only when distinct\nrepository sources mechanically require them. The\nreproduction command must name at least one exact test, package, path, or\nregression selector in `targets`. Invoke recognized validators and test runners\ndirectly. Standard contained `.\u002Fgradlew` and `.\u002Fmvnw` wrappers are supported. A\nrepository with a custom validator can declare its exact array-form command in a\n   bounded `.pr-validation.json` version-1 contract that is byte-identical to\n   the immutable `base_ref`\u002F`base_sha` merge-base copy and reference the exact\n   contract path\u002Fid. A contract added or changed by the PR never authorizes a\n   command. When that trusted contract replaces an otherwise opaque named\npackage script, the controller preserves the contract identity on the discovered\nobligation and receipt, requires non-empty execution evidence, and permits only\nan exact inspected npm, pnpm, yarn, or Bun script selection. Unsupported\nworkspace-glob semantics fail closed rather than silently omitting a workspace.\nArbitrary opaque scripts and unverified package-script names remain non-proof\nbecause a name such as `test` or `build` can hide a no-op. A\nreproduction must also return non-empty machine-observable runner output.\nThe reproduction check also supplies one `feedback_targets` row per immutable\nfeedback ID, in inventory order: exact `feedback_item_id`, one executed `target`,\nconcrete `expected_behavior`, and a typed `proof_kind` (`defect`, `metadata`,\n`source-proof`, `conflict`, `ci`, or `user-decision`). Missing, duplicate,\ninvented, target-less, or kind-less mappings block Stage B; the controller\npersists that exact per-item mapping. This is a STRUCTURAL mapping with a typed\nproof kind — it proves each item maps to a target the executed command actually\nselects, not that the target is causally decisive for that item; the Stage B\nreviewer lane owns that judgement (issue #2131 C4).\nNo-op\u002Fhelp\u002Flist\u002Fdry-run,\nfix\u002Fupdate, package publication\u002Fdeployment, Git mutation, remote client,\nshell\u002Feval\u002Fwrapper, and credentialed publication surfaces fail closed. The\ncontroller snapshots the content revision plus HEAD, index, refs, upstream, and\nGit config before and after every command (including failures\u002Ftimeouts); any\nmutation invalidates Stage A and prevents later commands from becoming proof.\n\nThe Stage A response carries per-check summaries (category, command, exit code,\nduration) rather than inline stdout\u002Fstderr. On failure it also carries a bounded\ntail of the failing check and a `full_output_ref` for retrieving the complete\noutput via `retrieve_summary`; if that persistence fails, the failing check's\nfull stdout\u002Fstderr is inlined instead so evidence is never lost. A successful\nrun persists nothing — there is no failure evidence to recover, and the\nper-check summaries are the useful record.\n\n### Re-recording Stage A on an unchanged revision\n\nRe-recording Stage A always requires a fresh, complete receipt set on the\ncurrent revision digest — that part is unconditional. What happens to the\nalready-recorded Stage B and closeout gate batches depends on whether the\nrevision digest itself changed. If the digest is unchanged from the prior\nStage A record **and** the newly declared applicable obligations\u002Fcategories\nare equal to or a superset of the prior declaration, the already-approved\nindependent gate batches are retained: re-recording Stage A to add a\npreviously-missed obligation, or to re-attest the same set, does not by\nitself discard Stage B and closeout work that already passed on that\nrevision. A narrower obligation set than the prior declaration, or any actual\ndigest change, still wipes every recorded gate batch and un-arms publication\nexactly as before — a controller cannot narrow what it declares in order to\ndodge re-verification.\n\n### Why gate evidence is not item-scoped\n\nStage A, Stage B, and closeout evidence invalidate as whole gate batches, not\nper feedback item, and that is a deliberate design decision, not unfinished\nwork:\n\n- **No trustworthy item-to-file mapping exists to key invalidation on.** The\n  file scope a caller declares for a feedback item is caller-asserted and\n  only path-sanitized — it is never intersected with the actual changed-file\n  set, and it carries no persisted binding back to feedback item IDs. Keying\n  invalidation on that declaration would let a controller dodge\n  re-verification by under-declaring scope, turning a fail-closed guarantee\n  into a fail-open one (AGENTS.md invariant 9) — the same failure class that\n  already ruled out keying digest invalidation on `git diff --raw` blob OIDs.\n- **The four gate phases are holistic by contract.** Each recorded batch must\n  own every inventory item exactly once and in declared order. Retaining\n  evidence for a subset of items per gate would re-partition that\n  independent-review contract itself, and would need its own\n  collusion\u002Findependence analysis before it could be trusted — it is not a\n  drop-in extension of the revision-level retention above.\n\n### Stage B — reviewer + test_engineer (mandatory after Stage A passes)\n\nTwo independent agents on the Stage-A-green diff, run in order: **reviewer\nfirst**, then **test_engineer**. The reviewer validates the fixes before the\ntest_engineer writes falsification probes against them; running them in parallel\nrisks the test_engineer pinning a not-yet-approved fix shape.\n\n- **reviewer** — independent (fresh context, not the implementer, not a continued\n  conversation). Validates each fix on the current diff against the feedback\n  item it closes. Verdict per item: APPROVE \u002F NEEDS_REVISION \u002F BLOCKED.\n- **test_engineer** — independently designs and runs the falsification probe or\n  regression test that proves each fix resolves its item (tests for changed\n  behavior or newly covered gaps). The structured gate lane is read-only: if a\n  missing test must be authored, return `FAIL` with the exact requested probe so\n  implementation can add it before the sequence restarts. Verdict per item:\n  PASS \u002F FAIL \u002F BLOCKED.\n\nAddress every NEEDS_REVISION \u002F BLOCKED \u002F FAIL, then restart at Stage A on the\ncurrent diff. When implementation authors or modifies test files requested by\nthe test_engineer, the content-digest controller invalidates all earlier\nreceipts automatically. Stage A must be green over the full Stage-B-inclusive\ndiff before a new Stage B reviewer and test engineer run.\n\n### Closeout gate — reviewer + critic (mandatory after Stage B)\n\nA *separate* reviewer + critic pair on the Stage-B-approved diff. This is the\nswarm closeout contract (see `..\u002Fswarm\u002FSKILL.md` \"Mandatory implementation\ncloseout gate\"); because this skill edits code, docs, release notes, or skill files it applies in full — Stage B\nalone does not satisfy it.\n\n- **independent reviewer** (fresh context, separate from the Stage B reviewer)\n  → APPROVE \u002F NEEDS_REVISION \u002F BLOCKED per item.\n- **final critic** (separate fresh context, not a continued conversation with\n  the reviewer, dispatched after the reviewer returns APPROVE) → APPROVE \u002F\n  NEEDS_REVISION \u002F BLOCKED per item. The critic challenges: is every original\n  feedback item actually resolved? Any requirement drift, weak evidence, missing\n  sibling-file checks, stale approvals, anything unwired or silently deferred?\n\nAddress every NEEDS_REVISION \u002F BLOCKED item, re-review with the reviewer if the\ncritic surfaces correctness issues, then re-critic. **Any edit after the\nreviewer's or critic's approval invalidates that approval** — re-run the\naffected gate on the current diff before publishing.\n\nRecord both closeout verdicts (reviewer + critic, with HEAD\u002Fdiff) in the\nruntime's session task-gates artifact using the repository\u002Fruntime-specific\ndurable-session guidance when one exists. `.swarm\u002F` is the plugin's runtime\nstate — never write task artifacts there.\n\n### Post-publish verification (mandatory after the PR is pushed)\n\nThese checks run after the fix lands on the remote — they are NOT Stage A\npre-checks and must not be folded into Stage A.\n\n- PR metadata checks after push: head SHA, check status,\n  mergeability\u002Fconflicts, and unresolved feedback state.\n- After conflict fixes, verify remote mergeability is clean (`MERGEABLE` \u002F\n  `CLEAN`), not only that local conflict markers disappeared.\n- For current-head CI, prefer run-level details when PR checks look stale:\n  `gh run view \u003Crun-id> --json headSha,status,conclusion,jobs,url`.\n\n## Publishing And Communication\n\nAfter every ordered local gate passes on one unchanged content digest, create\nthe reviewed commit with one standalone `git commit` command. Under Profile A,\nthen call\n`complete_pr_workflow` once with `mode: \"PR_FEEDBACK\"` and the immutable intake\n`pr_head_sha`. A `ready-to-publish` result arms publication but deliberately\nkeeps the durable gate active and binds that post-commit HEAD to the current\nbranch's exact upstream remote-tracking ref. Configure the repository's intended\nPR-branch upstream before committing and arming. Push is blocked before this\ntransition. Arming fails unless the index\u002Fworktree are clean and the bound HEAD\nis a non-merge direct child whose sole parent is the immutable intake head. Any content\nmutation or amend after it is blocked; restart at Stage A if the approved\ncontent must change.\n\nAfter arming, publish with exactly one non-force, single-ref command of the\nform `git push \u003Cbound-remote> \u003Cbound-commit>:refs\u002Fheads\u002F\u003Cbound-branch>`. The\nsource must be the literal commit ID bound by the first completion call, not\n`HEAD`; the destination must be the branch behind the bound upstream\nremote-tracking ref. Force flags, mirror\u002Fall\u002Ftags\u002Fdelete operations, extra\nrefspecs, URLs, wrappers, `git -C`, `gh` writes, aliases, and other publication\nsurfaces fail closed. Read-only inspection remains available. Immediately\nafter the exact push and read-only remote verification, call\n`complete_pr_workflow` again to prove the bound remote-tracking ref points at\nthe bound commit. Completion also performs a bounded query of the actual remote\nbranch; a locally forged or fetched tracking ref is never publication proof.\nThe gate clears only after both observations agree, before any PR\ncomment\u002Fbody\u002Fthread write.\n\nUnder Profiles B\u002FC, the same publication invariants apply procedurally: one\nreviewed commit on the PR branch, a single non-force push of exactly that\ncommit to the PR head branch through the repository's normal workflow, then\nread-only verification that the actual remote head equals the pushed commit\nbefore any PR comment\u002Fbody\u002Fthread write.\n\nCommits and pushes follow the repository's commit\u002FPR workflow (for example\n`file:.swarm\u002Fbundled-skills\u002Fcommit-pr\u002FSKILL.md` when that bundled workflow is\navailable) — do not push ad-hoc.\n\nAfter fixes, update the PR body or comment with a closure ledger:\n\n```text\nFB-001 | fixed | commit\u002Ftest evidence\nFB-002 | disproved | code evidence\nFB-003 | pre-existing | base-branch evidence\nFB-004 | needs user decision | decision required\nFB-005 | needs more evidence | .swarm\u002Fevidence\u002F{phase}\u002Fphase-council.json missing\nCONFLICT-001 | fixed | remote mergeability is MERGEABLE\u002FCLEAN\nCI-001 | fixed | current-head check\u002Frun evidence\n```\n\nDo not resolve GitHub review threads unless explicitly instructed. If instructed,\nresolve only threads whose ledger item is fixed or disproved on the pushed PR\nhead, and record the exact evidence used.\n\n## Final Output\n\nUnder Profile A, before emitting the user-facing final response, call\n`complete_pr_workflow` a\nsecond time with the same mode and immutable verification `pr_head_sha`. The\ntool clears the durable session gate only when the content digest still equals\nthe independently approved digest, the exact approved commit remains current,\nits bound upstream remote-tracking ref points to that exact commit, every\nfeedback ID has exact-provenance evidence, and no PR-workflow lanes remain\nopen. While the gate remains active, the runtime prepends a workflow-active\nbanner to architect text (the model's text is preserved below it) and normally re-wakes an\nidle parent session. A user interruption pauses automatic wakes until a later\nexplicit user turn settles; the durable gate remains available to continue or\nabort. When the terminal response reports `checkout_restore_required`, call\n`prepare_pr_workflow_checkout` with `operation: \"restore\"` before returning to\nthe user. When `checkout_restore_receipts` lists multiple entries, one restore\ncall reapplies all receipts that share the recorded destination; an optional\nlisted `stash_oid` is an exact inventory assertion, not a selector that leaves\nthe other receipts pending. Successfully applied stashes remain in Git as\nexplicit safety backups and are listed in `retained_stash_oids`; the controller\nnever drops a mutable `stash@{n}` selector. The restore refuses\ndirty, mixed-destination, missing-stash, invalid-receipt, cross-session, or\ndivergent state without reset\u002Fclean and preserves recovery evidence on failure.\nLegacy receipts derive their original commit from the preserved stash and\nselect a uniquely matching local branch when available.\n\nUnder Profiles B\u002FC, no mechanical gate exists: emit the final response only\nafter the closure ledger accounts for every original item and the pushed\nremote head has been verified read-only.\n\nReport:\n\n- intake sources checked and unavailable sources,\n- ledger counts by status,\n- root-cause clusters fixed,\n- tests and commands run,\n- unresolved user decisions,\n- CI\u002Fmergeability state,\n- whether review-thread resolution was skipped or explicitly performed.\n\nEnd with a complete ledger mapping every original item to its outcome.\n\n## Aborting or cancelling an unrecoverable feedback workflow (Profile A)\n\nIf the verification bind is genuinely unreachable (the PR head cannot be\nfetched or checked out, or a compound `git fetch … && git checkout …` keeps\nbeing rejected — run them as TWO separate standalone commands first), call\n`abort_pr_workflow` with `mode: \"PR_FEEDBACK\"`, `kind: \"recovery\"`, and a\none-line `reason` while the workflow is pre-armed. Plain recovery\u002Fforce aborts\nrefuse once publication is armed. To terminate an armed publication without\npublishing, use `kind: \"cancel-publication\"`, `cancel_publication: true`, and a\nnon-empty `reason`. This records terminal `cancelled_without_publication` with\nthe observed remote head, never grants push authority, and then clears the gate.\nDo not substitute a plain abort. To change approved content, use\n`invalidate_pr_feedback_publication`; the full Stage A and ordered independent\ngates must run again. A published generation is never cleared by abort; use\n`complete_pr_workflow` so the actual remote branch is re-verified. When abort\nreports `checkout_restore_required`, call `prepare_pr_workflow_checkout` with\n`operation: \"restore\"` before returning. On Profiles B\u002FC there is no durable\ngate to abort: report the blocker to the user and stop.\n\n## Contract addendum (2026-10-12)\n\n- **Body-claim audit.** Before the reviewer gate, grep the LIVE published\n  artifact (PR body, issue body) against every ledger row whose fix-ref is\n  that artifact: the fixed phrasing present, the contradicting phrasing\n  absent. A row marked FIXED for a file never edited is an unbacked claim —\n  record CLOSED only after the grep matches.\n- **Probe hygiene.** Mutation\u002Frevert probes must leave the tree as found:\n  restore with `git checkout -- \u003Cfile>` after every probe and verify\n  `git status --porcelain` clean before the first commit of the round. An\n  uncommitted mutant left in a tracked source file can ride explicit-path\n  staging into the fix commit — or `git add -A` into the release.\n- **Stable obligation identity.** Never substitute the obligation between\n  ledger and proof: if the ledger defined mutant M4 as X, closing it with a\n  different mutant Y is a new row, not a closure. Coverage-diff the ledger\n  against EVERY source finding table by ID, both directions, before\n  implementing.\n","# Swarm PR Feedback\n\nUse this skill to close known PR feedback. This is not a fresh broad PR review.\nRepository-specific bot names and examples below are illustrative; substitute the repo's actual bot and branch-state surfaces when they differ.\n`swarm-pr-review` discovers new findings; `swarm-pr-feedback` ingests existing\nfeedback surfaces, verifies each claim, clusters related problems, fixes confirmed\nissues, validates the branch, and reports closure status for every item.\n\n**Mandatory gate contract.** Stage A (structural pre-checks) and Stage B\n(reviewer + test_engineer) gates and the reviewer + critic closeout gate are\nMANDATORY for any change made as part of this process. No fix lands, no closure\nledger row is marked FIXED, and no PR is published until all three gates pass on\nthe current diff. There is no speed, efficiency, or time exception. See\n\"Mandatory Gates\" below for the full protocol.\n\nWhen the work starts from a prior Profile-A `swarm-pr-review` run, use the exact\nuser command `\u002Fswarm pr-feedback \u003CPR_URL> continue from\n.swarm\u002Fpr-review\u002F\u003Crun_id>\u002Ffeedback-handoff.json`. The controller validates the\nterminal review and artifact before atomically creating an unbound feedback\ngate; the artifact alone is not write authorization. Profiles B\u002FC ingest their\ntask-workspace handoff directly before triage.\nCarry forward the original review finding IDs, classifications, reviewer\u002Fcritic\nprovenance, and any operational blockers instead of renumbering them as new\ndiscoveries.\n\nFeedback closure is not the end of the PR lifecycle: when PR monitoring is\nenabled (`pr_monitor.enabled`), the PR remains subscribed and monitored under\n`..\u002Fswarm-pr-subscribe\u002FSKILL.md` until it is merged or closed. Events that\narrive after closure (a new bot round, a CI change, fresh review activity) are\ntriaged through that skill and route back into this discipline when they need\nfixes.\n\n## Multi-Round Bot Reviews (Iterative Pattern)\n\nWhen the repo uses an auto-review bot that posts a new review comment after\n**every push** to the PR branch, identify that bot from the repository contract\nand apply this pattern (for example `hermes-pr-review` in this repo). Expect N\nrounds of review for N pushes, and budget for it.\n\n**Round N+1 deltas vs Round N:**\n- Fresh `FB-###` ledger IDs for new findings (do not reuse IDs from earlier rounds)\n- Findings from prior rounds that remain unfixed will reappear with the same evidence\n- Findings you marked DISPROVED with new evidence may reappear if the bot disagrees\n- New findings may be introduced that the prior round did not see (the bot's read scope\n  is the new commit, not the full diff history)\n\n**Operating principles for multi-round triage:**\n\n1. **Continue the ledger, do not start over.** Append to the same `FB-###` counter\n   across rounds. Track each finding's state per round (open, fixed, disproved,\n   awaiting-decision, repeated).\n2. **Carry forward unresolved items.** Findings you marked `PARTIAL` or `NEEDS_USER_DECISION`\n   in round N will still be open in round N+1. The closure ledger should show their\n   evolution (e.g., \"PARTIAL round 1 → CONFIRMED round 2 after evidence collected\").\n3. **Apply the 3-strikes evidence-escalation rule.** When the same finding is\n   raised 3+ times across rounds, re-run source verification with a fresh\n   reviewer context and surface the disagreement explicitly. Add a\n   defense-in-depth change only when that fresh verification proves the change\n   is correct, preserves the real invariant, and adds meaningful protection.\n   Repetition, time, token cost, and reviewer persistence are never substitutes\n   for evidence. Document any parent-vs-inner relationship inline so future\n   readers see the rationale.\n   **Do not add the repeated suggestion:** If it would add incorrect or\n   misleading code about existing guards — e.g., an outer guard that already exists at an\n   inner scope and whose addition would imply the inner guard is absent, a type\n   narrowing that masks a real error class, or a check whose presence asserts a\n   false invariant — do not add the change. A wrong fix embedded in the code is\n   harder to remove than a repeated rebuttal in a comment thread. When the\n   repeated finding is misleading about existing guards, apply item 6's\n   \"surface to user\" path instead of 3-strikes; otherwise the 3-strikes rule\n   applies.\n4. **Verify bot fix-direction suggestions against actual file structure.** Bots\n   read files linearly and can miss parent-block guards. For any \"add an X check\"\n   suggestion, read the surrounding function\u002Fblock to confirm the check is genuinely\n   missing or already exists at a higher scope.\n5. **Each round produces its own closure ledger as a PR comment.** Prefix with\n   \"Round N\" so the bot and reviewers can see progression. Maintain a running\n   summary table at the end of each comment showing totals across rounds\n   (confirmed+fixed \u002F disproved \u002F partial \u002F awaiting-decision).\n6. **Stop the cycle deliberately.** If a finding is disproved with code evidence 3+\n   times and the bot keeps re-raising it, leave the comment, post the closure\n   ledger with the cumulative evidence, and surface the disagreement to the user\n   rather than continuing to push fixes. The user can resolve persistent\n   reviewer-AI disagreement.\n\n**Why this matters:** Without the multi-round pattern, each round looks like\n\"start over, re-triage everything.\" With it, the rounds become incremental:\neach round's work is bounded by new findings + carried-forward items only.\nThis matches how the bot actually behaves and avoids wasted cycles.\n\n### Bot and Security Claim Verification\n\nBefore trusting automated review findings (SAST bots, security scanners, AI reviewers), apply the verification protocol in `references\u002Fbot-claim-verification.md`. Key principle: every bot claim is unverified until you reproduce the exact finding against the current HEAD with the exact tool and rule it names.\n\n## Operating Stance\n\nTreat every review comment, CI failure, bot summary, PR body claim, and pasted note\nas a claim until source evidence proves it. Do not silently drop, defer, or mark\nitems out of scope. Ask the user only for product or scope decisions that cannot\nbe proven from the PR, repo, or explicit instructions.\n\nDo not run a fresh broad PR review while addressing existing feedback. Inspect\nadjacent code only as needed to verify reachability, dependencies, shared root\ncauses, regression risk, or sibling changes required by a confirmed item.\n\nGitHub review-thread resolution is user-controlled. Do not resolve or mark review\nthreads resolved unless the user explicitly instructs you to do so.\n\nDo not act on review-discovered findings from a prior `swarm-pr-review` run\nunless the user has explicitly approved the transition into `swarm-pr-feedback`.\nThe handoff artifact is triage input, not standing authorization to change code.\n\n## Runtime Capability Profiles\n\nThis skill runs on any agent harness. Detect the active profile from the\nactual tool list before triage — the same three profiles defined in\n`..\u002Fswarm-pr-review\u002FSKILL.md` (Runtime Capability Profiles):\n\n- **Profile A — mechanical PR-feedback controller.** The plugin's tools are\n  present in this session: `dispatch_lanes_async`, `collect_lane_results`,\n  `retrieve_lane_output`, `prepare_pr_feedback_scope`,\n  `run_pr_feedback_stage_a`, `complete_pr_workflow`. The controller's\n  fail-closed accounting (immutable inventory, ordered gate lanes, content\n  digests, arming, bound push) is authoritative; bypassing it — direct\n  subagent calls, blocking dispatch, prose verdicts — is BLOCKED while it is\n  active.\n- **Profile B — native parallel subagents, no controller.** Run the same\n  intake → verify → fix → gate → publish discipline using your harness's\n  subagent tool for verification lanes and gate roles; you maintain the\n  ledger, the ownership partition, and the digest accounting yourself in\n  session\u002Ftask workspace files (never under `.swarm\u002F`, which belongs to the\n  plugin runtime).\n- **Profile C — single context, no subagents.** Same discipline as strictly\n  separated sequential passes that re-derive rather than restate earlier\n  reasoning, plus explicit disclosure in the closure ledger that gate\n  independence was procedural.\n\nController-tool absence is NOT a blocker; Profiles B and C are first-class\nexecution paths. BLOCKED is reserved for bypassing an active controller and\nfor verification or coverage gaps that stay unclosable after bounded retries.\n\n## Pre-flight: Check Out the PR Branch Locally\n\nBefore verifying any claim or making any fix, ensure the PR branch is the working\ntree:\n\n- If `head_ref` is a remote branch that is not checked out locally, fetch it\n  (`git fetch origin \u003Chead_ref>`).\n- **Check for parallel work first.** Before checkout, use the repository or\n  runtime's parallel-work check. When the bundled\n  `parallel-work-check` skill exists, it is one conditional implementation to\n  detect concurrent pushes from other agents (for example the repo's\n  auto-review bot following up, a maintainer pushing fixes, or parallel swarm\n  work). If remote has new commits: read `git log local..remote`, evaluate whether the parallel work\n  supersedes your planned fixes, and prefer the parallel work if it's more\n  comprehensive (more tests, better edge coverage, clearer error handling).\n  Abort your rebase, take the remote state, then add minor improvements on top.\n- Verify the working tree is clean first (`git status --porcelain`). If any\n  tracked or untracked changes exist, call `prepare_pr_workflow_checkout`\n  before binding (Profile A). Omit `paths` to auto-discover and atomically\n  preserve every dirty path, including untracked files; pass explicit `paths`\n  only for an exact bounded tracked-file set. It creates an auditable stash\n  receipt containing the original branch\u002FHEAD and a structured\n  `operation: \"restore\"` recovery instruction. Do not issue `git stash`\n  through shell.\n  Without the controller, surface dirty state to the user or abort the checkout\n  — do not blind-stash.\n- Treat `recovery-required` and `indeterminate` controller results as terminal\n  for the current attempt: report the typed `required_action`, abort\u002Fclear any\n  already-active gate, and stop. Only `stashable` permits one preparation call;\n  retry only when the controller explicitly returns `retryable: true`.\n- **Check out the head branch locally before dispatching feedback lanes.** Feedback verification reads the working-tree\n  filesystem (`Read`\u002F`Glob`\u002F`Grep`), and fixes must land on the PR branch — without a\n  checkout you would verify and patch the base branch's code instead. Record the\n  exact `merge_base...head_ref` range for diff-scoped inspection.\n - Pass the exact `merge_base...head_ref` commit range in every read-only verification or\n   explorer\u002Fadvisory-lane delegation so lane agents can inspect specific revisions\n   with `git show` when needed.\n- If no PR reference was provided (a pasted-feedback session on the current branch),\n   confirm the current branch is the intended PR branch before editing.\n- A detached checkout at the authoritative full PR head is a valid pre-bind\n  intake state. On the first Profile-A bind, the controller attaches it only\n  when Git reports exactly one safe candidate: an existing local branch at\n  that SHA whose upstream is an exact remote ref at the same SHA, or one exact\n  remote-tracking ref. It never guesses a remote\u002Fname boundary. Zero\n  candidates, multiple candidates, a linked-worktree-owned local branch, or an\n  existing mismatched upstream fails closed without publishing the bind. Retry\n  is idempotent if switching succeeded but state persistence failed.\n- The existing constrained tracked-branch and safe `gh pr checkout` pre-bind\n  forms remain supported on every profile after proving the exact SHA and a\n  unique intended remote ref. Never use force, submodule-recursive, or detached\n  `gh pr checkout` variants.\n- Immediately after the first bind and before feedback verification dispatch,\n  prove that `git rev-parse HEAD` equals the authoritative full `pr_head_sha`,\n  `git status --porcelain` is empty, and the current branch tracks the intended\n  PR head remote\u002Fbranch. A detached exact-head checkout is intake-only; the\n  bind must attach it before feedback dispatch or publication.\n\nWhen a verification lane result includes `output_ref`, treat `output` as a\npreview and call `retrieve_lane_output` before using it to classify, resolve,\ndisprove, or group feedback items. If the result is `output_degraded`,\n`transcript_incomplete`, or truncated without a usable ref, keep the affected\nledger items as `NEEDS_MORE_EVIDENCE` or re-dispatch a narrower read-only lane.\n(Profile A. On Profiles B\u002FC, read each verification subagent's or pass's full\nreport directly — a truncated or summary-only report is a preview, not\nverification evidence, and keeps its items open the same way.)\n\n## Pre-flight: Dirty Worktree Handling\n\nBefore staging any files for the PR commit, check the working tree state:\n\n**The problem:** `git add -A` stages every uncommitted change in the working tree,\nincluding pre-existing changes from other branches or prior work.\n\n**The check:** Run `git status --porcelain` first. If output is non-empty, identify\nwhich files are PR-related vs pre-existing uncommitted changes.\n\n**The rule:** Stage files explicitly by path when the working tree contains files\nunrelated to the PR. For example:\n\n```bash\ngit add src\u002Ffoo.ts tests\u002Ffoo.test.ts\n```\n\nNever use `git add -A` when the working tree has pre-existing changes from other\nbranches or prior work sessions.\n\n## Batch Collection (mandatory before any fix)\n\nWhen the runtime provides a CI-failure-batching workflow, load it before\nproceeding. The bundled `ci-failure-batching` skill is one conditional\nimplementation; otherwise apply the host-neutral complete-ledger protocol\nbelow.\n\nFor the detailed 6-step batch collection protocol, read `file:.swarm\u002Fbundled-skills\u002Fci-failure-batching\u002FSKILL.md`. The steps below are a summary:\n\n1. `gh pr checks \u003Cnumber> --json name,bucket,state,link` to collect all check results\n2. Filter to `bucket == \"fail\"` or `bucket == \"cancel\"`\n3. `gh run view \u003Cid> --log-failed` for each failing run\n4. Group failures by root cause before fixing\n\n**Rule:** The complete failure ledger must be collected before any\nmodification is proposed. Verifying the ledger is complete is a prerequisite\nfor the Fix Planning step.\n\n## Pre-flight: Scope Discipline\n\nWhen the plugin's mechanical controller is available, every coder Task must be\npreceded by `prepare_pr_feedback_scope({ task_id, files })`. The controller is\navailable only after the immutable feedback-verification lanes have settled and\nbinds the exact file set to the current feedback revision, parent session, and\nnext matching Task call. The coder prompt must use the same numeric `task_id`,\ncontain matching `FILE:` directives, and include a literal `ACCEPTANCE:` line.\nOnce a Task consumes that scope, its `task_id` is immutable for the current\nfeedback revision. Any retry must prepare and dispatch a fresh nested numeric\ntask identity (for example `1.1.1`), never re-declare the consumed ID.\n\nDo not create a synthetic `save_plan` merely to authorize feedback work, and do\nnot use `declare_scope`; those tools belong to the normal implementation-plan\nlifecycle. There is no one-file or single-function carve-out from the dedicated\nPR-feedback scope controller.\n\nIn runtimes without this controller, use the native scope mechanism. If none\nexists, put exact allowed files and non-goals in the delegation and verify the\nresulting diff mechanically. Never bypass an available scope controller merely\nto reduce ceremony.\n\n## Intake Surfaces\n\nBuild a complete feedback ledger before editing. Include every available source:\n\n- validated findings and operational blockers handed off from `swarm-pr-review`,\n- pasted user or reviewer feedback,\n- GitHub review threads, inline review comments, and review summaries,\n- PR issue comments and requested-changes reviews,\n- CI\u002Fcheck failures, check annotations, and relevant logs,\n- mergeability, conflicts, base drift, and stale PR branch state,\n- local validation failures,\n- PR body checkboxes, test-plan claims, linked issues, and acceptance criteria,\n- commit history and bot\u002Fapp commits on the PR branch.\n\nIf a source is unavailable, retry with alternative access paths. If unavailable after retry, the source is a coverage gap that must be reported to the user — do not silently \"record that limitation\" and proceed as if the source doesn't matter.\n\n### Async advisory verification lanes\n\nAfter the complete feedback ledger exists and before editing, run independent\nread-only verification lanes. Under Profile A, use\n`dispatch_lanes_async` with `mode: \"swarm-pr-feedback:verification\"`, the\ncomplete immutable `feedback_inventory` ID list, the exact current\n`pr_head_sha`, and each lane's exact\n`feedback_item_ids` ownership list for independent read-only verification lanes:\ncomment classification, CI\u002Flog root-cause inspection, test impact mapping,\nrelease\u002Fdocs claim checks, and stale-branch\u002Fconflict analysis. Partition the\nledger so each `FB-###` item is owned by exactly one verification lane and the\nunion of lanes covers the entire ledger — no feedback item may be left\nunassigned to a lane; state each lane's owned IDs both structurally and in its\nprompt. The runtime rejects missing, duplicate, overlapping, or unknown item\nownership and blocks mutation until the verification batch settles. Scale\nthe lane count to the ledger size: a 1–3 item round may use a single combined\nlane, while a large multi-round intake may warrant one lane per category above.\nCap each `dispatch_lanes_async` batch at 8 lanes (`MAX_LANES`); if the ledger\nneeds more than 8 verification lanes, dispatch in sequential batches and settle\neach batch's COVERAGE GATE before the next — do not over-spawn lanes for a\ntrivial round. Record each returned `batch_id`, then continue only ledger-safe\narchitect work: normalize feedback IDs, gather deterministic PR metadata, prepare\nreproduction commands, and plan likely fix groups. Do not edit, close items, or\nmark feedback resolved from running lanes.\n\nEvery verification lane must end with one parseable row for each owned item:\n\n```text\n[FEEDBACK-VERIFIED] | FB-### | CONFIRMED\u002FPARTIAL\u002FDISPROVED\u002FPRE_EXISTING\u002FNEEDS_MORE_EVIDENCE\u002FNEEDS_USER_DECISION | evidence\n```\n\nNon-empty prose without this marker contract is not a settled verification\nartifact and cannot unlock mutation.\n\nBefore the Verification step can mark any item `CONFIRMED`, `PARTIAL`,\n`DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`,\nevery open verification batch must be fully settled. Poll with\n`collect_lane_results` (wait omitted or `false`) to process settled lanes\nincrementally — clustering confirmed items and pre-reading files for settled\nfindings while ledger-safe work remains — then issue a final\n`collect_lane_results` with `wait: true` per batch once independent work is\nexhausted, to confirm every lane is settled.\nMissing, stale, cancelled, or failed lanes are coverage gaps that must be closed\nbefore marking any item CONFIRMED\u002FPARTIAL\u002FDISPROVED\u002FPRE_EXISTING. Apply the\nCOVERAGE GATE:\nretry failed lanes (max 2) as another\n`swarm-pr-feedback:verification` async batch with the same immutable inventory,\nexact `pr_head_sha`, agent type, prompt, scope, and isolation, or stop and\nsurface the lane failure to the user as BLOCKED. Under Profile A, blocking and\ndirect-Task fallbacks are rejected because they cannot satisfy the durable\nownership and head-provenance gate.\nDo not proceed with \"blocking verification and record that async advisory lanes\nwere unavailable\" — record-and-continue is not coverage closure.\n\nUnder Profile B, partition the same immutable inventory across fresh read-only\nverification subagents — every `FB-###` item owned by exactly one lane and the\nunion of lanes covering the entire ledger — with each prompt stating its owned\nIDs and the exact `pr_head_sha`, and each lane returning one\n`[FEEDBACK-VERIFIED]` row per owned item. Under Profile C, verify the ledger\nin sequential category passes with the same one-row-per-item contract. On\nevery profile, no item may be classified until its verification lane or pass\nhas settled, and unclosable verification gaps are surfaced as BLOCKED.\n\n### CI matrix cascade check (do this before fixing)\n\nWhen the PR's `unit` job is a matrix across multiple OSes and downstream jobs\n(`integration`, `smoke`) have `needs: unit`, an OS leg failure blocks the\nentire pipeline. Before triaging, check:\n\n1. Are `integration` or `smoke` jobs in `skipped` or `cancelled` state rather\n   than `failed`? That signals a unit matrix cascade — the unit job failed\n   on one OS leg, blocking the downstream jobs from running on the current\n   HEAD.\n2. If a unit OS leg is the blocker, classify the failure:\n   - **Code issue** — the test itself fails. Reproduce locally; if the\n     test passes locally, the runner is the problem.\n   - **Runner performance** — the test step exceeds the configured timeout.\n     Run all files in the step locally with per-file timing; if cumulative\n     local runtime is \u003C10 min and the runner can't complete in 60+ min, the\n     issue is runner performance. Bump the CI timeout as a stopgap and file\n     a follow-up issue for parallelization. Do not loop bumping the timeout\n     past 90 min without filing the follow-up.\n3. Surface cascade failures to the user explicitly. The downstream jobs'\n   results don't exist; the code's coverage of the current HEAD cannot be\n   confirmed by CI alone.\n\n### PR body claim verification\n\nThe `.swarm\u002Fevidence\u002F` paths below apply only when the reviewed repository uses\nthis plugin's council evidence contract. For any other repository, locate the\nauthoritative CI attestation, code-host review record, or repository-declared\nevidence store; the universal rule is that an approval claim needs a real,\nretrievable provenance artifact.\n\nPR body text like \"PHASE 2 council APPROVED (5\u002F5, round 2)\" or \"Final council\nAPPROVED\" must be backed by an evidence file under `.swarm\u002Fevidence\u002F` — phase\ncouncils write `.swarm\u002Fevidence\u002F{phaseNumber}\u002Fphase-council.json`; the final\ncouncil writes the flat `.swarm\u002Fevidence\u002Ffinal-council.json`. Bot-generated PR\nbodies commonly auto-fill these claims without real review. Before accepting\nsuch a claim as part of triage:\n\n1. Check whether the corresponding evidence file exists with `verdict:APPROVED`.\n2. If the claim is unsupported, mark the closure ledger item as\n   `NEEDS_MORE_EVIDENCE` rather than `CONFIRMED`. Do not silently drop the\n   claim — it indicates the PR body was generated without a real review.\n\n## Feedback Ledger\n\nNormalize each item before triage:\n\n```text\nFB-001 | source | author\u002Ftool | status: UNTRIAGED | location | claim | raw link\u002Fquote | depends_on\n```\n\nRules:\n\n- Preserve prior `F-###`, `CI-###`, `CONFLICT-###`, `STALE-###`, and similar\n  IDs from a review handoff when they already exist. Only mint fresh `FB-###`\n  IDs for new feedback discovered after the handoff.\n- Preserve reviewer\u002Fcritic provenance from the handoff artifact so the closure\n  ledger can show which items were review-validated before fix work began.\n- Preserve exact reviewer wording or log summary when practical.\n- Split compound comments into separate ledger items only when they require\n  different evidence or fixes.\n- Keep duplicate symptoms linked to one root cause rather than deleting them.\n- Include conflicts, stale branch state, obsolete older-head CI,\n  generated-output (`dist\u002F`) drift, and other CI failures as first-class ledger\n  items.\n- Use explicit IDs for non-review feedback when useful, for example\n  `CONFLICT-001` for merge\u002Fbase drift and `CI-001` for check failures, so PR\n  bodies can show exactly how operational blockers were closed.\n\n### Mandatory: integrate all PR comments with feedback or findings before branch validation (Stage A)\n\n**Before branch validation (Stage A) can begin, every PR comment that contains feedback\nor findings MUST be integrated into the total feedback ledger as a\n`FB-###` item.** This is a hard requirement, not a best-effort step.\n\nWhat counts as \"feedback or findings\":\n- A reviewer request for a code change (\"please rename this\", \"add a test for\n  X\", \"this should call `_internals.foo`\")\n- A reviewer claim about correctness, security, or style (\"this is\n  incorrect\", \"X will leak\")\n- A bot reviewer's findings table entries\n- A CI failure with a specific file:line root cause\n- A reviewer question that implies a code change is needed (\"why is this\n  static?\")\n- PR review summaries or aggregate comments\n\nWhat does NOT count (and is therefore not required to be a ledger item):\n- Pure acknowledgements (\"LGTM\", \"looks good\")\n- PR-level metadata changes (title, label, milestone)\n- Force-push acknowledgements\n\nRules:\n- **No finding may be addressed outside the ledger.** If you fix something a\n  reviewer mentioned, the corresponding `FB-###` item MUST be in the ledger\n  before the fix. If you skip the fix, the `FB-###` item MUST be in the\n  ledger with a `DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or\n  `NEEDS_USER_DECISION` status before branch validation (Stage A) can begin.\n- **Status semantics for unaddressed items:**\n  - `CONFIRMED` and `PARTIAL` items must be addressed (fixed or\n    disproved) before branch validation (Stage A) can begin. A `CONFIRMED` item that is\n    left unaddressed is a regression against the review.\n  - `DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, and\n    `NEEDS_USER_DECISION` items may remain open at branch-validation (Stage A) time, but\n    each must be explicitly justified in the closure ledger.\n- **The closure ledger at the end of the run must account for every `FB-###`\n  item** with a final status (fixed \u002F disproved \u002F pre-existing \u002F needs user\n  decision \u002F needs more evidence).\n- **Comments from the latest bot round take precedence over earlier rounds**\n  for the same finding; the earlier-round `FB-###` item is updated with the\n  new evidence rather than a new item being created.\n- **Multi-round pattern continues to apply** (see \"Multi-Round Bot Reviews\"\n  section). A new bot round adds new `FB-###` items for findings that\n  weren't in the prior round; the prior round's items are carried forward\n  and updated with the new evidence.\n\nRationale: silently addressing a review comment without a corresponding\nledger item means the closure summary at the end of the run cannot\ndemonstrate that every review comment was considered. The closure summary\nis the only artifact the user\u002Fmaintainer reads to confirm the PR is ready\nto merge. Missing items in the ledger = missing items in the closure = a\nPR that ships with unreviewed feedback.\n\n## Verification\n\nClassify every ledger item before fixing:\n\n| Status | Meaning |\n|---|---|\n| `CONFIRMED` | The issue is real, reachable or structurally proven, and introduced or exposed by the PR. |\n| `PARTIAL` | The comment points at a real concern, but the framing, severity, or requested fix is incomplete. |\n| `DISPROVED` | Source, tests, or execution context prove the claim is false, unreachable, or already mitigated. |\n| `PRE_EXISTING` | The issue exists on the base branch and is not materially worsened by the PR. |\n| `NEEDS_MORE_EVIDENCE` | The claim (e.g., \"council APPROVED\") is unsupported by stored evidence (e.g., a missing or failed `.swarm\u002Fevidence\u002F` artifact); more information is required before triage. |\n| `NEEDS_USER_DECISION` | The item requires a product, UX, compatibility, or scope choice that cannot be inferred. |\n\nVerification checklist:\n\n- Read the referenced file and surrounding code.\n- Check caller context, reachability, feature flags, schema validation, guards,\n  state-machine rules, and permission boundaries.\n- Determine whether the issue is PR-introduced, pre-existing, or unresolved.\n- Check related tests and whether a failing\u002Fproposed test would prove the item.\n- Check whether multiple feedback items share one root cause.\n\n### DI seam migration validation\n\nWhen the repository uses `_internals` seam \u002F `mock.module()` patterns, apply the validation protocol in `references\u002Foperational-gotchas.md`.\n\n## Fix Planning\n\nCluster ledger items by root cause before coding. Fix in this order unless a user\ninstruction or dependency requires otherwise:\n\n1. Merge conflicts, stale branch state, and base drift.\n2. Deterministic CI, build, typecheck, formatting, and test failures.\n3. Confirmed correctness, security, data-loss, persistence, git\u002Fwrite-safety, and\n   permission issues.\n4. Test gaps needed to prove confirmed fixes.\n5. Docs, release notes, PR body, and migration guidance.\n6. Reviewer communication and closure summaries.\n\nFor each cluster, record:\n\n```text\nROOT-001 | ledger items: FB-001, FB-004 | files | fix approach | tests | docs | risk\n```\n\nDo not make scope decisions yourself. If the right fix depends on product intent\nor compatibility policy, mark the item `NEEDS_USER_DECISION` and ask.\n\n## Implementation Rules\n\n- Patch only confirmed or partial items, plus required tests\u002Fdocs.\n- Do not implement speculative cleanup while feedback remains unclosed.\n- Never ship unwired code. Any new command, tool, skill, config, docs surface, or\n  generated artifact must be fully registered and validated.\n- Never defer work or declare it out of scope without explicit user instruction.\n- Keep invalid or disproved findings in the closure ledger with the evidence.\n- For CI failures, verify the failing job belongs to the current PR head before\n  treating it as current evidence.\n- For generated output or dist failures, inspect the failing log before rebuilding\n  and commit regenerated files only when the PR touches the source surface.\n- When `main` has a merge queue enabled, do not rebase or force-push a PR only\n  because `main` advanced. Once required checks and review are green, queue the PR\n  and let the merge queue perform final current-base validation. Still resolve real\n   merge conflicts and SHA-dependent review threads before queuing.\n\n### Conditional runtime\u002Fhost gotchas\n\nFor portability gotchas (plan identity, stale gate evidence, PowerShell comment posting, same-file batching), read `references\u002Foperational-gotchas.md`.\n\n## Mandatory Gates\n\n**Stage A and Stage B gates and the reviewer + critic closeout gate are\nMANDATORY for any change made as part of the PR-feedback process.** No fix\nlands, no closure ledger row is marked FIXED, and no PR is published until all\nthree gates pass on the current diff. This section uses the repository's\nestablished Stage A\u002FB meaning: Stage A = `pre_check_batch`-equivalent structural\npre-checks; Stage B = `reviewer` + `test_engineer` per-task gates (consistent\nwith `execute`, `plan`, `specify`, `brainstorm`, `docs\u002Fswarm-briefing.md`, and\n`docs\u002Fcouncil\u002FREADME.md`).\n\n**Mechanical controller contract (Profile A).** Prose acknowledgements, direct `Task` calls,\nblocking dispatch, reused conversations, and free-form `APPROVE`\u002F`PASS` text do\nnot satisfy these gates while the controller is active. The durable controller requires this exact sequence on\none content digest:\n\nController authority follows the parent\u002Fchild session ancestry. Coder and\nnested child tool calls inherit the parent feedback gate; delegation never\ngrants early commit, push, remote-write, checkout, or protected-evidence\nauthority.\n\n1. `run_pr_feedback_stage_a` with array-form commands for every concrete\n   workspace\u002Fcategory\u002Fsource build, typecheck, and lint\u002Fformat obligation\n   mechanically discovered from the repository's manifests, configs, scripts,\n   or bounded `.pr-validation.json` contract, plus exact\n   `[\"git\", \"diff\", \"--check\"]`. A category with no repository-local signal is\n   not invented merely to reach a fixed command count.\n   Add one required proof command: use the exact failing CI\u002Ftest reproduction\n   when the immutable inventory includes a defect or CI\u002Ftest failure; otherwise\n   add a repo-appropriate targeted regression\u002Ftest command that exercises the\n   changed behavior. The tool executes the commands; naming a category without\n   executing it is not evidence. The controller binds that reproduction receipt\n   to the complete immutable feedback inventory, so no feedback item can reach\n   Stage B with an unrelated or unowned Stage A receipt.\n2. One `dispatch_lanes_async` lane with\n   `mode: \"swarm-pr-feedback:stage-b-reviewer\"`,\n   `workflow_lane: \"stage-b-reviewer\"`, every immutable\n   `feedback_item_ids`, and `max_concurrent: 1`.\n3. After that lane settles positively, one fresh `test_engineer` lane with\n   `mode: \"swarm-pr-feedback:stage-b-test\"`, matching `workflow_lane`, the\n   complete inventory, and `max_concurrent: 1`.\n4. After Stage B settles, one separate fresh reviewer lane with\n   `mode: \"swarm-pr-feedback:closeout-reviewer\"`, then one separate fresh\n   critic lane with `mode: \"swarm-pr-feedback:closeout-critic\"`. Each owns the\n   complete inventory and uses `max_concurrent: 1`.\n\nEvery gate lane emits exactly one fully populated row per feedback ID:\n\n```text\n[STAGE-B-REVIEW] | FB-001 | APPROVE|NEEDS_REVISION|BLOCKED | evidence\n[STAGE-B-TEST] | FB-001 | PASS|FAIL|BLOCKED | evidence\n[CLOSEOUT-REVIEW] | FB-001 | APPROVE|NEEDS_REVISION|BLOCKED | evidence\n[CLOSEOUT-CRITIC] | FB-001 | APPROVE|NEEDS_REVISION|BLOCKED | evidence\n```\n\nOnly exact positive verdict fields pass. A sentence containing “not APPROVE,” a\nheader without item rows, duplicate rows, missing IDs, degraded\u002Ftruncated\nartifacts, wrong roles, stale content digests, parallel or out-of-order phases,\nand reused pre-edit approvals all fail closed. Any content change after Stage A\ninvalidates Stage A and every later gate; restart at step 1. See\n\"Re-recording Stage A on an unchanged revision\" below for the one retention\nexception, which applies only when the revision digest itself did not change.\nPublication tools\nand `git commit`\u002F`git push` remain blocked until all four ordered lane phases\nsettle on the Stage-A digest. After they settle, only one standalone `git commit`\ncommand may create the reviewed commit; push and remote publication remain\nblocked until that exact commit is armed. The first completion requires a clean\nindex\u002Fworktree and a non-merge direct child commit whose sole parent is the\nimmutable intake head, so multiple commits, merge commits,\namend\u002Fnon-descendant histories,\n`--allow-empty`, and partially committed reviewed content fail closed. There is no speed, efficiency, token, or time exception.\n\n**Verified no-change terminal (issue #2131 C1).** When the ENTIRE immutable\ninventory is verified as a no-change outcome — every `FB-###` item classified\n`DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`\nin the settled verification lanes — a correct workflow needs NO content commit.\nAfter every ordered gate settles, call `complete_pr_workflow` with the intake\n`pr_head_sha` while HEAD still equals that intake head and the tree is clean:\nit returns `verified-no-change` and clears the gate terminally (nothing to\npublish; an empty or `--allow-empty` commit is still forbidden). Any item\nclassified `CONFIRMED`\u002F`PARTIAL` requires the ordinary exactly-one-reviewed-\ncommit path above.\n\n**Base-sync\u002Frebind (issue #2131 C2).** When base drift or merge conflicts force\na merge\u002Frebase, the repaired history is no longer a direct child of the intake\nhead and the ordinary publication path can never be satisfied. Do NOT abort\nad-hoc: finish the repair, fetch the new authoritative PR head, check it out,\nthen call `rebind_pr_feedback_head` with the new full PR head SHA. It moves the\nimmutable intake head to the new head, preserves the immutable inventory, and\ninvalidates every ancestry-bound receipt (Stage A, verification, ordered\ngates) — re-run the entire mechanical ladder on the new ancestry. It refuses a\nno-op rebind, refuses while publication is armed, and refuses while lanes are\nin flight.\n\n**Without the controller (Profiles B\u002FC).** The same gates run in the same\norder with the same one-row-per-feedback-ID verdict contracts; what changes is\nthe executor. Stage A: run the repository's discovered build, typecheck, and\nlint\u002Fformat obligations, exact `git diff --check`, and one targeted\nreproduction\u002Fregression command yourself, recording each command and its\noutput as a receipt in the ledger; track the content digest manually (for\nexample `git rev-parse HEAD` plus a working-tree diff hash) so stale receipts\nare detectable, and re-run the whole set after any content change. Stage B:\none fresh reviewer subagent, then one fresh test-engineer-role subagent\n(Profile B), or two strictly separated re-derivation passes (Profile C).\nCloseout: a separate fresh reviewer, then a separate fresh critic, per the\nswarm closeout contract. Emit the same `[STAGE-B-REVIEW]`, `[STAGE-B-TEST]`,\n`[CLOSEOUT-REVIEW]`, and `[CLOSEOUT-CRITIC]` rows, record the verdicts in the\nsession task-gates artifact, and disclose Profile C's procedural independence\nin the closure ledger. Any edit after a gate verdict invalidates that verdict\nand every later one; restart at Stage A.\n\nIf a gate failure is suspected pre-existing, prove it on the base branch or\nlabel it `UNVERIFIED`. Do not call the branch green while required checks are\nnon-green.\n\n### Stage A — structural pre-checks (mandatory before Stage B)\n\nRun for every changed surface. No \"where relevant\" — every PR-feedback change\nruns these; if a surface is genuinely untouched, state that explicitly rather\nthan skipping silently.\n\n- the repository's actual build validation for the changed surface — must\n  succeed when that surface participates in a build,\n- the repository's actual typecheck\u002Fstatic-analysis validation for the changed\n  surface — must pass when such a check exists,\n- the repository's actual lint\u002Fformat validation for the changed surface — must\n  pass when such a check exists,\n- `git diff --check` — no whitespace or merge-marker errors.\n- one proof command is mandatory on every run:\n  - use the exact failing CI\u002Ftest command when a ledger item is rooted in a\n    defect or CI\u002Ftest failure; the reproduction must fail on the pre-fix tree\n    and pass after the fix.\n  - otherwise run a repo-appropriate targeted regression\u002Ftest command that\n    exercises the changed behavior and passes on the post-fix tree.\n\nExecute these through `run_pr_feedback_stage_a` when available. Its bounded\narray-form commands are not arbitrary shell escape hatches: diff-check and a\ntargeted reproduction are unconditional, every mechanically discovered\nworkspace\u002Fcategory\u002Fsource obligation is also required, and each command must\nmatch its declared build\u002Ftypecheck\u002Flint\u002Fdiff-check\u002Freproduction intent. Multiple\ncommands in one category are mandatory when polyglot or monorepo discovery\nproduces multiple obligations; use the exact `working_directory` and\n`obligation_id` for each. Every obligation ID gets exactly one independently\nexecuted receipt; identical commands remain separate only when distinct\nrepository sources mechanically require them. The\nreproduction command must name at least one exact test, package, path, or\nregression selector in `targets`. Invoke recognized validators and test runners\ndirectly. Standard contained `.\u002Fgradlew` and `.\u002Fmvnw` wrappers are supported. A\nrepository with a custom validator can declare its exact array-form command in a\n   bounded `.pr-validation.json` version-1 contract that is byte-identical to\n   the immutable `base_ref`\u002F`base_sha` merge-base copy and reference the exact\n   contract path\u002Fid. A contract added or changed by the PR never authorizes a\n   command. When that trusted contract replaces an otherwise opaque named\npackage script, the controller preserves the contract identity on the discovered\nobligation and receipt, requires non-empty execution evidence, and permits only\nan exact inspected npm, pnpm, yarn, or Bun script selection. Unsupported\nworkspace-glob semantics fail closed rather than silently omitting a workspace.\nArbitrary opaque scripts and unverified package-script names remain non-proof\nbecause a name such as `test` or `build` can hide a no-op. A\nreproduction must also return non-empty machine-observable runner output.\nThe reproduction check also supplies one `feedback_targets` row per immutable\nfeedback ID, in inventory order: exact `feedback_item_id`, one executed `target`,\nconcrete `expected_behavior`, and a typed `proof_kind` (`defect`, `metadata`,\n`source-proof`, `conflict`, `ci`, or `user-decision`). Missing, duplicate,\ninvented, target-less, or kind-less mappings block Stage B; the controller\npersists that exact per-item mapping. This is a STRUCTURAL mapping with a typed\nproof kind — it proves each item maps to a target the executed command actually\nselects, not that the target is causally decisive for that item; the Stage B\nreviewer lane owns that judgement (issue #2131 C4).\nNo-op\u002Fhelp\u002Flist\u002Fdry-run,\nfix\u002Fupdate, package publication\u002Fdeployment, Git mutation, remote client,\nshell\u002Feval\u002Fwrapper, and credentialed publication surfaces fail closed. The\ncontroller snapshots the content revision plus HEAD, index, refs, upstream, and\nGit config before and after every command (including failures\u002Ftimeouts); any\nmutation invalidates Stage A and prevents later commands from becoming proof.\n\nThe Stage A response carries per-check summaries (category, command, exit code,\nduration) rather than inline stdout\u002Fstderr. On failure it also carries a bounded\ntail of the failing check and a `full_output_ref` for retrieving the complete\noutput via `retrieve_summary`; if that persistence fails, the failing check's\nfull stdout\u002Fstderr is inlined instead so evidence is never lost. A successful\nrun persists nothing — there is no failure evidence to recover, and the\nper-check summaries are the useful record.\n\n### Re-recording Stage A on an unchanged revision\n\nRe-recording Stage A always requires a fresh, complete receipt set on the\ncurrent revision digest — that part is unconditional. What happens to the\nalready-recorded Stage B and closeout gate batches depends on whether the\nrevision digest itself changed. If the digest is unchanged from the prior\nStage A record **and** the newly declared applicable obligations\u002Fcategories\nare equal to or a superset of the prior declaration, the already-approved\nindependent gate batches are retained: re-recording Stage A to add a\npreviously-missed obligation, or to re-attest the same set, does not by\nitself discard Stage B and closeout work that already passed on that\nrevision. A narrower obligation set than the prior declaration, or any actual\ndigest change, still wipes every recorded gate batch and un-arms publication\nexactly as before — a controller cannot narrow what it declares in order to\ndodge re-verification.\n\n### Why gate evidence is not item-scoped\n\nStage A, Stage B, and closeout evidence invalidate as whole gate batches, not\nper feedback item, and that is a deliberate design decision, not unfinished\nwork:\n\n- **No trustworthy item-to-file mapping exists to key invalidation on.** The\n  file scope a caller declares for a feedback item is caller-asserted and\n  only path-sanitized — it is never intersected with the actual changed-file\n  set, and it carries no persisted binding back to feedback item IDs. Keying\n  invalidation on that declaration would let a controller dodge\n  re-verification by under-declaring scope, turning a fail-closed guarantee\n  into a fail-open one (AGENTS.md invariant 9) — the same failure class that\n  already ruled out keying digest invalidation on `git diff --raw` blob OIDs.\n- **The four gate phases are holistic by contract.** Each recorded batch must\n  own every inventory item exactly once and in declared order. Retaining\n  evidence for a subset of items per gate would re-partition that\n  independent-review contract itself, and would need its own\n  collusion\u002Findependence analysis before it could be trusted — it is not a\n  drop-in extension of the revision-level retention above.\n\n### Stage B — reviewer + test_engineer (mandatory after Stage A passes)\n\nTwo independent agents on the Stage-A-green diff, run in order: **reviewer\nfirst**, then **test_engineer**. The reviewer validates the fixes before the\ntest_engineer writes falsification probes against them; running them in parallel\nrisks the test_engineer pinning a not-yet-approved fix shape.\n\n- **reviewer** — independent (fresh context, not the implementer, not a continued\n  conversation). Validates each fix on the current diff against the feedback\n  item it closes. Verdict per item: APPROVE \u002F NEEDS_REVISION \u002F BLOCKED.\n- **test_engineer** — independently designs and runs the falsification probe or\n  regression test that proves each fix resolves its item (tests for changed\n  behavior or newly covered gaps). The structured gate lane is read-only: if a\n  missing test must be authored, return `FAIL` with the exact requested probe so\n  implementation can add it before the sequence restarts. Verdict per item:\n  PASS \u002F FAIL \u002F BLOCKED.\n\nAddress every NEEDS_REVISION \u002F BLOCKED \u002F FAIL, then restart at Stage A on the\ncurrent diff. When implementation authors or modifies test files requested by\nthe test_engineer, the content-digest controller invalidates all earlier\nreceipts automatically. Stage A must be green over the full Stage-B-inclusive\ndiff before a new Stage B reviewer and test engineer run.\n\n### Closeout gate — reviewer + critic (mandatory after Stage B)\n\nA *separate* reviewer + critic pair on the Stage-B-approved diff. This is the\nswarm closeout contract (see `..\u002Fswarm\u002FSKILL.md` \"Mandatory implementation\ncloseout gate\"); because this skill edits code, docs, release notes, or skill files it applies in full — Stage B\nalone does not satisfy it.\n\n- **independent reviewer** (fresh context, separate from the Stage B reviewer)\n  → APPROVE \u002F NEEDS_REVISION \u002F BLOCKED per item.\n- **final critic** (separate fresh context, not a continued conversation with\n  the reviewer, dispatched after the reviewer returns APPROVE) → APPROVE \u002F\n  NEEDS_REVISION \u002F BLOCKED per item. The critic challenges: is every original\n  feedback item actually resolved? Any requirement drift, weak evidence, missing\n  sibling-file checks, stale approvals, anything unwired or silently deferred?\n\nAddress every NEEDS_REVISION \u002F BLOCKED item, re-review with the reviewer if the\ncritic surfaces correctness issues, then re-critic. **Any edit after the\nreviewer's or critic's approval invalidates that approval** — re-run the\naffected gate on the current diff before publishing.\n\nRecord both closeout verdicts (reviewer + critic, with HEAD\u002Fdiff) in the\nruntime's session task-gates artifact using the repository\u002Fruntime-specific\ndurable-session guidance when one exists. `.swarm\u002F` is the plugin's runtime\nstate — never write task artifacts there.\n\n### Post-publish verification (mandatory after the PR is pushed)\n\nThese checks run after the fix lands on the remote — they are NOT Stage A\npre-checks and must not be folded into Stage A.\n\n- PR metadata checks after push: head SHA, check status,\n  mergeability\u002Fconflicts, and unresolved feedback state.\n- After conflict fixes, verify remote mergeability is clean (`MERGEABLE` \u002F\n  `CLEAN`), not only that local conflict markers disappeared.\n- For current-head CI, prefer run-level details when PR checks look stale:\n  `gh run view \u003Crun-id> --json headSha,status,conclusion,jobs,url`.\n\n## Publishing And Communication\n\nAfter every ordered local gate passes on one unchanged content digest, create\nthe reviewed commit with one standalone `git commit` command. Under Profile A,\nthen call\n`complete_pr_workflow` once with `mode: \"PR_FEEDBACK\"` and the immutable intake\n`pr_head_sha`. A `ready-to-publish` result arms publication but deliberately\nkeeps the durable gate active and binds that post-commit HEAD to the current\nbranch's exact upstream remote-tracking ref. Configure the repository's intended\nPR-branch upstream before committing and arming. Push is blocked before this\ntransition. Arming fails unless the index\u002Fworktree are clean and the bound HEAD\nis a non-merge direct child whose sole parent is the immutable intake head. Any content\nmutation or amend after it is blocked; restart at Stage A if the approved\ncontent must change.\n\nAfter arming, publish with exactly one non-force, single-ref command of the\nform `git push \u003Cbound-remote> \u003Cbound-commit>:refs\u002Fheads\u002F\u003Cbound-branch>`. The\nsource must be the literal commit ID bound by the first completion call, not\n`HEAD`; the destination must be the branch behind the bound upstream\nremote-tracking ref. Force flags, mirror\u002Fall\u002Ftags\u002Fdelete operations, extra\nrefspecs, URLs, wrappers, `git -C`, `gh` writes, aliases, and other publication\nsurfaces fail closed. Read-only inspection remains available. Immediately\nafter the exact push and read-only remote verification, call\n`complete_pr_workflow` again to prove the bound remote-tracking ref points at\nthe bound commit. Completion also performs a bounded query of the actual remote\nbranch; a locally forged or fetched tracking ref is never publication proof.\nThe gate clears only after both observations agree, before any PR\ncomment\u002Fbody\u002Fthread write.\n\nUnder Profiles B\u002FC, the same publication invariants apply procedurally: one\nreviewed commit on the PR branch, a single non-force push of exactly that\ncommit to the PR head branch through the repository's normal workflow, then\nread-only verification that the actual remote head equals the pushed commit\nbefore any PR comment\u002Fbody\u002Fthread write.\n\nCommits and pushes follow the repository's commit\u002FPR workflow (for example\n`file:.swarm\u002Fbundled-skills\u002Fcommit-pr\u002FSKILL.md` when that bundled workflow is\navailable) — do not push ad-hoc.\n\nAfter fixes, update the PR body or comment with a closure ledger:\n\n```text\nFB-001 | fixed | commit\u002Ftest evidence\nFB-002 | disproved | code evidence\nFB-003 | pre-existing | base-branch evidence\nFB-004 | needs user decision | decision required\nFB-005 | needs more evidence | .swarm\u002Fevidence\u002F{phase}\u002Fphase-council.json missing\nCONFLICT-001 | fixed | remote mergeability is MERGEABLE\u002FCLEAN\nCI-001 | fixed | current-head check\u002Frun evidence\n```\n\nDo not resolve GitHub review threads unless explicitly instructed. If instructed,\nresolve only threads whose ledger item is fixed or disproved on the pushed PR\nhead, and record the exact evidence used.\n\n## Final Output\n\nUnder Profile A, before emitting the user-facing final response, call\n`complete_pr_workflow` a\nsecond time with the same mode and immutable verification `pr_head_sha`. The\ntool clears the durable session gate only when the content digest still equals\nthe independently approved digest, the exact approved commit remains current,\nits bound upstream remote-tracking ref points to that exact commit, every\nfeedback ID has exact-provenance evidence, and no PR-workflow lanes remain\nopen. While the gate remains active, the runtime prepends a workflow-active\nbanner to architect text (the model's text is preserved below it) and normally re-wakes an\nidle parent session. A user interruption pauses automatic wakes until a later\nexplicit user turn settles; the durable gate remains available to continue or\nabort. When the terminal response reports `checkout_restore_required`, call\n`prepare_pr_workflow_checkout` with `operation: \"restore\"` before returning to\nthe user. When `checkout_restore_receipts` lists multiple entries, one restore\ncall reapplies all receipts that share the recorded destination; an optional\nlisted `stash_oid` is an exact inventory assertion, not a selector that leaves\nthe other receipts pending. Successfully applied stashes remain in Git as\nexplicit safety backups and are listed in `retained_stash_oids`; the controller\nnever drops a mutable `stash@{n}` selector. The restore refuses\ndirty, mixed-destination, missing-stash, invalid-receipt, cross-session, or\ndivergent state without reset\u002Fclean and preserves recovery evidence on failure.\nLegacy receipts derive their original commit from the preserved stash and\nselect a uniquely matching local branch when available.\n\nUnder Profiles B\u002FC, no mechanical gate exists: emit the final response only\nafter the closure ledger accounts for every original item and the pushed\nremote head has been verified read-only.\n\nReport:\n\n- intake sources checked and unavailable sources,\n- ledger counts by status,\n- root-cause clusters fixed,\n- tests and commands run,\n- unresolved user decisions,\n- CI\u002Fmergeability state,\n- whether review-thread resolution was skipped or explicitly performed.\n\nEnd with a complete ledger mapping every original item to its outcome.\n\n## Aborting or cancelling an unrecoverable feedback workflow (Profile A)\n\nIf the verification bind is genuinely unreachable (the PR head cannot be\nfetched or checked out, or a compound `git fetch … && git checkout …` keeps\nbeing rejected — run them as TWO separate standalone commands first), call\n`abort_pr_workflow` with `mode: \"PR_FEEDBACK\"`, `kind: \"recovery\"`, and a\none-line `reason` while the workflow is pre-armed. Plain recovery\u002Fforce aborts\nrefuse once publication is armed. To terminate an armed publication without\npublishing, use `kind: \"cancel-publication\"`, `cancel_publication: true`, and a\nnon-empty `reason`. This records terminal `cancelled_without_publication` with\nthe observed remote head, never grants push authority, and then clears the gate.\nDo not substitute a plain abort. To change approved content, use\n`invalidate_pr_feedback_publication`; the full Stage A and ordered independent\ngates must run again. A published generation is never cleared by abort; use\n`complete_pr_workflow` so the actual remote branch is re-verified. When abort\nreports `checkout_restore_required`, call `prepare_pr_workflow_checkout` with\n`operation: \"restore\"` before returning. On Profiles B\u002FC there is no durable\ngate to abort: report the blocker to the user and stop.\n\n## Contract addendum (2026-10-12)\n\n- **Body-claim audit.** Before the reviewer gate, grep the LIVE published\n  artifact (PR body, issue body) against every ledger row whose fix-ref is\n  that artifact: the fixed phrasing present, the contradicting phrasing\n  absent. A row marked FIXED for a file never edited is an unbacked claim —\n  record CLOSED only after the grep matches.\n- **Probe hygiene.** Mutation\u002Frevert probes must leave the tree as found:\n  restore with `git checkout -- \u003Cfile>` after every probe and verify\n  `git status --porcelain` clean before the first commit of the round. An\n  uncommitted mutant left in a tracked source file can ride explicit-path\n  staging into the fix commit — or `git add -A` into the release.\n- **Stable obligation identity.** Never substitute the obligation between\n  ledger and proof: if the ledger defined mutant M4 as X, closing it with a\n  different mutant Y is a new row, not a closure. Coverage-diff the ledger\n  against EVERY source finding table by ID, both directions, before\n  implementing.\n",{"name":5,"audience":23,"description":24,"swarm-contract-digest":25},"swarm-plugin","Ingest and resolve known pull request feedback with skeptical source verification. Use when addressing pasted PR feedback, GitHub review comments or threads, requested changes, CI\u002Fcheck failures, merge conflicts, stale PR branches, or PR follow-up work that must close all known issues without dropping findings. Supports multi-round bot reviews when the repo uses an auto-review bot that posts a new review after every push, via the iterative pattern documented in the body. Stage A (structural pre-checks) and Stage B (reviewer + test_engineer) gates and the reviewer + critic closeout gate are MANDATORY for any change made as part of this process.\n","143d9443a82d","main","e7e0e0cd0150a86494a874e5a9b4f70fdb93256a","skills\u002Fswarm-pr-feedback",2,"https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem","https:\u002F\u002Fgithub.com\u002Fzaxbysauce","2026-11-15 01:44:13",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add zaxbysauce\u002Fzmem --skill swarm-pr-feedback",{"tool":39,"command":40},"bunx","bunx skills add zaxbysauce\u002Fzmem --skill swarm-pr-feedback",{"tool":42,"command":43},"pnpm","pnpm dlx skills add zaxbysauce\u002Fzmem --skill swarm-pr-feedback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-pr-feedback\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fbot-claim-verification.md","REFERENCE","参考文档",3962,"https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-pr-feedback\u002Freferences\u002Fbot-claim-verification.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Foperational-gotchas.md",2788,"https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-pr-feedback\u002Freferences\u002Foperational-gotchas.md",[58,64,69,74,79,86],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M78CEQCEHS30WN0456HFVZZZ","memory","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fhosts\u002Fexpected\u002Fcache\u002Fzcode\u002Fskills\u002Fmemory\u002FSKILL.md",[],[],{"skillNo":65,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M78CEPF4DNY1QASCA42AJ0FF","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fhosts\u002Fexpected\u002Fcache\u002Fcodex\u002Fskills\u002Fmemory\u002FSKILL.md",[],[],{"skillNo":70,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M78CENGZKX5GMJMJS0BRHJZX","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fhosts\u002Fexpected\u002Fcache\u002Fclaude\u002Fskills\u002Fmemory\u002FSKILL.md",[],[],{"skillNo":75,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M78CEMHW23T1R9DACHBWX9PE","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fhosts\u002Fcheckout\u002Fskills\u002Fmemory\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M78CEBF8MGZNEDFY2ABV7GF2","swarm-pr-review","Run a graph-guided, tool-augmented PR review using context packing, parallel exploration, mandatory repository-agnostic risk-family coverage with dispatch scaled to diff size and risk, independent reviewer validation, critic challenge, and metrics writeback. Use for deep pull request review with low false-positive tolerance and high recall in any repository, on any agent harness (structured lane controller, native parallel subagents, or single-context sequential passes).","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-pr-review\u002FSKILL.md",[],[],{"skillNo":87,"name":60,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M78CDGADXPR9WBQ05C10EJSW","ZMem — ZCode multi-tier memory system. Provides cross-session recall, capture, and management of lessons, facts, conventions, and preferences. Use when you need to recall prior knowledge before a non-trivial task, capture a lesson at task end, or manage the memory store. Tier 0 (core.md\u002FAGENTS.md) is auto-injected by the SessionStart hook; this skill operates Tier 2 (semantic store).","https:\u002F\u002Fgithub.com\u002Fzaxbysauce\u002Fzmem\u002Fblob\u002Fmain\u002Fskills\u002Fmemory\u002FSKILL.md",[],[]]