refactor playbook: extend state machine to Steps 8-13 + stale-cache fix - #130
Open
lis186 wants to merge 10 commits into
Open
refactor playbook: extend state machine to Steps 8-13 + stale-cache fix#130lis186 wants to merge 10 commits into
lis186 wants to merge 10 commits into
Conversation
…ommit Stale .sourceatlas/cross-language.yaml from a previous run silently fed months-old counts into pilot reports (caught by harness fact-check on WordPress-iOS after repo update: 3/5 claims failed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- state.sh: step keys 8_new_impl..13_delete_legacy (shadow 9a/9b/9c share 9_swap); advance refuses past final step 13 - init-state.sh + templates/state.yaml: schema 2.1 adds six step entries (old 2.0 state files unchanged through Step 7) - mode-dispatch.yaml: S8-S13 apply in every mode - gate-postswap.sh: Done-When grep signals for Steps 8/12/13 as exit codes; SKILL.md tables now point at it - test-postswap.sh: 9-assertion self-check (state walk 7-13 + gate pass/fail both directions) - SKILL.md: Gotchas section seeded with the stale-cache lesson Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ress-iOS #28 fix verified E2E: init-state.sh reuses prior pilot report without state.yaml, no hand-edits, schema 2.1, candidate locked. Step 2b blocked by /atlas.audit external-CLI dependency (gemini CLI dead as of 2026-07) — tracked as follow-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… degraded mode gemini CLI is dead for individual accounts (IneligibleTierError, 2026-07). Reviewer policy is now: blind scan = agy CLI, adversarial = codex CLI; either missing or failing at runtime falls back to a fresh-context Claude subagent with the identical prompt — independence comes from the clean context, not the vendor. The pipeline never blocks, so the entire degraded-mode machinery (prompt files for manual execution) is deleted. - audit/seam SKILL.md: reviewer resolution, fallback rules, reviewers: field in outputs; Task added to allowed-tools; seam description gains when-to-use triggers; CONFIRM_RATIO 30-70% relabeled as unvalidated reference heuristic - seam/refactor workflow.md: gemini sections rewritten as blind-scan with agy Option A / subagent Option B; vendor-neutral artifact names (3_seams_blind.md, adversary-output.md); audit_mode degraded → subagent Verified live: refactor_harness grading now runs GRADERS=(agy claude) — agy graded all 3 pilots successfully (~15s each). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… 1-13)
First real run on a Dynamic-group target (express lib/response.js) — nine
script fixes, two documented gaps, all gates now pass end to end:
- detect-zones/pilot-run: kill 'grep -c || echo 0' double-zero (9 sites);
zero-marker guard now works (the JS norm, previously never exercised)
- init-step2a: synthesize whole-file zone when detect-zones finds none
- gate-contracts/gate-seams/gate-step7: unescape YAML \" in extracted
verification_grep rules (three copies of the same extraction bug)
- gate-step7: re-run as Step 10 verification no longer regresses
current_step 10 -> 8 (only advances when current_step <= 7)
- gate-postswap: language-group dispatch for dynamic languages — Steps
8/13 check module-path require refs instead of bare common-word class
names ('response' matched ServerResponse and prose); Step 12 handles
Group C no-adapter-class by design; adapter-name regex anchored to
line start (was matching 'class exists' inside a comment)
- state.sh: set-status gains --audit-mode full|subagent (workflow requires
recording it; Rule 15 forbids hand-edits; there was no API)
- SKILL.md: +9 gotchas (agy --add-dir, reviewer CLI death mid-playbook,
quote-free verification_grep, mocha vs jest for Group C, audit --zone
interop gap, etc.)
- dev-notes: full scar list for the express E2E run
Verified: test-postswap.sh ALL PASS (Group A unregressed); express walk
reached 13_delete_legacy: verified with npm test green (1258).
argument-hint and description didn't reflect that Steps 8-13 are tracked by state.sh and verified by gate-postswap.sh since fcedd31. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
「測試全綠」只證明無回歸,不證明更好。gate-postswap --step 12 新增 [--impl-file] 並寫出 12_metrics.yaml(LOC、決策點 grep 代理、 零引用數,before vs after);反向訊號印⚠️ REVIEW 但不影響 exit code——指標是證據,方向判斷留給人。 文件同步:SKILL.md 加 verification boundary 註記 + 兩張表 Step 12 row、workflow.md §4.3 加「characterization tests 是護欄,寫得出 fail-on-old 是警訊」、steps-8-13-by-mode.md 加全 mode 共用註記。 self-test 16 case ALL PASS(既有 9 case 不變綠)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
「先寫紅」的指標版:動手前在 1_target.yaml 宣告這次重構的 「更好」定義(goal + 可機器驗的 checks),Step 12 gate-postswap 逐條跑 verify 並將 ✓/✗ 寫進 12_metrics.yaml → goal_checks。 未達成的宣告判準大聲印出但不改 exit code——達成與否是人的判決。 - init-state.sh scaffold success_criteria(空 = 靜默,向後相容) - gate-postswap.sh 回照段沿用 gate-contracts.sh 的 \" unescape 先例 - templates/1_target.yaml 註明這是唯一允許事後手填的區塊 - workflow.md §1.5 說明宣告時機與 verify 規則慣例 - SKILL.md verification boundary 補 goal_checks self-test 20 assertions ALL PASS(既有 16 個不變綠)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
§1.5 加三個 success_criteria template(拆職責/可測試性/去耦合) 和紅燈指引(宣告後立刻跑,應該 fail)。Step 12 尾端印 retrospective prompt 並寫 pending 進 12_metrics.yaml,由 LLM 向使用者確認後更新 為 yes/no/deferred。 self-test 21 assertions ALL PASS(+1 retrospective 斷言)。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fable 驗證計畫指出「goal 非空 + checks 空 → unverified: true」是 最常見使用模式但零覆蓋。補兩條斷言釘住這條 path。 self-test 23 assertions ALL PASS。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the "Playbook ends at Step 7" gap, fixes a real stale-cache bug, and integrates verification-principles into Steps 8-13.
1. fix: pilot-run.sh stale cross-language cache
cross-language.yamlwas regenerated only when missing. A months-old cache silently fed stale counts into pilot reports — caught byrefactor_harnessfact-check on WordPress-iOS after updating the repo (3/5 claims failed; 100% pass after fix). Now regenerated whenever older than the last commit.2. feat: Steps 8-13 state extension
state.sh: step keys8_new_impl…13_delete_legacy(shadow 9a/9b/9c share9_swap);advancerefuses past final step 13init-state.sh+templates/state.yaml: schema 2.1 (old 2.0 state files unchanged through Step 7)mode-dispatch.yaml: S8–S13 apply in all four modesgate-postswap.sh(new): the Done-When grep signals from the SKILL.md tables become exit codes for Steps 8/12/13 (9-11 remain test-suite gates)test-postswap.sh: 9-assertion self-check — state walk 7→13 + gate pass/fail in both directions (ALL PASS)3. feat: verification-principles 整合 (Steps 8-13)
核心主張:「測試全綠只證沒變差,不證更好。」四個 commit:
0617d604— Step 12 結構指標gate-postswap.sh --step 12接受--impl-file,寫出12_metrics.yaml(LOC、決策點 grep 代理、零引用數,before vs after)ecbd9007— success_criteria 宣告 + goal_checks 回照init-state.shscaffoldsuccess_criteria(goal + checks[])在1_target.yaml尾端gate-postswap.shStep 12 回照段:讀 success_criteria、逐條bash -c跑 verify、✓/✗ 寫進12_metrics.yaml → goal_checks\"unescape 先例a6a9f25b— worked examples + retrospective promptretrospective: pending進 yaml492f3283— 補 goal-only unverified path 測試4. docs: Plan A redo spec executed (was pending since 2026-05-05)
Ran E2E on WordPress-iOS (
AztecPostViewController.swift, clean-context agent): Step 1 gate PASS — #28 fix verified (init-state.shreuses prior pilot, no hand-edits, candidate locked). Step 2a PASS (67 zones). Step 2b blocked by/atlas.audit's gemini/codex CLI dependency — gemini CLI is dead for individuals as of 2026-07 (IneligibleTierError), so every real user now lands in degraded mode. Follow-up: replace external-CLI cross-validation with subagent-based blind review.Verification
scripts/test-postswap.sh→ ALL PASS (23/23)🤖 Generated with Claude Code