From cd3a745857a1bfc60f1c121a733723c185176518 Mon Sep 17 00:00:00 2001 From: bastien Date: Tue, 29 Sep 2026 15:09:45 +0200 Subject: [PATCH] fix(effort): resync re-applies the pins after the 21st pack refresh, order locked The 21st pack refresh (update-all 7.4) rewrites every 21st-* SKILL.md after the superpowers refresh; the re-apply now sits after it, the census locks the order in both scripts. Contract: criterion 3 anchor, shellcheck directive authorized, tracked design-motion-principles copy gated. --- .../contracts/2026-09-29-effort-round-1315.md | 6 ++++-- lib/tests/effort-routing.test.sh | 7 +++++++ update-all.sh | 17 +++++++++-------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.claude/tasks/contracts/2026-09-29-effort-round-1315.md b/.claude/tasks/contracts/2026-09-29-effort-round-1315.md index 32fc68f..11b337a 100644 --- a/.claude/tasks/contracts/2026-09-29-effort-round-1315.md +++ b/.claude/tasks/contracts/2026-09-29-effort-round-1315.md @@ -11,6 +11,7 @@ - Round result: 30 existing entry levels hold against the table; 3 repo skills had none (skills-perso low, pdf-translate medium, site-motion high); vendored externals get theirs from `lib/effort-pins.txt` re-applied by `lib/effort-pins.sh`; impeccable, graphify, find-docs, gstack, darwin-skill and the five shifters stay unpinned (machine-owned, BDR-107). - Defect found in passing, fixed here: `update-all.sh` re-fetched the vendored skills but never re-applied the pins (lost until the next `make plugin`). - Defect found in passing, surfaced not fixed: ~94 % of sub-agent usage records carry no `output_tokens_details`, so `lib/effort-audit.py` read zero thinking on sub-agents; the script now prints coverage and a CAVEAT; EVAL-037's "executors stay cheap" is a measurement gap (registry correction pending user approval). +- lib/tests/effort-routing.test.sh line 4 widens its shellcheck directive from SC2015 to SC2015,SC2016: the new `has … '$REPO'` locks are literal source text, the `$REPO` must NOT expand (authorized; a test file, informational). [verifier 2026-09-29 gap 3] - Frontmatter placement of the inserted `effort:` line (after `name:`, else before the closing `---`) has no harness effect; locked by the fixture suite only. ## ACCEPTANCE CRITERIA @@ -22,8 +23,8 @@ CHECK: out=$(make test suite=lib/tests/effort-routing.test.sh 2>&1); echo "$out" | grep -q 'census: [0-9]* pass, 0 fail' || { echo "$out" | grep FAIL; exit 1; }; for k in skills-perso pdf-translate site-motion effort-pins.txt 'stack_levels' 'apply_effort_pins'; do grep -q "$k" lib/tests/effort-routing.test.sh || { echo "census lacks $k"; exit 1; }; done; echo CENSUS_GREEN EXPECT: CENSUS_GREEN EVIDENCE: MET exit=0 marker-found :: CENSUS_GREEN -3. Re-apply wired after the LAST vendoring step of both scripts, hardcoded loop gone: in install-plugins.sh the call follows the 21st pack staging block; in update-all.sh it follows the superpowers refresh. - CHECK: a=$(grep -n 'apply_effort_pins "$REPO"' install-plugins.sh | cut -d: -f1); b=$(grep -n 'rm -rf "$TFD_STAGE"' install-plugins.sh | tail -1 | cut -d: -f1); c=$(grep -n 'apply_effort_pins "$REPO"' update-all.sh | cut -d: -f1); d=$(grep -n 'vendor_pinned_skills superpowers refresh' update-all.sh | cut -d: -f1); [ "$(echo "$a" | wc -l)" -eq 1 ] && [ "$a" -gt "$b" ] && [ "$(echo "$c" | wc -l)" -eq 1 ] && [ "$c" -gt "$d" ] && ! grep -q 'for _s in brainstorming writing-plans' install-plugins.sh && bash -n install-plugins.sh && bash -n update-all.sh && echo RESYNC_OK +3. Re-apply wired after the LAST vendoring step of both scripts, hardcoded loop gone: in install-plugins.sh the call follows the 21st pack staging block; in update-all.sh it follows the 21st pack refresh (§7.4, the last step that rewrites a SKILL.md), which itself follows the superpowers refresh. [verifier 2026-09-29: the first placement sat after the superpowers refresh only, the 21st refresh ran later and dropped seven pins] + CHECK: a=$(grep -n 'apply_effort_pins "$REPO"' install-plugins.sh | cut -d: -f1); b=$(grep -n 'rm -rf "$TFD_STAGE"' install-plugins.sh | tail -1 | cut -d: -f1); c=$(grep -n 'apply_effort_pins "$REPO"' update-all.sh | cut -d: -f1); d=$(grep -n 'skills-external/$_tfd_name' update-all.sh | tail -1 | cut -d: -f1); e=$(grep -n 'vendor_pinned_skills superpowers refresh' update-all.sh | cut -d: -f1); [ "$(echo "$a" | wc -l)" -eq 1 ] && [ "$a" -gt "$b" ] && [ "$(echo "$c" | wc -l)" -eq 1 ] && [ -n "$d" ] && [ "$c" -gt "$d" ] && [ "$c" -gt "$e" ] && ! grep -q 'for _s in brainstorming writing-plans' install-plugins.sh && bash -n install-plugins.sh && bash -n update-all.sh && echo RESYNC_OK EXPECT: RESYNC_OK EVIDENCE: MET exit=0 marker-found :: RESYNC_OK 4. Live tree: every map entry whose skill is vendored on this machine carries that level in its frontmatter (idempotent re-run applies 0). @@ -49,3 +50,4 @@ - skills/skills-perso/SKILL.md, skills/pdf-translate/SKILL.md, skills/site-motion/SKILL.md (effort line) - lib/effort-shift.md, CLAUDE.global.md (doctrine), README.md, USAGE.md, CHANGELOG.md - .claude/tasks/TODO.md, .claude/tasks/contracts/ (this file) +- skills-external/design-motion-principles/SKILL.md [gated 2026-09-29] — the only vendored external tracked in git; its copy carries the `effort: high` line the resync re-applies (user choice: gate, not untrack) diff --git a/lib/tests/effort-routing.test.sh b/lib/tests/effort-routing.test.sh index 378df7b..e6edeed 100755 --- a/lib/tests/effort-routing.test.sh +++ b/lib/tests/effort-routing.test.sh @@ -63,6 +63,13 @@ done < "$R/lib/effort-pins.txt" has "lib/effort-pins.txt" 'brainstorming xhigh'; has "lib/effort-pins.txt" 'writing-plans xhigh' has "install-plugins.sh" 'apply_effort_pins "$REPO"'; has "update-all.sh" 'apply_effort_pins "$REPO"' lacks "install-plugins.sh" 'for _s in brainstorming writing-plans; do' +ln_last() { grep -n "$2" "$R/$1" | tail -1 | cut -d: -f1; } +[ "$(ln_last install-plugins.sh 'apply_effort_pins "$REPO"')" -gt "$(ln_last install-plugins.sh 'rm -rf "$TFD_STAGE"')" ] \ + && ok || ko "install-plugins.sh: effort pins must be re-applied after the 21st pack refresh" +pins_ln=$(ln_last update-all.sh 'apply_effort_pins "$REPO"') +[ "$pins_ln" -gt "$(ln_last update-all.sh 'skills-external/$_tfd_name')" ] \ + && [ "$pins_ln" -gt "$(ln_last update-all.sh 'vendor_pinned_skills superpowers refresh')" ] \ + && ok || ko "update-all.sh: effort pins must be re-applied after the last vendoring step (21st pack)" [ -x "$R/lib/effort-pins.sh" ] && ok || ko "lib/effort-pins.sh missing or not executable" # 9b) design stack = ONE level (last loaded wins); site-motion (repo skill) pins the same one stack_levels() { awk '/^# design stack/{f=1;next} f&&/^#$/{f=0} f&&!/^#/&&NF==2{print $2}' "$R/lib/effort-pins.txt" | sort -u; } diff --git a/update-all.sh b/update-all.sh index c9c6c38..0537837 100644 --- a/update-all.sh +++ b/update-all.sh @@ -393,14 +393,6 @@ echo "" echo "── Updating superpowers skills (obra/superpowers)..." vendor_pinned_skills superpowers refresh -# Effort pins (BDR-107, BDR-108): every refresh above rewrites SKILL.md and -# drops the `effort:` line; put the entry levels of lib/effort-pins.txt back. -echo "" -echo "── Re-applying effort pins on the vendored skills..." -# shellcheck source=lib/effort-pins.sh disable=SC1091 -source "$REPO/lib/effort-pins.sh" -apply_effort_pins "$REPO" || warn "effort pins: map lines rejected — fix lib/effort-pins.txt" - # ── Impeccable (design detector + skill + subagents) ── # Global scope: the installer writes through the ~/.claude/{skills,agents} # symlinks straight into this repo (install-plugins.sh Step 8d explains why @@ -521,6 +513,15 @@ print(d.get('21st',{}).get('version','latest')) rm -rf "$TFD_STAGE" fi +# Effort pins (BDR-107, BDR-108): every refresh above rewrites SKILL.md and +# drops the `effort:` line; the 21st pack refresh is the last step that rewrites +# a SKILL.md, so the entry levels of lib/effort-pins.txt go back here. +echo "" +echo "── Re-applying effort pins on the vendored skills..." +# shellcheck source=lib/effort-pins.sh disable=SC1091 +source "$REPO/lib/effort-pins.sh" +apply_effort_pins "$REPO" || warn "effort pins: map lines rejected — fix lib/effort-pins.txt" + # ── 7.5. Update external skills (npx skills) ── echo "" echo "── Updating external skills (npx skills)..."