okstra 0.102.1 → 0.102.3

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 (162) hide show
  1. package/README.kr.md +5 -6
  2. package/README.md +5 -6
  3. package/docs/kr/architecture/storage-model.md +1 -1
  4. package/docs/kr/architecture.md +8 -12
  5. package/docs/kr/cli.md +6 -6
  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/okstra-antigravity-exec.sh +1 -2
  12. package/runtime/bin/okstra-codex-exec.sh +1 -2
  13. package/runtime/bin/okstra-render-final-report.py +2 -9
  14. package/runtime/bin/okstra-spawn-followups.py +4 -6
  15. package/runtime/bin/okstra-trace-cleanup.sh +24 -4
  16. package/runtime/prompts/lead/okstra-lead-contract.md +2 -2
  17. package/runtime/prompts/lead/report-writer.md +1 -1
  18. package/runtime/prompts/profiles/_common-contract.md +9 -11
  19. package/runtime/python/okstra_ctl/codex_dispatch.py +4 -12
  20. package/runtime/python/okstra_ctl/consumers.py +35 -0
  21. package/runtime/python/okstra_ctl/container.py +4 -6
  22. package/runtime/python/okstra_ctl/dispatch_core.py +4 -12
  23. package/runtime/python/okstra_ctl/final_report_paths.py +24 -0
  24. package/runtime/python/okstra_ctl/handoff.py +2 -1
  25. package/runtime/python/okstra_ctl/implementation_stage.py +7 -11
  26. package/runtime/python/okstra_ctl/report_view_artifacts.py +14 -0
  27. package/runtime/python/okstra_ctl/report_views.py +7 -4
  28. package/runtime/python/okstra_ctl/run.py +3 -10
  29. package/runtime/python/okstra_ctl/stage_targets.py +18 -0
  30. package/runtime/python/okstra_ctl/wizard.py +24 -25
  31. package/runtime/python/okstra_ctl/wizard_stage_intent.py +54 -0
  32. package/runtime/python/okstra_token_usage/report.py +2 -5
  33. package/runtime/validators/validate-report-views.py +2 -1
  34. package/runtime/validators/validate-run.py +1 -11
  35. package/src/cli-registry.mjs +1 -1
  36. package/src/commands/lifecycle/install.mjs +10 -20
  37. package/src/commands/lifecycle/uninstall.mjs +7 -10
  38. package/docs/superpowers/plans/2026-05-12-ticket-id-in-reports.md +0 -638
  39. package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +0 -1568
  40. package/docs/superpowers/plans/2026-05-17-dual-format-final-report.md +0 -167
  41. package/docs/superpowers/plans/2026-05-20-final-report-language.md +0 -1501
  42. package/docs/superpowers/plans/2026-05-20-implementation-planning-multi-stage.md +0 -1267
  43. package/docs/superpowers/plans/2026-05-20-okstra-run-prompt-sot-b1.md +0 -1007
  44. package/docs/superpowers/plans/2026-05-20-wizard-messages-json-sot.md +0 -720
  45. package/docs/superpowers/plans/2026-05-20-wizard-prompt-json-sot-a1.md +0 -681
  46. package/docs/superpowers/plans/2026-05-21-improvement-discovery-task-type.md +0 -1691
  47. package/docs/superpowers/plans/2026-05-24-implementation-lead-context-slimming.md +0 -1700
  48. package/docs/superpowers/plans/2026-05-25-okstra-project-root-rename.md +0 -158
  49. package/docs/superpowers/plans/2026-05-26-wizard-3-option-picker.md +0 -860
  50. package/docs/superpowers/plans/2026-06-02-final-verification-protocol-hardening.md +0 -326
  51. package/docs/superpowers/plans/2026-06-02-okstra-run-branch-confirm-step.md +0 -337
  52. package/docs/superpowers/plans/2026-06-02-okstra-run-phase-pane-cleanup.md +0 -410
  53. package/docs/superpowers/plans/2026-06-02-requirements-discovery-fanout.md +0 -728
  54. package/docs/superpowers/plans/2026-06-04-adversarial-implementation-planning.md +0 -294
  55. package/docs/superpowers/plans/2026-06-04-adversarial-verification.md +0 -570
  56. package/docs/superpowers/plans/2026-06-04-coverage-critic.md +0 -516
  57. package/docs/superpowers/plans/2026-06-04-stage-cohesion-planner.md +0 -351
  58. package/docs/superpowers/plans/2026-06-04-stage-run-batching.md +0 -457
  59. package/docs/superpowers/plans/2026-06-05-acceptance-critic.md +0 -251
  60. package/docs/superpowers/plans/2026-06-05-compact-markdown-report-tables.md +0 -323
  61. package/docs/superpowers/plans/2026-06-05-wizard-batch-prompts.md +0 -559
  62. package/docs/superpowers/plans/2026-06-06-final-verification-whole-task-gate.md +0 -993
  63. package/docs/superpowers/plans/2026-06-06-stage-parallel-and-pending-fixes.md +0 -93
  64. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p1.md +0 -447
  65. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p2.md +0 -289
  66. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p3.md +0 -774
  67. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p4.md +0 -303
  68. package/docs/superpowers/plans/2026-06-06-stage-worktree-isolation-p5-multidep-base.md +0 -387
  69. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase2.md +0 -275
  70. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase3.md +0 -282
  71. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4a.md +0 -147
  72. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4b.md +0 -262
  73. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4c.md +0 -184
  74. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4d.md +0 -88
  75. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa-phase4e.md +0 -250
  76. package/docs/superpowers/plans/2026-06-07-stage-conformance-qa.md +0 -409
  77. package/docs/superpowers/plans/2026-06-09-implementation-run-artifact-stage-isolation.md +0 -320
  78. package/docs/superpowers/plans/2026-06-10-concurrent-run-team-guard.md +0 -456
  79. package/docs/superpowers/plans/2026-06-10-git-reconcile-stale-sha-recovery.md +0 -1408
  80. package/docs/superpowers/plans/2026-06-10-lead-worker-completion-polling-PROBE.md +0 -42
  81. package/docs/superpowers/plans/2026-06-10-lead-worker-completion-polling.md +0 -337
  82. package/docs/superpowers/plans/2026-06-10-p6-token-usage-incremental.md +0 -1029
  83. package/docs/superpowers/plans/2026-06-10-stage-group-handoff.md +0 -1572
  84. package/docs/superpowers/plans/2026-06-11-fix-cycle.md +0 -1290
  85. package/docs/superpowers/plans/2026-06-11-wizard-whole-task-final-verification.md +0 -526
  86. package/docs/superpowers/plans/2026-06-12-html-plan-approval.md +0 -1000
  87. package/docs/superpowers/plans/2026-06-13-repo-risk-hardening.md +0 -493
  88. package/docs/superpowers/plans/2026-06-14-host-runtime-auto-execution.md +0 -1775
  89. package/docs/superpowers/plans/2026-06-15-coding-preflight-pack-dispatch-path.md +0 -504
  90. package/docs/superpowers/plans/2026-06-15-internal-skill-migration-final-fixups.md +0 -342
  91. package/docs/superpowers/plans/2026-06-15-internal-skill-migration-fixups.md +0 -258
  92. package/docs/superpowers/plans/2026-06-15-internal-skill-migration-remaining-fixups.md +0 -387
  93. package/docs/superpowers/plans/2026-06-15-internal-skill-resource-migration.md +0 -749
  94. package/docs/superpowers/plans/2026-06-15-worker-prompt-anchor-final-fixups.md +0 -828
  95. package/docs/superpowers/plans/2026-06-15-worker-prompt-header-error-contract.md +0 -490
  96. package/docs/superpowers/plans/2026-06-17-okstra-error-report.md +0 -724
  97. package/docs/superpowers/plans/2026-06-18-subagent-pane-reclaim.md +0 -483
  98. package/docs/superpowers/plans/2026-06-19-agent-operating-standard.md +0 -476
  99. package/docs/superpowers/plans/2026-06-19-okstra-inspect-recap-facet.md +0 -647
  100. package/docs/superpowers/plans/2026-06-20-error-feedback-loop.md +0 -1019
  101. package/docs/superpowers/plans/2026-06-20-run-index-row-normalization.md +0 -583
  102. package/docs/superpowers/plans/2026-06-20-stage-auto-integrate-teardown.md +0 -819
  103. package/docs/superpowers/plans/2026-06-21-okstra-container-local-user-test.md +0 -714
  104. package/docs/superpowers/plans/2026-06-21-release-handoff-local-checkout.md +0 -348
  105. package/docs/superpowers/plans/2026-06-23-implementation-stage-multiselect-chain.md +0 -630
  106. package/docs/superpowers/plans/2026-06-23-implementation-step-commit-granularity.md +0 -274
  107. package/docs/superpowers/plans/2026-06-23-phase-batch-cleanup-enforcement.md +0 -409
  108. package/docs/superpowers/plans/2026-06-24-cross-project-precondition.md +0 -542
  109. package/docs/superpowers/plans/2026-06-24-decision-drafts-render-gap.md +0 -568
  110. package/docs/superpowers/plans/2026-06-24-manual-user-test-section.md +0 -203
  111. package/docs/superpowers/plans/2026-06-24-okstra-container-build-rename.md +0 -525
  112. package/docs/superpowers/specs/2026-05-12-ticket-id-in-reports-design.md +0 -131
  113. package/docs/superpowers/specs/2026-05-15-implementation-plan-verification-design.md +0 -254
  114. package/docs/superpowers/specs/2026-05-20-final-report-language-design.md +0 -383
  115. package/docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md +0 -322
  116. package/docs/superpowers/specs/2026-05-20-okstra-run-prompt-sot-design.md +0 -299
  117. package/docs/superpowers/specs/2026-05-21-improvement-discovery-task-type-design.md +0 -335
  118. package/docs/superpowers/specs/2026-06-02-okstra-run-branch-confirm-step-design.md +0 -113
  119. package/docs/superpowers/specs/2026-06-02-okstra-run-phase-pane-cleanup-design.md +0 -173
  120. package/docs/superpowers/specs/2026-06-02-requirements-discovery-fanout-design.md +0 -154
  121. package/docs/superpowers/specs/2026-06-04-adversarial-implementation-planning-design.md +0 -90
  122. package/docs/superpowers/specs/2026-06-04-adversarial-verification-design.md +0 -176
  123. package/docs/superpowers/specs/2026-06-04-coverage-critic-design.md +0 -99
  124. package/docs/superpowers/specs/2026-06-04-stage-splitting-cost-aware-design.md +0 -98
  125. package/docs/superpowers/specs/2026-06-05-acceptance-critic-design.md +0 -90
  126. package/docs/superpowers/specs/2026-06-05-compact-markdown-report-tables-design.md +0 -87
  127. package/docs/superpowers/specs/2026-06-05-wizard-batch-prompts-design.md +0 -121
  128. package/docs/superpowers/specs/2026-06-06-final-verification-whole-task-gate-design.md +0 -126
  129. package/docs/superpowers/specs/2026-06-06-stage-worktree-isolation-design.md +0 -180
  130. package/docs/superpowers/specs/2026-06-06-vertical-slice-tdd-planning-design.md +0 -179
  131. package/docs/superpowers/specs/2026-06-07-stage-conformance-qa-design.md +0 -169
  132. package/docs/superpowers/specs/2026-06-09-executor-model-custom-id-cascade-design.md +0 -66
  133. package/docs/superpowers/specs/2026-06-09-implementation-run-artifact-stage-isolation-design.md +0 -87
  134. package/docs/superpowers/specs/2026-06-10-blocking-contract-posthoc-conformance-design.md +0 -168
  135. package/docs/superpowers/specs/2026-06-10-concurrent-run-team-guard-design.md +0 -107
  136. package/docs/superpowers/specs/2026-06-10-git-reconcile-stale-sha-recovery-design.md +0 -105
  137. package/docs/superpowers/specs/2026-06-10-lead-worker-completion-polling-design.md +0 -113
  138. package/docs/superpowers/specs/2026-06-10-stage-group-handoff-design.md +0 -156
  139. package/docs/superpowers/specs/2026-06-11-brief-entry-only-handoff-stage-entry-design.md +0 -158
  140. package/docs/superpowers/specs/2026-06-11-fix-cycle-design.md +0 -94
  141. package/docs/superpowers/specs/2026-06-11-wizard-whole-task-final-verification-design.md +0 -89
  142. package/docs/superpowers/specs/2026-06-12-codex-lead-adapter-design.md +0 -358
  143. package/docs/superpowers/specs/2026-06-12-html-plan-approval-design.md +0 -85
  144. package/docs/superpowers/specs/2026-06-12-stage-discipline-rule-design.md +0 -108
  145. package/docs/superpowers/specs/2026-06-13-forbidden-actions-ssot-design.md +0 -134
  146. package/docs/superpowers/specs/2026-06-13-neutral-tmux-lead-adapter-design.md +0 -284
  147. package/docs/superpowers/specs/2026-06-14-host-runtime-auto-execution-design.md +0 -404
  148. package/docs/superpowers/specs/2026-06-17-okstra-error-report-design.md +0 -123
  149. package/docs/superpowers/specs/2026-06-18-subagent-pane-reclaim-design.md +0 -150
  150. package/docs/superpowers/specs/2026-06-19-agent-operating-standard-design.md +0 -120
  151. package/docs/superpowers/specs/2026-06-19-okstra-inspect-recap-facet-design.md +0 -96
  152. package/docs/superpowers/specs/2026-06-20-error-feedback-loop-design.md +0 -171
  153. package/docs/superpowers/specs/2026-06-20-run-index-row-normalization-design.md +0 -112
  154. package/docs/superpowers/specs/2026-06-20-stage-auto-integrate-teardown-design.md +0 -145
  155. package/docs/superpowers/specs/2026-06-21-okstra-container-local-user-test-design.md +0 -125
  156. package/docs/superpowers/specs/2026-06-21-release-handoff-local-checkout-design.md +0 -113
  157. package/docs/superpowers/specs/2026-06-23-implementation-stage-multiselect-chain-design.md +0 -138
  158. package/docs/superpowers/specs/2026-06-23-implementation-step-commit-granularity-design.md +0 -120
  159. package/docs/superpowers/specs/2026-06-24-cross-project-precondition-design.md +0 -129
  160. package/docs/superpowers/specs/2026-06-24-decision-drafts-render-gap-design.md +0 -185
  161. package/docs/superpowers/specs/2026-06-24-manual-user-test-section-design.md +0 -121
  162. package/docs/superpowers/specs/2026-06-24-okstra-container-build-rename-design.md +0 -110
