okstra 0.102.2 → 0.102.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.kr.md +5 -5
  2. package/README.md +5 -5
  3. package/docs/kr/architecture/storage-model.md +8 -3
  4. package/docs/kr/architecture.md +12 -13
  5. package/docs/kr/cli.md +4 -4
  6. package/docs/kr/container.md +1 -1
  7. package/docs/kr/performance-improvement-plan-v2.md +2 -2
  8. package/docs/project-structure-overview.md +2 -2
  9. package/package.json +7 -2
  10. package/runtime/BUILD.json +2 -2
  11. package/runtime/bin/lib/okstra/interactive.sh +12 -0
  12. package/runtime/bin/okstra-antigravity-exec.sh +1 -2
  13. package/runtime/bin/okstra-codex-exec.sh +1 -2
  14. package/runtime/bin/okstra-render-final-report.py +2 -9
  15. package/runtime/bin/okstra-spawn-followups.py +4 -6
  16. package/runtime/bin/okstra-trace-cleanup.sh +24 -4
  17. package/runtime/prompts/lead/okstra-lead-contract.md +2 -2
  18. package/runtime/prompts/lead/report-writer.md +1 -1
  19. package/runtime/prompts/profiles/_common-contract.md +9 -11
  20. package/runtime/python/okstra_ctl/codex_dispatch.py +6 -13
  21. package/runtime/python/okstra_ctl/consumers.py +35 -0
  22. package/runtime/python/okstra_ctl/container.py +4 -6
  23. package/runtime/python/okstra_ctl/dispatch_core.py +8 -13
  24. package/runtime/python/okstra_ctl/final_report_paths.py +24 -0
  25. package/runtime/python/okstra_ctl/handoff.py +2 -1
  26. package/runtime/python/okstra_ctl/implementation_outcome.py +271 -0
  27. package/runtime/python/okstra_ctl/implementation_stage.py +7 -11
  28. package/runtime/python/okstra_ctl/path_hints.py +665 -0
  29. package/runtime/python/okstra_ctl/render.py +4 -3
  30. package/runtime/python/okstra_ctl/report_view_artifacts.py +14 -0
  31. package/runtime/python/okstra_ctl/report_views.py +7 -4
  32. package/runtime/python/okstra_ctl/run.py +3 -10
  33. package/runtime/python/okstra_ctl/run_context.py +4 -2
  34. package/runtime/python/okstra_ctl/stage_targets.py +18 -0
  35. package/runtime/python/okstra_ctl/wizard.py +37 -26
  36. package/runtime/python/okstra_ctl/wizard_stage_intent.py +54 -0
  37. package/runtime/python/okstra_project/state.py +40 -2
  38. package/runtime/python/okstra_token_usage/report.py +2 -5
  39. package/runtime/validators/validate-report-views.py +2 -1
  40. package/runtime/validators/validate-run.py +1 -11
  41. package/src/commands/lifecycle/install.mjs +5 -5
  42. package/src/commands/lifecycle/uninstall.mjs +4 -4
  43. package/docs/superpowers/plans/2026-05-12-ticket-id-in-reports.md +0 -638
  44. package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +0 -1568
  45. package/docs/superpowers/plans/2026-05-17-dual-format-final-report.md +0 -167
  46. package/docs/superpowers/plans/2026-05-20-final-report-language.md +0 -1501
  47. package/docs/superpowers/plans/2026-05-20-implementation-planning-multi-stage.md +0 -1267
  48. package/docs/superpowers/plans/2026-05-20-okstra-run-prompt-sot-b1.md +0 -1007
  49. package/docs/superpowers/plans/2026-05-20-wizard-messages-json-sot.md +0 -720
  50. package/docs/superpowers/plans/2026-05-20-wizard-prompt-json-sot-a1.md +0 -681
  51. package/docs/superpowers/plans/2026-05-21-improvement-discovery-task-type.md +0 -1691
  52. package/docs/superpowers/plans/2026-05-24-implementation-lead-context-slimming.md +0 -1700
  53. package/docs/superpowers/plans/2026-05-25-okstra-project-root-rename.md +0 -158
  54. package/docs/superpowers/plans/2026-05-26-wizard-3-option-picker.md +0 -860
  55. package/docs/superpowers/plans/2026-06-02-final-verification-protocol-hardening.md +0 -326
  56. package/docs/superpowers/plans/2026-06-02-okstra-run-branch-confirm-step.md +0 -337
  57. package/docs/superpowers/plans/2026-06-02-okstra-run-phase-pane-cleanup.md +0 -410
  58. package/docs/superpowers/plans/2026-06-02-requirements-discovery-fanout.md +0 -728
  59. package/docs/superpowers/plans/2026-06-04-adversarial-implementation-planning.md +0 -294
  60. package/docs/superpowers/plans/2026-06-04-adversarial-verification.md +0 -570
  61. package/docs/superpowers/plans/2026-06-04-coverage-critic.md +0 -516
  62. package/docs/superpowers/plans/2026-06-04-stage-cohesion-planner.md +0 -351
  63. package/docs/superpowers/plans/2026-06-04-stage-run-batching.md +0 -457
  64. package/docs/superpowers/plans/2026-06-05-acceptance-critic.md +0 -251
  65. package/docs/superpowers/plans/2026-06-05-compact-markdown-report-tables.md +0 -323
  66. package/docs/superpowers/plans/2026-06-05-wizard-batch-prompts.md +0 -559
  67. package/docs/superpowers/plans/2026-06-06-final-verification-whole-task-gate.md +0 -993
  68. package/docs/superpowers/plans/2026-06-06-stage-parallel-and-pending-fixes.md +0 -93
  69. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p1.md +0 -447
  70. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p2.md +0 -289
  71. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p3.md +0 -774
  72. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p4.md +0 -303
  73. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p5-multidep-base.md +0 -387
  74. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase2.md +0 -275
  75. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase3.md +0 -282
  76. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4a.md +0 -147
  77. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4b.md +0 -262
  78. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4c.md +0 -184
  79. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4d.md +0 -88
  80. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4e.md +0 -250
  81. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa.md +0 -409
  82. package/docs/superpowers/plans/2026-06-09-implementation-run-artifact-stage-isolation.md +0 -320
  83. package/docs/superpowers/plans/2026-06-10-concurrent-run-team-guard.md +0 -456
  84. package/docs/superpowers/plans/2026-06-10-git-reconcile-stale-sha-recovery.md +0 -1408
  85. package/docs/superpowers/plans/2026-06-10-lead-worker-completion-polling-PROBE.md +0 -42
  86. package/docs/superpowers/plans/2026-06-10-lead-worker-completion-polling.md +0 -337
  87. package/docs/superpowers/plans/2026-06-10-p6-token-usage-incremental.md +0 -1029
  88. package/docs/superpowers/plans/2026-06-10-stage-group-handoff.md +0 -1572
  89. package/docs/superpowers/plans/2026-06-11-fix-cycle.md +0 -1290
  90. package/docs/superpowers/plans/2026-06-11-wizard-whole-task-final-verification.md +0 -526
  91. package/docs/superpowers/plans/2026-06-12-html-plan-approval.md +0 -1000
  92. package/docs/superpowers/plans/2026-06-13-repo-risk-hardening.md +0 -493
  93. package/docs/superpowers/plans/2026-06-14-host-runtime-auto-execution.md +0 -1775
  94. package/docs/superpowers/plans/2026-06-15-coding-preflight-pack-dispatch-path.md +0 -504
  95. package/docs/superpowers/plans/2026-06-15-internal-skill-migration-final-fixups.md +0 -342
  96. package/docs/superpowers/plans/2026-06-15-internal-skill-migration-fixups.md +0 -258
  97. package/docs/superpowers/plans/2026-06-15-internal-skill-migration-remaining-fixups.md +0 -387
  98. package/docs/superpowers/plans/2026-06-15-internal-skill-resource-migration.md +0 -749
  99. package/docs/superpowers/plans/2026-06-15-worker-prompt-anchor-final-fixups.md +0 -828
  100. package/docs/superpowers/plans/2026-06-15-worker-prompt-header-error-contract.md +0 -490
  101. package/docs/superpowers/plans/2026-06-17-okstra-error-report.md +0 -724
  102. package/docs/superpowers/plans/2026-06-18-subagent-pane-reclaim.md +0 -483
  103. package/docs/superpowers/plans/2026-06-19-agent-operating-standard.md +0 -476
  104. package/docs/superpowers/plans/2026-06-19-okstra-inspect-recap-facet.md +0 -647
  105. package/docs/superpowers/plans/2026-06-20-error-feedback-loop.md +0 -1019
  106. package/docs/superpowers/plans/2026-06-20-run-index-row-normalization.md +0 -583
  107. package/docs/superpowers/plans/2026-06-20-stage-auto-integrate-teardown.md +0 -819
  108. package/docs/superpowers/plans/2026-06-21-okstra-container-local-user-test.md +0 -714
  109. package/docs/superpowers/plans/2026-06-21-release-handoff-local-checkout.md +0 -348
  110. package/docs/superpowers/plans/2026-06-23-implementation-stage-multiselect-chain.md +0 -630
  111. package/docs/superpowers/plans/2026-06-23-implementation-step-commit-granularity.md +0 -274
  112. package/docs/superpowers/plans/2026-06-23-phase-batch-cleanup-enforcement.md +0 -409
  113. package/docs/superpowers/plans/2026-06-24-cross-project-precondition.md +0 -542
  114. package/docs/superpowers/plans/2026-06-24-decision-drafts-render-gap.md +0 -568
  115. package/docs/superpowers/plans/2026-06-24-manual-user-test-section.md +0 -203
  116. package/docs/superpowers/plans/2026-06-24-okstra-container-build-rename.md +0 -525
  117. package/docs/superpowers/specs/2026-05-12-ticket-id-in-reports-design.md +0 -131
  118. package/docs/superpowers/specs/2026-05-15-implementation-plan-verification-design.md +0 -254
  119. package/docs/superpowers/specs/2026-05-20-final-report-language-design.md +0 -383
  120. package/docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md +0 -322
  121. package/docs/superpowers/specs/2026-05-20-okstra-run-prompt-sot-design.md +0 -299
  122. package/docs/superpowers/specs/2026-05-21-improvement-discovery-task-type-design.md +0 -335
  123. package/docs/superpowers/specs/2026-06-02-okstra-run-branch-confirm-step-design.md +0 -113
  124. package/docs/superpowers/specs/2026-06-02-okstra-run-phase-pane-cleanup-design.md +0 -173
  125. package/docs/superpowers/specs/2026-06-02-requirements-discovery-fanout-design.md +0 -154
  126. package/docs/superpowers/specs/2026-06-04-adversarial-implementation-planning-design.md +0 -90
  127. package/docs/superpowers/specs/2026-06-04-adversarial-verification-design.md +0 -176
  128. package/docs/superpowers/specs/2026-06-04-coverage-critic-design.md +0 -99
  129. package/docs/superpowers/specs/2026-06-04-stage-splitting-cost-aware-design.md +0 -98
  130. package/docs/superpowers/specs/2026-06-05-acceptance-critic-design.md +0 -90
  131. package/docs/superpowers/specs/2026-06-05-compact-markdown-report-tables-design.md +0 -87
  132. package/docs/superpowers/specs/2026-06-05-wizard-batch-prompts-design.md +0 -121
  133. package/docs/superpowers/specs/2026-06-06-final-verification-whole-task-gate-design.md +0 -126
  134. package/docs/superpowers/specs/2026-06-06-stage-worktree-isolation-design.md +0 -180
  135. package/docs/superpowers/specs/2026-06-06-vertical-slice-tdd-planning-design.md +0 -179
  136. package/docs/superpowers/specs/2026-06-07-stage-conformance-qa-design.md +0 -169
  137. package/docs/superpowers/specs/2026-06-09-executor-model-custom-id-cascade-design.md +0 -66
  138. package/docs/superpowers/specs/2026-06-09-implementation-run-artifact-stage-isolation-design.md +0 -87
  139. package/docs/superpowers/specs/2026-06-10-blocking-contract-posthoc-conformance-design.md +0 -168
  140. package/docs/superpowers/specs/2026-06-10-concurrent-run-team-guard-design.md +0 -107
  141. package/docs/superpowers/specs/2026-06-10-git-reconcile-stale-sha-recovery-design.md +0 -105
  142. package/docs/superpowers/specs/2026-06-10-lead-worker-completion-polling-design.md +0 -113
  143. package/docs/superpowers/specs/2026-06-10-stage-group-handoff-design.md +0 -156
  144. package/docs/superpowers/specs/2026-06-11-brief-entry-only-handoff-stage-entry-design.md +0 -158
  145. package/docs/superpowers/specs/2026-06-11-fix-cycle-design.md +0 -94
  146. package/docs/superpowers/specs/2026-06-11-wizard-whole-task-final-verification-design.md +0 -89
  147. package/docs/superpowers/specs/2026-06-12-codex-lead-adapter-design.md +0 -358
  148. package/docs/superpowers/specs/2026-06-12-html-plan-approval-design.md +0 -85
  149. package/docs/superpowers/specs/2026-06-12-stage-discipline-rule-design.md +0 -108
  150. package/docs/superpowers/specs/2026-06-13-forbidden-actions-ssot-design.md +0 -134
  151. package/docs/superpowers/specs/2026-06-13-neutral-tmux-lead-adapter-design.md +0 -284
  152. package/docs/superpowers/specs/2026-06-14-host-runtime-auto-execution-design.md +0 -404
  153. package/docs/superpowers/specs/2026-06-17-okstra-error-report-design.md +0 -123
  154. package/docs/superpowers/specs/2026-06-18-subagent-pane-reclaim-design.md +0 -150
  155. package/docs/superpowers/specs/2026-06-19-agent-operating-standard-design.md +0 -120
  156. package/docs/superpowers/specs/2026-06-19-okstra-inspect-recap-facet-design.md +0 -96
  157. package/docs/superpowers/specs/2026-06-20-error-feedback-loop-design.md +0 -171
  158. package/docs/superpowers/specs/2026-06-20-run-index-row-normalization-design.md +0 -112
  159. package/docs/superpowers/specs/2026-06-20-stage-auto-integrate-teardown-design.md +0 -145
  160. package/docs/superpowers/specs/2026-06-21-okstra-container-local-user-test-design.md +0 -125
  161. package/docs/superpowers/specs/2026-06-21-release-handoff-local-checkout-design.md +0 -113
  162. package/docs/superpowers/specs/2026-06-23-implementation-stage-multiselect-chain-design.md +0 -138
  163. package/docs/superpowers/specs/2026-06-23-implementation-step-commit-granularity-design.md +0 -120
  164. package/docs/superpowers/specs/2026-06-24-cross-project-precondition-design.md +0 -129
  165. package/docs/superpowers/specs/2026-06-24-decision-drafts-render-gap-design.md +0 -185
  166. package/docs/superpowers/specs/2026-06-24-manual-user-test-section-design.md +0 -121
  167. package/docs/superpowers/specs/2026-06-24-okstra-container-build-rename-design.md +0 -110
