okstra 0.117.0 → 0.118.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 +115 -104
- package/docs/architecture/storage-model.md +300 -0
- package/docs/architecture.md +802 -0
- package/docs/cli.md +658 -0
- package/docs/container.md +124 -0
- package/docs/contributor-change-matrix.md +5 -4
- package/docs/follow-ups/2026-07-10-final-report-option-3.md +51 -0
- package/docs/performance-improvement-plan-v2.md +374 -0
- package/docs/project-structure-overview.md +21 -10
- package/package.json +10 -5
- package/runtime/BUILD.json +2 -2
- package/runtime/python/okstra_ctl/recap.py +80 -3
- package/runtime/skills/okstra-inspect/SKILL.md +37 -2
- package/runtime/skills/okstra-pr-gen/SKILL.md +9 -8
- package/src/commands/inspect/recap.mjs +6 -1
- package/README.kr.md +0 -231
- package/docs/kr/architecture/storage-model.md +0 -297
- package/docs/kr/architecture.md +0 -815
- package/docs/kr/cli.md +0 -657
- package/docs/kr/container.md +0 -122
- package/docs/kr/follow-ups/2026-07-10-final-report-option-3.md +0 -51
- package/docs/kr/performance-improvement-plan-v2.md +0 -374
- package/docs/kr/performance-improvement-plan.md +0 -147
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
# Storage model & on-disk contracts
|
|
2
|
+
|
|
3
|
+
> Detailed storage and contract section from [`docs/kr/architecture.md`](../architecture.md). This section was split out after the main document exceeded 1,000 lines.
|
|
4
|
+
|
|
5
|
+
## Storage model
|
|
6
|
+
|
|
7
|
+
Files created by `okstra` are stored in the following three areas according to their purpose.
|
|
8
|
+
|
|
9
|
+
### 1. Stable task root
|
|
10
|
+
|
|
11
|
+
This is the task's primary directory.
|
|
12
|
+
The task manifest, task index, instruction set, runs, and history are collected under this root.
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
<target-project>/.okstra/tasks/<task-group>/<task-id>/
|
|
16
|
+
├── task-manifest.json
|
|
17
|
+
├── task-index.md
|
|
18
|
+
├── instruction-set/
|
|
19
|
+
│ ├── analysis-profile.md
|
|
20
|
+
│ ├── analysis-packet.md # analysis worker primary compact input
|
|
21
|
+
│ ├── analysis-material.md
|
|
22
|
+
│ ├── reference-expectations.md
|
|
23
|
+
│ ├── task-brief.md
|
|
24
|
+
│ ├── directive.txt # optional (mirrors --directive)
|
|
25
|
+
│ ├── final-report-schema.json
|
|
26
|
+
│ ├── final-report-template.md
|
|
27
|
+
│ └── claude-execution-prompt.md
|
|
28
|
+
├── runs/
|
|
29
|
+
│ └── <task-type>/
|
|
30
|
+
│ ├── manifests/
|
|
31
|
+
│ │ └── run-manifest-<task-type>-<seq>.json
|
|
32
|
+
│ ├── state/
|
|
33
|
+
│ │ └── team-state-<task-type>-<seq>.json
|
|
34
|
+
│ ├── prompts/
|
|
35
|
+
│ │ ├── claude-execution-prompt-<task-type>-<seq>.md
|
|
36
|
+
│ │ ├── claude-worker-prompt-<task-type>-<seq>.md
|
|
37
|
+
│ │ ├── codex-worker-prompt-<task-type>-<seq>.md
|
|
38
|
+
│ │ ├── antigravity-worker-prompt-<task-type>-<seq>.md
|
|
39
|
+
│ │ └── report-writer-worker-prompt-<task-type>-<seq>.md
|
|
40
|
+
│ ├── reports/
|
|
41
|
+
│ │ └── final-report-<task-type>-<seq>.md
|
|
42
|
+
│ ├── status/
|
|
43
|
+
│ │ └── final-<task-type>-<seq>.status
|
|
44
|
+
│ ├── sessions/
|
|
45
|
+
│ │ └── claude-resume-<task-type>-<seq>.sh
|
|
46
|
+
│ ├── logs/
|
|
47
|
+
│ │ └── errors-<task-type>-<seq>.jsonl # optional, lead-only writer
|
|
48
|
+
│ └── worker-results/
|
|
49
|
+
├── history/
|
|
50
|
+
│ ├── timeline.json
|
|
51
|
+
│ └── fix-cycles.jsonl # optional, created only when entering a fix cycle (append-only)
|
|
52
|
+
├── recap/
|
|
53
|
+
│ └── recap-log.jsonl # optional, append-only before/after summaries and Q&A for recap (other artifacts unchanged)
|
|
54
|
+
└── notes/
|
|
55
|
+
└── <slug>-<YYYY-MM-DD>.md # optional, agent-authored notes written by `okstra recap note` (evidence/decision-draft/analysis); inert — never auto-read by a run, fed forward only via --clarification-response
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Actual directory segments may be normalized into slugs to create safe paths.
|
|
59
|
+
However, the logical task key always retains the original input values in the form `project-id:task-group:task-id`.
|
|
60
|
+
|
|
61
|
+
### 2. Per-run execution artifacts
|
|
62
|
+
|
|
63
|
+
Artifacts from each execution accumulate beneath the current run's resolved `run_dir`.
|
|
64
|
+
`runs/<task-type>/` is the run directory for non-stage runs. As exceptions, `implementation` uses `runs/implementation/stage-<N>/`, and single-stage `final-verification` uses `runs/final-verification/stage-<N>/` as its `run_dir`. Whole-task `final-verification` retains the non-stage form `runs/final-verification/`.
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
<target-project>/.okstra/tasks/<task-group>/<task-id>/runs/<task-type>/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The representative files below are all relative to the resolved run directory (`run_dir`). Therefore, report, log, carry, and session paths for stage-isolated runs include the `stage-<N>/` segment.
|
|
71
|
+
|
|
72
|
+
- `manifests/run-manifest-<task-type>-<seq>.json`
|
|
73
|
+
- `state/team-state-<task-type>-<seq>.json`
|
|
74
|
+
- `prompts/claude-execution-prompt-<task-type>-<seq>.md`
|
|
75
|
+
- `prompts/<worker>-worker-prompt-<task-type>-<seq>.md`
|
|
76
|
+
|
|
77
|
+
Unless `--render-only` is used, the handed-off Claude session typically adds the following result files to the current run.
|
|
78
|
+
- `sessions/claude-resume-<task-type>-<seq>.sh`
|
|
79
|
+
- `reports/final-report-<task-type>-<seq>.md`
|
|
80
|
+
- `reports/final-report-<task-type>-<seq>.html` *(Phase 7 deterministic post-processing: self-contained HTML for human reviewers, with inline CSS/JS)*
|
|
81
|
+
- `user-responses/user-response-<task-type>-<seq>.md` *(A sidecar downloaded under the same name by the HTML `Export user response` button; storing it here lets `--resume-clarification` automatically attach it to `clarification-response.md` in the instruction set — `clarification_items.clarification_response_with_sidecars`)*
|
|
82
|
+
- `worker-results/<worker>-audit-<task-type>-<seq>.md` *(Per-worker Reading Confirmation sidecar; for auditing rather than report content)*
|
|
83
|
+
- `status/final-<task-type>-<seq>.status`
|
|
84
|
+
- `runs/implementation/stage-<N>/carry/stage-<N>.json` *(implementation only: execution evidence sidecar beneath stage N's resolved run directory; automatically carried into the next stage)*
|
|
85
|
+
- `consumers.jsonl` *(implementation-planning only: backlinks to the impl-run that consumed each stage in this plan; append-only)*
|
|
86
|
+
The final result files (`final-report` MD / status) are not files that `okstra` creates by saving stdout.
|
|
87
|
+
They are results written directly into the current run by Claude, based on the task bundle prepared by `okstra`.
|
|
88
|
+
The self-contained HTML view is generated deterministically from a single final-report MD input by `okstra render-views <final-report.md>` (Phase 7 step 1.5). Generating the view does not modify the original MD.
|
|
89
|
+
By contrast, `sessions/claude-resume-<task-type>-<seq>.sh` is an interruption-recovery helper that `okstra` creates before launching Claude.
|
|
90
|
+
|
|
91
|
+
The resolved run directory collects execution history. It divides its contents into type-specific subdirectories such as `manifests/`, `state/`, `prompts/`, `reports/`, `status/`, `sessions/`, and `worker-results/`, then distinguishes each run-level artifact and result file with a `-<task-type>-<seq>` suffix (a three-digit, zero-padded per-category counter, such as `001` or `002`).
|
|
92
|
+
Worker prompt history is retained not under `/tmp`, but always as a canonical artifact under `prompts/` for the current run.
|
|
93
|
+
Unlike before, `analysis-profile.md`, `analysis-material.md`, `reference-expectations.md`, `task-brief.md`, skill copies, and `final-report-template.md` are not duplicated for every run.
|
|
94
|
+
These materials retain canonical copies in `instruction-set/` under the stable task root.
|
|
95
|
+
When the same non-stage task type runs again, it reuses the same `runs/<task-type>/` run directory. Reruns of `implementation` and single-stage `final-verification` reuse their resolved `runs/<task-type>/stage-<N>/` run directories. In both cases, existing artifacts are not overwritten because run-level filenames are separated by `-<task-type>-<seq>` suffixes within type-specific subdirectories. Because `<seq>` is scanned independently for each category directory (`manifests/`, `prompts/`, `reports/`, `status/`, `state/`, `sessions/`, `worker-results/`) beneath the resolved run directory, values may differ by category even within the same run.
|
|
96
|
+
If flat legacy artifacts remain at the top level of a task-type run directory, the next execution automatically moves them into the corresponding type-specific subdirectories.
|
|
97
|
+
|
|
98
|
+
### 3. Project-level discovery and installed skill assets
|
|
99
|
+
Shared project discovery pointers are created at the following paths.
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
<target-project>/.okstra/discovery/latest-task.json
|
|
103
|
+
<target-project>/.okstra/discovery/task-catalog.json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Division of responsibilities:
|
|
107
|
+
|
|
108
|
+
- `.okstra/discovery/latest-task.json`: a current-task convenience pointer to the most recently prepared okstra task bundle in the current project
|
|
109
|
+
- `.okstra/discovery/task-catalog.json`: the canonical project-level catalog that maintains the list of okstra task bundles prepared in the current project by `taskKey`, `taskGroup`, and `taskId`
|
|
110
|
+
- `instruction-set/reference-expectations.md`: a task-level canonical artifact that identifies the config files, deployment manifests, and expected values the current task should reference
|
|
111
|
+
- `~/.claude/skills/okstra-*/...`, `~/.agents/skills/okstra-*/...`, `~/.claude/agents/...`: skill/agent assets seeded into the user's home directory by `okstra install` (project-local seeding no longer occurs; refresh them with `okstra install --refresh`)
|
|
112
|
+
|
|
113
|
+
The following former files are no longer generated by okstra.
|
|
114
|
+
|
|
115
|
+
- `CLAUDE.md`
|
|
116
|
+
- `.project-docs/ai/claude-project-guide.md`
|
|
117
|
+
- `.project-docs/ai/claude-skill-index.md`
|
|
118
|
+
- `.project-docs/ai/okstra/okstra-guide.md`
|
|
119
|
+
- `.project-docs/ai/okstra/worker-catalog.md`
|
|
120
|
+
|
|
121
|
+
### 4. Manager-owned cross-project state
|
|
122
|
+
|
|
123
|
+
`okstra manager` does not replace the project-local `.okstra` canonical state. It stores global manager state that groups multiple project-local tasks in the user's home directory.
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
~/.okstra/managers/<manager-id>/
|
|
127
|
+
├── manager.json
|
|
128
|
+
├── projects.json
|
|
129
|
+
└── task-groups/<safe-task-group>/<safe-task-id>/
|
|
130
|
+
├── manifest.json
|
|
131
|
+
├── children.json
|
|
132
|
+
├── directives.jsonl
|
|
133
|
+
├── snapshots.json
|
|
134
|
+
├── events.jsonl
|
|
135
|
+
└── child-context/<safe-project-id>-<safe-child-task-id>.md
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Storage authority:
|
|
139
|
+
|
|
140
|
+
- `manager.json`: manager identity and schema version.
|
|
141
|
+
- `projects.json`: the projectId / projectRoot / role / tags registered with the manager. `projectRoot` must be an existing directory, and setup-equivalent registration is performed only when project-local `.okstra/project.json` is absent.
|
|
142
|
+
- `manifest.json`, `children.json`, `directives.jsonl`: manager-owned plan, child assignment, and shared/project directives.
|
|
143
|
+
- `snapshots.json`: a read-side snapshot that `task sync` imports from the child project's `.okstra`. It is not the source of truth for project state.
|
|
144
|
+
- `events.jsonl`: manager events such as `task-created` and `child-launch-prepared`.
|
|
145
|
+
- `child-context/*.md`: child lead context prepared by `task run`. Sibling project reports/snapshots are passed only as read-side source material.
|
|
146
|
+
|
|
147
|
+
Path segments are normalized into slugs. If a slug would be empty, as can happen with non-ASCII values, a `u-<sha1-prefix>` fallback segment is used. However, `manifest.json` and the child `taskKey` preserve the original input values (`project-id:task-group:task-id`).
|
|
148
|
+
|
|
149
|
+
## Task manifest contract
|
|
150
|
+
|
|
151
|
+
`task-manifest.json` is the canonical metadata file Claude uses to understand task continuity.
|
|
152
|
+
As a general rule, this manifest records the absolute `projectRoot` path only once and expresses the remaining generated paths as project-relative fields whenever possible.
|
|
153
|
+
|
|
154
|
+
Examples of key fields:
|
|
155
|
+
|
|
156
|
+
- `projectId`
|
|
157
|
+
- `taskGroup`
|
|
158
|
+
- `taskId`
|
|
159
|
+
- `taskKey`
|
|
160
|
+
- `projectRoot`
|
|
161
|
+
- `taskType`
|
|
162
|
+
- `workCategory`
|
|
163
|
+
- `taskBriefPath`
|
|
164
|
+
- `relatedTasks`
|
|
165
|
+
- `currentStatus`
|
|
166
|
+
- `taskRootPath`
|
|
167
|
+
- `instructionSetPath`
|
|
168
|
+
- `referenceExpectationsPath`
|
|
169
|
+
- `runsPath`
|
|
170
|
+
- `historyTimelinePath`
|
|
171
|
+
- `latestRunPath`
|
|
172
|
+
- `latestRunStatus`
|
|
173
|
+
- `latestRunPromptsPath`
|
|
174
|
+
- `latestReportPath`
|
|
175
|
+
- `latestResumeCommandPath`
|
|
176
|
+
- `workflow.currentPhase`
|
|
177
|
+
- `workflow.currentPhaseState`
|
|
178
|
+
- `workflow.phaseStates`
|
|
179
|
+
- `workflow.lastCompletedPhase`
|
|
180
|
+
- `workflow.nextRecommendedPhase`
|
|
181
|
+
- `workflow.awaitingApproval`
|
|
182
|
+
- `workflow.routingStatus`
|
|
183
|
+
- `workflow.lastSafeCheckpoint`
|
|
184
|
+
- `phaseOutcome` *(artifact-derived semantic phase outcome; for example, when the implementation carry proves that all stages passed, the implementation phase outcome may be recorded as completed even if run contract validation failures remain)*
|
|
185
|
+
- `inputs`
|
|
186
|
+
- `artifacts`
|
|
187
|
+
- `resultContract`
|
|
188
|
+
- `claudeSession`
|
|
189
|
+
- `fixCycles` *(derived summary — `{count, openCycleId, latest:{cycle, symptom, targetReport, closedAt}}`; recalculated on every prepare)*
|
|
190
|
+
|
|
191
|
+
This manifest serves the following purposes.
|
|
192
|
+
|
|
193
|
+
- Let Claude understand task continuity before reading the brief
|
|
194
|
+
- Establish which files should be read first
|
|
195
|
+
- Establish how config files and deployment manifests should be interpreted against expected values
|
|
196
|
+
- Establish the task key under which results accumulate
|
|
197
|
+
- Make it quick to locate related tasks and the latest run
|
|
198
|
+
|
|
199
|
+
## Task index contract
|
|
200
|
+
|
|
201
|
+
`task-index.md` is a summary document for quick human reading.
|
|
202
|
+
|
|
203
|
+
Main contents:
|
|
204
|
+
- task key
|
|
205
|
+
- current task type
|
|
206
|
+
- work category
|
|
207
|
+
- current task status
|
|
208
|
+
- latest run status
|
|
209
|
+
- current phase
|
|
210
|
+
- current phase state
|
|
211
|
+
- next recommended phase
|
|
212
|
+
- reference expectations
|
|
213
|
+
- latest run
|
|
214
|
+
- latest report
|
|
215
|
+
- resume command
|
|
216
|
+
|
|
217
|
+
This document is only a quick summary and is not the source of truth.
|
|
218
|
+
Always use `task-manifest.json` when checking canonical metadata.
|
|
219
|
+
|
|
220
|
+
## Run manifest contract
|
|
221
|
+
|
|
222
|
+
Each execution records the current run contract in the resolved `<run-dir>/manifests/run-manifest-<task-type>-<seq>.json`. The non-stage or stage-qualified rule above determines `<run-dir>`.
|
|
223
|
+
|
|
224
|
+
`manifests/run-context-<task-type>-<seq>.json`, starting with schemaVersion `2.0`, stores `identity` + `pathHints` rather than directly storing every legacy path key. The host-side reader hydrates `pathHints` to reconstruct the former flat keys (`RUN_MANIFEST_RELATIVE_PATH`, `TEAM_STATE_PATH`, and so on) in memory.
|
|
225
|
+
|
|
226
|
+
`state/active-run-context-<task-type>-<seq>.json` is also the compact intake for lead Phase 1 starting with schemaVersion `2.0`. It stores only `identity` + `pathHints` and worker identities instead of repeated path strings, and the deterministic dispatcher hydrates it into the legacy active context shape when reading it.
|
|
227
|
+
|
|
228
|
+
The path fields in `manifests/run-manifest-<task-type>-<seq>.json` are still stored as paths relative to the target project root for validator, team dispatch, and inspect compatibility.
|
|
229
|
+
Immediately after `okstra` starts the Claude handoff, the current run status is usually recorded as `in-progress`.
|
|
230
|
+
Claude then continues with saving the final results and updating status.
|
|
231
|
+
Before launch, `okstra` also preallocates a session ID and creates, under the same run's `sessions/` directory, `claude-resume-<task-type>-<seq>.sh`.
|
|
232
|
+
|
|
233
|
+
Main contents:
|
|
234
|
+
|
|
235
|
+
- task key
|
|
236
|
+
- task type
|
|
237
|
+
- work category
|
|
238
|
+
- run datetime segment
|
|
239
|
+
- task brief relative path
|
|
240
|
+
- analysis target
|
|
241
|
+
- related tasks
|
|
242
|
+
- selected workers
|
|
243
|
+
- worker model assignments
|
|
244
|
+
- claude session id
|
|
245
|
+
- resume command relative path
|
|
246
|
+
- expected report relative path
|
|
247
|
+
- expected status relative path
|
|
248
|
+
- prompt snapshot relative path
|
|
249
|
+
- `worker prompt directory relative path`
|
|
250
|
+
- `worker prompt relative path by worker id`
|
|
251
|
+
- current run status
|
|
252
|
+
- workflow snapshot
|
|
253
|
+
- team contract
|
|
254
|
+
- `fixCycleId` *(only when attached to a fix cycle; field omitted otherwise)*
|
|
255
|
+
|
|
256
|
+
## Timeline contract
|
|
257
|
+
|
|
258
|
+
`history/timeline.json` accumulates the history of runs belonging to a task.
|
|
259
|
+
|
|
260
|
+
The history generally includes the following.
|
|
261
|
+
|
|
262
|
+
- run timestamp
|
|
263
|
+
- run directory relative path
|
|
264
|
+
- run manifest relative path
|
|
265
|
+
- run time segment
|
|
266
|
+
- task type
|
|
267
|
+
- work category
|
|
268
|
+
- status
|
|
269
|
+
- worker prompt directory relative path
|
|
270
|
+
- report relative path
|
|
271
|
+
- resume command relative path
|
|
272
|
+
- related tasks
|
|
273
|
+
- workflow snapshot
|
|
274
|
+
- `fixCycleId` *(only when attached to a fix cycle; field omitted otherwise)*
|
|
275
|
+
Reruns of the same task type reuse the same resolved run directory family. Non-stage runs use `runs/<task-type>/`, while `implementation` and single-stage `final-verification` runs use `runs/<task-type>/stage-<N>/`. Sequence-specific artifacts live beneath that resolved run directory, and each execution accumulates as a separate history entry because `run-manifest-<task-type>-<seq>.json` and related artifact paths are separated by per-category sequence suffixes (`<task-type>-<seq>`). The cross-category identifier is the manifest's `runDateTimeSegment` ISO timestamp field.
|
|
276
|
+
|
|
277
|
+
## Claude operating contract
|
|
278
|
+
|
|
279
|
+
After `okstra` runs, Claude should follow this default sequence when reading the current task.
|
|
280
|
+
|
|
281
|
+
1. If task browsing or task-id disambiguation is required, first read `.okstra/discovery/task-catalog.json`.
|
|
282
|
+
2. If the current task key or task path is not specified, read `.okstra/discovery/latest-task.json` as the current-task pointer.
|
|
283
|
+
3. Read `task-manifest.json`.
|
|
284
|
+
4. If the current `state/active-run-context-<task-type>-<seq>.json` exists, read it as the primary input for lead Phase 1. This file is a compact intake that reconstructs run artifact paths from `identity` + `pathHints` clues. If it does not exist, fall back to the current `manifests/run-manifest-<task-type>-<seq>.json` and `team-state`.
|
|
285
|
+
5. Read `instruction-set/analysis-profile.md` and `instruction-set/analysis-packet.md`.
|
|
286
|
+
6. Read `task-index.md` only when a quick summary is needed.
|
|
287
|
+
7. Lazily read `analysis-material.md`, `reference-expectations.md`, `task-brief.md`, and `final-report-template.md` when the packet is insufficient or when source citations/report writing require them.
|
|
288
|
+
8. Consult `history/timeline.json` and previous run results if necessary.
|
|
289
|
+
9. As `Claude lead`, organize roles according to the current run's worker roster (`Claude worker`, `Codex worker`, and `Report writer worker` by default; `Antigravity worker` only when explicitly included).
|
|
290
|
+
10. Save each selected worker prompt under the current run's `prompts/` directory at the assigned worker prompt history path before dispatching the worker.
|
|
291
|
+
14. Collect a result or terminal status for each required worker.
|
|
292
|
+
15. Unless the brief requires a more specific format, write the final Markdown report using the `final-report-template.md` structure.
|
|
293
|
+
16. Save the result directly to `reports/final-report-<task-type>-<seq>.md` for the current run and, if necessary, update `status/final-<task-type>-<seq>.status`, `manifests/run-manifest-<task-type>-<seq>.json`, `task-manifest.json`, and `task-index.md` to match the current state.
|
|
294
|
+
|
|
295
|
+
Recommended worker status values:
|
|
296
|
+
|
|
297
|
+
- `completed`
|
|
298
|
+
- `timeout`
|
|
299
|
+
- `error`
|
|
300
|
+
- `not-run`
|