@@ -1,504 +0,0 @@
1
- # Coding Preflight Pack Dispatch Path 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:** Ensure every implementation executor/verifier prompt receives the resolved `Coding preflight pack` path, so workers can read runtime prompt resources without relying on launch-only context or hardcoded `~/.okstra` paths.
6
-
7
- **Architecture:** `OKSTRA_CODING_PREFLIGHT_DIR` is already computed by `okstra_ctl.paths.compute_run_paths()` and rendered in the lead launch prompt. Promote that value into the machine-readable active-run-context as `runtimeResources.codingPreflightDir`, then include it as a worker prompt anchor header: `**Coding preflight pack:** <absolute-path>`. Deterministic dispatchers (`codex_dispatch.py`, `dispatch_core.py`) read the active context and inject the same header; prompt docs and tests treat this worker header as the source workers consume.
8
-
9
- **Tech Stack:** Python `okstra_ctl` render/dispatch modules, markdown prompt contracts, pytest for prompt/docs contracts, Node `node:test` for install/runtime surface checks, existing `npm run build` runtime sync.
10
-
11
- ---
12
-
13
- ## Problem
14
-
15
- The previous migration removed hardcoded `~/.okstra/prompts/coding-preflight/` paths and made worker-facing text say to use the `Coding preflight pack:` path. That path currently appears in the lead launch prompt's `## Okstra Runtime Resources` block, but worker dispatch prompts do not reliably carry that block.
16
-
17
- Observed grounding:
18
-
19
- - Launch prompt resource block includes `Coding preflight pack`: `scripts/okstra_ctl/render.py` builds it from `OKSTRA_CODING_PREFLIGHT_DIR`.
20
- - Active-run-context currently has task/run/instruction/workers/errorLogs/executorWorktree/sourceArtifacts/lazyReadPlan, but no runtime resource paths.
21
- - Worker prompt anchor contract lists only seven headers, ending at `**Errors sidecar path:**`.
22
- - Codex/Gemini materialized prompts are produced by `scripts/okstra_ctl/codex_dispatch.py::_base_prompt_headers()` and currently omit the preflight pack path.
23
- - Generic `dispatch_core.py::_materialize_prompt_if_missing()` creates a minimal fallback prompt and also omits the preflight pack path.
24
- - `agents/workers/claude-worker.md` currently points the executor to the lead prompt's `## Okstra Runtime Resources`; workers do not necessarily receive that launch prompt.
25
-
26
- ## Design decision
27
-
28
- Use a worker prompt anchor header, not prose-only forwarding.
29
-
30
- New invariant:
31
-
32
- ```markdown
33
- **Coding preflight pack:** <absolute-path>
34
- ```
35
-
36
- Placement:
37
-
38
- - Add it to every worker prompt anchor set after `**Worker Preamble Path:**` and before error-log headers.
39
- - Include it for all worker roles. Non-executor workers can ignore it; a uniform header avoids role-specific prompt shape drift.
40
- - The value must come from `active-run-context.runtimeResources.codingPreflightDir` when available.
41
- - Fallback for older active contexts: `okstra_home() / "prompts" / "coding-preflight"`, honoring `OKSTRA_HOME`.
42
-
43
- Why this design:
44
-
45
- - Workers already parse anchor headers (`Project Root`, `Result Path`, `Errors sidecar path`). This keeps path delivery in the existing mechanism.
46
- - Active-run-context is the machine-readable bridge from render-time computed paths to later deterministic dispatch.
47
- - Avoids reintroducing hidden skills or default-home literals.
48
- - Avoids inlining the whole preflight pack; workers still lazy-load only the resources selected by the router.
49
-
50
- ## Task 1: Add runtime resource paths to active-run-context
51
-
52
- **Files:**
53
- - Modify: `scripts/okstra_ctl/render.py`
54
- - Modify: `tests/test_lead_runtime_marker.py` or a new focused pytest in `tests/test_docs_runtime_contract.py`
55
-
56
- - [ ] **Step 1: Add `_active_runtime_resources(ctx)`**
57
-
58
- In `scripts/okstra_ctl/render.py`, add a helper near `_active_error_logs` / `_active_executor_worktree`:
59
-
60
- ```python
61
- def _active_runtime_resources(ctx: dict) -> dict:
62
- runtime_home = okstra_home()
63
- return {
64
- "codingPreflightDir": ctx.get("OKSTRA_CODING_PREFLIGHT_DIR")
65
- or str(runtime_home / "prompts" / "coding-preflight"),
66
- }
67
- ```
68
-
69
- Use only absolute paths. `OKSTRA_CODING_PREFLIGHT_DIR` is already computed by `paths.py` from `OKSTRA_HOME`, so this honors non-default runtime homes.
70
-
71
- - [ ] **Step 2: Persist it in `render_active_run_context`**
72
-
73
- Add the new field to the active context payload:
74
-
75
- ```python
76
- payload = {
77
- "schemaVersion": "1.0",
78
- "kind": "active-run-context",
79
- "task": _active_task(ctx),
80
- "workflow": _active_workflow(ctx),
81
- "run": _active_run(ctx),
82
- "instructionSet": _active_instruction_set(ctx),
83
- "workers": _active_workers(ctx),
84
- "errorLogs": _active_error_logs(ctx),
85
- "runtimeResources": _active_runtime_resources(ctx),
86
- "executorWorktree": _active_executor_worktree(ctx),
87
- "sourceArtifacts": _active_source_artifacts(ctx),
88
- "lazyReadPlan": _active_lazy_read_plan(),
89
- }
90
- ```
91
-
92
- Do not remove or rename existing active context fields.
93
-
94
- - [ ] **Step 3: Add active-context regression test**
95
-
96
- Add a focused test that renders a task bundle with custom `OKSTRA_HOME` and reads the generated active-run-context JSON.
97
-
98
- Expected assertions:
99
-
100
- ```python
101
- active = json.loads(active_context_path.read_text(encoding="utf-8"))
102
- assert active["runtimeResources"]["codingPreflightDir"] == (
103
- str(Path(os.environ["OKSTRA_HOME"]) / "prompts" / "coding-preflight")
104
- )
105
- ```
106
-
107
- If an existing render test already locates `activeRunContextPath`, extend it rather than adding a parallel fixture.
108
-
109
- - [ ] **Step 4: Run focused Python test**
110
-
111
- Run:
112
-
113
- ```bash
114
- python3 -m pytest tests/test_lead_runtime_marker.py tests/test_docs_runtime_contract.py
115
- ```
116
-
117
- Expected: all tests pass and the new active-context assertion confirms `OKSTRA_HOME` is honored.
118
-
119
- ## Task 2: Add `Coding preflight pack` to the worker prompt contract
120
-
121
- **Files:**
122
- - Modify: `prompts/lead/team-contract.md`
123
- - Modify: `agents/workers/claude-worker.md`
124
- - Modify: `prompts/profiles/_coding-conventions-preflight.md`
125
- - Modify: `prompts/profiles/_implementation-verifier.md`
126
- - Modify: `tests/test_docs_runtime_contract.py`
127
-
128
- - [ ] **Step 1: Update anchor header list**
129
-
130
- In `prompts/lead/team-contract.md`, update `## Worker Prompt Composition` so the anchor list becomes:
131
-
132
- ```markdown
133
- 1. `**Project Root:** <absolute-path>` — absolute target project root (from `{{PROJECT_ROOT}}` in the lead's prompt). Required so the worker can self-anchor without relying on inherited cwd.
134
- 2. `**Prompt History Path:** <project-relative-path>`
135
- 3. `**Result Path:** <project-relative-path>` — canonical destination for the worker's result file. Workers resolve it to absolute against `**Project Root:**` and use it for the post-completion existence check (see CLI wrapper agents' step 8c, and Lead's redispatch policy below). The path identifies a single file; do NOT deliver a directory.
136
- 4. `Assigned worker prompt history path: <absolute-path>` — same as the prompt-history path but resolved against `Project Root`. Codex/Gemini wrapper subagents extract this exact line.
137
- 5. `**Worker Preamble Path:** <absolute-path>` — points to `~/.okstra/templates/worker-prompt-preamble.md` (canonical SSOT for Required Reading + Error Reporting + Anchor / Output sections). Workers Read this file end-to-end before producing any output. This anchor replaces the ~80 lines of inlined `[Required reading]` / `[Error reporting]` boilerplate that earlier versions injected into every dispatch.
138
- 6. `**Coding preflight pack:** <absolute-path>` — points to the installed runtime resource pack under `<OKSTRA_HOME>/prompts/coding-preflight`. Implementation executors and verifiers use this to read `overview.md`, `clean-code.md`, and routed language/framework/architecture resources. Other worker roles may ignore it.
139
- 7. `**Errors log path:** <absolute-path>` — run-level errors JSONL.
140
- 8. `**Errors sidecar path:** <absolute-path>` — this worker's per-run sidecar JSON.
141
- ```
142
-
143
- Update any local references that say headers #6 and #7 to #7 and #8.
144
-
145
- - [ ] **Step 2: Update worker-facing prose to consume the worker header**
146
-
147
- In `agents/workers/claude-worker.md`, replace `from the lead prompt's ## Okstra Runtime Resources block` with `from this worker prompt's **Coding preflight pack:** anchor header`.
148
-
149
- Expected sentence:
150
-
151
- ```markdown
152
- Use this worker prompt's `**Coding preflight pack:**` anchor header; 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.
153
- ```
154
-
155
- - [ ] **Step 3: Update executor/verifier sidecars to consume the worker header**
156
-
157
- In `prompts/profiles/_coding-conventions-preflight.md`, replace launch-prompt wording:
158
-
159
- ```markdown
160
- Use this worker prompt's `**Coding preflight pack:**` anchor header as the absolute path to the installed routed pack.
161
- ```
162
-
163
- In `prompts/profiles/_implementation-verifier.md`, replace launch-prompt wording with the same worker-header wording.
164
-
165
- This matters because executor/verifier prompts are dispatched worker prompts, not the lead launch prompt.
166
-
167
- - [ ] **Step 4: Add docs contract checks**
168
-
169
- In `tests/test_docs_runtime_contract.py`, add or extend a test:
170
-
171
- ```python
172
- def test_worker_prompt_contract_carries_coding_preflight_pack_anchor():
173
- team_contract = _read_doc("prompts/lead/team-contract.md")
174
- assert "`**Coding preflight pack:** <absolute-path>`" in team_contract
175
- assert "**Worker Preamble Path:**" in team_contract
176
- assert team_contract.index("**Worker Preamble Path:**") < team_contract.index("**Coding preflight pack:**")
177
- assert team_contract.index("**Coding preflight pack:**") < team_contract.index("**Errors log path:**")
178
-
179
- for relative_path in [
180
- "agents/workers/claude-worker.md",
181
- "prompts/profiles/_coding-conventions-preflight.md",
182
- "prompts/profiles/_implementation-verifier.md",
183
- ]:
184
- text = _read_doc(relative_path)
185
- assert "worker prompt's `**Coding preflight pack:**`" in text, relative_path
186
- assert "lead prompt's `## Okstra Runtime Resources`" not in text, relative_path
187
- ```
188
-
189
- - [ ] **Step 5: Run focused docs tests**
190
-
191
- Run:
192
-
193
- ```bash
194
- python3 -m pytest tests/test_docs_runtime_contract.py
195
- ```
196
-
197
- Expected: all docs contract tests pass.
198
-
199
- ## Task 3: Inject the header into deterministic worker prompt materialization
200
-
201
- **Files:**
202
- - Modify: `scripts/okstra_ctl/codex_dispatch.py`
203
- - Modify: `scripts/okstra_ctl/dispatch_core.py`
204
- - Modify: `tests/test_codex_dispatch.py`
205
- - Modify or add: dispatch-core pytest if one exists for `_materialize_prompt_if_missing`
206
-
207
- - [ ] **Step 1: Add a shared local resolver in `codex_dispatch.py`**
208
-
209
- In `scripts/okstra_ctl/codex_dispatch.py`, import `okstra_home` from `okstra_ctl.paths` if not already imported:
210
-
211
- ```python
212
- from .paths import okstra_home
213
- ```
214
-
215
- Add helper near `_base_prompt_headers`:
216
-
217
- ```python
218
- def _coding_preflight_pack_path(active_context: Mapping[str, Any]) -> Path:
219
- runtime_resources = active_context.get("runtimeResources")
220
- if isinstance(runtime_resources, Mapping):
221
- value = _string_value(runtime_resources.get("codingPreflightDir"))
222
- if value:
223
- return Path(value)
224
- return okstra_home() / "prompts" / "coding-preflight"
225
- ```
226
-
227
- - [ ] **Step 2: Add header to `_base_prompt_headers`**
228
-
229
- Insert the header after `Worker Preamble Path` and before error-log headers:
230
-
231
- ```python
232
- return [
233
- f"**Project Root:** {project_root}",
234
- f"**Prompt History Path:** {prompt_rel}",
235
- f"**Result Path:** {result_rel}",
236
- f"Assigned worker prompt history path: {prompt_path}",
237
- f"**Worker Preamble Path:** {WORKER_PREAMBLE_PATH}",
238
- f"**Coding preflight pack:** {_coding_preflight_pack_path(active_context)}",
239
- f"**Errors log path:** {_errors_log_path(project_root, manifest, active_context)}",
240
- (
241
- f"**Errors sidecar path:** "
242
- f"{_worker_errors_sidecar_path(project_root, manifest, active_context, worker_id)}"
243
- ),
244
- ]
245
- ```
246
-
247
- This covers Codex/Gemini materialized analysis, executor, and report-writer prompts.
248
-
249
- - [ ] **Step 3: Add the header to `dispatch_core.py` minimal fallback**
250
-
251
- `dispatch_core.py::_materialize_prompt_if_missing()` currently receives `active_context` at the caller level but not in the function. Thread it through:
252
-
253
- ```python
254
- _materialize_prompt_if_missing(prompt_path, worker_id, result_path, project_root, active_context)
255
- ```
256
-
257
- Change the function signature:
258
-
259
- ```python
260
- def _materialize_prompt_if_missing(
261
- prompt_path: Path,
262
- worker_id: str,
263
- result_path: Path,
264
- project_root: Path,
265
- active_context: Mapping[str, Any],
266
- ) -> None:
267
- ```
268
-
269
- Add a helper in `dispatch_core.py` mirroring the resolver:
270
-
271
- ```python
272
- def _coding_preflight_pack_path(active_context: Mapping[str, Any]) -> Path:
273
- runtime_resources = active_context.get("runtimeResources")
274
- if isinstance(runtime_resources, Mapping):
275
- value = _string_value(runtime_resources.get("codingPreflightDir"))
276
- if value:
277
- return Path(value)
278
- return okstra_home() / "prompts" / "coding-preflight"
279
- ```
280
-
281
- Import `okstra_home` from `.paths`.
282
-
283
- Include the header in the fallback prompt:
284
-
285
- ```python
286
- prompt_path.write_text(
287
- "\n".join([
288
- f"# {worker_id} worker prompt",
289
- f"**Project Root:** {project_root}",
290
- f"**Result Path:** {result_path}",
291
- f"**Coding preflight pack:** {_coding_preflight_pack_path(active_context)}",
292
- "",
293
- ]),
294
- encoding="utf-8",
295
- )
296
- ```
297
-
298
- This fallback prompt is still minimal by design, but it no longer violates the runtime-resource path contract.
299
-
300
- - [ ] **Step 4: Extend Codex dispatch test**
301
-
302
- In `tests/test_codex_dispatch.py::test_build_dispatch_plan_generates_executor_prompt_for_implementation`, set the active context runtime resource path before writing it:
303
-
304
- ```python
305
- active_context["runtimeResources"] = {
306
- "codingPreflightDir": "/tmp/okstra-runtime/prompts/coding-preflight"
307
- }
308
- ```
309
-
310
- Add assertions:
311
-
312
- ```python
313
- assert "**Coding preflight pack:** /tmp/okstra-runtime/prompts/coding-preflight" in prompt
314
- assert prompt.index("**Worker Preamble Path:**") < prompt.index("**Coding preflight pack:**")
315
- assert prompt.index("**Coding preflight pack:**") < prompt.index("**Errors log path:**")
316
- ```
317
-
318
- Also add a report-writer or default worker materialization assertion if a nearby test already reads those prompt files. The header should be uniform across roles.
319
-
320
- - [ ] **Step 5: Add fallback test for old active contexts**
321
-
322
- Add a narrow test that omits `runtimeResources` from active context and sets `OKSTRA_HOME` with `monkeypatch`:
323
-
324
- ```python
325
- monkeypatch.setenv("OKSTRA_HOME", str(tmp_path / "custom-okstra-home"))
326
- ...
327
- assert f"**Coding preflight pack:** {tmp_path / 'custom-okstra-home' / 'prompts' / 'coding-preflight'}" in prompt
328
- ```
329
-
330
- Use an existing dispatch test fixture to avoid duplicating manifest setup.
331
-
332
- - [ ] **Step 6: Run focused dispatch tests**
333
-
334
- Run:
335
-
336
- ```bash
337
- python3 -m pytest tests/test_codex_dispatch.py
338
- ```
339
-
340
- Expected: all codex dispatch tests pass and materialized executor prompt includes the resolved `Coding preflight pack` header.
341
-
342
- ## Task 4: Strengthen regression guards for old skill paths and untracked resources
343
-
344
- **Files:**
345
- - Modify: `tests/test_docs_runtime_contract.py`
346
- - Modify: `tests-js/skill-catalog.test.mjs` or add a small JS filesystem test if preferred
347
-
348
- - [ ] **Step 1: Forbid old internal skill paths in scanned live docs**
349
-
350
- Extend `forbidden_fragments` in `tests/test_docs_runtime_contract.py` with exact stale path fragments:
351
-
352
- ```python
353
- "~/.claude/skills/okstra-coding-preflight",
354
- "~/.claude/skills/okstra-team-contract",
355
- "~/.claude/skills/okstra-convergence",
356
- "~/.claude/skills/okstra-report-writer",
357
- "skills/okstra-context-loader/SKILL.md",
358
- "skills/okstra-team-contract/SKILL.md",
359
- "skills/okstra-convergence/SKILL.md",
360
- "skills/okstra-report-writer/SKILL.md",
361
- "skills/okstra-coding-preflight/SKILL.md",
362
- ```
363
-
364
- The scan should remain limited to live prompts/docs/templates, not dated historical plans.
365
-
366
- - [ ] **Step 2: Add source-resource existence test**
367
-
368
- Add a test that fails if required new source files are not present in the working tree. Python is simplest because the docs test already has `REPO_ROOT`:
369
-
370
- ```python
371
- def test_internal_runtime_resource_sources_exist():
372
- for relative_path in [
373
- "src/skill-catalog.mjs",
374
- "prompts/lead/okstra-lead-contract.md",
375
- "prompts/lead/context-loader.md",
376
- "prompts/lead/team-contract.md",
377
- "prompts/lead/convergence.md",
378
- "prompts/lead/report-writer.md",
379
- "prompts/coding-preflight/overview.md",
380
- "prompts/coding-preflight/clean-code.md",
381
- "prompts/coding-preflight/languages/javascript-typescript.md",
382
- "prompts/coding-preflight/languages/python.md",
383
- "prompts/coding-preflight/languages/rust.md",
384
- "prompts/coding-preflight/languages/java.md",
385
- "prompts/coding-preflight/languages/kotlin.md",
386
- "prompts/coding-preflight/languages/sql.md",
387
- "prompts/coding-preflight/frameworks/node-server.md",
388
- "prompts/coding-preflight/architectures/hexagonal.md",
389
- ]:
390
- assert (REPO_ROOT / relative_path).is_file(), relative_path
391
- ```
392
-
393
- This does not prove git tracking by itself, but it catches clean-checkout omissions once CI runs on the branch.
394
-
395
- - [ ] **Step 3: Add manual git tracking gate before push**
396
-
397
- Before commit/push, run:
398
-
399
- ```bash
400
- git status --short -- prompts/lead prompts/coding-preflight src/skill-catalog.mjs tests-js/skill-catalog.test.mjs
401
- ```
402
-
403
- Expected: these paths appear as staged additions (`A`) or tracked modifications/deletions, not untracked (`??`). If any required runtime resource still shows `??`, stage it before pushing.
404
-
405
- ## Task 5: Final verification
406
-
407
- **Files:**
408
- - Generated: `runtime/` via `npm run build`
409
-
410
- - [ ] **Step 1: Build runtime**
411
-
412
- Run:
413
-
414
- ```bash
415
- npm run build
416
- ```
417
-
418
- Expected: build exits 0 and syncs prompt/agent/source changes into `runtime/`.
419
-
420
- - [ ] **Step 2: Focused tests**
421
-
422
- Run:
423
-
424
- ```bash
425
- python3 -m pytest tests/test_docs_runtime_contract.py tests/test_codex_dispatch.py tests/test_lead_runtime_marker.py
426
- node --test tests-js/install-runtime.test.mjs tests-js/skill-catalog.test.mjs
427
- ```
428
-
429
- Expected: all listed tests pass.
430
-
431
- - [ ] **Step 3: Materialized executor prompt smoke**
432
-
433
- Run or add a test equivalent to:
434
-
435
- ```bash
436
- python3 -m pytest tests/test_codex_dispatch.py::test_build_dispatch_plan_generates_executor_prompt_for_implementation
437
- ```
438
-
439
- Expected: generated executor prompt contains `**Coding preflight pack:** <resolved-path>` before `**Errors log path:**`.
440
-
441
- - [ ] **Step 4: Stale reference search**
442
-
443
- Run searches for live stale references:
444
-
445
- ```text
446
- ~/.okstra/prompts/coding-preflight
447
- ~/.claude/skills/okstra-coding-preflight
448
- ~/.claude/skills/okstra-team-contract
449
- skills/okstra-team-contract/SKILL.md
450
- skills/okstra-convergence/SKILL.md
451
- convergence skill
452
- schema in the convergence skill
453
- lead prompt's `## Okstra Runtime Resources`
454
- ```
455
-
456
- Expected: no matches in live prompt resources, worker templates, README, architecture docs, CLI docs, source code, or tests except forbidden-fragment test literals. Historical plans may still contain old paths when clearly archival.
457
-
458
- - [ ] **Step 5: Full suite**
459
-
460
- Run:
461
-
462
- ```bash
463
- npm run check
464
- ```
465
-
466
- Expected: build, JS tests, Python tests, and workflow validator pass.
467
-
468
- - [ ] **Step 6: Runtime surface assertion**
469
-
470
- Run:
471
-
472
- ```bash
473
- node --input-type=module -e "
474
- import assert from 'node:assert/strict';
475
- import { readdirSync, existsSync } from 'node:fs';
476
- import { join } from 'node:path';
477
- import { USER_SKILL_NAMES, OBSOLETE_INTERNAL_SKILL_NAMES } from './src/skill-catalog.mjs';
478
- const names = readdirSync('runtime/skills', { withFileTypes: true })
479
- .filter((entry) => entry.isDirectory())
480
- .map((entry) => entry.name)
481
- .sort();
482
- assert.deepEqual(names, [...USER_SKILL_NAMES].sort());
483
- for (const name of OBSOLETE_INTERNAL_SKILL_NAMES) {
484
- assert.equal(existsSync(join('runtime/skills', name)), false, name);
485
- }
486
- assert.equal(existsSync('runtime/prompts/lead/okstra-lead-contract.md'), true);
487
- assert.equal(existsSync('runtime/prompts/coding-preflight/overview.md'), true);
488
- assert.equal(existsSync('runtime/prompts/coding-preflight/languages/python.md'), true);
489
- console.log('runtime surface ok');
490
- "
491
- ```
492
-
493
- Expected: exit code 0 and `runtime surface ok`.
494
-
495
- ## Completion criteria
496
-
497
- The migration is complete only when:
498
-
499
- - Active-run-context persists `runtimeResources.codingPreflightDir` from the resolved runtime home.
500
- - Every materialized worker prompt carries `**Coding preflight pack:** <absolute-path>`.
501
- - Executor/verifier/worker prose consumes the worker prompt header, not the lead launch prompt.
502
- - No live prompt/doc/source path reintroduces hidden/internal skill locations.
503
- - Required new source/resource files are tracked before push.
504
- - Focused tests, dispatch prompt smoke, stale-reference search, `npm run check`, and runtime surface assertion pass freshly.