okstra 0.172.0 → 0.174.0
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.
- package/README.md +8 -6
- package/docs/architecture/storage-model.md +24 -3
- package/docs/architecture.md +21 -35
- package/docs/cli.md +39 -7
- package/docs/container.md +1 -1
- package/docs/contributor-change-matrix.md +1 -1
- package/docs/performance-improvement-plan-v2.md +6 -5
- package/docs/project-structure-overview.md +33 -25
- package/docs/task-process/README.md +6 -4
- package/docs/task-process/error-analysis.md +2 -2
- package/docs/task-process/final-verification.md +2 -2
- package/docs/task-process/implementation-option-selection.md +70 -0
- package/docs/task-process/implementation-planning.md +24 -16
- package/docs/task-process/requirements-discovery.md +2 -2
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/claude-worker.md +1 -1
- package/runtime/agents/workers/report-writer-worker.md +30 -6
- package/runtime/bin/lib/okstra/cli.sh +5 -1
- package/runtime/bin/lib/okstra/globals.sh +2 -1
- package/runtime/bin/lib/okstra/usage.sh +3 -0
- package/runtime/bin/okstra-provider-exec.py +29 -12
- package/runtime/bin/okstra-trace-cleanup.sh +58 -129
- package/runtime/bin/okstra.sh +2 -0
- package/runtime/prompts/duties/direction-selection-worker.md +44 -0
- package/runtime/prompts/duties/planning-worker.md +12 -4
- package/runtime/prompts/lead/adapters/cmux.md +2 -0
- package/runtime/prompts/lead/context-loader.md +1 -1
- package/runtime/prompts/lead/convergence.md +5 -5
- package/runtime/prompts/lead/okstra-lead-contract.md +7 -6
- package/runtime/prompts/lead/plan-body-verification.md +23 -6
- package/runtime/prompts/lead/report-writer.md +33 -11
- package/runtime/prompts/profiles/_common-contract.md +3 -3
- package/runtime/prompts/profiles/_implementation-deliverable.md +2 -2
- package/runtime/prompts/profiles/_implementation-executor.md +2 -0
- package/runtime/prompts/profiles/_implementation-verifier.md +2 -2
- package/runtime/prompts/profiles/error-analysis.md +4 -4
- package/runtime/prompts/profiles/final-verification.md +3 -3
- package/runtime/prompts/profiles/forbidden-actions.json +7 -0
- package/runtime/prompts/profiles/implementation-option-selection.md +35 -0
- package/runtime/prompts/profiles/implementation-planning.md +61 -46
- package/runtime/prompts/profiles/implementation.md +4 -2
- package/runtime/prompts/profiles/improvement-discovery.md +1 -1
- package/runtime/prompts/profiles/release-handoff.md +1 -1
- package/runtime/prompts/profiles/requirements-discovery.md +3 -3
- package/runtime/prompts/wizard/prompts.ko.json +9 -1
- package/runtime/python/okstra_ctl/adapters/dispatch/__init__.py +1 -6
- package/runtime/python/okstra_ctl/adapters/hosts/external/relay.md +4 -4
- package/runtime/python/okstra_ctl/adapters/providers/claude/adapter.py +5 -0
- package/runtime/python/okstra_ctl/agent_invocation.py +1 -0
- package/runtime/python/okstra_ctl/analysis_packet.py +6 -0
- package/runtime/python/okstra_ctl/conformance.py +68 -0
- package/runtime/python/okstra_ctl/dispatch_core.py +89 -39
- package/runtime/python/okstra_ctl/dispatch_state.py +142 -14
- package/runtime/python/okstra_ctl/doctor.py +2 -2
- package/runtime/python/okstra_ctl/domain/worker_exec.py +5 -0
- package/runtime/python/okstra_ctl/exact_coverage.py +128 -0
- package/runtime/python/okstra_ctl/final_report_schema.py +5 -4
- package/runtime/python/okstra_ctl/fix_cycles.py +3 -1
- package/runtime/python/okstra_ctl/implementation_direction.py +836 -0
- package/runtime/python/okstra_ctl/implementation_options.py +479 -0
- package/runtime/python/okstra_ctl/pane_reclaim.py +13 -22
- package/runtime/python/okstra_ctl/plan_items.py +51 -3
- package/runtime/python/okstra_ctl/render.py +1 -0
- package/runtime/python/okstra_ctl/render_final_report.py +16 -19
- package/runtime/python/okstra_ctl/report_contract.py +45 -14
- package/runtime/python/okstra_ctl/report_finalize.py +68 -9
- package/runtime/python/okstra_ctl/report_html/render.py +4 -2
- package/runtime/python/okstra_ctl/report_html/router.py +4 -0
- package/runtime/python/okstra_ctl/report_html/view_models/implementation_option_selection.py +32 -0
- package/runtime/python/okstra_ctl/report_html/view_models/implementation_planning.py +25 -10
- package/runtime/python/okstra_ctl/report_views.py +148 -12
- package/runtime/python/okstra_ctl/run.py +393 -4
- package/runtime/python/okstra_ctl/schema_excerpt.py +1 -1
- package/runtime/python/okstra_ctl/scope_provenance.py +16 -10
- package/runtime/python/okstra_ctl/session.py +69 -12
- package/runtime/python/okstra_ctl/team.py +51 -25
- package/runtime/python/okstra_ctl/tmux.py +19 -149
- package/runtime/python/okstra_ctl/user_response.py +75 -0
- package/runtime/python/okstra_ctl/wizard.py +144 -0
- package/runtime/python/okstra_ctl/worker_prompt_policy.py +2 -0
- package/runtime/python/okstra_ctl/worker_request.py +2 -0
- package/runtime/python/okstra_ctl/workflow.py +29 -7
- package/runtime/python/okstra_ctl/worktree.py +69 -3
- package/runtime/python/okstra_token_usage/cli.py +1 -1
- package/runtime/python/okstra_token_usage/collect.py +66 -6
- package/runtime/schemas/final-report-v2.0.schema.json +1428 -137
- package/runtime/skills/okstra-setup/references/project-config.md +11 -0
- package/runtime/templates/reports/final-report-v2.template.md +4 -0
- package/runtime/templates/reports/final-verification-input.template.md +1 -1
- package/runtime/templates/reports/html/base.template.html +3 -2
- package/runtime/templates/reports/html/i18n/en.json +21 -1
- package/runtime/templates/reports/html/i18n/ko.json +21 -1
- package/runtime/templates/reports/html/macros/forms.html +21 -2
- package/runtime/templates/reports/html/tasks/implementation-option-selection.template.html +49 -0
- package/runtime/templates/reports/html/tasks/implementation-planning.template.html +36 -2
- package/runtime/templates/reports/i18n/en.json +13 -0
- package/runtime/templates/reports/implementation-input.template.md +4 -2
- package/runtime/templates/reports/implementation-planning-input.template.md +18 -4
- package/runtime/templates/reports/improvement-discovery-input.template.md +1 -1
- package/runtime/templates/reports/md/tasks/implementation-option-selection.template.md +13 -0
- package/runtime/templates/reports/md/tasks/implementation-planning.template.md +17 -0
- package/runtime/templates/reports/report.js +111 -4
- package/runtime/templates/reports/settings.template.json +0 -24
- package/runtime/templates/reports/task-brief.template.md +9 -3
- package/runtime/templates/reports/user-response.template.md +25 -4
- package/runtime/templates/worker-prompt-preamble.md +8 -0
- package/runtime/validators/lib/fixtures.sh +49 -17
- package/runtime/validators/validate-implementation-plan-stages.py +169 -4
- package/runtime/validators/validate-report-views.py +2 -2
- package/runtime/validators/validate-run.py +149 -498
- package/runtime/validators/validate_improvement_report.py +5 -1
- package/runtime/validators/validate_session_conformance.py +1 -1
- package/src/cli-registry.mjs +8 -1
- package/src/commands/execute/codex-run.mjs +1 -0
- package/src/commands/execute/render-bundle.mjs +1 -0
- package/src/commands/execute/team.mjs +3 -3
- package/src/commands/execute/worktree-status.mjs +109 -0
- package/src/commands/lifecycle/install.mjs +0 -2
- package/src/commands/report/finalize.mjs +13 -6
- package/runtime/bin/okstra-subagent-reclaim.sh +0 -26
- package/runtime/schemas/final-report-v1.0.schema.json +0 -6366
- package/runtime/templates/reports/final-report.template.md +0 -1258
|
@@ -10,7 +10,7 @@ Use this matrix before changing high-risk repo contracts. Update the source file
|
|
|
10
10
|
| Change manager contract | `scripts/okstra_ctl/manager_*.py`, `src/commands/manager.mjs`, `skills/okstra-manager/SKILL.md`, `docs/for-ai/skills/okstra-manager.md`, `docs/cli.md`, `docs/architecture/storage-model.md` | `tests-js/manager.test.mjs`, `tests/test_okstra_manager_*.py` |
|
|
11
11
|
| Add phase | `scripts/okstra_ctl/workflow.py`, `prompts/profiles/`, `validators/`, `tests/` | workflow and validation contract tests |
|
|
12
12
|
| Change worker roster | `prompts/profiles/*.md`, `scripts/okstra_ctl/workers.py`, `tests/contract/test_repo_contracts.py` | worker roster contract tests |
|
|
13
|
-
| Change report section | `schemas/final-report-
|
|
13
|
+
| Change report section | `schemas/final-report-v2.0.schema.json`, `templates/reports/final-report-v2.template.md`, `scripts/okstra_ctl/render_final_report.py`, `validators/validate-run.py` | final-report schema, renderer, and validator tests |
|
|
14
14
|
| Maintain Korean review mirrors | `config/korean-sources.json`, `tools/korean-sources/` (`lifecycle.mjs` plus its `lifecycle-*.mjs` support modules, CLI/hooks adapters, and shared workflow), `.agents/skills/sync-korean-sources/`, `.claude/skills/sync-korean-sources/` | `tests-js/korean-sources-*.test.mjs` (`lifecycle`, `cli`, `hooks`, and `skill`) |
|
|
15
15
|
|
|
16
16
|
`runtime/` is build output. Never edit it directly; change source files and rebuild the runtime payload instead.
|
|
@@ -50,16 +50,17 @@ The current documentation and code contain two layers with similarly named phase
|
|
|
50
50
|
|
|
51
51
|
#### Task-type lifecycle
|
|
52
52
|
|
|
53
|
-
`PHASE_SEQUENCE` in `scripts/okstra_ctl/workflow.py` contains
|
|
53
|
+
`PHASE_SEQUENCE` in `scripts/okstra_ctl/workflow.py` contains the following task types in order.
|
|
54
54
|
|
|
55
55
|
| Order | task-type | Responsibility |
|
|
56
56
|
|---|---|---|
|
|
57
57
|
| 1 | `requirements-discovery` | Classify the work category, route safely to the next phase, and identify missing inputs |
|
|
58
58
|
| 2 | `error-analysis` | Analyze symptoms, root-cause hypotheses, reproduction gaps, and verification paths |
|
|
59
|
-
| 3 | `implementation-
|
|
60
|
-
| 4 | `implementation` |
|
|
61
|
-
| 5 | `
|
|
62
|
-
| 6 | `
|
|
59
|
+
| 3 | `implementation-option-selection` | Compare implementation directions, validate exact coverage, and record the user's selected direction |
|
|
60
|
+
| 4 | `implementation-planning` | Expand the `selected-direction` contract into execution order, validation, rollback, and a separate plan approval request |
|
|
61
|
+
| 5 | `implementation` | Execute the approved plan, commit, run verifier checks, and capture rollback evidence |
|
|
62
|
+
| 6 | `final-verification` | Verify acceptability and residual risk, and decide whether to enter release handoff |
|
|
63
|
+
| 7 | `release-handoff` | Perform the commit/push/PR handoff action selected by the user |
|
|
63
64
|
|
|
64
65
|
Each okstra invocation performs exactly one task type. Moving to the next task type requires a new invocation.
|
|
65
66
|
|
|
@@ -27,10 +27,10 @@ Current baseline:
|
|
|
27
27
|
- package version: see `package.json`
|
|
28
28
|
- Node CLI entrypoint: `bin/okstra`
|
|
29
29
|
- Python orchestration authority: `scripts/okstra_ctl/run.py::prepare_task_bundle`
|
|
30
|
-
- lifecycle: `requirements-discovery → error-analysis → implementation-planning → implementation → final-verification → release-handoff`
|
|
30
|
+
- lifecycle: `requirements-discovery → error-analysis → implementation-option-selection → implementation-planning → implementation → final-verification → release-handoff`
|
|
31
31
|
- installed skills: 13
|
|
32
32
|
- provider workers: `claude`, `codex`, `antigravity`, `grok`, `kimi`; functional report writer: `report-writer`
|
|
33
|
-
- final report SSOT:
|
|
33
|
+
- final report SSOT: `schemas/final-report-v2.0.schema.json` + `*.data.json`
|
|
34
34
|
|
|
35
35
|
Design principles:
|
|
36
36
|
|
|
@@ -180,6 +180,7 @@ Runtime/install asset changes follow this checklist:
|
|
|
180
180
|
| `worker-audit-check` | `src/commands/execute/worker-audit-check.mjs` | Apply the Phase 7 worker audit-sidecar rules while the worker session is still alive, so it can fix its own citations (Python: `okstra_ctl.worker_audit_check`, rules in `okstra_ctl.worker_audit_ledger`) |
|
|
181
181
|
| `context-cost` | `src/commands/inspect/context-cost.mjs` | Estimate task bundle file/read context cost |
|
|
182
182
|
| `worktree-lookup` | `src/commands/execute/worktree-lookup.mjs` | Look up a task-key's registered worktree |
|
|
183
|
+
| `worktree-status` | `src/commands/execute/worktree-status.mjs` | Clean-worktree check over source paths only, excluding okstra's provisioned entries and nested stage worktrees (Python: `okstra_ctl.worktree.dirty_entries_excluding_okstra`) |
|
|
183
184
|
| `plan-validate` | `src/commands/execute/plan-validate.mjs` | Check approved-plan approval marker |
|
|
184
185
|
| `render-bundle` | `src/commands/execute/render-bundle.mjs` | Preview `prepare_task_bundle(render_only=True)` |
|
|
185
186
|
| `profile` | `src/commands/inspect/profile-show.mjs` | Print a phase profile with `{{INCLUDE:}}` expanded and its lazy-read sidecars appended transitively, so one grep answers whether a task-type covers a rule — a top-level grep alone returns false negatives (Python: `okstra_ctl.profile_show`). Read-only, unlike `render-bundle` |
|
|
@@ -191,7 +192,7 @@ Runtime/install asset changes follow this checklist:
|
|
|
191
192
|
| `plan-items` | `src/commands/execute/plan-items.mjs` | Internal admin CLI for deterministic plan-body item extraction and exact-match validation (`extract`/`validate`; Python: `okstra_ctl.plan_items_cli`) |
|
|
192
193
|
| `agent-activity` | `src/commands/report/agent-activity.mjs` | Thin Node shim for `okstra_ctl.agent_activity`; `append` records one run-bound activity and `project` writes the validated event projection into final-report data |
|
|
193
194
|
| `report-finalize` | `src/commands/report/finalize.mjs` | Run the whole Phase 7 post-report sequence in contractual order (Python: `okstra_ctl.report_finalize`) — the single reference point shared with the Codex lead adapter |
|
|
194
|
-
| `render-views` | `src/commands/report/render-views.mjs` | Render schema v2 data with its task-specific human template, or use the
|
|
195
|
+
| `render-views` | `src/commands/report/render-views.mjs` | Render schema v2 data with its task-specific human template, or use the quick-report compatibility view |
|
|
195
196
|
| `render-final-report`, `inject-report-index` | `src/commands/report/*.mjs` | Render version-selected AI handoff Markdown from data.json; v1 index injection remains compatibility-only |
|
|
196
197
|
| `wizard` | `src/commands/execute/wizard.mjs` | Drive the `okstra-run` interactive state machine, including the final outcome envelope |
|
|
197
198
|
| `token-usage` | `src/commands/execute/token-usage.mjs` | Wrap installed Python token usage CLI |
|
|
@@ -225,11 +226,10 @@ Top-level scripts:
|
|
|
225
226
|
| `okstra-wrapper-status.py` | Standalone writer for one worker status sidecar. No longer on the dispatch path — `worker_runner.py` writes the same document in-process |
|
|
226
227
|
| `okstra-token-usage.py` | Token usage CLI entrypoint |
|
|
227
228
|
| `okstra-render-final-report.py` | Render version-selected final-report Markdown from data.json |
|
|
228
|
-
| `okstra-render-report-views.py` | Render schema v2 task-specific HTML directly from data.json, or a legacy view from
|
|
229
|
+
| `okstra-render-report-views.py` | Render schema v2 task-specific HTML directly from data.json, or a legacy view from quick Markdown |
|
|
229
230
|
| `okstra-error-log.py` | Normalize worker/lead error sidecars |
|
|
230
231
|
| `okstra-spawn-followups.py` | Follow-up spawning helper |
|
|
231
|
-
| `okstra-trace-cleanup.sh` |
|
|
232
|
-
| `okstra-subagent-reclaim.sh` | entry that walks active runs and drives `--reclaim-completed` (wired to the `SubagentStop`/`TaskCompleted` hooks). **Inert for the same reason** — it still runs and matches nothing. Left installed rather than removed: the hooks are already seeded on user machines, so retiring this is a deliberate follow-up |
|
|
232
|
+
| `okstra-trace-cleanup.sh` | Closes the harness-owned worker-agent panes of a run (excluding the lead pane), called by the lead at every worker round boundary — not once per phase; `--keep <substr>` (repeatable) spares panes whose title contains the substring, which is how an in-flight `report-writer-worker` survives a boundary; `--list` prints what would be reclaimed without killing. The tag-driven paths (`--reap`, `--reclaim-completed`, and the `@okstra_worker_run` / `@okstra_trace_run` / `@okstra_status` scan) were removed once nothing wrote those tags — a title scan scoped to the lead's window is all that remains |
|
|
233
233
|
|
|
234
234
|
### 4.3 `scripts/okstra_ctl/` — Python orchestration core
|
|
235
235
|
|
|
@@ -239,6 +239,9 @@ Important modules:
|
|
|
239
239
|
|---|---|
|
|
240
240
|
| `run.py` | `prepare_task_bundle()` single authority and CLI parser; for final-verification it adapts CLI stage input into `FinalVerificationTargetRequest`, maps the acquired target into render context, and owns `verification-target.md` snapshot/digest materialization before manifests and prompts are rendered |
|
|
241
241
|
| `agent_activity.py` | Records activity rows against run-manifest identity, imports validated command evidence from worker audit sidecars, and deterministically projects the current run's `lead-events-*.jsonl` activity rows into `agentActivity[]`. Manifests without `activityContractVersion: 1` are left unchanged. |
|
|
242
|
+
| `exact_coverage.py` | Shared pure calculator for requirement coverage and scope precision in option selection and selected-direction planning |
|
|
243
|
+
| `implementation_options.py` | Option-selection criteria, weighting, candidate fingerprint convergence, ranking, and semantic validation |
|
|
244
|
+
| `implementation_direction.py` | Selected report/response validation, direction snapshot materialization, and selected-direction reference validation |
|
|
242
245
|
| `implementation_stage.py` | `implementation` single-stage run orchestration — read the Stage Lifecycle Snapshot → pick an available Stage Map entry → provision an isolated stage worktree → publish the selected stage as run context (extracted from `run.py`) |
|
|
243
246
|
| `stage_targets.py` | Stage readiness/verification policy SSOT — from the Stage Lifecycle Snapshot (`consumers.jsonl` ledger + carry sidecar backfill + active registry reservation) it decides which stage is runnable, which commit it branches from, and what final-verification checks. `acquire_final_verification_target()` acquires the ledger, registry, worktree, Git, and optional whole-task integration facts behind one task-key mutex and returns a typed target without render-context coupling. `order_stage_closure` topologically sorts (Kahn) the dependency closure of the wizard's multi-selected stage set to produce the unattended `chain-stages` chaining order |
|
|
244
247
|
| `stage_fix_carry.py` | fix-run carry derivation for a re-run on an `implementation` stage whose latest final-report data.json carries verifier `FAIL` verdicts — collects the previous report path, previous run HEAD, failed verifiers, carried blocking findings, and a routing recommendation, which `run.py` renders into the analysis profile through the `{{FIX_RUN_CONTEXT}}` token. A first run, or a re-run after `PASS`, yields no carry and renders the token empty |
|
|
@@ -265,9 +268,9 @@ Important modules:
|
|
|
265
268
|
| `clarification_items.py` | Unified §5 clarification table parser and approval blockers |
|
|
266
269
|
| `md_table.py` | Markdown pipe-table escape/split SSOT — the `mdcell` filter (`escape_pipes`) and the `\|`-aware `split_pipe_row`; shared by the renderer, HTML view, and validators |
|
|
267
270
|
| `qa_commands.py` | QA command deny-list validation for plans |
|
|
268
|
-
| `conformance.py` | validates task-level Tier 3 manifests, parses `QA-RESULT`, detects diff capability surfaces, and reduces results to PASS/ADVISORY/BLOCKING; DB/HTTP/external non-PASS is user-owned advisory while local IO and contract defects remain blocking, enforced by `scripts/okstra_ctl/conformance.py::decide_conformance_gate` and `validators/validate-run.py::_validate_conformance` |
|
|
271
|
+
| `conformance.py` | validates task-level Tier 3 manifests, parses `QA-RESULT`, detects diff capability surfaces, and reduces results to PASS/ADVISORY/BLOCKING; DB/HTTP/external non-PASS is user-owned advisory while local IO and contract defects remain blocking, enforced by `scripts/okstra_ctl/conformance.py::decide_conformance_gate` and `validators/validate-run.py::_validate_conformance`. Also the single definition of the plan's `Conformance tests:` declaration format (`parse_conformance_tests`, `malformed_conformance_stages`), read both at the approval boundary (`run.py::_validate_approved_plan`) and at the end of an implementation run (`validators/validate-run.py`) so the two cannot disagree |
|
|
269
272
|
| `pr_template.py` | PR body template resolution for release-handoff |
|
|
270
|
-
| `report_views.py`, `render_final_report.py`, `final_report_schema.py` |
|
|
273
|
+
| `report_views.py`, `render_final_report.py`, `final_report_schema.py` | Final-report contract: schema v2 data independently produces AI handoff Markdown and human HTML |
|
|
271
274
|
| `report_markdown.py` | Schema-ordered Markdown serialisation of a data.json subtree for the AI handoff report — headings, tables for uniform row sets, prose for narrative fields; field order read from the schema, not from the mapping |
|
|
272
275
|
| `final_report_paths.py`, `report_view_artifacts.py` | Path-helper SSOT for the final-report markdown/data.json pair and the generated view artifacts (HTML view, user-responses directory) |
|
|
273
276
|
| `wizard.py` | `okstra-run` prompt state machine; user-facing Korean strings live in `prompts/wizard/prompts.ko.json` |
|
|
@@ -287,7 +290,7 @@ Important modules:
|
|
|
287
290
|
| `code_review_paths.py` | filesystem-layout SSOT for code-review result files — `stage_review_dir` / `branch_review_dir` plus `next_stage_review` / `next_branch_review`, which read the existing files to derive the next round's name (`stage-<NN>.md`, then `-r2`, `-r3`, …) or the next same-day sequence (`<YYYY-MM-DD>-<NN>.md`), so skill markdown never re-derives a literal review path |
|
|
288
291
|
| `code_review_target.py` | `okstra code-review target` backend — argument validation and JSON shaping only. Stage mode delegates whole to `okstra_project.state.code_review_target_snapshot`; branch mode is resolved here, defaulting the diff base to the merge-base with the default branch (`refs/remotes/origin/HEAD`, else `main`/`master`). Read-only: it never creates the review directory |
|
|
289
292
|
| `session.py`, `tmux.py`, `seeding.py`, `locks.py`, `invocation.py`, `sequence.py`, `ids.py`, `material.py` | Supporting lifecycle helpers |
|
|
290
|
-
| `pane_reclaim.py` |
|
|
293
|
+
| `pane_reclaim.py` | resolves which in-progress runs of the current project the `SessionStart(compact)` hook should re-inject the pane-cleanup obligation for; imports the in-progress status set from the `reconcile.NON_TERMINAL_RECENT_STATUSES` SSOT. The completed-pane decision it also used to own went away with `--reclaim-completed` |
|
|
291
294
|
| `improvement_lenses.py` | lens enum SSOT + cap constants for the improvement-discovery phase (DEFAULT 8, ABSOLUTE 12, MIN/MAX PRIORITY 1/4, SOURCE_WORKERS) |
|
|
292
295
|
| `improvement_assignment.py` | improvement-discovery primary-pass lens assignment — round-robins the resolved `requiredWorkerRoles` order over the resolved priority lenses (`assign_primary_lenses`) and validates the resulting map (`validate_primary_lens_assignments`). Only the primary pass rotates; every analyser still confirms the full lens set afterwards |
|
|
293
296
|
| `container.py` | the `okstra container` convergence entrypoint of the okstra-container-build public skill — `provision_container_group` + `up`/`status`/`logs`/`stop-watcher`/`down` dispatch, env-override synthesis, compose argv assembly, and per-container watcher startup |
|
|
@@ -330,7 +333,7 @@ Important modules:
|
|
|
330
333
|
| `plan_derivations.py` | the supersession sweep `_common-contract.md` requires an author to do by hand — extracts the symbols, paths, and ids an answered clarification names and reports every plan string that mentions one. Advisory: it locates candidates and never judges which are now false |
|
|
331
334
|
| `scope_provenance.py` | single source of truth for the scope-provenance grammar every phase-emitted requirement must declare, shared by `validators/validate-run.py` and `validators/validate_fanout.py` so the planning report and fan-out packets cannot drift |
|
|
332
335
|
| `worker_artifact_paths.py` | canonical worker artifact path derivation (e.g. `audit_sidecar_rel` inserts `-audit-` after the first `-worker-` token), so dispatch and validation agree on non-canonical-path rejection |
|
|
333
|
-
| `report_finalize.py` | Phase 7 post-report sequence **SSOT** — runs `check-source` → `token-usage` → `render-views` → `spawn-followups` → `validate-run` in that load-bearing order, stops at the first non-zero exit and names the failing step. Both lead paths converge here: the Codex adapter calls it in-process (`codex_dispatch`), a Claude-led run reaches it through `okstra report-finalize`. Neither reimplements the sequence |
|
|
336
|
+
| `report_finalize.py` | Phase 7 post-report sequence **SSOT** — runs `check-source` → `token-usage` → `render-views` → `spawn-followups` → `validate-run` in that load-bearing order, stops at the first non-zero exit and names the failing step — except `token-usage`, whose failure defers so the later steps still produce their artifacts. Both lead paths converge here: the Codex adapter calls it in-process (`codex_dispatch`), a Claude-led run reaches it through `okstra report-finalize`. Neither reimplements the sequence |
|
|
334
337
|
| `wrapper_status.py` | worker wrapper status sidecar reader — the host-side reader of the sidecar `worker_runner.py` writes. `is_terminal` is the one question it answers for the dispatch record and the pane reclaim: does `stage` read `exited` |
|
|
335
338
|
| `worker_runner.py` | runs one worker CLI and records what happened — shared by every provider entrypoint. Owns the `selectors` pump over the child's streams, the stream-arrival idle watchdog (`killpg` on breach), the run-wide progress cap on the log copy, and the status sidecar's whole life. A run that dies after launch still closes its sidecar, so `worker_liveness` never reads a dead worker as running |
|
|
336
339
|
| `worker_request.py` | assembles the `WorkerExecRequest` every strategy then takes on trust: resolved paths, the write scope in the order the CLIs are told it (project root → stage tree → the tree's git-common-dir), the verifier's toolchain grants, and the role's idle budget |
|
|
@@ -365,9 +368,10 @@ Token/cost accounting:
|
|
|
365
368
|
| Path | Role |
|
|
366
369
|
|---|---|
|
|
367
370
|
| `launch.template.md` | Lead prompt template rendered for each run |
|
|
368
|
-
| `duties/common.md`, `duties/<audience>.md` | Canonical common and functional duty contracts composed into every Okstra-owned LLM invocation; provider/model identity does not select the duty |
|
|
371
|
+
| `duties/common.md`, `duties/<audience>.md` | Canonical common and functional duty contracts composed into every Okstra-owned LLM invocation; `direction-selection-worker` owns direction comparison/validation while `planning-worker` realizes the selected direction; provider/model identity does not select the duty |
|
|
369
372
|
| `profiles/_common-contract.md` | Shared phase contract |
|
|
370
373
|
| `profiles/<task-type>.md` | Phase profiles (single language — runtime always loads from `profiles/`, never a translated mirror) |
|
|
374
|
+
| `implementation-option-selection.md` | Read-only lifecycle profile for candidate comparison or preselected-direction validation before detailed planning |
|
|
371
375
|
| `project-analysis.md`, `feature-analysis.md`, `change-impact-analysis.md` | Read-only sidetrack profiles for project mapping, one-feature behavior tracing, and proposed-change impact mapping |
|
|
372
376
|
| `wizard/prompts.ko.json` | Korean wizard prompt single source of truth |
|
|
373
377
|
|
|
@@ -375,10 +379,10 @@ Token/cost accounting:
|
|
|
375
379
|
|
|
376
380
|
| Path | Role |
|
|
377
381
|
|---|---|
|
|
378
|
-
| `templates/reports/final-report.template.md` |
|
|
382
|
+
| `templates/reports/final-report-v2.template.md` | AI handoff Markdown spine |
|
|
379
383
|
| `templates/reports/final-report-v2.template.md` | Schema v2 AI handoff Markdown spine |
|
|
380
|
-
| `templates/reports/md/tasks/*.template.md`, `md/macros/sections.md` |
|
|
381
|
-
| `templates/reports/html/base.template.html`, `html/tasks/*.template.html` | Shared HTML shell plus
|
|
384
|
+
| `templates/reports/md/tasks/*.template.md`, `md/macros/sections.md` | Eleven dedicated task bodies for the AI handoff Markdown, sibling of `html/tasks/`; shared section macro |
|
|
385
|
+
| `templates/reports/html/base.template.html`, `html/tasks/*.template.html` | Shared HTML shell plus eleven dedicated task templates for human reports; task bodies are not shared |
|
|
382
386
|
| `templates/reports/report.css`, `report.js` | Inline assets for self-contained HTML report views |
|
|
383
387
|
| `templates/reports/*.template.md` | Inputs, schedule, user-response, settings templates |
|
|
384
388
|
| `project-analysis-input.template.md`, `feature-analysis-input.template.md`, `change-impact-analysis-input.template.md` | Brief input templates for the three analysis sidetracks |
|
|
@@ -391,7 +395,7 @@ Token/cost accounting:
|
|
|
391
395
|
|
|
392
396
|
### 4.8 `schemas/`
|
|
393
397
|
|
|
394
|
-
`schemas/final-report-v2.0.schema.json` is the current final-report data.json contract. The report-writer worker writes `final-report-<task-type>-<seq>.data.json`; independent renderers produce AI handoff Markdown and task-specific human HTML.
|
|
398
|
+
`schemas/final-report-v2.0.schema.json` is the current final-report data.json contract. The report-writer worker writes `final-report-<task-type>-<seq>.data.json`; independent renderers produce AI handoff Markdown and task-specific human HTML.
|
|
395
399
|
|
|
396
400
|
The deterministic convergence inputs are `schemas/convergence-groups-v1.0.schema.json`, `schemas/convergence-round-results-v1.0.schema.json`, and `schemas/convergence-critic-results-v1.0.schema.json`. `tools/build.mjs` syncs the entire source `schemas/` directory to `runtime/schemas/`; these JSON Schema files are runtime contracts, not Markdown publication-inventory entries.
|
|
397
401
|
|
|
@@ -404,7 +408,7 @@ Optional (v1.0 backward-compatible) top-level keys:
|
|
|
404
408
|
|
|
405
409
|
| File | Role |
|
|
406
410
|
|---|---|
|
|
407
|
-
| `validate-run.py` |
|
|
411
|
+
| `validate-run.py` | Run/final-report validation: schema v2 AI handoff order + structured data rules |
|
|
408
412
|
| `validate-brief.py`, `validate-brief.sh` | Brief frontmatter/body contract validation |
|
|
409
413
|
| `validate-report-views.py` | HTML view validation (form-control placement / no external URLs / stale source digest / Response ID parity) |
|
|
410
414
|
| `validate_analysis_report.py` | Cross-field validation for the three read-only analysis reports: frozen target/evidence snapshots, current-code evidence, review-source identity, and exact affected-ID resolution coverage on revision reruns |
|
|
@@ -492,10 +496,11 @@ they are not published user skills.
|
|
|
492
496
|
3. Resolve task identity segments, work category, and the run sequence input needed for path allocation.
|
|
493
497
|
4. Provision or reuse the task-key worktree, or the selected implementation stage worktree for stage-isolated runs.
|
|
494
498
|
5. For an analysis sidetrack, resolve the immutable source commit from the provisioned worktree's `HEAD`, then resolve evidence reports, freshness, and the feature target through `analysis_inputs.py`.
|
|
495
|
-
6.
|
|
496
|
-
7.
|
|
497
|
-
8.
|
|
498
|
-
9.
|
|
499
|
+
6. For a new `implementation-planning` run, validate `--selected-direction` and materialize `instruction-set/selected-direction.json`; a same-task planning rerun validates its prior planning report instead.
|
|
500
|
+
7. Compute task/run paths and persist run context under `runs/<task-type>/manifests/`.
|
|
501
|
+
8. Materialize `instruction-set/` files and lead prompt snapshot.
|
|
502
|
+
9. Persist run inputs, team state, task manifest, task index, run manifest, timeline, discovery pointers.
|
|
503
|
+
10. Record the run in `~/.okstra/{active,recent}.jsonl` and project index.
|
|
499
504
|
|
|
500
505
|
### 5.2 Worktree model
|
|
501
506
|
|
|
@@ -532,7 +537,7 @@ Current report pipeline:
|
|
|
532
537
|
4. For implementation-planning, `okstra plan-items extract` creates the complete `P-*` queue, `validate` proves it still matches data.json, and the analyser instances run the separate plan-body verification round.
|
|
533
538
|
5. `scripts/okstra-render-final-report.py` renders compact AI handoff Markdown with `templates/reports/final-report-v2.template.md`.
|
|
534
539
|
6. Token usage substitution fills usage/cost cells.
|
|
535
|
-
7. `scripts/okstra-render-report-views.py` independently selects one of
|
|
540
|
+
7. `scripts/okstra-render-report-views.py` independently selects one of eleven dedicated task templates and emits human-facing HTML directly from the same data.json; run validation checks both derived artifacts. A quick Markdown input retains its legacy conditional path.
|
|
536
541
|
|
|
537
542
|
For the three analysis sidetracks, the HTML view also exports an immutable-source `## ANALYSIS REVIEW` sidecar. A revision rerun carries that sidecar, reanalyzes the whole confirmed scope, and records one `analysisReviewResolution` row for every affected ID before `validate_analysis_report.py` accepts the result.
|
|
538
543
|
|
|
@@ -612,9 +617,10 @@ Project-local `<PROJECT_ROOT>/.claude/settings.local.json` is provisioned as a s
|
|
|
612
617
|
|
|
613
618
|
| Phase | Purpose | Typical next step |
|
|
614
619
|
|---|---|---|
|
|
615
|
-
| `requirements-discovery` | Classify and route work | `error-analysis` or `implementation-
|
|
616
|
-
| `error-analysis` | Reproduce and explain failure | `implementation-
|
|
617
|
-
| `implementation-
|
|
620
|
+
| `requirements-discovery` | Classify and route work | `error-analysis` or `implementation-option-selection` |
|
|
621
|
+
| `error-analysis` | Reproduce and explain failure | `implementation-option-selection` |
|
|
622
|
+
| `implementation-option-selection` | Compare or validate directions; display at most three exact-coverage candidates | `implementation-planning` after direction confirmation |
|
|
623
|
+
| `implementation-planning` | Realize one selected direction as an approval-ready Stage Map and exact-coverage plan | `implementation` after separate plan approval, or `implementation-option-selection` if invalidated |
|
|
618
624
|
| `implementation` | Executor changes code, verifiers check independently | `final-verification` |
|
|
619
625
|
| `final-verification` | Read-only acceptance verification | `release-handoff` if accepted |
|
|
620
626
|
| `release-handoff` | User-selected commit/PR handoff | done or follow-up |
|
|
@@ -652,6 +658,8 @@ Edit English canonical Markdown sources directly. After changing a path register
|
|
|
652
658
|
| `S-NNN` | Secondary evidence or alternate interpretation |
|
|
653
659
|
| `R-NNN` | Missing information / risk |
|
|
654
660
|
| `RR-NNN` | Residual risk |
|
|
661
|
+
| `IO-NNN` | Ranked or audited implementation direction in option selection |
|
|
662
|
+
| `P-Dir-1` | Selected direction realization item used by plan-body verification |
|
|
655
663
|
| `P-Opt-*` | Plan option item used by plan-body verification |
|
|
656
664
|
| `P-Step-*` | Plan execution step item |
|
|
657
665
|
| `P-Dep-*` | Plan dependency / migration item |
|
|
@@ -660,7 +668,7 @@ Edit English canonical Markdown sources directly. After changing a path register
|
|
|
660
668
|
| `FU-NNN` | Follow-up task |
|
|
661
669
|
| `worker:item` | Source item pointer preserved from worker result into final report |
|
|
662
670
|
| `Verdict Token` | `accepted`, `conditional-accept`, `blocked`, `not-applicable` |
|
|
663
|
-
| `Direction` | `continue-investigation`, `begin-implementation`, `approve`, `reject`, `hold` |
|
|
671
|
+
| `Direction` | `continue-investigation`, `begin-option-selection`, `begin-implementation`, `approve`, `reject`, `hold` |
|
|
664
672
|
|
|
665
673
|
Clarifications now live in the unified `## 1. Clarification Items` table. Deprecated `5.1` / `5.2` split sections are no longer part of the schema.
|
|
666
674
|
|
|
@@ -40,7 +40,8 @@ flowchart TD
|
|
|
40
40
|
|---|---|---|
|
|
41
41
|
| `requirements-discovery` | [requirements-discovery.md](requirements-discovery.md) | Classify the request and choose the next safe phase. |
|
|
42
42
|
| `error-analysis` | [error-analysis.md](error-analysis.md) | Find cause candidates and validation paths from symptoms and evidence. |
|
|
43
|
-
| `implementation-
|
|
43
|
+
| `implementation-option-selection` | [implementation-option-selection.md](implementation-option-selection.md) | Compare or validate exact-coverage directions before detailed planning. |
|
|
44
|
+
| `implementation-planning` | [implementation-planning.md](implementation-planning.md) | Realize one selected direction as an exact-coverage plan with a separate approval gate. |
|
|
44
45
|
| `implementation` | [implementation.md](implementation.md) | The executor implements the approved plan and the verifier verifies it independently. |
|
|
45
46
|
| `final-verification` | [final-verification.md](final-verification.md) | Judge whole-task or single-stage acceptance of the implementation result. |
|
|
46
47
|
| `release-handoff` | [release-handoff.md](release-handoff.md) | Perform the push/PR handoff lead-only after an accepted verdict. |
|
|
@@ -62,15 +63,16 @@ flowchart TD
|
|
|
62
63
|
| worker roster parser | [`scripts/okstra_ctl/workers.py`](../../scripts/okstra_ctl/workers.py) |
|
|
63
64
|
| lead operating contract | [`prompts/lead/okstra-lead-contract.md`](../../prompts/lead/okstra-lead-contract.md) |
|
|
64
65
|
| phase profiles | [`prompts/profiles/`](../../prompts/profiles/) |
|
|
65
|
-
| final report shape / HTML view | [`templates/reports/final-report.template.md`](../../templates/reports/final-report.template.md), [`scripts/okstra_ctl/report_views.py`](../../scripts/okstra_ctl/report_views.py) |
|
|
66
|
+
| final report shape / HTML view | [`templates/reports/final-report-v2.template.md`](../../templates/reports/final-report-v2.template.md), [`scripts/okstra_ctl/report_views.py`](../../scripts/okstra_ctl/report_views.py) |
|
|
66
67
|
|
|
67
68
|
## 5. Quick comparison table
|
|
68
69
|
|
|
69
70
|
| task-type | wizard special question | runtime prepare gate | lead/worker mode | next phase default |
|
|
70
71
|
|---|---|---|---|---|
|
|
71
72
|
| `requirements-discovery` | common questions only | profile/brief/base-ref exist | multi-worker analysis, convergence 1 round default | `pending-routing-decision` |
|
|
72
|
-
| `error-analysis` | common questions only | profile/brief/base-ref exist | multi-worker analysis, convergence 2 rounds default | `implementation-
|
|
73
|
-
| `implementation-
|
|
73
|
+
| `error-analysis` | common questions only | profile/brief/base-ref exist | multi-worker analysis, convergence 2 rounds default | `implementation-option-selection` |
|
|
74
|
+
| `implementation-option-selection` | comparison or preselected-validation context | stable brief IDs and at least three analysers | read-only candidate validation, exact coverage, separate direction confirmation | `implementation-planning` or `blocked` |
|
|
75
|
+
| `implementation-planning` | selected-direction report for a new plan | selection report/sidecar/digest or same-task planning rerun | one-direction realization + Phase 6 plan-body verification | `implementation` after plan approval |
|
|
74
76
|
| `implementation` | approved plan, stage multi-pick, executor | approved marker, Stage Lifecycle Snapshot, stage-key reservation, QA command deny-list | one run = one stage; executor writes in isolated stage worktree, verifiers read-only | `final-verification` |
|
|
75
77
|
| `final-verification` | approved plan, stage pick (whole-task or single-stage) | `VERIFICATION_TARGET` resolved; whole-task auto integration/teardown or single-stage worktree reuse | whole-task may integrate stages first; analyser verification itself is read-only | `pending-release-handoff` |
|
|
76
78
|
| `release-handoff` | handoff scope (stage-group or whole-task), PR template override/scope | Stage Lifecycle Snapshot eligibility, generated `release-handoff-input.md`, empty worker roster | single-lead; whole-task PR or stage-group collector branch/PR | `done-or-follow-up` |
|
|
@@ -57,7 +57,7 @@ sequenceDiagram
|
|
|
57
57
|
|
|
58
58
|
For canonical briefs, preflight runs before worker resolution, worktree provisioning, or report creation. A brief whose `reporter-confirmations` status is `pending` stops at this point; legacy briefs keep the compatibility path.
|
|
59
59
|
|
|
60
|
-
The final report records its next phase in `errorAnalysis.routing.nextTaskType`. After report validation passes, workflow metadata persists that route as `nextRecommendedPhase`.
|
|
60
|
+
The final report records its next phase in `errorAnalysis.routing.nextTaskType`. After report validation passes, workflow metadata persists that route as `nextRecommendedPhase`. A credible cause uses `implementation-option-selection`; continued investigation uses `error-analysis`. The static fallback also routes a missing or legacy error-analysis report to option selection.
|
|
61
61
|
|
|
62
62
|
## 4. lead execution flow
|
|
63
63
|
|
|
@@ -92,7 +92,7 @@ The expected final-report content is:
|
|
|
92
92
|
- practical next diagnostic steps
|
|
93
93
|
- if there is blocking uncertainty, `## 1. Clarification Items`, usually `Blocks=next-phase`
|
|
94
94
|
|
|
95
|
-
For `error-analysis`, the structured `errorAnalysis` object is the source of truth for the verbatim symptom, reproduction status, `EA-NNN` cause candidates and their counter-evidence, the next diagnostic, and routing. Its shape is enforced by
|
|
95
|
+
For `error-analysis`, the structured `errorAnalysis` object is the source of truth for the verbatim symptom, reproduction status, `EA-NNN` cause candidates and their counter-evidence, the next diagnostic, and routing. Its shape is enforced by the final-report schema; `validators/validate-run.py::_validate_error_analysis_consistency` enforces the cross-field semantics. A route to `implementation-option-selection` needs a credible referenced leading cause and `begin-option-selection`. A route back to `error-analysis` needs the sharp next diagnostic and `continue-investigation`.
|
|
96
96
|
|
|
97
97
|
What is prohibited is source edit, refactor, fix attempt, implementation design artifact, and running build/migration/deploy. Deferring ambiguity that could be answered from code or logs to a user question is also a defect per the profile.
|
|
98
98
|
|
|
@@ -112,7 +112,7 @@ flowchart TD
|
|
|
112
112
|
Verdict{Verdict Token}
|
|
113
113
|
Verdict -->|accepted| Release[route to release-handoff or done]
|
|
114
114
|
Verdict -->|conditional-accept| Conditions[conditions listed exhaustively]
|
|
115
|
-
Conditions --> Followup[route
|
|
115
|
+
Conditions --> Followup[route by cause, direction, or detailed-plan defect]
|
|
116
116
|
Verdict -->|blocked| Blockers[acceptance blockers with evidence]
|
|
117
117
|
Blockers --> Followup
|
|
118
118
|
```
|
|
@@ -165,7 +165,7 @@ flowchart TD
|
|
|
165
165
|
FV -. forbidden .-> Hide[hide verifier dissent]
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
The stage merge/teardown of whole-task mode is a runtime-owned integration step that prepare performs. After that, lead verification is read-only. Source edit, follow-up fix, and scope expansion are all forbidden. When a defect is found, it is not fixed within the current run
|
|
168
|
+
The stage merge/teardown of whole-task mode is a runtime-owned integration step that prepare performs. After that, lead verification is read-only. Source edit, follow-up fix, and scope expansion are all forbidden. When a defect is found, it is not fixed within the current run. Cause defects route to `error-analysis`, selected-direction defects route to `implementation-option-selection`, and detailed-plan defects route to `implementation-planning`.
|
|
169
169
|
|
|
170
170
|
## 8. Verified code
|
|
171
171
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# implementation-option-selection process
|
|
2
|
+
|
|
3
|
+
## Index
|
|
4
|
+
|
|
5
|
+
- [1. Purpose](#1-purpose)
|
|
6
|
+
- [2. Execution modes](#2-execution-modes)
|
|
7
|
+
- [3. Prepare gates](#3-prepare-gates)
|
|
8
|
+
- [4. Candidate validation and ranking](#4-candidate-validation-and-ranking)
|
|
9
|
+
- [5. Direction confirmation and planning handoff](#5-direction-confirmation-and-planning-handoff)
|
|
10
|
+
- [6. Forbidden actions](#6-forbidden-actions)
|
|
11
|
+
- [7. Verified code](#7-verified-code)
|
|
12
|
+
|
|
13
|
+
## 1. Purpose
|
|
14
|
+
|
|
15
|
+
`implementation-option-selection` is the read-only lifecycle phase between cause analysis and detailed planning. It decides which implementation mechanism and architecture boundary planning may realize. It does not name the exact file list, split stages, or prescribe test commands.
|
|
16
|
+
|
|
17
|
+
Direction confirmation and detailed plan approval are independent user decisions. Confirming a direction permits planning to begin. It does not approve the plan or permit implementation.
|
|
18
|
+
|
|
19
|
+
## 2. Execution modes
|
|
20
|
+
|
|
21
|
+
| Mode | Input | Output |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `candidate-comparison` | Requirement ledger, cause evidence, code evidence, independently proposed raw candidates | At most three ranked valid directions and a separate user selection |
|
|
24
|
+
| `preselected-validation` | A direction already fixed by upstream evidence or an explicit user instruction | One normalized and validated direction, or `blocked`; no alternative is generated |
|
|
25
|
+
|
|
26
|
+
The normal analyser roster contains at least three analyser workers plus the report writer. Each analyser may propose at most three raw candidates. All analysers reassess the merged candidate set before ranking.
|
|
27
|
+
|
|
28
|
+
## 3. Prepare gates
|
|
29
|
+
|
|
30
|
+
Prepare rejects the phase when the brief has no stable `EB-NNN`, `PB-NNN`, or `EO-NNN` requirement IDs. External Gates are not part of that denominator. Prepare also rejects a roster with fewer than three analysers.
|
|
31
|
+
|
|
32
|
+
The phase reuses the task-key worktree and may inspect the code and prior task artifacts. It does not obtain a writable implementation-stage worktree.
|
|
33
|
+
|
|
34
|
+
## 4. Candidate validation and ranking
|
|
35
|
+
|
|
36
|
+
Every displayed candidate has all of the following properties:
|
|
37
|
+
|
|
38
|
+
- `coveragePercent == 100`
|
|
39
|
+
- `scopePrecisionPercent == 100`
|
|
40
|
+
- `coverageVerdict == exact`
|
|
41
|
+
- no `unmappedCommitments`
|
|
42
|
+
- no `contradictedRequirements`
|
|
43
|
+
- supporting code or upstream evidence
|
|
44
|
+
- at least two feasibility votes
|
|
45
|
+
- no safety blocker or unresolved implementation-critical external fact
|
|
46
|
+
|
|
47
|
+
The final report can display one, two, or three valid candidates. Rejected candidates remain in `candidateAudit` with their rejection reasons and cannot be selected. If no candidate is valid, the report uses `blocked` and planning cannot start.
|
|
48
|
+
|
|
49
|
+
Ranking uses eight fixed criteria with per-run weights: requirement fit, architecture fit, change locality, implementation complexity, correctness risk, reversibility, verification cost, and rollout cost. Safety and exact-coverage failures override the weighted score.
|
|
50
|
+
|
|
51
|
+
## 5. Direction confirmation and planning handoff
|
|
52
|
+
|
|
53
|
+
Comparison mode exports a `DIRECTION SELECTION` block in the user-response sidecar. Prepare validates the selected ID against the displayed candidates and binds the response to the report's sibling data JSON through its SHA-256 digest.
|
|
54
|
+
|
|
55
|
+
A new planning run receives the selection report through `--selected-direction`. Prepare normalizes the validated choice into `instruction-set/selected-direction.json`. Planning cites that snapshot through `selectedDirectionRef` and writes `approved: false` until the user separately approves the detailed plan.
|
|
56
|
+
|
|
57
|
+
If planning proves that the mechanism or architecture boundary cannot satisfy exact coverage, it emits `direction-invalidated` and routes back to `implementation-option-selection`. It never picks the next ranked direction automatically.
|
|
58
|
+
|
|
59
|
+
## 6. Forbidden actions
|
|
60
|
+
|
|
61
|
+
This phase does not edit source code, run builds or tests, execute migrations, deploy, or call a write API. Candidate details do not contain exact file lists, stage maps, or test commands. Those details belong to `implementation-planning` after direction confirmation.
|
|
62
|
+
|
|
63
|
+
## 7. Verified code
|
|
64
|
+
|
|
65
|
+
- [`prompts/profiles/implementation-option-selection.md`](../../prompts/profiles/implementation-option-selection.md)
|
|
66
|
+
- [`prompts/duties/direction-selection-worker.md`](../../prompts/duties/direction-selection-worker.md)
|
|
67
|
+
- [`scripts/okstra_ctl/implementation_options.py`](../../scripts/okstra_ctl/implementation_options.py)
|
|
68
|
+
- [`scripts/okstra_ctl/implementation_direction.py`](../../scripts/okstra_ctl/implementation_direction.py)
|
|
69
|
+
- [`scripts/okstra_ctl/exact_coverage.py`](../../scripts/okstra_ctl/exact_coverage.py)
|
|
70
|
+
- [`validators/validate-run.py`](../../validators/validate-run.py)
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
## 1. Purpose
|
|
14
14
|
|
|
15
|
-
`implementation-planning`
|
|
15
|
+
`implementation-planning` realizes one direction that was already confirmed by `implementation-option-selection`. It turns that mechanism and architecture boundary into a file-level Stage Map, validation checklist, rollback strategy, and exact requirement-coverage map. The resulting detailed plan has its own approval gate; direction confirmation does not approve it.
|
|
16
|
+
|
|
17
|
+
An existing plan without `planningContract: selected-direction` remains on the legacy candidate-plan contract for compatibility. A new planning run uses the selected-direction contract and does not generate or rank alternatives.
|
|
16
18
|
|
|
17
19
|
## 2. okstra-run wizard flow
|
|
18
20
|
|
|
@@ -20,7 +22,11 @@
|
|
|
20
22
|
flowchart TD
|
|
21
23
|
Start[/okstra-run/] --> Common[common task identity flow]
|
|
22
24
|
Common --> Type[task-type = implementation-planning]
|
|
23
|
-
Type -->
|
|
25
|
+
Type --> Input{new plan or planning rerun?}
|
|
26
|
+
Input -->|new| Direction[selected-direction report pick]
|
|
27
|
+
Input -->|rerun| Prior[prior planning report via clarification-response]
|
|
28
|
+
Direction --> Worktree{active task worktree?}
|
|
29
|
+
Prior --> Worktree
|
|
24
30
|
Worktree -->|yes| Defaults[Use defaults / Customize]
|
|
25
31
|
Worktree -->|no| BaseRef[base-ref pick/text]
|
|
26
32
|
BaseRef --> Defaults
|
|
@@ -33,7 +39,7 @@ flowchart TD
|
|
|
33
39
|
Confirm --> Render[render-bundle]
|
|
34
40
|
```
|
|
35
41
|
|
|
36
|
-
The wizard currently does not ask about `--no-plan-verification
|
|
42
|
+
For a new plan, the wizard asks for a validated option-selection report and passes it as `--selected-direction`. A planning clarification rerun passes its own prior report through `--clarification-response`. The wizard currently does not ask about `--no-plan-verification`; on the okstra-run path, plan-body verification is prepared as enabled by default.
|
|
37
43
|
|
|
38
44
|
## 3. prepare_task_bundle handling
|
|
39
45
|
|
|
@@ -44,8 +50,10 @@ sequenceDiagram
|
|
|
44
50
|
participant R as render.py
|
|
45
51
|
participant M as manifests
|
|
46
52
|
|
|
47
|
-
W->>P: task-type=implementation-planning
|
|
53
|
+
W->>P: task-type=implementation-planning + selected-direction or prior planning report
|
|
48
54
|
P->>P: validate profile/brief/base-ref
|
|
55
|
+
P->>P: validate selection report, data digest, response, and selected option
|
|
56
|
+
P->>M: write instruction-set/selected-direction.json
|
|
49
57
|
P->>P: resolve profile workers + optional override
|
|
50
58
|
P->>P: resolve model metadata
|
|
51
59
|
P->>P: provision/reuse task worktree
|
|
@@ -55,7 +63,7 @@ sequenceDiagram
|
|
|
55
63
|
P-->>W: prepared lead prompt
|
|
56
64
|
```
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
Prepare rejects a new plan without a selected-direction report. Comparison mode requires a valid `DIRECTION SELECTION` sidecar, while preselected-validation mode uses the confirmed upstream direction without one. The normalized snapshot binds the source report, source-data digest, option ID, direction body, requirements, and invariants.
|
|
59
67
|
|
|
60
68
|
## 4. lead execution flow
|
|
61
69
|
|
|
@@ -72,8 +80,8 @@ flowchart TD
|
|
|
72
80
|
RW --> Extract[Deterministic plan-item extraction]
|
|
73
81
|
Extract --> PBV[Phase 6 sub-step<br/>Plan-body verifier round]
|
|
74
82
|
PBV --> Gate{gate result}
|
|
75
|
-
Gate -->|passed / passed-with-dissent| Approval[render
|
|
76
|
-
Gate -->|blocked-by-disagreement / aborted-non-result| NoApproval[render
|
|
83
|
+
Gate -->|passed / passed-with-dissent| Approval[render plan decision approval control]
|
|
84
|
+
Gate -->|blocked-by-disagreement / aborted-non-result| NoApproval[render blocked plan decision]
|
|
77
85
|
Approval --> P7[Phase 7 persistence/finalization<br/>canonical Markdown render<br/>HTML render + validate-run<br/>via okstra report-finalize]
|
|
78
86
|
NoApproval --> P7
|
|
79
87
|
```
|
|
@@ -118,9 +126,8 @@ Plan approval and design-preparation status are independent gates. If plan-body
|
|
|
118
126
|
|
|
119
127
|
```mermaid
|
|
120
128
|
flowchart LR
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
Rec --> Stages[Stage Map + Stage Exit/Validation]
|
|
129
|
+
Direction[Selected Direction Snapshot] --> Realize[Direction Realization]
|
|
130
|
+
Realize --> Stages[Stage Map + Stage Exit/Validation]
|
|
124
131
|
Stages --> Prep[Implementation Design Preparation]
|
|
125
132
|
Prep --> Dep[Dependency / Migration Risk]
|
|
126
133
|
Dep --> Val[Validation Checklist]
|
|
@@ -130,11 +137,10 @@ flowchart LR
|
|
|
130
137
|
Approval --> Impl[Next run: implementation]
|
|
131
138
|
```
|
|
132
139
|
|
|
133
|
-
|
|
140
|
+
The selected-direction branch verifies `P-Dir-1` before its stage, dependency, validation, rollback, requirement, preparation, and variation items. `P-Dir-1` proves that the plan preserves the selected mechanism, architecture boundary, invariants, and user constraints. The legacy branch continues to extract `P-Opt-*` from its option candidates.
|
|
141
|
+
|
|
142
|
+
The detailed selected-direction plan retains these deliverable surfaces:
|
|
134
143
|
|
|
135
|
-
- `Option Candidates`
|
|
136
|
-
- `Trade-off`
|
|
137
|
-
- `Recommended Option`
|
|
138
144
|
- `Stage Map`
|
|
139
145
|
- `Stage Exit Contract`
|
|
140
146
|
- `Stage Validation`
|
|
@@ -146,7 +152,9 @@ Because the validator searches for the English substring of the section heading,
|
|
|
146
152
|
- `Requirement Coverage`
|
|
147
153
|
- `Implementation Design Preparation`
|
|
148
154
|
|
|
149
|
-
Approval is recorded with `approved: true` in
|
|
155
|
+
Approval is recorded with `approved: true` in YAML frontmatter. A selected-direction plan has no `implementation-option:` field and rejects `--implementation-option` before any approval-file mutation. If a `Blocks=approval` clarification row is unresolved, implementation prepare rejects the plan even when frontmatter is approved. Existing candidate plans keep their legacy option field and execution behavior.
|
|
156
|
+
|
|
157
|
+
`plan-ready` requires 100% requirement coverage, 100% scope precision, and no unmapped stage or file change. If the selected mechanism or boundary cannot meet those conditions, planning emits `direction-invalidated` without an executable Stage Map and routes back to `implementation-option-selection`. It does not choose another direction automatically.
|
|
150
158
|
|
|
151
159
|
## 6. Forbidden actions
|
|
152
160
|
|
|
@@ -165,7 +173,7 @@ This phase only produces the plan document. Code-level micro-optimization, sourc
|
|
|
165
173
|
|
|
166
174
|
- [`prompts/profiles/implementation-planning.md`](../../prompts/profiles/implementation-planning.md)
|
|
167
175
|
- [`templates/reports/implementation-planning-input.template.md`](../../templates/reports/implementation-planning-input.template.md)
|
|
168
|
-
- [`templates/reports/final-report.template.md`](../../templates/reports/final-report.template.md)
|
|
176
|
+
- [`templates/reports/final-report-v2.template.md`](../../templates/reports/final-report-v2.template.md)
|
|
169
177
|
- [`scripts/okstra_ctl/render.py`](../../scripts/okstra_ctl/render.py)
|
|
170
178
|
- [`validators/validate-run.py`](../../validators/validate-run.py)
|
|
171
179
|
- [`prompts/lead/okstra-lead-contract.md`](../../prompts/lead/okstra-lead-contract.md)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
## 1. Purpose
|
|
13
13
|
|
|
14
|
-
`requirements-discovery` classifies the request before implementation. It determines which of bugfix, feature, improvement, refactor, or ops it is, and chooses whether the next safe phase is `error-analysis` or `implementation-
|
|
14
|
+
`requirements-discovery` classifies the request before implementation. It determines which of bugfix, feature, improvement, refactor, or ops it is, and chooses whether the next safe phase is `error-analysis` or `implementation-option-selection`. Going directly to planning or implementation is not valid for a new direction. Implementation can only start once a selected direction has been expanded into a separately approved `implementation-planning` report.
|
|
15
15
|
|
|
16
16
|
## 2. okstra-run wizard flow
|
|
17
17
|
|
|
@@ -90,7 +90,7 @@ flowchart LR
|
|
|
90
90
|
RD --> Domain[Domain Alignment<br/>terminology resolution]
|
|
91
91
|
RD --> Route{next safe phase}
|
|
92
92
|
Route --> EA[error-analysis]
|
|
93
|
-
Route -->
|
|
93
|
+
Route --> IOS[implementation-option-selection]
|
|
94
94
|
Route -. invalid .-> Impl[implementation<br/>not allowed directly]
|
|
95
95
|
```
|
|
96
96
|
|
package/package.json
CHANGED
package/runtime/BUILD.json
CHANGED
|
@@ -64,7 +64,7 @@ Before producing any output, you MUST:
|
|
|
64
64
|
2. Read every primary input file the lead enumerated under `## Inputs` (or equivalent heading) end-to-end, following the selected preamble. Analysis workers normally receive `analysis-packet.md`; implementation workers receive their role sidecar and approved deliverable inputs.
|
|
65
65
|
3. When the prompt carries `**Evidence ledger:** required-v1`, follow the selected preamble's `Evidence read ledger` procedure for every claim-evidence file you open. Do not invent a separate audit-row format here.
|
|
66
66
|
|
|
67
|
-
**Heartbeat — write the audit sidecar EARLY and APPEND per stage (BLOCKING).** This worker runs as an in-process Agent or a
|
|
67
|
+
**Heartbeat — write the audit sidecar EARLY and APPEND per stage (BLOCKING).** This worker runs as an in-process Agent, a cmux surface, or a CLI wrapper subprocess, so the lead has no `BashOutput`-style liveness signal while it waits for your return — the audit sidecar is the only signal that survives a silent hang.
|
|
68
68
|
|
|
69
69
|
- **Where:** the absolute path in `**Audit sidecar path:**`.
|
|
70
70
|
- **Start (before the per-file reads):** immediately after extracting `Project Root` and the assigned paths, `Write` just the heading line (`# Claude Worker Audit — <task-key>`) plus one `- PROGRESS: started <ISO-8601-UTC>` line.
|