okstra 0.201.3 → 0.204.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 +3 -3
- package/dist/cli-registry.mjs +7 -7
- package/dist/cli-registry.mjs.map +1 -1
- package/dist/commands/lifecycle/install.mjs +50 -124
- package/dist/commands/lifecycle/install.mjs.map +1 -1
- package/dist/commands/lifecycle/setup.mjs +15 -0
- package/dist/commands/lifecycle/setup.mjs.map +1 -1
- package/dist/commands/memory/memory.mjs +41 -8
- package/dist/commands/memory/memory.mjs.map +1 -1
- package/dist/lib/citation-guidance.d.mts +21 -0
- package/dist/lib/citation-guidance.mjs +79 -0
- package/dist/lib/citation-guidance.mjs.map +1 -0
- package/dist/lib/install-assets.mjs +3 -0
- package/dist/lib/install-assets.mjs.map +1 -1
- package/dist/lib/runtime-manifest.mjs +2 -1
- package/dist/lib/runtime-manifest.mjs.map +1 -1
- package/dist/lib/types.d.mts +2 -1
- package/docs/architecture/storage-model.md +17 -10
- package/docs/architecture.md +26 -20
- package/docs/cli.md +16 -13
- package/docs/contributor-change-matrix.md +3 -2
- package/docs/performance-improvement-plan-v2.md +2 -3
- package/docs/project-structure-overview.md +38 -9
- package/docs/task-process/README.md +1 -1
- package/docs/task-process/common-flow.md +1 -1
- package/docs/task-process/final-verification.md +3 -1
- package/docs/task-process/implementation.md +1 -1
- package/docs/task-process/release-handoff.md +36 -39
- package/package.json +1 -2
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/common.json +28 -0
- package/runtime/agents/operations/code-review.json +6 -0
- package/runtime/agents/operations/report-translation.json +6 -0
- package/runtime/agents/operations/schedule-verification.json +6 -0
- package/runtime/agents/roles/analyser.json +18 -0
- package/runtime/agents/roles/critic.json +18 -0
- package/runtime/agents/roles/designer.json +18 -0
- package/runtime/agents/roles/implementer.json +20 -0
- package/runtime/agents/roles/leader.json +20 -0
- package/runtime/agents/roles/planner.json +18 -0
- package/runtime/agents/roles/report-writer.json +19 -0
- package/runtime/agents/roles/translator.json +19 -0
- package/runtime/agents/roles/verifier.json +18 -0
- package/runtime/bin/lib/okstra/usage.sh +5 -5
- package/runtime/prompts/duties/acceptance-critic.json +32 -0
- package/runtime/prompts/duties/acceptance-verifier.json +32 -0
- package/runtime/prompts/duties/analysis-worker.json +32 -0
- package/runtime/prompts/duties/code-reviewer.json +32 -0
- package/runtime/prompts/duties/diagnosis-worker.json +32 -0
- package/runtime/prompts/duties/direction-selection-worker.json +32 -0
- package/runtime/prompts/duties/discovery-worker.json +32 -0
- package/runtime/prompts/duties/implementation-executor.json +32 -0
- package/runtime/prompts/duties/implementation-verifier.json +32 -0
- package/runtime/prompts/duties/lead.json +32 -0
- package/runtime/prompts/duties/planning-worker.json +36 -0
- package/runtime/prompts/duties/report-writer.json +32 -0
- package/runtime/prompts/duties/reverification-worker.json +32 -0
- package/runtime/prompts/duties/schedule-verifier.json +32 -0
- package/runtime/prompts/duties/scope-critic.json +32 -0
- package/runtime/prompts/duties/technical-verification-worker.json +32 -0
- package/runtime/prompts/duties/translator.json +32 -0
- package/runtime/prompts/launch.template.md +3 -2
- package/runtime/prompts/lead/adapters/cmux.md +1 -1
- package/runtime/prompts/lead/convergence.md +4 -4
- package/runtime/prompts/lead/okstra-lead-contract.md +115 -6
- package/runtime/prompts/lead/plan-body-verification.md +6 -6
- package/runtime/prompts/lead/report-writer.md +3 -3
- package/runtime/prompts/profiles/_common-contract.md +2 -2
- package/runtime/prompts/profiles/_implementation-executor.md +4 -1
- package/runtime/prompts/profiles/_implementation-verifier.md +3 -3
- package/runtime/prompts/profiles/change-impact-analysis.json +31 -0
- package/runtime/prompts/profiles/change-impact-analysis.md +0 -20
- package/runtime/prompts/profiles/error-analysis.json +39 -0
- package/runtime/prompts/profiles/error-analysis.md +0 -25
- package/runtime/prompts/profiles/feature-analysis.json +31 -0
- package/runtime/prompts/profiles/feature-analysis.md +0 -20
- package/runtime/prompts/profiles/final-verification.json +30 -0
- package/runtime/prompts/profiles/final-verification.md +3 -22
- package/runtime/prompts/profiles/forbidden-actions.json +4 -3
- package/runtime/prompts/profiles/implementation-option-selection.json +31 -0
- package/runtime/prompts/profiles/implementation-option-selection.md +0 -20
- package/runtime/prompts/profiles/implementation-planning.json +40 -0
- package/runtime/prompts/profiles/implementation-planning.md +6 -29
- package/runtime/prompts/profiles/implementation.json +30 -0
- package/runtime/prompts/profiles/implementation.md +1 -20
- package/runtime/prompts/profiles/improvement-discovery.json +31 -0
- package/runtime/prompts/profiles/improvement-discovery.md +0 -20
- package/runtime/prompts/profiles/project-analysis.json +31 -0
- package/runtime/prompts/profiles/project-analysis.md +0 -20
- package/runtime/prompts/profiles/release-handoff.json +5 -0
- package/runtime/prompts/profiles/release-handoff.md +71 -73
- package/runtime/prompts/profiles/requirements-discovery.json +39 -0
- package/runtime/prompts/profiles/requirements-discovery.md +0 -25
- package/runtime/prompts/profiles/technical-verification.json +39 -0
- package/runtime/prompts/profiles/technical-verification.md +0 -25
- package/runtime/prompts/wizard/prompts.ko.json +12 -17
- package/runtime/python/okstra_ctl/adapters/hosts/antigravity/relay.md +1 -0
- package/runtime/python/okstra_ctl/adapters/hosts/claude-code/adapter.py +3 -0
- package/runtime/python/okstra_ctl/adapters/hosts/claude-code/manifest.json +1 -1
- package/runtime/python/okstra_ctl/adapters/hosts/claude-code/relay.md +4 -3
- package/runtime/python/okstra_ctl/adapters/hosts/claude-code/worker-session.md +108 -0
- package/runtime/python/okstra_ctl/adapters/hosts/codex/relay.md +1 -0
- package/runtime/python/okstra_ctl/adapters/hosts/grok/relay.md +2 -0
- package/runtime/python/okstra_ctl/adapters/hosts/kimi/relay.md +2 -0
- package/runtime/python/okstra_ctl/adapters/providers/antigravity/adapter.py +8 -1
- package/runtime/python/okstra_ctl/adapters/providers/claude/adapter.py +8 -0
- package/runtime/python/okstra_ctl/adapters/providers/codex/adapter.py +23 -6
- package/runtime/python/okstra_ctl/adapters/providers/grok/adapter.py +6 -2
- package/runtime/python/okstra_ctl/agent/invocation.py +168 -113
- package/runtime/python/okstra_ctl/agent/prompt_cli/cli.py +120 -0
- package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +107 -2
- package/runtime/python/okstra_ctl/agent/prompt_cli/run_identity.py +0 -49
- package/runtime/python/okstra_ctl/analysis_packet.py +4 -1
- package/runtime/python/okstra_ctl/application/open_worker.py +6 -1
- package/runtime/python/okstra_ctl/assignment_resolver.py +16 -5
- package/runtime/python/okstra_ctl/cmux.py +69 -20
- package/runtime/python/okstra_ctl/code_review_target.py +16 -8
- package/runtime/python/okstra_ctl/conformance.py +43 -0
- package/runtime/python/okstra_ctl/consumers.py +6 -3
- package/runtime/python/okstra_ctl/container.py +31 -8
- package/runtime/python/okstra_ctl/context_cost.py +11 -15
- package/runtime/python/okstra_ctl/contract_refreeze.py +156 -0
- package/runtime/python/okstra_ctl/convergence_critic_prompt.py +4 -6
- package/runtime/python/okstra_ctl/convergence_provenance.py +81 -18
- package/runtime/python/okstra_ctl/design_prep.py +34 -1
- package/runtime/python/okstra_ctl/dispatch_core.py +53 -27
- package/runtime/python/okstra_ctl/domain/host.py +5 -0
- package/runtime/python/okstra_ctl/domain/worker_runtime.py +10 -0
- package/runtime/python/okstra_ctl/error_report.py +4 -3
- package/runtime/python/okstra_ctl/execution_manifest.py +71 -18
- package/runtime/python/okstra_ctl/execution_mutation_audit.py +21 -21
- package/runtime/python/okstra_ctl/handoff.py +167 -277
- package/runtime/python/okstra_ctl/implementation_stage.py +9 -0
- package/runtime/python/okstra_ctl/initial_prompt_materialization.py +113 -0
- package/runtime/python/okstra_ctl/lead_progress.py +1 -1
- package/runtime/python/okstra_ctl/legacy_model_selection.py +2 -2
- package/runtime/python/okstra_ctl/manager_cli.py +175 -14
- package/runtime/python/okstra_ctl/manager_launch.py +41 -19
- package/runtime/python/okstra_ctl/manager_paths.py +22 -3
- package/runtime/python/okstra_ctl/manager_split.py +474 -0
- package/runtime/python/okstra_ctl/manager_store.py +331 -21
- package/runtime/python/okstra_ctl/manager_sync.py +37 -16
- package/runtime/python/okstra_ctl/manager_view.py +217 -0
- package/runtime/python/okstra_ctl/model_discovery.py +30 -0
- package/runtime/python/okstra_ctl/model_io/lines.py +14 -1
- package/runtime/python/okstra_ctl/model_io/renderers.py +4 -3
- package/runtime/python/okstra_ctl/models.py +1 -1
- package/runtime/python/okstra_ctl/next_phase.py +16 -6
- package/runtime/python/okstra_ctl/operation_invocation.py +86 -0
- package/runtime/python/okstra_ctl/option_comparison.py +168 -0
- package/runtime/python/okstra_ctl/path_hints.py +9 -0
- package/runtime/python/okstra_ctl/paths.py +3 -0
- package/runtime/python/okstra_ctl/plan_items_cli.py +6 -1
- package/runtime/python/okstra_ctl/profile_show.py +42 -1
- package/runtime/python/okstra_ctl/qa_commands.py +15 -0
- package/runtime/python/okstra_ctl/registry/host_discovery.py +20 -12
- package/runtime/python/okstra_ctl/registry/host_registry.py +11 -0
- package/runtime/python/okstra_ctl/render.py +50 -0
- package/runtime/python/okstra_ctl/report_contract.py +1 -1
- package/runtime/python/okstra_ctl/report_finalize.py +13 -6
- package/runtime/python/okstra_ctl/report_html/view_models/final_verification.py +2 -21
- package/runtime/python/okstra_ctl/report_html/view_models/release_handoff.py +21 -3
- package/runtime/python/okstra_ctl/report_html/visualizations.py +0 -5
- package/runtime/python/okstra_ctl/report_synthesis_packet.py +177 -17
- package/runtime/python/okstra_ctl/report_translation.py +2 -1
- package/runtime/python/okstra_ctl/report_translation_dispatch.py +69 -9
- package/runtime/python/okstra_ctl/role_requirements.py +142 -129
- package/runtime/python/okstra_ctl/rollup.py +3 -1
- package/runtime/python/okstra_ctl/run.py +76 -29
- package/runtime/python/okstra_ctl/schedule_semantics.py +17 -6
- package/runtime/python/okstra_ctl/stage_fix_carry.py +23 -4
- package/runtime/python/okstra_ctl/stage_integrate.py +178 -18
- package/runtime/python/okstra_ctl/stage_map.py +16 -2
- package/runtime/python/okstra_ctl/stage_targets.py +209 -43
- package/runtime/python/okstra_ctl/team.py +22 -13
- package/runtime/python/okstra_ctl/time_report.py +2 -1
- package/runtime/python/okstra_ctl/usage_report.py +3 -1
- package/runtime/python/okstra_ctl/verification_target.py +13 -2
- package/runtime/python/okstra_ctl/wizard/confirmation.py +3 -9
- package/runtime/python/okstra_ctl/wizard/ids.py +1 -1
- package/runtime/python/okstra_ctl/wizard/registry.py +1 -1
- package/runtime/python/okstra_ctl/wizard/state.py +3 -5
- package/runtime/python/okstra_ctl/wizard/steps_plan.py +3 -23
- package/runtime/python/okstra_ctl/worker_prompt_contract.py +5 -1
- package/runtime/python/okstra_ctl/worker_prompt_headers.py +35 -7
- package/runtime/python/okstra_ctl/worker_prompt_policy.py +66 -48
- package/runtime/python/okstra_ctl/workflow.py +1 -1
- package/runtime/python/okstra_ctl/worktree/__init__.py +3 -1
- package/runtime/python/okstra_ctl/worktree/naming.py +9 -0
- package/runtime/python/okstra_ctl/worktree_registry.py +38 -9
- package/runtime/python/okstra_token_usage/pricing.py +6 -4
- package/runtime/schemas/agent-common-v1.schema.json +34 -0
- package/runtime/schemas/agent-duty-v1.schema.json +38 -0
- package/runtime/schemas/agent-operation-v1.schema.json +11 -0
- package/runtime/schemas/agent-profile-v1.schema.json +46 -0
- package/runtime/schemas/agent-role-v1.schema.json +29 -0
- package/runtime/schemas/final-report-v2.0.schema.json +118 -97
- package/runtime/schemas/final-report-v3.0.schema.json +118 -97
- package/runtime/skills/okstra-brief-gen/SKILL.md +84 -4
- package/runtime/skills/okstra-chat/SKILL.md +2 -2
- package/runtime/skills/okstra-code-review/SKILL.md +23 -9
- package/runtime/skills/okstra-container-build/SKILL.md +10 -10
- package/runtime/skills/okstra-inspect/SKILL.md +1 -1
- package/runtime/skills/okstra-inspect/facets/cost.md +1 -1
- package/runtime/skills/okstra-inspect/facets/error-zip.md +9 -9
- package/runtime/skills/okstra-inspect/facets/errors.md +16 -16
- package/runtime/skills/okstra-inspect/facets/logs.md +7 -7
- package/runtime/skills/okstra-inspect/facets/recap.md +2 -2
- package/runtime/skills/okstra-inspect/facets/report.md +1 -1
- package/runtime/skills/okstra-inspect/facets/status.md +4 -3
- package/runtime/skills/okstra-inspect/facets/time.md +11 -10
- package/runtime/skills/okstra-manager/SKILL.md +70 -5
- package/runtime/skills/okstra-pr-gen/SKILL.md +6 -5
- package/runtime/skills/okstra-rollup/SKILL.md +5 -5
- package/runtime/skills/okstra-run/SKILL.md +32 -13
- package/runtime/skills/okstra-schedule-gen/SKILL.md +19 -14
- package/runtime/skills/okstra-setup/SKILL.md +21 -10
- package/runtime/skills/okstra-setup/references/project-config.md +7 -6
- package/runtime/skills/okstra-usage/SKILL.md +1 -1
- package/runtime/skills/okstra-user-response/SKILL.md +1 -1
- package/runtime/templates/manager/view.template.html +109 -0
- package/runtime/templates/report-writer-prompt-preamble.md +8 -0
- package/runtime/templates/reports/brief.template.md +14 -4
- package/runtime/templates/reports/html/i18n/en.json +7 -4
- package/runtime/templates/reports/html/i18n/ko.json +7 -4
- package/runtime/templates/reports/html/tasks/final-verification.template.html +2 -2
- package/runtime/templates/reports/html/tasks/release-handoff.template.html +8 -5
- package/runtime/templates/reports/i18n/en.json +1 -1
- package/runtime/templates/reports/md/tasks/release-handoff.template.md +1 -1
- package/runtime/templates/reports/release-handoff-input.template.md +6 -4
- package/runtime/templates/translator-prompt-preamble.md +36 -0
- package/runtime/validators/checks/validate-assets-01.py +7 -8
- package/runtime/validators/validate-brief.py +77 -2
- package/runtime/validators/validate-implementation-plan-stages.py +2 -1
- package/runtime/validators/validate-run.py +59 -9
- package/runtime/validators/validate-schedule.py +9 -0
- package/docs/for-ai/README.md +0 -68
- package/docs/for-ai/skills/okstra-brief-gen.md +0 -262
- package/docs/for-ai/skills/okstra-chat.md +0 -34
- package/docs/for-ai/skills/okstra-code-review.md +0 -57
- package/docs/for-ai/skills/okstra-container-build.md +0 -129
- package/docs/for-ai/skills/okstra-inspect.md +0 -262
- package/docs/for-ai/skills/okstra-manager.md +0 -69
- package/docs/for-ai/skills/okstra-memory.md +0 -126
- package/docs/for-ai/skills/okstra-pr-gen.md +0 -49
- package/docs/for-ai/skills/okstra-rollup.md +0 -114
- package/docs/for-ai/skills/okstra-run.md +0 -250
- package/docs/for-ai/skills/okstra-schedule-gen.md +0 -240
- package/docs/for-ai/skills/okstra-setup.md +0 -158
- package/docs/for-ai/skills/okstra-usage.md +0 -29
- package/docs/for-ai/skills/okstra-user-response.md +0 -72
- package/runtime/agents/workers/claude-worker.md +0 -128
- package/runtime/agents/workers/report-writer-worker.md +0 -37
- package/runtime/agents/workers/translator-worker.md +0 -63
- package/runtime/prompts/duties/acceptance-critic.md +0 -44
- package/runtime/prompts/duties/acceptance-verifier.md +0 -44
- package/runtime/prompts/duties/analysis-worker.md +0 -44
- package/runtime/prompts/duties/code-reviewer.md +0 -44
- package/runtime/prompts/duties/common.md +0 -39
- package/runtime/prompts/duties/diagnosis-worker.md +0 -44
- package/runtime/prompts/duties/direction-selection-worker.md +0 -44
- package/runtime/prompts/duties/discovery-worker.md +0 -44
- package/runtime/prompts/duties/implementation-executor.md +0 -44
- package/runtime/prompts/duties/implementation-verifier.md +0 -44
- package/runtime/prompts/duties/lead.md +0 -44
- package/runtime/prompts/duties/planning-worker.md +0 -52
- package/runtime/prompts/duties/report-writer.md +0 -44
- package/runtime/prompts/duties/reverification-worker.md +0 -44
- package/runtime/prompts/duties/schedule-verifier.md +0 -44
- package/runtime/prompts/duties/scope-critic.md +0 -44
- package/runtime/prompts/duties/technical-verification-worker.md +0 -44
- package/runtime/prompts/duties/translator.md +0 -44
- package/runtime/python/okstra_ctl/pane_title.py +0 -154
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# okstra-pr-gen AI Manual
|
|
2
|
-
|
|
3
|
-
## Sources
|
|
4
|
-
|
|
5
|
-
- Skill source: [`skills/okstra-pr-gen/SKILL.md`](../../../skills/okstra-pr-gen/SKILL.md)
|
|
6
|
-
- Template core (CLI): [`scripts/okstra_ctl/pr_template.py`](../../../scripts/okstra_ctl/pr_template.py)
|
|
7
|
-
- Node wrapper: [`src/commands/pr/pr.mjs`](../../../src/commands/pr/pr.mjs)
|
|
8
|
-
- Bundled default template: [`src/commands/pr/default.md`](../../../src/commands/pr/default.md)
|
|
9
|
-
|
|
10
|
-
## Purpose
|
|
11
|
-
|
|
12
|
-
`okstra-pr-gen` registers PR body templates and generates PR descriptions from a branch diff. Templates live in the user home at `~/.okstra/template/pr/`. This skill is **global** — it does not require `<PROJECT_ROOT>/.okstra/project.json`. PR generation additionally requires the current directory to be a git repository.
|
|
13
|
-
|
|
14
|
-
## Check CLI availability
|
|
15
|
-
|
|
16
|
-
A separate Bash call with a literal leading token:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
okstra pr --help
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
If `okstra` is not on PATH: `okstra not installed — run npx okstra@latest install once, then retry`. Every Bash command starts with the literal `okstra` token and passes literal arguments (do not wrap it in `$(...)`/leading `VAR=`/`if`/`eval`/`||`/`&&`).
|
|
23
|
-
|
|
24
|
-
## Pick the mode (always first)
|
|
25
|
-
|
|
26
|
-
A 3-option picker via `AskUserQuestion`:
|
|
27
|
-
|
|
28
|
-
1. `Generate PR` — generate a PR body from a branch diff
|
|
29
|
-
2. `Register template` — save a new PR body template
|
|
30
|
-
3. `Enter directly` — always last (okstra picker convention)
|
|
31
|
-
|
|
32
|
-
## Mode A — Generate PR
|
|
33
|
-
|
|
34
|
-
1. Pick a template: `okstra pr template list`. If the numbered `Templates` rows are empty, use the bundled default. Carry the chosen name as `<template>` (`default` for the bundled one).
|
|
35
|
-
2. Pick the base branch: `okstra pr branches`. Build a 3-option picker from the numbered `Recommended` rows plus `Enter directly`. Carry the choice as `<base>`.
|
|
36
|
-
3. Generation bundle: `okstra pr gen --base <base> --template <template>`. Read the fixed `Base`, `Current branch`, `Template name`, `Commits`, `Diff stat`, and `Template` sections. Then **read the real diff honestly** (SSOT): `git diff <base>...HEAD` (large diffs section by section). Fill the placeholders from the diff and commits, describing **only actual changes**. Mark a checklist box `[x]` only when the diff supports it (tests touched → tests box, docs touched → docs box). If `Commits` or `Diff stat` is empty, say there is nothing to describe and stop. **Never append AI trailers/footers.**
|
|
37
|
-
4. Identifier allowlist for the title and body: only repo-relative source paths (optionally `path:line`), symbol names present in the diff, branch names / commit subjects / SHAs, and issue-tracker ticket ids the reviewer can open. okstra's own artifact identifiers are out of the allowlist — report item ids (`F-001`, `C-001`, `R-001`, `D-0001`, `PREP-001`), run artifact names and their `<task-type>-<seq>` suffixes, phase/stage/worker labels (`final-verification`, `stage-2`, `codex-worker`), and any path under `.okstra/`. They resolve to nothing for a reviewer; restate the substance in code terms instead of citing the id.
|
|
38
|
-
5. Output and offer to create the PR: print the filled PR body as a single fenced markdown block. Ask whether to open a PR. **Only on an explicit yes**: write the body to a temp file and run `gh pr create --base <base> --title "<title>" --body-file <path>`. If `gh` is missing or unauthenticated (`gh auth status` fails), leave the text in chat and give manual-creation guidance. **No push/PR creation without the user's confirmation.**
|
|
39
|
-
|
|
40
|
-
## Mode B — Register template
|
|
41
|
-
|
|
42
|
-
1. Template name (`AskUserQuestion`, free text) — must match `^[A-Za-z0-9._-]+$`, otherwise re-ask.
|
|
43
|
-
2. body — pasted text or an absolute path.
|
|
44
|
-
3. Save: `okstra pr template add --name <name> --file <abs-path>` (or, for pasted text, `--content "<body>"`). Add `--yes` only when the user confirmed overwriting a same-named template. Report the saved path (`saved: ...`).
|
|
45
|
-
|
|
46
|
-
## Output Rules
|
|
47
|
-
|
|
48
|
-
- Not read-side — write actions (PR creation, template saving) happen only after the user's explicit confirmation.
|
|
49
|
-
- Do not invent changes not in the diff. Stop if commit/diffStat is empty.
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# okstra-rollup AI Manual
|
|
2
|
-
|
|
3
|
-
## Source
|
|
4
|
-
|
|
5
|
-
- Skill source: [`skills/okstra-rollup/SKILL.md`](../../../skills/okstra-rollup/SKILL.md)
|
|
6
|
-
- aggregation core (CLI): [`scripts/okstra_ctl/rollup.py`](../../../scripts/okstra_ctl/rollup.py)
|
|
7
|
-
- reused single-task aggregators: [`scripts/okstra_ctl/time_report.py`](../../../scripts/okstra_ctl/time_report.py), [`scripts/okstra_ctl/error_log_core.py`](../../../scripts/okstra_ctl/error_log_core.py)
|
|
8
|
-
- catalog enumeration helper: [`scripts/okstra_project/state.py`](../../../scripts/okstra_project/state.py) (`list_project_tasks`)
|
|
9
|
-
- unit tests: [`tests/inspect/test_okstra_rollup.py`](../../../tests/inspect/test_okstra_rollup.py)
|
|
10
|
-
|
|
11
|
-
## Purpose
|
|
12
|
-
|
|
13
|
-
`okstra-rollup` **collects and summarizes the run results of multiple tasks at once**. It is a cross-task read-side layer, in contrast to `okstra-inspect` which looks at a single task.
|
|
14
|
-
|
|
15
|
-
- Input scope: one task-group, or the whole-project catalog when `--task-group` is omitted.
|
|
16
|
-
- Deterministic aggregation (counts, time sums, error sums, status/category/phase distributions) is handled entirely by the `okstra rollup` CLI. The skill renders that table and reads each task's report body to write a **cross-task synthesis (digest)**.
|
|
17
|
-
- Design principle: hand-computed aggregation is error-prone for an LLM, so it is pushed to the CLI (SSOT), and only the natural-language synthesis is left to the LLM. This is the same division of labor as `okstra-inspect time`, which insists on "never re-sum the time by hand".
|
|
18
|
-
|
|
19
|
-
This skill is read-only. It does not mutate task artifacts.
|
|
20
|
-
|
|
21
|
-
## When to use
|
|
22
|
-
|
|
23
|
-
Use it when:
|
|
24
|
-
|
|
25
|
-
- The user asks for "rollup", "task-group summary", "group-level report", "collect multiple task results", "whole-project task status summary", "run results all at once".
|
|
26
|
-
- You want to look across **multiple tasks** rather than a single one.
|
|
27
|
-
|
|
28
|
-
Do not use it when:
|
|
29
|
-
|
|
30
|
-
- A single task's report/time/errors/recap → `okstra-inspect` (report / time / errors / recap facet).
|
|
31
|
-
- "Where does the group stand" — which briefs are done / in progress / not started, what is next, each task's latest conclusion → `okstra-inspect` recap facet with `--task-group`. rollup keeps the numbers (runs, time, errors) and the cross-task digest.
|
|
32
|
-
- A forward-looking work plan (a client-facing schedule of non-done tasks) → `okstra-schedule-gen`. rollup is **retrospective**, collecting past run results; schedule is **forward-looking**, planning future work.
|
|
33
|
-
- Actual phase execution → `okstra-run`.
|
|
34
|
-
|
|
35
|
-
## Preflight
|
|
36
|
-
|
|
37
|
-
A single Bash call starting with the literal `okstra` token (not wrapped in `if`/`eval`/`$(...)`/`VAR=`/`||`/`&&`/`npx` fallback):
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
okstra preflight --runtime claude-code
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
On `Okstra preflight: ready`, carry `Project root` as a literal string. On
|
|
44
|
-
`Okstra preflight: failed`, show `Reason` and `Recovery`, then stop.
|
|
45
|
-
|
|
46
|
-
## scope resolution
|
|
47
|
-
|
|
48
|
-
- The user named a task-group ("summarize the alpha group") → `--task-group <group>`.
|
|
49
|
-
- "all tasks" / "the whole project" / no scope named → omit `--task-group` (whole catalog).
|
|
50
|
-
- If genuinely ambiguous, ask once: one task-group or the whole project? Do not silently guess a specific group.
|
|
51
|
-
|
|
52
|
-
## CLI call
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
okstra rollup --task-group <group> --project-root <projectRoot> --text
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
For the whole project, drop `--task-group`. The output is fixed, ordered label/value rows, and **all times are raw milliseconds**.
|
|
59
|
-
|
|
60
|
-
## Interpreting the output
|
|
61
|
-
|
|
62
|
-
Fixed fields:
|
|
63
|
-
|
|
64
|
-
- `Task group` and `Task count` identify the scope.
|
|
65
|
-
- Numbered `Tasks` rows carry task identity, status, phase, next phase, report path, run count, CPU, wall-clock, and error count.
|
|
66
|
-
- `Totals runs`, `Totals CPU sum ms`, `Totals wall clock ms`, and `Totals errors` are the aggregate values.
|
|
67
|
-
- Numbered `Work status`, `Work category`, `Current phase`, and `Task type` rows carry the aggregate distributions.
|
|
68
|
-
|
|
69
|
-
Numeric meanings (must observe):
|
|
70
|
-
|
|
71
|
-
- `Run count` is the **total number of runs** in the timeline. CPU and wall-clock rows reflect only runs that reached Phase 7 usage, so they can be `0` even when run count is positive.
|
|
72
|
-
- `CPU sum ms` is the **CPU sum** of the overlapping lead + workers, not wall-clock.
|
|
73
|
-
- `Report path` is project-relative and may be `-` for a task with no report yet.
|
|
74
|
-
- If `Task count` is `0`, say there are no okstra tasks in that scope and stop.
|
|
75
|
-
|
|
76
|
-
## Render
|
|
77
|
-
|
|
78
|
-
Convert every `*Ms` to `HH:MM:SS` (zero-pad; never expose raw ms — the same rule as `okstra-inspect time`). Sort tasks by `updatedAt` descending.
|
|
79
|
-
|
|
80
|
-
```markdown
|
|
81
|
-
## okstra Rollup — <task-group or "whole project"> (<taskCount> tasks)
|
|
82
|
-
|
|
83
|
-
| Task | Category | workStatus | Phase | Runs | CPU | Errors | Report |
|
|
84
|
-
|------|----------|------------|-------|------|-----|--------|--------|
|
|
85
|
-
| DEV-1 | bugfix | done | final-verification | 2 | 00:25:00 | 2 | ✓ |
|
|
86
|
-
| DEV-2 | feature | in-progress | implementation | 1 | 00:00:00 | 0 | — |
|
|
87
|
-
|
|
88
|
-
**Totals:** 3 runs · CPU 00:25:00 · 2 errors
|
|
89
|
-
**workStatus:** done 1 · in-progress 1 **category:** bugfix 1 · feature 1
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
- `Report` column: `✓` when `reportPath` is present, `—` when not.
|
|
93
|
-
- Build the status/category/phase lines from the `totals` tally maps **verbatim**. Do not count the `tasks[]` array yourself (the CLI is the SSOT for aggregation).
|
|
94
|
-
|
|
95
|
-
## Writing the digest (the summary — the skill's core value)
|
|
96
|
-
|
|
97
|
-
When the user asks to "summarize"/"organize"/"summarize"/"digest" (the common case):
|
|
98
|
-
|
|
99
|
-
1. For each task with a non-empty `reportPath` whose `<projectRoot>/<reportPath>` file actually exists, read the report and summarize in 1–2 lines **what it accomplished and its recommended next step**.
|
|
100
|
-
2. Above the per-task lines, write a 2–4 sentence group-level synthesis: what was delivered across the group, where the open work sits (using `byWorkStatus`/`byCurrentPhase`), and whether there are error hot-spots (tasks with high `errorCount`).
|
|
101
|
-
3. Cite each per-task claim with the report path (`<reportPath>`) so the reader can open it directly.
|
|
102
|
-
|
|
103
|
-
For a task with no report, do not invent a summary; state the current phase/workStatus instead. Do not read non-report artifacts to fill the gap (artifact-home rule). If a report is empty or missing, say so.
|
|
104
|
-
|
|
105
|
-
If a deep single-task drill-down (full report, per-worker time, error breakdown, run-to-run recap) is needed, point the user to `/okstra-inspect`.
|
|
106
|
-
|
|
107
|
-
## Forbidden patterns
|
|
108
|
-
|
|
109
|
-
- Re-counting aggregate numbers (totals, distributions) by hand from `tasks[]`. `totals` is the SSOT.
|
|
110
|
-
- Exposing raw ms. Always `HH:MM:SS`.
|
|
111
|
-
- Labeling `cpuSumMs` as if it were wall-clock.
|
|
112
|
-
- Inventing a summary for a task with no report. Substitute the current phase/workStatus.
|
|
113
|
-
- Reading files outside okstra artifacts (non-`.okstra`) to fill the summary.
|
|
114
|
-
- Handling single-task detail in rollup. Send it to `okstra-inspect`.
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
# okstra-run AI Manual
|
|
2
|
-
|
|
3
|
-
## Source
|
|
4
|
-
|
|
5
|
-
- Skill source: [`skills/okstra-run/SKILL.md`](../../../skills/okstra-run/SKILL.md)
|
|
6
|
-
- wizard CLI wrapper: [`src/commands/execute/wizard.mjs`](../../../src/commands/execute/wizard.mjs)
|
|
7
|
-
- wizard state machine: [`scripts/okstra_ctl/wizard/`](../../../scripts/okstra_ctl/wizard/)
|
|
8
|
-
- render-bundle CLI: [`src/commands/execute/render-bundle.mjs`](../../../src/commands/execute/render-bundle.mjs)
|
|
9
|
-
- prepare entrypoint: [`scripts/okstra_ctl/run.py`](../../../scripts/okstra_ctl/run.py)
|
|
10
|
-
|
|
11
|
-
## Purpose
|
|
12
|
-
|
|
13
|
-
`okstra-run` starts an okstra task run inside the current supported agent host. Input collection is owned entirely by the `okstra wizard` state machine; the skill relays the wizard prompts to the user and then prepares the task bundle via `okstra render-bundle`. Once the bundle is ready, the current Claude Code, Codex, or Antigravity session takes over as the host-native Okstra lead.
|
|
14
|
-
|
|
15
|
-
Single authority:
|
|
16
|
-
|
|
17
|
-
- Question order: `scripts/okstra_ctl/wizard/registry.py` (`STEPS`); branching: `engine.py`; per-step validation: `steps_*.py`
|
|
18
|
-
- task bundle materialization: `prepare_task_bundle()`
|
|
19
|
-
- Skill document: thin prompt-relay loop
|
|
20
|
-
|
|
21
|
-
## When to Use
|
|
22
|
-
|
|
23
|
-
Use it when:
|
|
24
|
-
|
|
25
|
-
- The user wants to start an okstra task in the current session.
|
|
26
|
-
- The user wants to continue the next phase of an existing task.
|
|
27
|
-
- "okstra run", "okstra start", "start okstra in this session", "run the next phase", etc.
|
|
28
|
-
|
|
29
|
-
Do not use it when:
|
|
30
|
-
|
|
31
|
-
- The user only wants status: `okstra-inspect status`
|
|
32
|
-
- The user wants past runs or a resume command: `okstra-inspect history`
|
|
33
|
-
- The user explicitly named a new terminal / new claude process: point them to inspect history/resume
|
|
34
|
-
|
|
35
|
-
## Preflight
|
|
36
|
-
|
|
37
|
-
Resolve `<host-runtime>` from the executing harness: Claude Code → `claude-code`, Codex → `codex`, Antigravity CLI → `antigravity`, and another adapter host → `external`. This is a host capability, not a `PATH` inference or worker-provider choice. The lead provider is derived from this value and cannot be selected independently. Then make one Bash call:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
okstra preflight --runtime <host-runtime>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
On `Okstra preflight: failed`, show `Reason`, `Recovery`, `Runtime readiness`,
|
|
44
|
-
and every repeated `Readiness check` line, then stop. On
|
|
45
|
-
`Okstra preflight: ready`, require `Runtime readiness: ready`, carry the fixed
|
|
46
|
-
`Project root` line, and read the `Relay contract` path. Do not create an
|
|
47
|
-
`export PYTHONPATH`.
|
|
48
|
-
|
|
49
|
-
## Bash invocation rule
|
|
50
|
-
|
|
51
|
-
Every okstra call begins with the literal token `okstra`. Read the `--state-file`, `--answer`, path, model, and worker values from the prior JSON/tool output and paste them as literal strings.
|
|
52
|
-
|
|
53
|
-
Avoid:
|
|
54
|
-
|
|
55
|
-
- `$STATE_FILE`, `$ANSWER`
|
|
56
|
-
- `$(...)`
|
|
57
|
-
- `VAR=... okstra ...`
|
|
58
|
-
- `eval`, `export`
|
|
59
|
-
- `okstra ... && okstra ...`
|
|
60
|
-
|
|
61
|
-
Do not drop the flag even for an empty answer.
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
okstra wizard step --state-file /tmp/okstra-wizard/state.json --answer ""
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## wizard initialization
|
|
68
|
-
|
|
69
|
-
Create the state file:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
okstra wizard new-state-file
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Carry the printed absolute path verbatim.
|
|
76
|
-
|
|
77
|
-
wizard init:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
okstra wizard init --state-file /tmp/okstra-wizard/state.json --project-root /abs/project --project-id project-id --host-runtime <host-runtime>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
The result is `{ok, next}` JSON. The first step is `task_pick`.
|
|
84
|
-
|
|
85
|
-
## Interpreting the wizard JSON
|
|
86
|
-
|
|
87
|
-
Pick the UI according to `next.kind`.
|
|
88
|
-
|
|
89
|
-
| kind | Handling |
|
|
90
|
-
|---|---|
|
|
91
|
-
| `pick`, `multi: false` | Render every `options[]` verbatim as a selectable choice. Submit the chosen option's `value` |
|
|
92
|
-
| `pick`, `multi: true` | Submit all chosen values as a comma-separated string. An empty selection still submits `--answer ""` |
|
|
93
|
-
| `pick_group` | Render the wizard's `questions[]` as a single multi-question UI. Build a JSON object of per-step values and submit it in one shot |
|
|
94
|
-
| `text` | Show a plain text label without a picker, then submit the user's next message verbatim |
|
|
95
|
-
| `done` | Input collection finished. Move to render-args |
|
|
96
|
-
| `aborted` | Delete the state file and stop. Do not call render-args/render-bundle |
|
|
97
|
-
|
|
98
|
-
`progress.label` is a string the wizard composed. Append it verbatim after the UI prompt; do not compute it yourself.
|
|
99
|
-
|
|
100
|
-
## wizard loop
|
|
101
|
-
|
|
102
|
-
1. Render the prompt.
|
|
103
|
-
2. Submit the user's answer as a literal `--answer`.
|
|
104
|
-
3. `ok: true`: show `result.echo` to the user on one line and advance to the next step.
|
|
105
|
-
4. `ok: false`: show `result.error` verbatim and retry the same step via `result.current`.
|
|
106
|
-
5. `current: null`: a terminal error where the prompt cannot be reconstructed. Show the error and stop.
|
|
107
|
-
|
|
108
|
-
Important: never trim, hide, or restructure the wizard-provided options into a "recommended + Enter directly" form. The wizard's `options[]` is the complete choice set.
|
|
109
|
-
|
|
110
|
-
## brief candidate ordering
|
|
111
|
-
|
|
112
|
-
The brief selection is handled by the wizard. A new task is asked for its brief right after task-group and **before** the task-type; an existing task is asked only on an entry phase (`requirements-discovery`, `error-analysis`, `improvement-discovery`, `project-analysis`, `feature-analysis`, `change-impact-analysis`).
|
|
113
|
-
|
|
114
|
-
- task-group candidates are shown newest-first by combining recent task-catalog use with the recent brief creation/modification times under `.okstra/briefs/<group>/`.
|
|
115
|
-
- brief file candidates are chosen from within the selected group's `.okstra/briefs/<task-group>/**/*.md`.
|
|
116
|
-
- The brief-file sort key is `max(file created/modified time, task-catalog updatedAt of the task that used this brief)`.
|
|
117
|
-
- direct input is always last.
|
|
118
|
-
- for a new task the following task-type pick offers entry phases only, and its recommended slot is the selected brief's `Recommended next phase:` line (fallback `requirements-discovery`).
|
|
119
|
-
|
|
120
|
-
## confirm step
|
|
121
|
-
|
|
122
|
-
When `next.step == "confirm"`, first fetch the confirmation summary.
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
okstra wizard confirmation --state-file /tmp/okstra-wizard/state.json
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Show `text` to the user, then render the Proceed/Edit/Abort picker as the final output of that turn — the rendered question is the last thing you emit in that turn, and text emitted after the call renders below the picker. `Edit` rewinds the wizard to an earlier step.
|
|
129
|
-
|
|
130
|
-
## outcome and render-bundle
|
|
131
|
-
|
|
132
|
-
When `next.kind == "done"`:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
okstra wizard outcome --state-file /tmp/okstra-wizard/state.json
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Run `outcome.persistActions[]` first, then pass each key of the `outcome.renderArgs` object exactly once as an `okstra render-bundle` flag. Pass empty string values explicitly too, and add `--lead-runtime <host-runtime>` from preflight. Do not enumerate provider-specific keys in this manual; the wizard and provider registry own the emitted arguments. Exception: the `chain-stages` key is not a render-bundle flag — it drives the Step 7 unattended-chaining loop, so do not pass it as a flag (`run.py` accepts only `--stage`/`--stages`).
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
okstra render-bundle \
|
|
142
|
-
--lead-runtime <host-runtime> \
|
|
143
|
-
--<first-renderArgs-key> "<first-renderArgs-value>" \
|
|
144
|
-
--<each-remaining-renderArgs-key> "<corresponding-value>"
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Parse the following labeled lines from stdout.
|
|
148
|
-
|
|
149
|
-
- `okstra task root:`
|
|
150
|
-
- `okstra instruction-set:`
|
|
151
|
-
- optionally `okstra concurrent-run stages:`
|
|
152
|
-
|
|
153
|
-
render-bundle calls `prepare_task_bundle()` in render-only mode to prepare the manifests, run context, instruction set, and discovery files, and registers the run as `prepared` in `~/.okstra/recent.jsonl`.
|
|
154
|
-
|
|
155
|
-
## conformance waiver
|
|
156
|
-
|
|
157
|
-
Classify the entry before offering a waiver. If `requires` contains `db`,
|
|
158
|
-
`http`, or `external`, do not offer a waiver: Okstra still attempts the command,
|
|
159
|
-
but any non-PASS or unavailable outcome is an external advisory with a
|
|
160
|
-
user-owned rerun method. If `requires=[]`, fail closed as a declaration or
|
|
161
|
-
contract defect and do not offer a waiver. Offer the waiver only when
|
|
162
|
-
`requires=[io]` and that blocking local conformance command is genuinely
|
|
163
|
-
impossible to run in the environment. A waiver requires user approval and a
|
|
164
|
-
verbatim reason. Neither the AI lead nor a worker creates a self-exemption.
|
|
165
|
-
The resulting blocking/advisory policy is enforced by
|
|
166
|
-
`scripts/okstra_ctl/conformance.py::decide_conformance_gate` and
|
|
167
|
-
`validators/validate-run.py::_validate_conformance`; the picker restriction is
|
|
168
|
-
defined by `prompts/host-orchestration/implementation.md` Step 5.1 (the
|
|
169
|
-
`okstra-run` skill body carries a generated copy).
|
|
170
|
-
|
|
171
|
-
When chosen, add it to `render-bundle` only.
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
--qa-waiver "<stageKey>:<reason>"
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Omit the flag entirely when there is no value.
|
|
178
|
-
|
|
179
|
-
## concurrent-run branch
|
|
180
|
-
|
|
181
|
-
If `render-bundle` stdout carries `okstra concurrent-run stages:`, the no-team background gate is already reflected in the prompt.
|
|
182
|
-
|
|
183
|
-
Give the user three options.
|
|
184
|
-
|
|
185
|
-
1. Proceed as no-team background.
|
|
186
|
-
2. Wait — hold the dispatch, preserve the stage worktree·run context. After the occupying run finishes, print the resume command (`okstra-inspect` history → resume) so the user can resume the same stage.
|
|
187
|
-
3. Enter directly.
|
|
188
|
-
|
|
189
|
-
This picker is authored by the skill, so it is separate from the wizard-option-abbreviation ban.
|
|
190
|
-
|
|
191
|
-
## stale git SHA recovery
|
|
192
|
-
|
|
193
|
-
When a `PrepareError` such as `Recorded stage SHAs no longer match the git history` appears, do not fix the registry/consumers by hand.
|
|
194
|
-
|
|
195
|
-
1. Run the `okstra git-reconcile ... --check --text` printed in the error message verbatim.
|
|
196
|
-
2. For each confirm item, ask the user for the current branch tip, a different ref, or abort.
|
|
197
|
-
3. Run `okstra git-reconcile ... --apply --stage <N> --use-ref <ref>` with the chosen ref.
|
|
198
|
-
4. Retry the failed render-bundle with the same arguments.
|
|
199
|
-
|
|
200
|
-
If the anchor is unresolvable, run `--reset-anchor <ref>` after user confirmation.
|
|
201
|
-
|
|
202
|
-
## PR template persistence
|
|
203
|
-
|
|
204
|
-
In release-handoff, when `outcome.persistActions[]` returns a `config.set` / `pr-template-path` action, save the config before render-bundle.
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
# action.scope == "project"
|
|
208
|
-
okstra config set pr-template-path "<path>" --scope project
|
|
209
|
-
# action.scope == "global"
|
|
210
|
-
okstra config set pr-template-path "<path>" --scope global
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
Read the scope and path from the persist action of `okstra wizard outcome`, not from the wizard state file. Do not read the raw state file directly.
|
|
214
|
-
|
|
215
|
-
## Okstra lead takeover
|
|
216
|
-
|
|
217
|
-
After render-bundle, read the run manifest's `resources.leadExecutionPromptPath` (project-relative, under `runs/<task-type>/prompts/`), read that file verbatim, and proceed from Phase 1 in that prompt's order. Before any in-run approval or clarification question, follow the lead contract "User confirmation before an approval blocker": read cited plan items, worker findings, and files, then ask in the user's language with each option's outcome.
|
|
218
|
-
|
|
219
|
-
Inform the user on one line.
|
|
220
|
-
|
|
221
|
-
```text
|
|
222
|
-
Took over as Okstra lead (`<host-runtime>`) for `<taskKey>` (`<task-type>`). Run dir: `<RUN_DIR_RELATIVE_PATH>`. Beginning Phase 1 (context loading).
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
For a single-element chain, the end of Step 6 is the end of the run. Step 7 below applies only when the `chain-stages` CSV has 2 or more elements. When the run is over, close with the user's next action — one command they can run now. A prohibition is not a next action. Take it from the `report-finalize` result: `nextCommand` (`{command, note}`) is the table below already applied, and `nextRecommendedPhase` (`phase`, `status`, `rationale`) is what it was applied to — do not re-derive either from the report, and treat `nextRecommendedPhaseError` as "pointer unreadable", said in one line before the `validate-run` branch. After `implementation-planning`: open approval blockers → `/okstra-user-response`; a recorded `accept-risk` / `select` / `answer` is not an open blocker; no open approval blocker → `/okstra-run` → `implementation` or `--approve` (do not start another planning run; do not say `/okstra-inspect`). For every other task type: pointer `ready` → `/okstra-run` for that phase; `validate-run` failed → one-line cause then `/okstra-run`; otherwise `/okstra-inspect status`.
|
|
226
|
-
|
|
227
|
-
## implementation unattended chaining (chain-stages)
|
|
228
|
-
|
|
229
|
-
When `task-type == implementation` and the render-args `chain-stages` CSV has 2 or more elements, the current session acts as the orchestrator and runs the stages as an unattended chain in dependency order. Queue = the topologically-sorted stage list from splitting `chain-stages` on `,`. For each stage `N` in the queue, in order:
|
|
230
|
-
|
|
231
|
-
1. Re-call render-bundle with the same arguments but `--stage N` (the base commit is auto-computed by prepare from the predecessor's done `head_commit` — do not pass it by hand). The `io`-only conformance waiver·concurrent-run·git-reconcile gates apply identically to each stage's render-bundle.
|
|
232
|
-
2. As in Step 6, become the host-native Okstra lead and run that stage's Phase 1–7 inline. Phase 6's lead persistence appends that stage's `status:"done"` row to `runs/<plan-task-key>/consumers.jsonl`.
|
|
233
|
-
3. After confirming the `done` row was written, move to the next stage. Clean up context (leftover panes·finished teammates) at each stage boundary. A `status:"failed"` row in place of `done` means the stage ended `FAIL` — stop the queue per the FAIL branch below.
|
|
234
|
-
4. One-line report at each stage start/finish: `stage N start` / `stage N done → next K`.
|
|
235
|
-
|
|
236
|
-
Once the whole queue is consumed, end the chain and report completion.
|
|
237
|
-
|
|
238
|
-
- **Next stage not yet ready — normal termination:** When a stage in the queue is occupied by another implementation run as started/reserved and render-bundle is rejected with `--stage N already in progress or reserved by another run` (StageTargetError), this is not an exception — **terminate the chain normally** and report the remaining queue (e.g. `remaining queue: stage 4, 5 — resume with okstra-run after occupancy is released`).
|
|
239
|
-
- **Stage ended FAIL — stop the queue and report:** When a stage's synthesised verdict is `FAIL`, Phase 6 writes no carry sidecar and appends a `status:"failed"` row instead of `done`. **Stop the queue there** and report the failed stage, its report path, and the remaining queue. Do not continue to the next stage even when it is dependency-independent — later work must not be stacked on a confirmed regression. The `failed` row frees the occupancy, so `--stage <N>` re-enters that stage on its preserved worktree and branch.
|
|
240
|
-
- **Exception gate during chaining:** If render-bundle raises a concurrent-run conflict or git stale-SHA reconciliation, **stop the chain at that stage** and present the gate to the user per the Step 5 procedure. Once the user resolves it, resume the remaining queue in place. Data corruption·concurrent-occupancy conflicts are confirmed by a human — this is the safety boundary of unattended chaining.
|
|
241
|
-
|
|
242
|
-
## Forbidden patterns
|
|
243
|
-
|
|
244
|
-
- Changing the question order the wizard emitted.
|
|
245
|
-
- Hiding wizard options or keeping only the recommendations.
|
|
246
|
-
- Turning a `text` prompt into a picker.
|
|
247
|
-
- Dropping the `--answer` flag on an empty answer.
|
|
248
|
-
- Bypassing the wizard/render-bundle path by calling `okstra.sh`.
|
|
249
|
-
- Calling render-args on a state the user aborted before render-bundle.
|
|
250
|
-
- Starting phase work arbitrarily before reading the Okstra lead prompt.
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
# okstra-schedule-gen AI Manual
|
|
2
|
-
|
|
3
|
-
## Source
|
|
4
|
-
|
|
5
|
-
- Skill source: [`skills/okstra-schedule-gen/SKILL.md`](../../../skills/okstra-schedule-gen/SKILL.md)
|
|
6
|
-
- Schedule template: [`templates/reports/schedule.template.md`](../../../templates/reports/schedule.template.md)
|
|
7
|
-
- Schedule validator: [`validators/validate-schedule.py`](../../../validators/validate-schedule.py)
|
|
8
|
-
- Stage Map read side: [`scripts/okstra_project/state.py`](../../../scripts/okstra_project/state.py)
|
|
9
|
-
- Selection semantics: [`scripts/okstra_ctl/schedule_semantics.py`](../../../scripts/okstra_ctl/schedule_semantics.py)
|
|
10
|
-
- Work-category source of truth: [`scripts/okstra_ctl/work_categories.py`](../../../scripts/okstra_ctl/work_categories.py)
|
|
11
|
-
- workStatus inference reference: [`skills/okstra-inspect/SKILL.md`](../../../skills/okstra-inspect/SKILL.md)
|
|
12
|
-
|
|
13
|
-
## Purpose and invocation
|
|
14
|
-
|
|
15
|
-
`okstra-schedule-gen` gathers non-done tasks in a task group and produces one client-facing work schedule from user-selected unfinished implementation stages.
|
|
16
|
-
|
|
17
|
-
Public invocation:
|
|
18
|
-
|
|
19
|
-
```text
|
|
20
|
-
/okstra-schedule-gen [task-group]
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
This is a host skill, not a schedule-generation shell command. Use `stage-map` and `validate-schedule.py` only as backend contracts inside the skill.
|
|
24
|
-
|
|
25
|
-
Output location:
|
|
26
|
-
|
|
27
|
-
```text
|
|
28
|
-
<PROJECT_ROOT>/.okstra/tasks/<task-group-segment>/schedule/<task-group-segment>-plan-<YYYY-MM-DD_HH-MM-SS>.md
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Do not use it for single-task status analysis or phase execution. Use `okstra-inspect status` and `okstra-run` for those jobs.
|
|
32
|
-
|
|
33
|
-
## Preflight and task-group resolution
|
|
34
|
-
|
|
35
|
-
Run one literal-token preflight call:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
okstra preflight --runtime claude-code
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
On `Okstra preflight: failed`, show `Reason` and `Recovery`, then stop. On
|
|
42
|
-
`Okstra preflight: ready`, carry the fixed `Project root` line. Resolve an
|
|
43
|
-
explicit task-group from the invocation or host request. If none is unambiguous,
|
|
44
|
-
run `okstra model-io task-selection-input --project-root <projectRoot>` and ask
|
|
45
|
-
the user to choose from the fixed `Task` rows; never guess. Then run
|
|
46
|
-
`okstra model-io schedule-input --project-root <projectRoot> --task-group <group>`
|
|
47
|
-
and use only its fixed task metadata rows.
|
|
48
|
-
|
|
49
|
-
On zero matches, report that the task group was not found and do not create a file.
|
|
50
|
-
|
|
51
|
-
## Candidate filter
|
|
52
|
-
|
|
53
|
-
`workStatus` is used only to decide which tasks are candidates. When it is missing or empty, use the `okstra-inspect` `status.4` inference table.
|
|
54
|
-
|
|
55
|
-
- Exclude resolved `done` tasks.
|
|
56
|
-
- Include every other resolved state.
|
|
57
|
-
- If no task remains, report that all tasks are done and do not create a file.
|
|
58
|
-
|
|
59
|
-
Do not render `workStatus` as the detailed task status. The per-task `Status` value is `<taskType> / <currentPhase>`.
|
|
60
|
-
|
|
61
|
-
## Source-aware Stage Map resolution
|
|
62
|
-
|
|
63
|
-
For every candidate task, call:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
okstra stage-map <task-key> --text
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
The successful fixed response carries `Status`, `Task key`, `Task root`, `State`,
|
|
70
|
-
`Source plan path`, and lossless numbered `Stages`, `Done stages`, and `Planning`
|
|
71
|
-
count/name/value rows.
|
|
72
|
-
|
|
73
|
-
Handle each result explicitly:
|
|
74
|
-
|
|
75
|
-
- `Status: ready`, `State: ready`: use exactly `Source plan path`; do not pick a report by mtime or `latestReportRecordPath`. Select only stages not present in the done-stage rows.
|
|
76
|
-
- `Status: ready`, `State: missing`: record an empty source and empty stage sets, mark the task `[NEEDS-PLANNING]`, and emit no forward Work Breakdown, Gantt, or day total for it.
|
|
77
|
-
- `Status: error` or another state: stop before drafting and report `Failure stage` and `Failure reason`. A corrupt or conflicting source must never fall back to a guessed report.
|
|
78
|
-
|
|
79
|
-
A valid selected set is dependency-closed: every transitive prerequisite of a selected stage is either also selected or present in `doneStages`. Completed prerequisites remain evidence only and are never scheduled forward.
|
|
80
|
-
|
|
81
|
-
If a ready task has no unfinished stages, render `_Complete — no remaining stage_` and omit forward effort.
|
|
82
|
-
|
|
83
|
-
## Stage selection
|
|
84
|
-
|
|
85
|
-
Offer up to three dependency-closed cumulative bundles in topological order, plus all remaining stages. A custom set is accepted only after closing it over unfinished prerequisites; completed prerequisites are preserved separately.
|
|
86
|
-
|
|
87
|
-
Skip the picker when the remaining work has only one possible bundle and use all unfinished stages. Record the final stage numbers as `selectedStages`.
|
|
88
|
-
|
|
89
|
-
## Temporary selection contract
|
|
90
|
-
|
|
91
|
-
Write a paired draft and selection input with one timestamp:
|
|
92
|
-
|
|
93
|
-
```text
|
|
94
|
-
.okstra/tasks/<task-group-segment>/schedule/.draft/<timestamp>.md
|
|
95
|
-
.okstra/tasks/<task-group-segment>/schedule/.draft/<timestamp>.selection.json
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
The selection file is a temporary verification input. It freezes the exact source, full stage map, completed stages, and user-selected forward work so both validators judge the same facts instead of re-resolving mutable task state.
|
|
99
|
-
|
|
100
|
-
Schema version 1:
|
|
101
|
-
|
|
102
|
-
```json
|
|
103
|
-
{
|
|
104
|
-
"schemaVersion": 1,
|
|
105
|
-
"tasks": [
|
|
106
|
-
{
|
|
107
|
-
"taskKey": "demo:group:DEV-1",
|
|
108
|
-
"taskId": "DEV-1",
|
|
109
|
-
"state": "ready",
|
|
110
|
-
"sourcePlanPath": "/absolute/path/final-report-implementation-planning-001.data.json",
|
|
111
|
-
"selectedStages": [2, 3],
|
|
112
|
-
"doneStages": [1],
|
|
113
|
-
"stages": [
|
|
114
|
-
{
|
|
115
|
-
"stageNumber": 1,
|
|
116
|
-
"title": "Prepare port",
|
|
117
|
-
"dependsOn": [],
|
|
118
|
-
"stepCount": 2
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"stageNumber": 2,
|
|
122
|
-
"title": "Build adapter",
|
|
123
|
-
"dependsOn": [1],
|
|
124
|
-
"stepCount": 3
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"stageNumber": 3,
|
|
128
|
-
"title": "Wire consumer",
|
|
129
|
-
"dependsOn": [2],
|
|
130
|
-
"stepCount": 2
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Include every candidate task. A `missing` task has an empty `sourcePlanPath`, `selectedStages`, `doneStages`, and `stages`. Convert the CLI stage-row keys to the camel-case selection boundary exactly as shown.
|
|
139
|
-
|
|
140
|
-
## Phase classification
|
|
141
|
-
|
|
142
|
-
Only these canonical categories are valid:
|
|
143
|
-
|
|
144
|
-
| workCategory | Default phase |
|
|
145
|
-
|---|---|
|
|
146
|
-
| `bugfix` | Phase 1 for High or Med-High risk; otherwise Phase 2 |
|
|
147
|
-
| `feature` | Phase 2 |
|
|
148
|
-
| `improvement` | Phase 2 |
|
|
149
|
-
| `refactor` | Phase 3 |
|
|
150
|
-
| `ops` | Phase 3 |
|
|
151
|
-
|
|
152
|
-
Priority overrides category: P0 maps to Phase 1, P1/P2 to Phase 2, and P3 to Phase 3. An unknown or missing raw category falls back to Phase 2 with a one-line rationale naming the raw value. Do not invent another category.
|
|
153
|
-
|
|
154
|
-
## Template contract
|
|
155
|
-
|
|
156
|
-
Follow `schedule.template.md` exactly. The required top-level order is:
|
|
157
|
-
|
|
158
|
-
1. `## At a Glance`
|
|
159
|
-
2. `## Executive Summary`
|
|
160
|
-
3. `## Task Dependency Graph`
|
|
161
|
-
4. optional `## Gantt Chart`
|
|
162
|
-
5. `## Phase 1: Critical Fixes`
|
|
163
|
-
6. `## Phase 2: Enhancements`
|
|
164
|
-
7. `## Phase 3: Architecture`
|
|
165
|
-
8. `## Execution Priority Matrix`
|
|
166
|
-
9. `## Cross-Task Dependencies & Shared Concerns`
|
|
167
|
-
10. `## Risk Mitigation Strategy`
|
|
168
|
-
11. `## Recommended Immediate Actions`
|
|
169
|
-
12. optional final `## Glossary`
|
|
170
|
-
|
|
171
|
-
Keep an empty required section and render `_none_`. Headings and field labels stay as English template literals; body prose is Korean.
|
|
172
|
-
|
|
173
|
-
Each scheduled task uses this stage-level Work Breakdown shape:
|
|
174
|
-
|
|
175
|
-
```markdown
|
|
176
|
-
| Stage | Title | Steps | Depends On | Days |
|
|
177
|
-
|---:|---|---:|---|---:|
|
|
178
|
-
| 2 | Build adapter | 3 | 1 (done) | 2.0 ~ 3.0 |
|
|
179
|
-
| 3 | Wire consumer | 2 | 2 | 1.0 ~ 2.0 |
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Use the template's Effort Sizing Criteria values without redefining them. Allocate a task's range across selected stages in `stepCount` proportion: round every stage except the last to 0.5 day and let the last absorb the remainder. The stage ranges must sum to the task range, and finite task ranges must sum to the displayed total. XXL, missing, and complete tasks contribute no forward total.
|
|
183
|
-
|
|
184
|
-
An unrepresentable half-day allocation is a validation error. Do not substitute a fallback allocation algorithm; revise the task sizing or selected-stage scope.
|
|
185
|
-
|
|
186
|
-
## Gantt contract
|
|
187
|
-
|
|
188
|
-
Render a plain fenced relative-day Gantt when the selected stages have finite day ranges. Every forward row is identified by stage and repeats its Work Breakdown range:
|
|
189
|
-
|
|
190
|
-
```text
|
|
191
|
-
DEV-1 Stage 2 ████ days=2.0~3.0
|
|
192
|
-
DEV-1 Stage 3 ████ days=1.0~2.0
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
A row is labelled `Stage <n>` when exactly one task is scheduled and `<TASK-ID> Stage <n>` when more than one is; the annotation is `days=<lower>~<upper>`. Spell the stage out — `S1` is an opaque code that costs the reader a lookup and saves five characters. Do not emit a row for a completed, unselected, missing, or unknown stage. Bar length is arithmetic: one column is half a day, so a bar runs `lower / 0.5` filled cells `█` then `(upper - lower) / 0.5` open cells `░`.
|
|
196
|
-
|
|
197
|
-
Skip the chart only when no forward task has a finite day signal, and state the concrete reason. Do not use calendar dates, Mermaid, PlantUML, Graphviz, or another graph language.
|
|
198
|
-
|
|
199
|
-
A host-supplied directive or the first `## Directive` in the configured analysis material may override the render/skip heuristic, but it cannot override stage selection, dependency closure, or validated day arithmetic.
|
|
200
|
-
|
|
201
|
-
## Client-facing boundary
|
|
202
|
-
|
|
203
|
-
Assume the team has the required authority. Exclude approval waits, permission checks, stakeholder coordination, decision checklists, and internal blocker codes from forward engineering work. Gantt duration and totals represent engineering work only.
|
|
204
|
-
|
|
205
|
-
Resolve opaque source-report codes inline or in the optional final Glossary. Decision-item codes do not belong in the schedule.
|
|
206
|
-
|
|
207
|
-
## Two validation gates
|
|
208
|
-
|
|
209
|
-
Run both gates against the same draft and temporary selection contract.
|
|
210
|
-
|
|
211
|
-
1. Deterministic gate:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
python3 ~/.okstra/lib/validators/validate-schedule.py <draft> --selection-json <selection>
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
2. Only after that command passes, create a new `.okstra/agent-invocations/schedule-verification/<invocation-id>.instructions.md` with the draft, selection JSON, and checks, but not the lead's reasoning. Run `okstra agent-prompt materialize --purpose schedule-verification --audience schedule-verifier ...` and verify the returned metadata before dispatch. A native host call uses the verified prompt body plus `hostModelValue`; a deterministic provider process uses `okstra worker-dispatch`, the prompt path, and `modelExecutionValue`. The verifier checks narrative coherence, phase rationale, executable order, engineering-only scope, and contradictions with the structured rows.
|
|
218
|
-
|
|
219
|
-
Capture the raw verifier return under the purpose directory's `.tmp/`, then run `okstra agent-prompt materialize-result`, `complete`, and `verify-completion` in order. Parse only the verified `returnedBody`; an inline or unverified response cannot pass the narrative gate.
|
|
220
|
-
|
|
221
|
-
If either gate finds a defect, revise the same draft in place and restart from the deterministic gate. Allow at most two revision rounds across both gates. Never publish a draft that has not passed both gates in that order.
|
|
222
|
-
|
|
223
|
-
After both gates pass:
|
|
224
|
-
|
|
225
|
-
1. Move the same draft content to the collision-safe final path; do not re-render it.
|
|
226
|
-
2. Re-read it and run the installed format validator on the final path, falling back to the repository validator only when needed.
|
|
227
|
-
3. Delete the temporary selection file only after final validation passes.
|
|
228
|
-
4. Report completion in Korean with the output path, included/excluded counts, finite total range, and lead-plus-verifier mode.
|
|
229
|
-
|
|
230
|
-
## Forbidden patterns
|
|
231
|
-
|
|
232
|
-
- Guessing a planning report after `stage-map` reports a structured error.
|
|
233
|
-
- Treating `workStatus` as the detailed schedule status.
|
|
234
|
-
- Scheduling completed or non-selected stages.
|
|
235
|
-
- Publishing a Gantt row without its `Stage <n>` label and `days=` range, or abbreviating that label to `S<n>`.
|
|
236
|
-
- Drawing stage order in `## Task Dependency Graph` — that graph carries cross-task edges only; stage order lives in the Work Breakdown's `Depends On` column.
|
|
237
|
-
- Dispatching narrative validation before deterministic `--selection-json` validation.
|
|
238
|
-
- Re-rendering after validation instead of promoting the same draft.
|
|
239
|
-
- Deleting the selection contract before final validation.
|
|
240
|
-
- Publishing after more than two unsuccessful revision rounds.
|