[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E5QTP40FX78N1PHB6Q49Q4":3,"skill-same:01M6E5QTP40FX78N1PHB6Q49Q4":83},{"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":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":13,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":54},"01M6E5QTP40FX78N1PHB6Q49Q4","wave-end",null,"Finalize a wave (review, merge, counters, cleanup) — mechanical only; scoring\u002Fprocess analysis lives in \u002Fwave-retro","parametrization\u002F2real-team-framework","parametrization","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1111097?v=4","01M6E5MC117M94CEXKX3C96PPX","01M6E5MC7YWG5N3VV4792VFK85",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fframework\u002Fassets\u002Fskills\u002Fwave-end\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29],"end","wave end","review","merge","cleanup","analysis","retro","process","only","process analysis","scoring","mechanical","2026-11-10 10:12:30",false,"---\nname: wave-end\ndescription: Finalize a wave (review, merge, counters, cleanup) — mechanical only; scoring\u002Fprocess analysis lives in \u002Fwave-retro\n---\n\nFinalize the current wave. This skill is the **mechanical finalize** surface: merge ready\nPRs, close resolved issues, record the wave's counters, clean up. It does **no** trust\nscoring and no process analysis — that is `\u002Fwave-retro`, which runs immediately after this\nand reads the counters recorded here.\n\n## Instructions\n\n0. Resolve the framework libs. The state file is owned by `lifecycle.py`; resolve it the\n   dual-deploy way — installed location first, framework-source checkout as fallback (so\n   this skill runs both in a deployed repo and in the framework source repo itself):\n\n   ```bash\n   REPO_ROOT=\"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)\"\n   LIB=\"$REPO_ROOT\u002F.claude\u002Flib\"\n   [ -f \"$LIB\u002Flifecycle.py\" ] || LIB=\"$REPO_ROOT\u002Fframework\u002Fassets\u002Flib\"   # framework source repo\n   W=\"$(python3 \"$LIB\u002Flifecycle.py\" state show | python3 -c 'import json,sys; print(json.load(sys.stdin).get(\"current_wave\",\"\").removeprefix(\"wave-\"))')\"\n   echo \"Finalizing wave: $W\"\n   ```\n\n1. List all open PRs targeting the current wave's base branch (the integration branch for\n   a `wave-branch` merge model, the default branch otherwise — `lifecycle.py merge-model\n   get {W}` says which):\n\n   ```bash\n   python3 \"$LIB\u002Flifecycle.py\" merge-model get \"$W\"\n   ```\n2. For each PR:\n   a. Check CI status — do NOT proceed if failing\n   b. Review the diff\n   c. Post review comment (charter format)\n   d. Create tech-debt issues for findings (label: next phase)\n   e. Merge if CI green\n   f. Close referenced issues\n3. **Derive the wave's counters mechanically — never transcribe them from the\n   handoff.** The three counters `\u002Fwave-retro` step 2 reads for drift verification\n   MUST be computed from the merged-PR set and `trust_signals.py extract` — the same\n   authority the retro reconciles against. The session handoff narrates *final\n   verdict state* (a PR amended in place after its fix lands reads \"clean\"); the\n   counters track *round history*. Transcribing the prose is a second source of truth\n   and guarantees drift — it bit twice: Wave 22 recorded `--cr-cycles 1` because the\n   handoff read \"3 PRs \u002F 1 CR cycle\" and called #290 \"2 clean\" (true of its amended\n   final state, false of its round history — #290 carried a real rework round), and\n   `trust_signals.py extract 22` disagreed on sight; Wave 11 produced the analogous\n   rollup slip that motivated the `origin\u002F\u003Cwave>` runbook step (#255).\n\n   Compute all three from the same merged-PR set the retro uses, then pass the derived\n   values to `wrapup` — do not type numbers from memory:\n\n   ```bash\n   # BASE = the wave's PR base — the integration branch for a wave-branch merge model,\n   # the default branch otherwise (same resolution as step 1 \u002F `\u002Fwave-retro` step 1).\n   MM=\"$(python3 \"$LIB\u002Flifecycle.py\" merge-model get \"$W\" 2>\u002Fdev\u002Fnull || echo direct-to-main)\"\n   # wave-branch    → BASE=\u003Cbranch.integration template, the wave's phase + $W>\n   # direct-to-main → BASE=\u003Cdefault branch>; add `--label \"wave-$W\"` to scope the wave\n\n   # REFUSE to derive counters from a read you cannot trust. `extract` fails SILENT\n   # under a GraphQL rate limit (returns `{}`, exit 0), and `gh pr list --json` is\n   # GraphQL-backed too — the SAME 5,000\u002Fhr bucket — so when the budget is pre-exhausted\n   # BOTH come back empty and a naive `${PR_COUNT:-0}` collapses to 0, then the\n   # cross-check compares 0 == 0 and reports health (#307 review). Three ORTHOGONAL\n   # defenses run before any counter is derived or `wave wrapup` is called:\n\n   # (A) Preflight the GraphQL budget over an INDEPENDENT channel. `gh api rate_limit`\n   #     is served over REST — a different bucket that does NOT drain with GraphQL — so\n   #     it stays readable when `gh pr list` \u002F `extract` cannot. If GraphQL is at\u002Fnear\n   #     zero, the wave read WILL return empty-but-successful; abort now, naming the\n   #     limit. `GQL_FLOOR` is a fail-fast margin; (B) and (C) are the hard guarantees.\n   GQL_FLOOR=100\n   GQL_REMAINING=\"$(gh api rate_limit --jq '.resources.graphql.remaining' 2>\u002Fdev\u002Fnull)\"\n   case \"$GQL_REMAINING\" in\n       ''|*[!0-9]*)\n           echo 'ABORT: could not read the GraphQL rate-limit budget (REST rate_limit failed).' >&2\n           echo '  Cannot establish that the wave read will succeed — refusing to record counters.' >&2\n           exit 1 ;;\n   esac\n   if [ \"$GQL_REMAINING\" -lt \"$GQL_FLOOR\" ]; then\n       echo \"ABORT: GraphQL budget near-exhausted ($GQL_REMAINING \u003C $GQL_FLOOR).\" >&2\n       echo '  gh pr list and trust_signals extract both draw on this bucket and would' >&2\n       echo '  return empty-but-successful, recording FALSE zero counters. Wait for reset —' >&2\n       echo '  gh api rate_limit --jq .resources.graphql — then re-run step 3 from the top.' >&2\n       exit 1\n   fi\n\n   # (B) --pr-count is identity-AGNOSTIC (a count of PRs, not authors, so `gh`'s single\n   #     dogfood `.author.login` is fine here) — but its READ can still fail. Capture the\n   #     exit status EXPLICITLY: a failed `gh pr list` must not collapse into '' and then\n   #     0 via `${VAR:-0}`. A non-zero exit, or non-numeric stdout, is an ABORT, not a\n   #     zero. (This is what the pre-exhausted case trips — `gh pr list` exits non-zero.)\n   PR_LIST=\"$(gh pr list --state merged --base \"$BASE\" --json number)\"; PR_LIST_RC=$?\n   PR_COUNT=\"$(printf '%s' \"$PR_LIST\" | jq 'length' 2>\u002Fdev\u002Fnull)\"\n   if [ \"$PR_LIST_RC\" -ne 0 ] || ! printf '%s' \"$PR_COUNT\" | grep -Eq '^[0-9]+$'; then\n       echo \"ABORT: gh pr list failed (exit $PR_LIST_RC) or returned a non-numeric count.\" >&2\n       echo '  A failed read is NOT an empty wave — refusing to record zero counters.' >&2\n       exit 1\n   fi\n\n   # --cr-cycles and --concentration are BOTH identity-SENSITIVE, so both derive from\n   # `trust_signals.py extract` — the only source that resolves team-member identity (it\n   # parses the `Co-Authored-By` trailers); grouping `gh`'s `.author.login` would collapse\n   # a dogfooded repo to ~100% concentration forever (#307). Extract ONCE — a second call\n   # could straddle a rate-limit boundary and return different data:\n   SIG=\"$(python3 \"$LIB\u002Ftrust_signals.py\" extract \"$W\")\"\n\n   # (C) Cross-check `extract` against the now-TRUSTED PR_COUNT (reads (A)+(B) confirmed\n   #     succeeded). `extract` still fails SILENT (`{}`, exit 0) — the #300 follow-up; the\n   #     library-level fix is #311 on the trust_signals surface, not touched here. An\n   #     empty map — or ANY disagreement, which also catches a PARTIAL read — for a wave\n   #     that merged PRs is an ABORT, never a zero. A genuinely empty wave reaches here\n   #     only after the reads SUCCEEDED, so PR_COUNT == 0 is then a real zero and proceeds:\n   SIG_ENGINEERS=\"$(printf '%s' \"$SIG\" | jq 'length' 2>\u002Fdev\u002Fnull || echo 0)\"\n   SIG_PR_TOTAL=\"$(printf '%s' \"$SIG\" | jq '[.[].authored_prs | length] | add \u002F\u002F 0' 2>\u002Fdev\u002Fnull || echo 0)\"\n   if [ \"$PR_COUNT\" -gt 0 ] && { [ \"${SIG_ENGINEERS:-0}\" -eq 0 ] || [ \"${SIG_PR_TOTAL:-0}\" -ne \"$PR_COUNT\" ]; }; then\n       echo \"ABORT: trust_signals extract could not be trusted for wave $W\" >&2\n       echo \"  gh pr list count = $PR_COUNT, but extract shows $SIG_ENGINEERS engineer(s)\" >&2\n       echo \"  covering $SIG_PR_TOTAL authored PR(s). An empty\u002Fshort extract for a wave that\" >&2\n       echo \"  merged PRs means the READ FAILED (usually a GraphQL rate limit), NOT that no\" >&2\n       echo \"  rework happened. Do NOT run 'wave wrapup' with these numbers. Wait for reset\" >&2\n       echo \"  and re-run step 3 from the top.\" >&2\n       exit 1\n   fi\n\n   # --cr-cycles = PRs that took >=1 changes-requested round. `trust_signals.py`\n   # increments an author's `rework_cycles` exactly ONCE per PR that carried a rework\n   # round, and the extraction is edit-history-aware (the #164 catch ledger \u002F #229\n   # comment histories), so an in-place verdict amendment does NOT erase the round.\n   # Summing `rework_cycles` across engineers therefore counts reworked PRs per-PR,\n   # not per-verdict (a PR with `reviewers_required=2` can carry two ChangesRequested\n   # verdicts in one round — still one reworked PR). This is the SAME extraction\n   # `\u002Fwave-retro` steps 2-3 run, so the wrapup counter and the retro recompute can\n   # never diverge:\n   CR_CYCLES=\"$(echo \"$SIG\" | jq '[.[].rework_cycles] | add \u002F\u002F 0')\"\n\n   # --concentration = max(PRs by one author) × 100 \u002F total, over the SAME identity-aware\n   # `authored_prs` lists `\u002Fwave-retro` step 2 reconciles against (integer floor; guard\n   # total == 0):\n   CONCENTRATION=\"$(echo \"$SIG\" | jq '\n       [ .[].authored_prs | length ] as $lens\n       | ($lens | add) as $total\n       | if ($total \u002F\u002F 0) == 0 then 0 else (($lens | max) * 100 \u002F $total | floor) end')\"\n\n   echo \"derived counters → --pr-count $PR_COUNT --cr-cycles $CR_CYCLES --concentration $CONCENTRATION\"\n   ```\n\n   For a `meta-and-children` project, `trust_signals.py extract` already sweeps every\n   repo in `project.repos` internally, so `--cr-cycles` \u002F `--concentration` need no\n   manual sweep; union the per-repo `gh pr list` results yourself only for `--pr-count`.\n\n   Then record the counters and close the wave **live** — the `wrapup` transition\n   writes `wave_{W}_completed_at`, deactivates the wave, advances `last_completed_wave`,\n   and stores the three counters `\u002Fwave-retro` reads for drift verification:\n\n   ```bash\n   python3 \"$LIB\u002Flifecycle.py\" wave wrapup \"$W\" \\\n       --pr-count \"$PR_COUNT\" --cr-cycles \"$CR_CYCLES\" --concentration \"$CONCENTRATION\"\n   ```\n\n   **The recomputed-vs-claimed reconciliation is bidirectional.** `\u002Fwave-retro` step 2\n   independently recomputes these counters; deriving them mechanically here makes the\n   two agree by construction, but state both directions so the reconciliation is\n   unambiguous whenever they differ:\n   - **recomputed `\u003C` claimed AND the gap is fully explained by edited-in-place\n     verdicts** → the **claimed value stands**. A naive recompute from *current*\n     comment bodies under-counts a ChangesRequested verdict that was amended in place\n     to Approved after the fix landed — the historic round still happened, so the\n     wrapup-time count is authoritative-historic. Record a\n     `wave_{W}_counter_corrections` entry documenting the measurement conflict; do NOT\n     correct the historic count downward. (Deriving `--cr-cycles` from the\n     history-aware `extract` above avoids this under-count in the first place.)\n   - **recomputed `>` claimed** → **recomputed wins** — the wrapup missed a real round.\n     This was Wave 22 (claimed 1, recomputed 2: `extract` found `rework_cycles=1` on\n     both #290 and #292). Because this step now derives `--cr-cycles` from that same\n     `extract`, this direction should not resurface at retro time again.\n\n   **Emit review-load next to concentration** (#231): concentration tracks *authoring*\n   load; the companion number is *reviewing* load — per-reviewer verdict counts, so a\n   lopsided slate (one reviewer carrying most verdicts) is a tracked number rather than\n   something you balance by eye. Compute it with the skill's bundled `review_load.py`,\n   resolved the same dual-deploy way as `$LIB` (installed copy first, framework-source\n   fallback), and record the line alongside the counters — `\u002Fwave-retro` reads it into the\n   feedback log's review-load note:\n\n   ```bash\n   RL=\"$REPO_ROOT\u002F.claude\u002Fskills\u002Fwave-end\u002Freview_load.py\"\n   [ -f \"$RL\" ] || RL=\"$REPO_ROOT\u002Fframework\u002Fassets\u002Fskills\u002Fwave-end\u002Freview_load.py\"\n   python3 \"$RL\" counts \"$W\"   # {reviewer: {verdicts, prs_reviewed}}, roster-canonicalized\n   ```\n\n   A \"verdict\" is one review turn by its `Requestor:` (both `Request` and the\n   amended-in-place `Replied` count once — the amendment convention edits the comment in\n   place, so it never inflates the count; see [pull-requests.md](..\u002F..\u002Fteam\u002Fcharter\u002Fpull-requests.md)).\n4. Run `git worktree prune`\n5. Scan docs\u002F and diagrams for staleness against changes\n6. If this is the final wave of the phase, create a PR to the default branch (User\n   approval gate applies — never merge without sign-off). When that rollup is landed,\n   follow the **rollup pre-flight** in\n   [pull-requests.md](..\u002F..\u002Fteam\u002Fcharter\u002Fpull-requests.md): `git fetch origin` and merge\n   `origin\u002F\u003Cwave>` **explicitly** (never a stale local ref), then verify feature-code is on\n   the merge parent (`git show \u003Cdefault-branch>:\u003Cfile> | grep -c \u003Cnew-symbol>`) BEFORE\n   bump\u002Frelease — a code-less rollup (state.json only) is a stop-and-investigate.\n7. Hand off to `\u002Fwave-retro` — trust deltas, the forced negative-signal pass, the\n   feedback-log entry, process proposals, and the next-wave stub all live there, not here.\n\n## Division of labor\n\n| Surface | Job |\n|---------|-----|\n| `\u002Fwave-end` (this) | Mechanical finalize: review, merge, close issues, record counters, cleanup |\n| `\u002Fwave-retro` | Scoring\u002Fprocess: drift verification, trust deltas, feedback log, proposals, next-wave stub |\n| `\u002Fretro` | Lightweight mid-wave pulse (diagnostic only) |\n","Finalize the current wave. This skill is the **mechanical finalize** surface: merge ready\nPRs, close resolved issues, record the wave's counters, clean up. It does **no** trust\nscoring and no process analysis — that is `\u002Fwave-retro`, which runs immediately after this\nand reads the counters recorded here.\n\n## Instructions\n\n0. Resolve the framework libs. The state file is owned by `lifecycle.py`; resolve it the\n   dual-deploy way — installed location first, framework-source checkout as fallback (so\n   this skill runs both in a deployed repo and in the framework source repo itself):\n\n   ```bash\n   REPO_ROOT=\"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)\"\n   LIB=\"$REPO_ROOT\u002F.claude\u002Flib\"\n   [ -f \"$LIB\u002Flifecycle.py\" ] || LIB=\"$REPO_ROOT\u002Fframework\u002Fassets\u002Flib\"   # framework source repo\n   W=\"$(python3 \"$LIB\u002Flifecycle.py\" state show | python3 -c 'import json,sys; print(json.load(sys.stdin).get(\"current_wave\",\"\").removeprefix(\"wave-\"))')\"\n   echo \"Finalizing wave: $W\"\n   ```\n\n1. List all open PRs targeting the current wave's base branch (the integration branch for\n   a `wave-branch` merge model, the default branch otherwise — `lifecycle.py merge-model\n   get {W}` says which):\n\n   ```bash\n   python3 \"$LIB\u002Flifecycle.py\" merge-model get \"$W\"\n   ```\n2. For each PR:\n   a. Check CI status — do NOT proceed if failing\n   b. Review the diff\n   c. Post review comment (charter format)\n   d. Create tech-debt issues for findings (label: next phase)\n   e. Merge if CI green\n   f. Close referenced issues\n3. **Derive the wave's counters mechanically — never transcribe them from the\n   handoff.** The three counters `\u002Fwave-retro` step 2 reads for drift verification\n   MUST be computed from the merged-PR set and `trust_signals.py extract` — the same\n   authority the retro reconciles against. The session handoff narrates *final\n   verdict state* (a PR amended in place after its fix lands reads \"clean\"); the\n   counters track *round history*. Transcribing the prose is a second source of truth\n   and guarantees drift — it bit twice: Wave 22 recorded `--cr-cycles 1` because the\n   handoff read \"3 PRs \u002F 1 CR cycle\" and called #290 \"2 clean\" (true of its amended\n   final state, false of its round history — #290 carried a real rework round), and\n   `trust_signals.py extract 22` disagreed on sight; Wave 11 produced the analogous\n   rollup slip that motivated the `origin\u002F\u003Cwave>` runbook step (#255).\n\n   Compute all three from the same merged-PR set the retro uses, then pass the derived\n   values to `wrapup` — do not type numbers from memory:\n\n   ```bash\n   # BASE = the wave's PR base — the integration branch for a wave-branch merge model,\n   # the default branch otherwise (same resolution as step 1 \u002F `\u002Fwave-retro` step 1).\n   MM=\"$(python3 \"$LIB\u002Flifecycle.py\" merge-model get \"$W\" 2>\u002Fdev\u002Fnull || echo direct-to-main)\"\n   # wave-branch    → BASE=\u003Cbranch.integration template, the wave's phase + $W>\n   # direct-to-main → BASE=\u003Cdefault branch>; add `--label \"wave-$W\"` to scope the wave\n\n   # REFUSE to derive counters from a read you cannot trust. `extract` fails SILENT\n   # under a GraphQL rate limit (returns `{}`, exit 0), and `gh pr list --json` is\n   # GraphQL-backed too — the SAME 5,000\u002Fhr bucket — so when the budget is pre-exhausted\n   # BOTH come back empty and a naive `${PR_COUNT:-0}` collapses to 0, then the\n   # cross-check compares 0 == 0 and reports health (#307 review). Three ORTHOGONAL\n   # defenses run before any counter is derived or `wave wrapup` is called:\n\n   # (A) Preflight the GraphQL budget over an INDEPENDENT channel. `gh api rate_limit`\n   #     is served over REST — a different bucket that does NOT drain with GraphQL — so\n   #     it stays readable when `gh pr list` \u002F `extract` cannot. If GraphQL is at\u002Fnear\n   #     zero, the wave read WILL return empty-but-successful; abort now, naming the\n   #     limit. `GQL_FLOOR` is a fail-fast margin; (B) and (C) are the hard guarantees.\n   GQL_FLOOR=100\n   GQL_REMAINING=\"$(gh api rate_limit --jq '.resources.graphql.remaining' 2>\u002Fdev\u002Fnull)\"\n   case \"$GQL_REMAINING\" in\n       ''|*[!0-9]*)\n           echo 'ABORT: could not read the GraphQL rate-limit budget (REST rate_limit failed).' >&2\n           echo '  Cannot establish that the wave read will succeed — refusing to record counters.' >&2\n           exit 1 ;;\n   esac\n   if [ \"$GQL_REMAINING\" -lt \"$GQL_FLOOR\" ]; then\n       echo \"ABORT: GraphQL budget near-exhausted ($GQL_REMAINING \u003C $GQL_FLOOR).\" >&2\n       echo '  gh pr list and trust_signals extract both draw on this bucket and would' >&2\n       echo '  return empty-but-successful, recording FALSE zero counters. Wait for reset —' >&2\n       echo '  gh api rate_limit --jq .resources.graphql — then re-run step 3 from the top.' >&2\n       exit 1\n   fi\n\n   # (B) --pr-count is identity-AGNOSTIC (a count of PRs, not authors, so `gh`'s single\n   #     dogfood `.author.login` is fine here) — but its READ can still fail. Capture the\n   #     exit status EXPLICITLY: a failed `gh pr list` must not collapse into '' and then\n   #     0 via `${VAR:-0}`. A non-zero exit, or non-numeric stdout, is an ABORT, not a\n   #     zero. (This is what the pre-exhausted case trips — `gh pr list` exits non-zero.)\n   PR_LIST=\"$(gh pr list --state merged --base \"$BASE\" --json number)\"; PR_LIST_RC=$?\n   PR_COUNT=\"$(printf '%s' \"$PR_LIST\" | jq 'length' 2>\u002Fdev\u002Fnull)\"\n   if [ \"$PR_LIST_RC\" -ne 0 ] || ! printf '%s' \"$PR_COUNT\" | grep -Eq '^[0-9]+$'; then\n       echo \"ABORT: gh pr list failed (exit $PR_LIST_RC) or returned a non-numeric count.\" >&2\n       echo '  A failed read is NOT an empty wave — refusing to record zero counters.' >&2\n       exit 1\n   fi\n\n   # --cr-cycles and --concentration are BOTH identity-SENSITIVE, so both derive from\n   # `trust_signals.py extract` — the only source that resolves team-member identity (it\n   # parses the `Co-Authored-By` trailers); grouping `gh`'s `.author.login` would collapse\n   # a dogfooded repo to ~100% concentration forever (#307). Extract ONCE — a second call\n   # could straddle a rate-limit boundary and return different data:\n   SIG=\"$(python3 \"$LIB\u002Ftrust_signals.py\" extract \"$W\")\"\n\n   # (C) Cross-check `extract` against the now-TRUSTED PR_COUNT (reads (A)+(B) confirmed\n   #     succeeded). `extract` still fails SILENT (`{}`, exit 0) — the #300 follow-up; the\n   #     library-level fix is #311 on the trust_signals surface, not touched here. An\n   #     empty map — or ANY disagreement, which also catches a PARTIAL read — for a wave\n   #     that merged PRs is an ABORT, never a zero. A genuinely empty wave reaches here\n   #     only after the reads SUCCEEDED, so PR_COUNT == 0 is then a real zero and proceeds:\n   SIG_ENGINEERS=\"$(printf '%s' \"$SIG\" | jq 'length' 2>\u002Fdev\u002Fnull || echo 0)\"\n   SIG_PR_TOTAL=\"$(printf '%s' \"$SIG\" | jq '[.[].authored_prs | length] | add \u002F\u002F 0' 2>\u002Fdev\u002Fnull || echo 0)\"\n   if [ \"$PR_COUNT\" -gt 0 ] && { [ \"${SIG_ENGINEERS:-0}\" -eq 0 ] || [ \"${SIG_PR_TOTAL:-0}\" -ne \"$PR_COUNT\" ]; }; then\n       echo \"ABORT: trust_signals extract could not be trusted for wave $W\" >&2\n       echo \"  gh pr list count = $PR_COUNT, but extract shows $SIG_ENGINEERS engineer(s)\" >&2\n       echo \"  covering $SIG_PR_TOTAL authored PR(s). An empty\u002Fshort extract for a wave that\" >&2\n       echo \"  merged PRs means the READ FAILED (usually a GraphQL rate limit), NOT that no\" >&2\n       echo \"  rework happened. Do NOT run 'wave wrapup' with these numbers. Wait for reset\" >&2\n       echo \"  and re-run step 3 from the top.\" >&2\n       exit 1\n   fi\n\n   # --cr-cycles = PRs that took >=1 changes-requested round. `trust_signals.py`\n   # increments an author's `rework_cycles` exactly ONCE per PR that carried a rework\n   # round, and the extraction is edit-history-aware (the #164 catch ledger \u002F #229\n   # comment histories), so an in-place verdict amendment does NOT erase the round.\n   # Summing `rework_cycles` across engineers therefore counts reworked PRs per-PR,\n   # not per-verdict (a PR with `reviewers_required=2` can carry two ChangesRequested\n   # verdicts in one round — still one reworked PR). This is the SAME extraction\n   # `\u002Fwave-retro` steps 2-3 run, so the wrapup counter and the retro recompute can\n   # never diverge:\n   CR_CYCLES=\"$(echo \"$SIG\" | jq '[.[].rework_cycles] | add \u002F\u002F 0')\"\n\n   # --concentration = max(PRs by one author) × 100 \u002F total, over the SAME identity-aware\n   # `authored_prs` lists `\u002Fwave-retro` step 2 reconciles against (integer floor; guard\n   # total == 0):\n   CONCENTRATION=\"$(echo \"$SIG\" | jq '\n       [ .[].authored_prs | length ] as $lens\n       | ($lens | add) as $total\n       | if ($total \u002F\u002F 0) == 0 then 0 else (($lens | max) * 100 \u002F $total | floor) end')\"\n\n   echo \"derived counters → --pr-count $PR_COUNT --cr-cycles $CR_CYCLES --concentration $CONCENTRATION\"\n   ```\n\n   For a `meta-and-children` project, `trust_signals.py extract` already sweeps every\n   repo in `project.repos` internally, so `--cr-cycles` \u002F `--concentration` need no\n   manual sweep; union the per-repo `gh pr list` results yourself only for `--pr-count`.\n\n   Then record the counters and close the wave **live** — the `wrapup` transition\n   writes `wave_{W}_completed_at`, deactivates the wave, advances `last_completed_wave`,\n   and stores the three counters `\u002Fwave-retro` reads for drift verification:\n\n   ```bash\n   python3 \"$LIB\u002Flifecycle.py\" wave wrapup \"$W\" \\\n       --pr-count \"$PR_COUNT\" --cr-cycles \"$CR_CYCLES\" --concentration \"$CONCENTRATION\"\n   ```\n\n   **The recomputed-vs-claimed reconciliation is bidirectional.** `\u002Fwave-retro` step 2\n   independently recomputes these counters; deriving them mechanically here makes the\n   two agree by construction, but state both directions so the reconciliation is\n   unambiguous whenever they differ:\n   - **recomputed `\u003C` claimed AND the gap is fully explained by edited-in-place\n     verdicts** → the **claimed value stands**. A naive recompute from *current*\n     comment bodies under-counts a ChangesRequested verdict that was amended in place\n     to Approved after the fix landed — the historic round still happened, so the\n     wrapup-time count is authoritative-historic. Record a\n     `wave_{W}_counter_corrections` entry documenting the measurement conflict; do NOT\n     correct the historic count downward. (Deriving `--cr-cycles` from the\n     history-aware `extract` above avoids this under-count in the first place.)\n   - **recomputed `>` claimed** → **recomputed wins** — the wrapup missed a real round.\n     This was Wave 22 (claimed 1, recomputed 2: `extract` found `rework_cycles=1` on\n     both #290 and #292). Because this step now derives `--cr-cycles` from that same\n     `extract`, this direction should not resurface at retro time again.\n\n   **Emit review-load next to concentration** (#231): concentration tracks *authoring*\n   load; the companion number is *reviewing* load — per-reviewer verdict counts, so a\n   lopsided slate (one reviewer carrying most verdicts) is a tracked number rather than\n   something you balance by eye. Compute it with the skill's bundled `review_load.py`,\n   resolved the same dual-deploy way as `$LIB` (installed copy first, framework-source\n   fallback), and record the line alongside the counters — `\u002Fwave-retro` reads it into the\n   feedback log's review-load note:\n\n   ```bash\n   RL=\"$REPO_ROOT\u002F.claude\u002Fskills\u002Fwave-end\u002Freview_load.py\"\n   [ -f \"$RL\" ] || RL=\"$REPO_ROOT\u002Fframework\u002Fassets\u002Fskills\u002Fwave-end\u002Freview_load.py\"\n   python3 \"$RL\" counts \"$W\"   # {reviewer: {verdicts, prs_reviewed}}, roster-canonicalized\n   ```\n\n   A \"verdict\" is one review turn by its `Requestor:` (both `Request` and the\n   amended-in-place `Replied` count once — the amendment convention edits the comment in\n   place, so it never inflates the count; see [pull-requests.md](..\u002F..\u002Fteam\u002Fcharter\u002Fpull-requests.md)).\n4. Run `git worktree prune`\n5. Scan docs\u002F and diagrams for staleness against changes\n6. If this is the final wave of the phase, create a PR to the default branch (User\n   approval gate applies — never merge without sign-off). When that rollup is landed,\n   follow the **rollup pre-flight** in\n   [pull-requests.md](..\u002F..\u002Fteam\u002Fcharter\u002Fpull-requests.md): `git fetch origin` and merge\n   `origin\u002F\u003Cwave>` **explicitly** (never a stale local ref), then verify feature-code is on\n   the merge parent (`git show \u003Cdefault-branch>:\u003Cfile> | grep -c \u003Cnew-symbol>`) BEFORE\n   bump\u002Frelease — a code-less rollup (state.json only) is a stop-and-investigate.\n7. Hand off to `\u002Fwave-retro` — trust deltas, the forced negative-signal pass, the\n   feedback-log entry, process proposals, and the next-wave stub all live there, not here.\n\n## Division of labor\n\n| Surface | Job |\n|---------|-----|\n| `\u002Fwave-end` (this) | Mechanical finalize: review, merge, close issues, record counters, cleanup |\n| `\u002Fwave-retro` | Scoring\u002Fprocess: drift verification, trust deltas, feedback log, proposals, next-wave stub |\n| `\u002Fretro` | Lightweight mid-wave pulse (diagnostic only) |\n",{"name":5,"description":7},"main","53ec1032b93d41533a48603e8fae7a92f56cc66c","framework\u002Fassets\u002Fskills\u002Fwave-end","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework","https:\u002F\u002Fgithub.com\u002Fparametrization","2026-09-21 01:06:30",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add parametrization\u002F2real-team-framework --skill wave-end",{"tool":47,"command":48},"bunx","bunx skills add parametrization\u002F2real-team-framework --skill wave-end",{"tool":50,"command":51},"pnpm","pnpm dlx skills add parametrization\u002F2real-team-framework --skill wave-end","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fframework\u002Fassets\u002Fskills\u002Fwave-end\u002FSKILL.md",true,[55,61,67,71,75,79],{"path":56,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fnote.md","REFERENCE","参考文档",680,"https:\u002F\u002Fgithub.com\u002Fhaxorize\u002Fskills\u002Fblob\u002Fmain\u002Fscripts\u002Flint-fixtures-clean\u002Fsrc\u002Fclean-skill\u002Freferences\u002Fnote.md",{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"review_load.py","SCRIPT","脚本",8390,"https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fframework\u002Fassets\u002Fskills\u002Fwave-end\u002Freview_load.py",{"path":68,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":69,"sourceHtmlUrl":70},"scripts\u002FNOTES.txt",344,"https:\u002F\u002Fgithub.com\u002Fhaxorize\u002Fskills\u002Fblob\u002Fmain\u002Fscripts\u002Flint-fixtures-clean\u002Fsrc\u002Fclean-skill\u002Fscripts\u002FNOTES.txt",{"path":72,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":73,"sourceHtmlUrl":74},"scripts\u002Fpaired-bundled-fixtures\u002Finput.py",351,"https:\u002F\u002Fgithub.com\u002Fhaxorize\u002Fskills\u002Fblob\u002Fmain\u002Fscripts\u002Flint-fixtures-clean\u002Fsrc\u002Fclean-skill\u002Fscripts\u002Fpaired-bundled-fixtures\u002Finput.py",{"path":76,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":77,"sourceHtmlUrl":78},"scripts\u002Fpaired-bundled-selftest.sh",135,"https:\u002F\u002Fgithub.com\u002Fhaxorize\u002Fskills\u002Fblob\u002Fmain\u002Fscripts\u002Flint-fixtures-clean\u002Fsrc\u002Fclean-skill\u002Fscripts\u002Fpaired-bundled-selftest.sh",{"path":80,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Fpaired-bundled.py",317,"https:\u002F\u002Fgithub.com\u002Fhaxorize\u002Fskills\u002Fblob\u002Fmain\u002Fscripts\u002Flint-fixtures-clean\u002Fsrc\u002Fclean-skill\u002Fscripts\u002Fpaired-bundled.py",[84,102,119,135,149,162],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":30},"01M6E5VG1R7FF1025BZAV6BDTS","wave-wrapup","Finalize a wave — PR review, merge sequencing, issue cleanup, worktree cleanup, and handoff to retro","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-wrapup\u002FSKILL.md",[],[91,92,20,93,21,94,95,22,96,24,97,98,99,100,101],"wave wrapup","wrapup","handoff","pr review","pr","worktree","team","issue","worktree cleanup","name","sequencing",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":30},"01M6E5V9GDF75GV4YD2WPSH912","wave-start","Initialize a new wave — worktree cleanup, branch creation, label setup, status file update","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-start\u002FSKILL.md",[],[109,110,111,22,112,96,113,97,114,115,116,99,117,100,118],"wave start","start","setup","update","file","branch","file update","initialize","creation","status",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":30},"01M6E5V4VXEJ39V87VHN1A3AW9","wave-scope","Reconcile declared-vs-labeled wave scope between \u002Fwave-retro and \u002Fwave-kickoff — collect dispositions, fold in retro carry-forwards and memory must-includes, and refresh the meta-issue","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-scope\u002FSKILL.md",[],[126,127,128,129,130,24,131,132,133,98,134],"wave scope","scope","memory","collect","Meta","refresh","reconcile","Fold","kickoff",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":30},"01M6E5TZNPGG5EXZEN1FKJJT6K","wave-retro","Automated wave retrospective — PR analysis, assessments, trust matrix updates, feedback log, charter change proposals","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-retro\u002FSKILL.md",[],[142,24,143,144,95,145,23,97,146,147,148,100],"wave retro","log","change","retrospective","feedback","proposals","trust",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":30},"01M6E5TR8XB3Z10A9SD4ZYNV45","wave-kickoff","Automated wave planning — branch creation, label management, issue labeling, kickoff comments, and execution plan","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-kickoff\u002FSKILL.md",[],[156,134,157,98,117,100,158,97,159,114,160,161],"wave kickoff","management","plan","execution","planning","execution plan",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":30},"01M6E5TMZAFB6MTVYT750FZDVY","wave-audit","Audit open issues against merged PRs — find and close orphaned issues with proper comments","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-audit\u002FSKILL.md",[],[169,170,171,172,173,174],"audit","wave audit","close","find","open","issues"]