@@ -1,342 +0,0 @@
1
- # Internal Skill Migration Final Fixups Implementation Plan
2
-
3
- > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
-
5
- **Goal:** Finish the internal-skill migration by making `ensure-installed`, executor instructions, and runtime prompt-resource wording match the new resource-based contract model.
6
-
7
- **Architecture:** Keep the public skill surface fixed at the six plugin-listed user skills. Treat the routed coding-preflight pack as a required installed runtime asset: `ensure-installed` must validate every routed pack file that `overview.md` can select. All executor/verifier instructions must use the generated launch prompt's resolved `Coding preflight pack:` absolute path, never a hardcoded `~/.okstra` path. Lead runtime resources must refer to moved internals as contracts/resources, not skills.
8
-
9
- **Tech Stack:** Node.js ES modules for install drift checks and JS tests, Python pytest contract tests for prompt/docs invariants, markdown prompt resources, existing `npm run build` runtime sync.
10
-
11
- ---
12
-
13
- ## Current failing checks
14
-
15
- These gaps were observed after the previous fix pass:
16
-
17
- 1. `okstra ensure-installed` restores a missing `prompts/` directory, but still reports OK when a routed language file such as `prompts/coding-preflight/languages/python.md` is missing.
18
- 2. `_implementation-executor.md` and `claude-worker.md` still mention `~/.okstra/prompts/coding-preflight/` directly.
19
- 3. `okstra-lead-contract.md` still says `convergence skill` in the plan-body verification section.
20
- 4. Existing contract tests do not scan the files where items 2 and 3 survive.
21
-
22
- ## File map
23
-
24
- - `src/install.mjs` — owns install/ensure drift detection. Add every routed coding-preflight resource to the required prompt-resource allowlist.
25
- - `tests-js/install-runtime.test.mjs` — add a regression that removes a single language resource and verifies `ensure-installed` restores it.
26
- - `prompts/profiles/_implementation-executor.md` — remove hardcoded default preflight path from executor-side guidance.
27
- - `agents/workers/claude-worker.md` — remove hardcoded default preflight path from Claude executor guidance.
28
- - `prompts/lead/okstra-lead-contract.md` — replace stale `convergence skill` wording with `convergence contract` / `convergence resource`.
29
- - `tests/test_docs_runtime_contract.py` — extend path and wording guards so these regressions fail in tests.
30
- - `runtime/` — generated by `npm run build`; do not edit directly.
31
-
32
- ## Task 1: Require the full routed coding-preflight pack in `ensure-installed`
33
-
34
- **Files:**
35
- - Modify: `src/install.mjs`
36
- - Modify: `tests-js/install-runtime.test.mjs`
37
-
38
- - [ ] **Step 1: Extend `REQUIRED_PROMPT_RESOURCE_FILES`**
39
-
40
- In `src/install.mjs`, extend the existing `REQUIRED_PROMPT_RESOURCE_FILES` allowlist so it covers every resource listed by `prompts/coding-preflight/overview.md`.
41
-
42
- Replace the current block with:
43
-
44
- ```js
45
- const REQUIRED_PROMPT_RESOURCE_FILES = Object.freeze([
46
- ["prompts", "lead", "okstra-lead-contract.md"],
47
- ["prompts", "lead", "context-loader.md"],
48
- ["prompts", "lead", "team-contract.md"],
49
- ["prompts", "lead", "convergence.md"],
50
- ["prompts", "lead", "report-writer.md"],
51
- ["prompts", "coding-preflight", "overview.md"],
52
- ["prompts", "coding-preflight", "clean-code.md"],
53
- ["prompts", "coding-preflight", "languages", "javascript-typescript.md"],
54
- ["prompts", "coding-preflight", "languages", "python.md"],
55
- ["prompts", "coding-preflight", "languages", "rust.md"],
56
- ["prompts", "coding-preflight", "languages", "java.md"],
57
- ["prompts", "coding-preflight", "languages", "kotlin.md"],
58
- ["prompts", "coding-preflight", "languages", "sql.md"],
59
- ["prompts", "coding-preflight", "frameworks", "node-server.md"],
60
- ["prompts", "coding-preflight", "architectures", "hexagonal.md"],
61
- ]);
62
- ```
63
-
64
- Keep this as an exact allowlist. Do not replace it with a recursive directory check; missing routed files should produce explicit `missing <path>` reasons.
65
-
66
- - [ ] **Step 2: Add a single-file resource-drift regression test**
67
-
68
- In `tests-js/install-runtime.test.mjs`, add a test after `ensure-installed repairs missing runtime prompt resources`:
69
-
70
- ```js
71
- test("ensure-installed repairs a missing routed coding preflight language resource", () => {
72
- const { root, env } = makeInstallEnv();
73
- mkdirSync(join(root, ".claude"), { recursive: true });
74
-
75
- const install = runCli(["install", "--quiet"], { ...env, OKSTRA_RUNTIME_HOST: "external" });
76
- assert.equal(install.code, 0, install.stderr);
77
-
78
- const pythonResource = join(root, ".okstra", "prompts", "coding-preflight", "languages", "python.md");
79
- rmSync(pythonResource, { force: true });
80
-
81
- const ensure = runCli(["ensure-installed"], { ...env, OKSTRA_RUNTIME_HOST: "external" });
82
- assert.equal(ensure.code, 0, ensure.stderr);
83
- assert.match(ensure.stderr, /okstra runtime needs install:/);
84
- assert.equal(existsSync(pythonResource), true);
85
- });
86
- ```
87
-
88
- This covers the failure where `overview.md` and `clean-code.md` exist but a selectable language rule target is missing.
89
-
90
- - [ ] **Step 3: Verify focused JS behavior**
91
-
92
- Run:
93
-
94
- ```bash
95
- node --test tests-js/install-runtime.test.mjs
96
- ```
97
-
98
- Expected: all install-runtime subtests pass, including the new single-file resource-drift regression.
99
-
100
- ## Task 2: Remove hardcoded preflight paths from executor/worker instructions
101
-
102
- **Files:**
103
- - Modify: `prompts/profiles/_implementation-executor.md`
104
- - Modify: `agents/workers/claude-worker.md`
105
- - Modify: `tests/test_docs_runtime_contract.py`
106
-
107
- - [ ] **Step 1: Rewrite executor sidecar preflight pointer text**
108
-
109
- In `prompts/profiles/_implementation-executor.md`, replace the parenthetical that currently says `skill-file pointers (~/.okstra/prompts/coding-preflight/)` with resolved-resource wording:
110
-
111
- ```markdown
112
- - **Coding-conventions preflight (BLOCKING — runs before the first `Edit` / `Write`, and binds the TDD loop below).** The gate body is a single source at `prompts/profiles/_coding-conventions-preflight.md` (sibling of this sidecar): resolved `Coding preflight pack:` runtime-resource path usage, project review rule packs, the always-binding language-agnostic principles, and graceful degradation. Do NOT re-type that content from memory — deliver it by file so it cannot drift or be dropped:
113
- ```
114
-
115
- Do not mention `~/.okstra` in this file.
116
-
117
- - [ ] **Step 2: Rewrite Claude worker preflight instruction**
118
-
119
- In `agents/workers/claude-worker.md`, replace the sentence that starts with `Read ~/.okstra/prompts/coding-preflight/overview.md` with launch-resource wording:
120
-
121
- ```markdown
122
- - **Executor coding-conventions preflight (BLOCKING, before your first `Edit` / `Write`):** when dispatched as the `Executor`, you MUST run the coding-conventions preflight defined in the executor sidecar (`prompts/profiles/_implementation-executor.md` → "Pre-implementation context exploration") before writing any code. Use the `Coding preflight pack:` absolute path from the lead prompt's `## Okstra Runtime Resources` block; read that pack's `overview.md` and `clean-code.md`, then follow the routed pack's language → framework → architecture stages, iterating every rule and loading every matching resource (for example `frameworks/node-server.md` and `architectures/hexagonal.md` when their conditions match). The preflight pack is a runtime resource, not an auto-invoked skill; read the files via the Read tool by absolute path.
123
- ```
124
-
125
- Do not mention `~/.okstra` in this file.
126
-
127
- - [ ] **Step 3: Extend hardcoded preflight path contract test**
128
-
129
- In `tests/test_docs_runtime_contract.py`, update `test_profile_sidecars_use_resolved_coding_preflight_pack_path` to scan both newly identified files:
130
-
131
- ```python
132
- def test_profile_sidecars_use_resolved_coding_preflight_pack_path():
133
- for relative_path in [
134
- "prompts/profiles/_coding-conventions-preflight.md",
135
- "prompts/profiles/_implementation-verifier.md",
136
- "prompts/profiles/_implementation-executor.md",
137
- "agents/workers/claude-worker.md",
138
- ]:
139
- text = _read_doc(relative_path)
140
- assert "~/.okstra/prompts/coding-preflight" not in text, relative_path
141
-
142
- for relative_path in [
143
- "prompts/profiles/_coding-conventions-preflight.md",
144
- "prompts/profiles/_implementation-verifier.md",
145
- "agents/workers/claude-worker.md",
146
- ]:
147
- text = _read_doc(relative_path)
148
- assert "Coding preflight pack:" in text, relative_path
149
- ```
150
-
151
- `_implementation-executor.md` delegates the actual preflight body by file and may only mention the heading name indirectly; the test should require absence of hardcoded path there, not duplicate the full router wording.
152
-
153
- - [ ] **Step 4: Verify focused Python behavior**
154
-
155
- Run:
156
-
157
- ```bash
158
- python3 -m pytest tests/test_docs_runtime_contract.py::test_profile_sidecars_use_resolved_coding_preflight_pack_path
159
- ```
160
-
161
- Expected: test passes.
162
-
163
- ## Task 3: Replace stale `convergence skill` wording in the lead contract
164
-
165
- **Files:**
166
- - Modify: `prompts/lead/okstra-lead-contract.md`
167
- - Modify: `tests/test_docs_runtime_contract.py`
168
-
169
- - [ ] **Step 1: Rewrite the two stale references**
170
-
171
- In `prompts/lead/okstra-lead-contract.md`, update the plan-body verification numbered list:
172
-
173
- ```markdown
174
- 1. Extract `P-*` plan items from the draft report's `## 5.4 Implementation Plan Deliverables` per the prefix → source-section mapping in the convergence contract.
175
- 2. Dispatch a single plan-body reverify round to every analyser worker in the roster (`claude`, `codex`, and `gemini` when opted in). `Report writer worker` is NOT a participant in this round.
176
- 3. Aggregate verdicts and resolve the gate result to one of `passed` / `passed-with-dissent` / `blocked-by-disagreement` / `aborted-non-result`.
177
- 4. Write `runs/<task-type>/state/plan-body-verification.json` (schema in the convergence contract).
178
- ```
179
-
180
- Only the words `convergence skill` change. Do not alter phase semantics.
181
-
182
- - [ ] **Step 2: Extend stale wording scan to the lead contract**
183
-
184
- In `tests/test_docs_runtime_contract.py`, add `prompts/lead/okstra-lead-contract.md` to `scanned_files` in `test_live_docs_do_not_describe_internal_contracts_as_skills`:
185
-
186
- ```python
187
- "prompts/lead/okstra-lead-contract.md",
188
- "prompts/lead/context-loader.md",
189
- "prompts/lead/convergence.md",
190
- "prompts/lead/report-writer.md",
191
- "prompts/lead/team-contract.md",
192
- ```
193
-
194
- Also add exact forbidden fragments for this regression:
195
-
196
- ```python
197
- "convergence skill",
198
- "schema in the convergence skill",
199
- ```
200
-
201
- Keep existing public-skill wording allowed; this guard is only for internal contract/resource naming.
202
-
203
- - [ ] **Step 3: Verify focused stale-wording behavior**
204
-
205
- Run:
206
-
207
- ```bash
208
- python3 -m pytest tests/test_docs_runtime_contract.py::test_live_docs_do_not_describe_internal_contracts_as_skills
209
- ```
210
-
211
- Expected: test passes and would fail if `convergence skill` returns to the lead contract.
212
-
213
- ## Task 4: Final verification and runtime sync
214
-
215
- **Files:**
216
- - Generated: `runtime/` via `npm run build`
217
-
218
- - [ ] **Step 1: Build runtime**
219
-
220
- Run:
221
-
222
- ```bash
223
- npm run build
224
- ```
225
-
226
- Expected: build exits 0 and syncs `prompts/`, `agents/`, `skills/`, `validators/`, and runtime scripts into `runtime/`.
227
-
228
- - [ ] **Step 2: Re-run focused tests**
229
-
230
- Run:
231
-
232
- ```bash
233
- node --test tests-js/install-runtime.test.mjs
234
- python3 -m pytest tests/test_docs_runtime_contract.py tests/test_lead_runtime_marker.py
235
- ```
236
-
237
- Expected: all listed tests pass.
238
-
239
- - [ ] **Step 3: Re-run the single-file coding-preflight resource smoke**
240
-
241
- Run:
242
-
243
- ```bash
244
- TMP_HOME=$(mktemp -d)
245
- mkdir -p "$TMP_HOME/.claude"
246
- HOME="$TMP_HOME" OKSTRA_HOME="$TMP_HOME/.okstra" OKSTRA_RUNTIME_HOST=external node bin/okstra install --quiet
247
- node --input-type=module -e "
248
- import { rmSync } from 'node:fs';
249
- import { join } from 'node:path';
250
- rmSync(join(process.argv[1], '.okstra', 'prompts', 'coding-preflight', 'languages', 'python.md'), { force: true });
251
- " "$TMP_HOME"
252
- HOME="$TMP_HOME" OKSTRA_HOME="$TMP_HOME/.okstra" OKSTRA_RUNTIME_HOST=external node bin/okstra ensure-installed
253
- node --input-type=module -e "
254
- import assert from 'node:assert/strict';
255
- import { existsSync } from 'node:fs';
256
- import { join } from 'node:path';
257
- const home = process.argv[1];
258
- const resource = join(home, '.okstra', 'prompts', 'coding-preflight', 'languages', 'python.md');
259
- assert.equal(existsSync(resource), true);
260
- console.log('single routed preflight resource restore smoke ok');
261
- " "$TMP_HOME"
262
- ```
263
-
264
- Expected: `ensure-installed` prints `okstra runtime needs install: ... python.md ...`, reinstalls, and the final Node assertion passes.
265
-
266
- - [ ] **Step 4: Search for live stale references**
267
-
268
- Run repository searches for these strings and classify results:
269
-
270
- ```text
271
- ~/.okstra/prompts/coding-preflight
272
- convergence skill
273
- schema in the convergence skill
274
- This skill governs
275
- When this skill says
276
- Information to be obtained after executing this skill
277
- If you are reading this skill
278
- During Phase 6 of the OKSTRA skill
279
- During Phase 7 of the OKSTRA skill
280
- During okstra Skill Phases
281
- When the okstra skill Phase
282
- Project rules override this skill
283
- project-level Python style skill
284
- rust-guidelines skill
285
- skills/okstra-context-loader
286
- skills/okstra-team-contract
287
- skills/okstra-convergence
288
- skills/okstra-report-writer
289
- skills/okstra-coding-preflight
290
- ```
291
-
292
- Expected:
293
-
294
- - No matches in live runtime prompts, worker templates, README, architecture docs, CLI docs, install code, or tests except test forbidden-fragment literals.
295
- - Matches inside dated historical plans and `agents/TODO.md` are acceptable only when they are historical/archival, not active runtime instructions.
296
-
297
- - [ ] **Step 5: Run full suite**
298
-
299
- Run:
300
-
301
- ```bash
302
- npm run check
303
- ```
304
-
305
- Expected: build, JS tests, Python tests, and workflow validator pass.
306
-
307
- - [ ] **Step 6: Assert runtime skill surface**
308
-
309
- Run:
310
-
311
- ```bash
312
- node --input-type=module -e "
313
- import assert from 'node:assert/strict';
314
- import { readdirSync, existsSync } from 'node:fs';
315
- import { join } from 'node:path';
316
- import { USER_SKILL_NAMES, OBSOLETE_INTERNAL_SKILL_NAMES } from './src/skill-catalog.mjs';
317
- const names = readdirSync('runtime/skills', { withFileTypes: true })
318
- .filter((entry) => entry.isDirectory())
319
- .map((entry) => entry.name)
320
- .sort();
321
- assert.deepEqual(names, [...USER_SKILL_NAMES].sort());
322
- for (const name of OBSOLETE_INTERNAL_SKILL_NAMES) {
323
- assert.equal(existsSync(join('runtime/skills', name)), false, name);
324
- }
325
- assert.equal(existsSync('runtime/prompts/lead/okstra-lead-contract.md'), true);
326
- assert.equal(existsSync('runtime/prompts/coding-preflight/overview.md'), true);
327
- assert.equal(existsSync('runtime/prompts/coding-preflight/languages/python.md'), true);
328
- console.log('runtime surface ok');
329
- "
330
- ```
331
-
332
- Expected: exit code 0 and `runtime surface ok`.
333
-
334
- ## Completion criteria
335
-
336
- This work is complete only when all of these are true:
337
-
338
- - `ensure-installed` restores any missing required coding-preflight resource selected by the router.
339
- - No live executor/worker instruction hardcodes `~/.okstra/prompts/coding-preflight/`.
340
- - No live lead runtime resource describes moved internal contracts as skills.
341
- - Public skill surface remains exactly the six plugin-listed user skills.
342
- - Focused tests, targeted smoke, stale-reference search, `npm run check`, and runtime surface assertion pass freshly.
@@ -1,258 +0,0 @@
1
- # Internal Skill Migration Fixups
2
-
3
- ## Purpose
4
-
5
- The internal-skill migration is not ready to merge. The standard suites pass, but smoke checks found real install/render path gaps. This document lists the fixes required before the migration can be considered complete.
6
-
7
- ## Current Passing Evidence
8
-
9
- - `npm run check` completed successfully after the migration:
10
- - JS: 106 passed
11
- - Python: 1614 passed, 2 skipped
12
- - workflow validator passed
13
- - `runtime/skills` contains only the six public skills after `npm run build`.
14
- - `runtime/prompts/lead/okstra-lead-contract.md` and `runtime/prompts/coding-preflight/clean-code.md` exist after `npm run build`.
15
-
16
- Passing suites are not sufficient because the custom install/render smoke checks below expose uncovered paths.
17
-
18
- ## Required Fixes
19
-
20
- ### 1. Link-mode install must expose runtime prompt resources
21
-
22
- **Problem:** `okstra install --link` does not install or symlink the `prompts/` tree into `OKSTRA_HOME` / `~/.okstra`, so generated prompts point at files that do not exist in dev-link installs.
23
-
24
- **Evidence:**
25
-
26
- - Link install currently installs skills, agents, settings, and manifests, but no `prompts/` resource tree: `src/install.mjs:319`, `src/install.mjs:329`.
27
- - Copy mode does install the prompt resources: `src/install.mjs:775`, `src/install.mjs:781`.
28
-
29
- **Required change:**
30
-
31
- - In `installRuntimeLink`, add link-mode handling for `prompts/`:
32
- - source: `<repo>/prompts`
33
- - destination: `<OKSTRA_HOME>/prompts`
34
- - behavior: symlink in link mode, matching existing link-mode style.
35
- - Keep copy mode unchanged.
36
- - Ensure link mode still refreshes public skills and agents as before.
37
-
38
- **Regression coverage:**
39
-
40
- - Add JS test for `install --link .` with temp `HOME` / `OKSTRA_HOME`:
41
- - `~/.okstra/prompts/lead/okstra-lead-contract.md` exists.
42
- - `~/.okstra/prompts/coding-preflight/overview.md` exists.
43
- - public skills exist under detected agent home.
44
- - obsolete internal skill dirs do not exist.
45
-
46
- **Smoke command after fix:**
47
-
48
- ```bash
49
- TMP_HOME=$(mktemp -d)
50
- mkdir -p "$TMP_HOME/.claude"
51
- HOME="$TMP_HOME" OKSTRA_HOME="$TMP_HOME/.okstra" OKSTRA_RUNTIME_HOST=external node bin/okstra install --link .
52
- node --input-type=module -e "
53
- import assert from 'node:assert/strict';
54
- import { existsSync } from 'node:fs';
55
- import { join } from 'node:path';
56
- const home = process.argv[1];
57
- assert.equal(existsSync(join(home, '.okstra', 'prompts', 'lead', 'okstra-lead-contract.md')), true);
58
- assert.equal(existsSync(join(home, '.okstra', 'prompts', 'coding-preflight', 'overview.md')), true);
59
- " "$TMP_HOME"
60
- ```
61
-
62
- ### 2. Runtime resource paths must honor `OKSTRA_HOME`
63
-
64
- **Problem:** generated lead prompts still use `Path.home() / ".okstra"` for lead contracts and coding-preflight resources. This breaks non-default installs and tests that isolate `OKSTRA_HOME`.
65
-
66
- **Evidence:**
67
-
68
- - `build_context` seeds `OKSTRA_LEAD_CONTRACT_PATH`, `OKSTRA_TEAM_CONTRACT_PATH`, and `OKSTRA_CODING_PREFLIGHT_DIR` from `Path.home() / ".okstra"`: `scripts/okstra_ctl/paths.py:211`, `scripts/okstra_ctl/paths.py:214`, `scripts/okstra_ctl/paths.py:229`.
69
- - Render fallback repeats the same hardcoded home path: `scripts/okstra_ctl/render.py:1670`, `scripts/okstra_ctl/render.py:1686`, `scripts/okstra_ctl/render.py:2037`, `scripts/okstra_ctl/render.py:2044`.
70
-
71
- **Required change:**
72
-
73
- - Add one Python runtime-home resolver and reuse it wherever Okstra runtime resources are addressed:
74
-
75
- ```python
76
- def okstra_home() -> Path:
77
- raw = os.environ.get("OKSTRA_HOME", "").strip()
78
- return Path(raw).expanduser() if raw else Path.home() / ".okstra"
79
- ```
80
-
81
- - Use that resolver for:
82
- - `WORKER_PROMPT_PREAMBLE_PATH`
83
- - `OKSTRA_LEAD_CONTRACT_PATH`
84
- - `OKSTRA_CONTEXT_LOADER_PATH`
85
- - `OKSTRA_TEAM_CONTRACT_PATH`
86
- - `OKSTRA_CONVERGENCE_PATH`
87
- - `OKSTRA_REPORT_WRITER_PATH`
88
- - `OKSTRA_CODING_PREFLIGHT_DIR`
89
- - Apply it in both `scripts/okstra_ctl/paths.py` and `scripts/okstra_ctl/render.py` fallback paths.
90
-
91
- **Regression coverage:**
92
-
93
- - Add Python test that sets `OKSTRA_HOME` to a temp path, renders a Claude lead prompt, and asserts:
94
- - `<temp>/prompts/lead/okstra-lead-contract.md` is present.
95
- - `<Path.home()/.okstra/prompts/lead/okstra-lead-contract.md>` is absent when different from temp.
96
-
97
- **Smoke command after fix:**
98
-
99
- ```bash
100
- TMP_HOME=$(mktemp -d /private/tmp/okstra-home.XXXXXX)
101
- OKSTRA_HOME="$TMP_HOME/.okstra-home" OKSTRA_SKIP_INSTALL_CHECK=1 PYTHONPATH=scripts python3 - <<'PY'
102
- import os
103
- import tempfile
104
- from pathlib import Path
105
- from okstra_ctl import run
106
- repo = Path.cwd()
107
- project = Path(tempfile.mkdtemp(dir="/private/tmp")).resolve()
108
- brief = project / "brief.md"
109
- brief.write_text("# Brief\n", encoding="utf-8")
110
- out = run.prepare_task_bundle(run.PrepareInputs(
111
- workspace_root=repo,
112
- project_root=project,
113
- project_id="proj",
114
- task_group="group",
115
- task_id="task",
116
- task_type="error-analysis",
117
- brief_path=brief,
118
- lead_runtime="claude-code",
119
- render_only=True,
120
- ))
121
- expected = os.environ["OKSTRA_HOME"] + "/prompts/lead/okstra-lead-contract.md"
122
- assert expected in out.prompt_text
123
- assert str(Path.home() / ".okstra" / "prompts" / "lead" / "okstra-lead-contract.md") not in out.prompt_text
124
- PY
125
- ```
126
-
127
- ### 3. Obsolete internal skill pruning must remove symlinks, including dangling symlinks
128
-
129
- **Problem:** prune checks only `dirExists(path)`. A stale link-mode install can leave dangling internal skill symlinks in the agent skill home, and `dirExists` skips them.
130
-
131
- **Evidence:**
132
-
133
- - Prune uses `dirExists(path)` before `fs.rm`: `src/install.mjs:622`, `src/install.mjs:626`.
134
- - Exact-name prune is required because former internal contracts now ship as runtime resources, not agent skills: `src/install.mjs:619`.
135
-
136
- **Required change:**
137
-
138
- - Replace `dirExists` check in `pruneObsoleteInternalSkills` with an lstat-based entry check:
139
-
140
- ```js
141
- async function pathEntryExists(path) {
142
- try {
143
- await fs.lstat(path);
144
- return true;
145
- } catch (err) {
146
- if (err.code === "ENOENT") return false;
147
- throw err;
148
- }
149
- }
150
- ```
151
-
152
- - Use `pathEntryExists` before `fs.rm(path, { recursive: true, force: true })`.
153
- - Keep exact-name allowlist from `OBSOLETE_INTERNAL_SKILL_NAMES`; do not wildcard-delete `okstra-*`.
154
-
155
- **Regression coverage:**
156
-
157
- - Add JS test where `~/.claude/skills/okstra-team-contract` is a dangling symlink before install.
158
- - Run `okstra install`.
159
- - Assert `lstat` fails for that path after install.
160
-
161
- **Smoke command after fix:**
162
-
163
- ```bash
164
- TMP_HOME=$(mktemp -d)
165
- mkdir -p "$TMP_HOME/.claude/skills"
166
- ln -s "$TMP_HOME/missing-source" "$TMP_HOME/.claude/skills/okstra-team-contract"
167
- HOME="$TMP_HOME" OKSTRA_HOME="$TMP_HOME/.okstra" OKSTRA_RUNTIME_HOST=external node bin/okstra install
168
- node --input-type=module -e "
169
- import assert from 'node:assert/strict';
170
- import { lstatSync } from 'node:fs';
171
- import { join } from 'node:path';
172
- const path = join(process.argv[1], '.claude', 'skills', 'okstra-team-contract');
173
- let exists = true;
174
- try { lstatSync(path); } catch { exists = false; }
175
- assert.equal(exists, false);
176
- " "$TMP_HOME"
177
- ```
178
-
179
- ### 4. Verifier preflight must use the same staged router as executor preflight
180
-
181
- **Problem:** executor preflight now routes via `overview.md` with language -> framework -> architecture stages, but verifier preflight still hardcodes language + `clean-code.md` + hexagonal overlay. It can miss `frameworks/node-server.md` and the router semantics.
182
-
183
- **Evidence:**
184
-
185
- - Router defines three ordered stages and all-rule accumulation: `prompts/coding-preflight/overview.md:12`, `prompts/coding-preflight/overview.md:16`, `prompts/coding-preflight/overview.md:27`, `prompts/coding-preflight/overview.md:35`.
186
- - Executor prompt tells workers to read `overview.md` and route through the staged pack: `prompts/profiles/_coding-conventions-preflight.md:18`.
187
- - Verifier prompt still says `languages/<lang>.md` + `clean-code.md` + `architectures/hexagonal.md`: `prompts/profiles/_implementation-verifier.md:91`.
188
-
189
- **Required change:**
190
-
191
- - Update verifier preflight text to require:
192
- - read `~/.okstra/prompts/coding-preflight/overview.md` first;
193
- - read `clean-code.md`;
194
- - run the same three-stage route as executor: language, framework, architecture;
195
- - iterate every rule in each stage and accumulate all matching resources;
196
- - record resources loaded or `resource-unavailable` degradation.
197
-
198
- **Regression coverage:**
199
-
200
- - Add doc/contract test that `_implementation-verifier.md` contains:
201
- - `overview.md`
202
- - `frameworks/node-server.md`
203
- - `iterate` / `accumulate` semantics
204
- - Add negative assertion that verifier no longer instructs only direct `languages/<lang>.md` + `architectures/hexagonal.md` loading.
205
-
206
- ### 5. Remove stale “internal skill” wording from docs and worker templates
207
-
208
- **Problem:** user-facing docs and worker template still call internal resources “skills”, contradicting the new install surface.
209
-
210
- **Evidence:**
211
-
212
- - README EN still says `visible user skills + hidden internal support skills`: `README.md:79`.
213
- - Architecture doc still says lead/support internal skills are installed with `user-invocable: false`: `docs/kr/architecture.md:21`.
214
- - CLI wrapper template still calls `team-contract` a skill and authoritative source: `agents/workers/_cli-wrapper-template.md:158`, `agents/workers/_cli-wrapper-template.md:170`, `agents/workers/_cli-wrapper-template.md:172`.
215
-
216
- **Required change:**
217
-
218
- - Replace stale wording with runtime-resource language:
219
- - `team-contract resource`
220
- - `prompts/lead/team-contract.md`
221
- - `prompts/lead/okstra-lead-contract.md`
222
- - `prompts/coding-preflight/*`
223
- - README EN storage map should match README KR:
224
-
225
- ```text
226
- └── okstra-*/SKILL.md user-facing skills only (setup/brief/run/memory/inspect/schedule)
227
- ```
228
-
229
- - Architecture “At a glance” should say public skills only are copied to agent homes; lead/support contracts are runtime resources under `~/.okstra/prompts/` and are not skill-discovery targets.
230
-
231
- **Regression coverage:**
232
-
233
- - Add/extend docs contract test to fail on live references to:
234
- - `hidden internal support skills`
235
- - `team-contract skill`
236
- - `okstra-convergence skill`
237
- - `okstra-report-writer skill`
238
- - `user-invocable: false` as the described install mechanism for internal Okstra contracts
239
-
240
- ## Verification Checklist After Fixes
241
-
242
- Run these in order:
243
-
244
- ```bash
245
- node --test tests-js/skill-catalog.test.mjs tests-js/install-runtime.test.mjs tests-js/uninstall-runtime.test.mjs tests-js/doctor-runtime.test.mjs
246
- python3 -m pytest tests/test_docs_runtime_contract.py tests/test_lead_runtime_marker.py
247
- bash validators/validate-workflow.sh
248
- npm run check
249
- ```
250
-
251
- Then run the three smoke commands from Fixes 1-3. The migration is complete only when all automated tests and all smoke commands pass.
252
-
253
- ## Non-Goals
254
-
255
- - Do not reintroduce hidden/internal skills under agent skill homes.
256
- - Do not add compatibility aliases for old internal skill names.
257
- - Do not wildcard-delete `okstra-*` directories; prune only names in `OBSOLETE_INTERNAL_SKILL_NAMES`.
258
- - Do not inline all coding-preflight files into launch prompts. The router must keep lazy, situation-based loading.