okstra 0.201.2 → 0.202.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/bin/okstra +1 -1
- package/dist/commands/lifecycle/setup.mjs +15 -0
- package/dist/commands/lifecycle/setup.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/docs/architecture/storage-model.md +4 -0
- package/docs/architecture.md +1 -1
- package/docs/cli.md +2 -2
- package/docs/for-ai/skills/okstra-manager.md +21 -4
- package/docs/for-ai/skills/okstra-setup.md +9 -0
- package/docs/project-structure-overview.md +11 -5
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/prompts/launch.template.md +1 -1
- package/runtime/prompts/lead/okstra-lead-contract.md +15 -3
- package/runtime/prompts/lead/team-contract.md +2 -0
- package/runtime/prompts/profiles/_implementation-executor.md +2 -2
- package/runtime/prompts/profiles/_implementation-verifier.md +7 -1
- package/runtime/prompts/profiles/implementation-planning.md +2 -0
- package/runtime/python/okstra_ctl/agent/evidence_recovery.py +78 -0
- package/runtime/python/okstra_ctl/convergence_critic_prompt.py +4 -6
- package/runtime/python/okstra_ctl/convergence_provenance.py +75 -18
- package/runtime/python/okstra_ctl/dispatch_core.py +91 -17
- package/runtime/python/okstra_ctl/execution_identity.py +9 -2
- package/runtime/python/okstra_ctl/execution_manifest.py +6 -2
- package/runtime/python/okstra_ctl/execution_mutation_audit.py +134 -65
- package/runtime/python/okstra_ctl/manager_cli.py +85 -12
- package/runtime/python/okstra_ctl/manager_launch.py +40 -18
- package/runtime/python/okstra_ctl/manager_paths.py +8 -0
- package/runtime/python/okstra_ctl/manager_split.py +474 -0
- package/runtime/python/okstra_ctl/manager_store.py +121 -18
- package/runtime/python/okstra_ctl/manager_sync.py +33 -15
- package/runtime/python/okstra_ctl/manager_view.py +216 -0
- package/runtime/python/okstra_ctl/plan_items_cli.py +6 -1
- package/runtime/python/okstra_ctl/qa_commands.py +15 -0
- 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/visualizations.py +0 -5
- package/runtime/python/okstra_ctl/verification_target.py +13 -2
- package/runtime/skills/okstra-manager/SKILL.md +53 -4
- package/runtime/skills/okstra-run/SKILL.md +3 -1
- package/runtime/skills/okstra-setup/SKILL.md +9 -0
- package/runtime/templates/manager/view.template.html +108 -0
- package/runtime/templates/reports/html/i18n/en.json +2 -0
- package/runtime/templates/reports/html/i18n/ko.json +2 -0
- package/runtime/templates/reports/html/tasks/final-verification.template.html +2 -2
- package/runtime/validators/validate-brief.py +7 -2
- package/runtime/validators/validate-run.py +7 -15
package/bin/okstra
CHANGED
|
@@ -2,6 +2,7 @@ import { promises as fs } from "node:fs";
|
|
|
2
2
|
import { createInterface } from "node:readline";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join, resolve as resolvePath } from "node:path";
|
|
5
|
+
import { ensureCitationGuidance } from "../../lib/citation-guidance.mjs";
|
|
5
6
|
import { buildPythonpath, resolvePaths } from "../../lib/paths.mjs";
|
|
6
7
|
import { errorCode, errorMessage, fileExists, runProcess } from "../../lib/proc.mjs";
|
|
7
8
|
const USAGE = `okstra setup — register the current project with okstra
|
|
@@ -20,6 +21,9 @@ Usage:
|
|
|
20
21
|
on the command line
|
|
21
22
|
|
|
22
23
|
Behavior:
|
|
24
|
+
- If <PROJECT_ROOT>/CLAUDE.md or AGENTS.md exists, an okstra-managed block is
|
|
25
|
+
appended (or refreshed) telling agents not to cite okstra-internal ids and
|
|
26
|
+
.okstra/ paths outside okstra reports. Neither file is created.
|
|
23
27
|
- If project.json already exists, the projectId must match (okstra refuses
|
|
24
28
|
to silently rename a project). Delete the file manually if you really
|
|
25
29
|
want to change projectId.
|
|
@@ -229,11 +233,22 @@ export async function run(args) {
|
|
|
229
233
|
process.stderr.write(`warning: failed to provision .claude/settings.local.json symlink — ` +
|
|
230
234
|
`host Claude Code sessions in this project may need to add wrapper permissions manually. (${errorMessage(err)})\n`);
|
|
231
235
|
}
|
|
236
|
+
// 프로젝트에 host 지침 문서(CLAUDE.md / AGENTS.md)가 이미 있으면, okstra 산출물
|
|
237
|
+
// 인용 규율 블록을 그 끝에 심는다. 없는 파일은 만들지 않는다.
|
|
238
|
+
let citationGuidance = [];
|
|
239
|
+
try {
|
|
240
|
+
citationGuidance = await ensureCitationGuidance(projectRoot);
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
process.stderr.write(`warning: failed to update okstra citation guidance in CLAUDE.md / AGENTS.md — ` +
|
|
244
|
+
`agents in this project may quote okstra-internal ids in non-okstra writing. (${errorMessage(err)})\n`);
|
|
245
|
+
}
|
|
232
246
|
process.stdout.write(JSON.stringify({
|
|
233
247
|
ok: true,
|
|
234
248
|
...result,
|
|
235
249
|
projectJsonPath,
|
|
236
250
|
settingsLocalJson: settingsSymlink,
|
|
251
|
+
citationGuidance,
|
|
237
252
|
}, null, 2) + "\n");
|
|
238
253
|
return 0;
|
|
239
254
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.mjs","sourceRoot":"","sources":["../../../src/commands/lifecycle/setup.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrF,MAAM,KAAK,GA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O,CAAC,CAAC;QAC9E,IAAI,QAAQ,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;QACzC,MAAM,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAAgB;IAC9D,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;SACrB,WAAW,EAAE;SACb,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;SACnB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACrB,MAAM,MAAM,GAAG,GAAG,MAAM,QAAQ,KAAK,EAAE,CAAC;IACxC,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const GUIDANCE_BEGIN = "<!-- okstra:citation-guidance:begin -->";
|
|
2
|
+
export declare const GUIDANCE_END = "<!-- okstra:citation-guidance:end -->";
|
|
3
|
+
/** 관리 대상 host 지침 문서. 존재하는 것만 갱신한다. */
|
|
4
|
+
export declare const GUIDANCE_TARGET_FILES: readonly ["CLAUDE.md", "AGENTS.md"];
|
|
5
|
+
/** 마커로 감싼 블록 전문. 앞뒤 개행은 붙이는 쪽에서 관리한다. */
|
|
6
|
+
export declare function renderGuidanceBlock(): string;
|
|
7
|
+
/**
|
|
8
|
+
* 문서 본문에 블록을 반영한 결과를 돌려준다. 기존 블록이 있으면 그 자리에서
|
|
9
|
+
* 교체하고(문안이 바뀌어도 사용자가 쓴 앞부분은 그대로), 없으면 문서 끝에
|
|
10
|
+
* 붙인다. 내용이 이미 같으면 `changed: false` 로 파일을 건드리지 않는다.
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyGuidance(content: string): {
|
|
13
|
+
content: string;
|
|
14
|
+
changed: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 프로젝트 루트의 host 지침 문서를 갱신하고, 실제로 쓴 파일 경로를 돌려준다.
|
|
18
|
+
* 없는 파일은 건너뛴다. `AGENTS.md` 가 `CLAUDE.md` 심링크인 흔한 배치에서는
|
|
19
|
+
* 같은 실파일을 두 번 쓰지 않도록 realpath 로 중복을 제거한다.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ensureCitationGuidance(projectRoot: string): Promise<string[]>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// okstra 산출물 인용 규율 블록을 대상 프로젝트의 host 지침 문서에 심는다.
|
|
2
|
+
//
|
|
3
|
+
// 배경: okstra 리포트는 `.okstra/` 안의 독자를 전제로 내부 식별자(리포트 절
|
|
4
|
+
// 번호, `C-001` 같은 clarification id, run/stage id, `.okstra/...` 경로)를
|
|
5
|
+
// 쓴다. 에이전트가 같은 식별자를 리포트 밖 글(대화 답변, 커밋/PR 본문,
|
|
6
|
+
// 프로젝트 문서)에 그대로 옮기면 독자는 그 참조를 해석할 수 없다.
|
|
7
|
+
//
|
|
8
|
+
// 이 모듈은 `okstra setup` 이 프로젝트 루트에 **이미 있는** `CLAUDE.md` /
|
|
9
|
+
// `AGENTS.md` 끝에 붙이는 관리 블록을 렌더하고 적용한다. 두 파일을 새로
|
|
10
|
+
// 만들지는 않는다 — 없는 프로젝트는 host 지침 문서를 쓰지 않는다는 뜻이다.
|
|
11
|
+
// 마커 규약은 `scripts/okstra_ctl/group_context.py` 의 task-memory 영역과 같다.
|
|
12
|
+
import { promises as fs } from "node:fs";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
export const GUIDANCE_BEGIN = "<!-- okstra:citation-guidance:begin -->";
|
|
15
|
+
export const GUIDANCE_END = "<!-- okstra:citation-guidance:end -->";
|
|
16
|
+
/** 관리 대상 host 지침 문서. 존재하는 것만 갱신한다. */
|
|
17
|
+
export const GUIDANCE_TARGET_FILES = ["CLAUDE.md", "AGENTS.md"];
|
|
18
|
+
const GUIDANCE_BODY = [
|
|
19
|
+
"<!-- Managed by `okstra setup`. Edit above this block; this region is rewritten on each setup run. -->",
|
|
20
|
+
"",
|
|
21
|
+
"## Citing okstra artifacts",
|
|
22
|
+
"",
|
|
23
|
+
"okstra keeps its reports, decisions, and ledgers under `.okstra/`, written for readers of those reports.",
|
|
24
|
+
"Outside an okstra report — chat answers, commit messages, PR bodies, project docs, issue comments — do not",
|
|
25
|
+
"cite okstra-internal references (report section numbers, finding or clarification ids such as `C-001`,",
|
|
26
|
+
"run and stage ids, `.okstra/...` paths) as if the reader could resolve them. State the finding itself and",
|
|
27
|
+
"cite source code as `path:line`; name an okstra file only when the reader has been pointed to it.",
|
|
28
|
+
].join("\n");
|
|
29
|
+
/** 마커로 감싼 블록 전문. 앞뒤 개행은 붙이는 쪽에서 관리한다. */
|
|
30
|
+
export function renderGuidanceBlock() {
|
|
31
|
+
return `${GUIDANCE_BEGIN}\n${GUIDANCE_BODY}\n${GUIDANCE_END}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 문서 본문에 블록을 반영한 결과를 돌려준다. 기존 블록이 있으면 그 자리에서
|
|
35
|
+
* 교체하고(문안이 바뀌어도 사용자가 쓴 앞부분은 그대로), 없으면 문서 끝에
|
|
36
|
+
* 붙인다. 내용이 이미 같으면 `changed: false` 로 파일을 건드리지 않는다.
|
|
37
|
+
*/
|
|
38
|
+
export function applyGuidance(content) {
|
|
39
|
+
const block = renderGuidanceBlock();
|
|
40
|
+
const begin = content.indexOf(GUIDANCE_BEGIN);
|
|
41
|
+
const end = content.indexOf(GUIDANCE_END);
|
|
42
|
+
if (begin !== -1 && end > begin) {
|
|
43
|
+
const next = content.slice(0, begin) + block + content.slice(end + GUIDANCE_END.length);
|
|
44
|
+
return { content: next, changed: next !== content };
|
|
45
|
+
}
|
|
46
|
+
const base = content.replace(/\s*$/, "");
|
|
47
|
+
const next = base.length === 0 ? `${block}\n` : `${base}\n\n${block}\n`;
|
|
48
|
+
return { content: next, changed: true };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 프로젝트 루트의 host 지침 문서를 갱신하고, 실제로 쓴 파일 경로를 돌려준다.
|
|
52
|
+
* 없는 파일은 건너뛴다. `AGENTS.md` 가 `CLAUDE.md` 심링크인 흔한 배치에서는
|
|
53
|
+
* 같은 실파일을 두 번 쓰지 않도록 realpath 로 중복을 제거한다.
|
|
54
|
+
*/
|
|
55
|
+
export async function ensureCitationGuidance(projectRoot) {
|
|
56
|
+
const written = [];
|
|
57
|
+
const seen = new Set();
|
|
58
|
+
for (const name of GUIDANCE_TARGET_FILES) {
|
|
59
|
+
const target = join(projectRoot, name);
|
|
60
|
+
let real;
|
|
61
|
+
try {
|
|
62
|
+
real = await fs.realpath(target);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
continue; // 파일이 없거나 끊어진 심링크 — okstra 가 새로 만들지는 않는다.
|
|
66
|
+
}
|
|
67
|
+
if (seen.has(real))
|
|
68
|
+
continue;
|
|
69
|
+
seen.add(real);
|
|
70
|
+
const content = await fs.readFile(target, "utf8");
|
|
71
|
+
const applied = applyGuidance(content);
|
|
72
|
+
if (!applied.changed)
|
|
73
|
+
continue;
|
|
74
|
+
await fs.writeFile(target, applied.content, "utf8");
|
|
75
|
+
written.push(target);
|
|
76
|
+
}
|
|
77
|
+
return written;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=citation-guidance.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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AAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -220,11 +220,13 @@ The following former files are no longer generated by okstra.
|
|
|
220
220
|
~/.okstra/managers/<manager-id>/
|
|
221
221
|
├── manager.json
|
|
222
222
|
├── projects.json
|
|
223
|
+
├── view/index.html
|
|
223
224
|
└── task-groups/<safe-task-group>/<safe-task-id>/
|
|
224
225
|
├── manifest.json
|
|
225
226
|
├── children.json
|
|
226
227
|
├── directives.jsonl
|
|
227
228
|
├── snapshots.json
|
|
229
|
+
├── split-plan.json
|
|
228
230
|
├── events.jsonl
|
|
229
231
|
└── child-context/<safe-project-id>-<safe-child-task-id>.md
|
|
230
232
|
```
|
|
@@ -234,9 +236,11 @@ Storage authority:
|
|
|
234
236
|
- `manager.json`: manager identity and schema version.
|
|
235
237
|
- `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.
|
|
236
238
|
- `manifest.json`, `children.json`, `directives.jsonl`: manager-owned plan, child assignment, and shared/project directives.
|
|
239
|
+
- `split-plan.json`: the last tracker split plan `task split` applied. The briefs it produced live in each child project's `.okstra/briefs/`, and the children it registered carry `ticketId`, `briefPath`, `scope` and `recommendedPhase` in `children.json`.
|
|
237
240
|
- `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.
|
|
238
241
|
- `events.jsonl`: manager events such as `task-created` and `child-launch-prepared`.
|
|
239
242
|
- `child-context/*.md`: child lead context prepared by `task run`. Sibling project reports/snapshots are passed only as read-side source material.
|
|
243
|
+
- `view/index.html`: the page `okstra manager view` writes from the files above. It is a derived view, rewritten on every run; it does not read child projects, so it shows each task as of its last `task sync`.
|
|
240
244
|
|
|
241
245
|
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`).
|
|
242
246
|
|
package/docs/architecture.md
CHANGED
|
@@ -128,7 +128,7 @@ Runtime entry points are consolidated in Python packages. Bash and skills only c
|
|
|
128
128
|
- [`okstra_ctl.session`](../scripts/okstra_ctl/session.py) · [`okstra_ctl.seeding`](../scripts/okstra_ctl/seeding.py) — Claude session ID / resume command / installation validation / runtime settings.
|
|
129
129
|
- [`okstra_ctl.{ids,index,invocation,jsonl,project_meta,reconcile,sequence,backfill,listing,locks}`](../scripts/okstra_ctl/) — existing central-index (`~/.okstra`) modules.
|
|
130
130
|
- [`okstra_project.{resolver,state}`](../scripts/okstra_project/) — PROJECT_ROOT resolution + project.json upsert + task-catalog/manifest reader.
|
|
131
|
-
- [`okstra_ctl.manager_cli`](../scripts/okstra_ctl/manager_cli.py), [`manager_store`](../scripts/okstra_ctl/manager_store.py), [`manager_sync`](../scripts/okstra_ctl/manager_sync.py), [`manager_launch`](../scripts/okstra_ctl/manager_launch.py), [`manager_paths`](../scripts/okstra_ctl/manager_paths.py) — cross-project manager state, one-way project snapshot sync,
|
|
131
|
+
- [`okstra_ctl.manager_cli`](../scripts/okstra_ctl/manager_cli.py), [`manager_store`](../scripts/okstra_ctl/manager_store.py), [`manager_sync`](../scripts/okstra_ctl/manager_sync.py), [`manager_launch`](../scripts/okstra_ctl/manager_launch.py), [`manager_paths`](../scripts/okstra_ctl/manager_paths.py), [`manager_view`](../scripts/okstra_ctl/manager_view.py), [`manager_split`](../scripts/okstra_ctl/manager_split.py) — cross-project manager state, one-way project snapshot sync, child launch packet/context creation, the HTML overview page, and tracker split into per-project scoped briefs for `okstra manager`.
|
|
132
132
|
|
|
133
133
|
### Bash entry points (thin)
|
|
134
134
|
|
package/docs/cli.md
CHANGED
|
@@ -823,7 +823,7 @@ The `okstra` Node CLI (`bin/okstra`) provides both installer/admin commands and
|
|
|
823
823
|
| `okstra doctor [--runtime claude-code\|codex\|antigravity\|external\|all] [--phase <phase>] [--json]` | Diagnose the runtime, Python imports, skill/agent installation, and model-pool state. The JSON `modelPool` object reports pool errors, default errors, binding precision, observed model, max write boundary, and invocation downgrade reason. It never sends an inference call. The `codex`, `antigravity`, and `external` runtimes omit Claude skill checks. `--phase` adds readiness checks for `implementation`, `final-verification`, `release-handoff`, or `improvement-discovery` |
|
|
824
824
|
| `okstra model list [--role <role>] [--host <host>] [--json]` | List catalog models for a host and optional role. Unselectable exact bindings report `exact binding unavailable`. No inference call |
|
|
825
825
|
| `okstra model default set\|unset <role> ... --scope project\|global [--cwd <dir>]` | Atomically write or remove `modelDefaults` for one canonical role |
|
|
826
|
-
| `okstra setup --project-id <id>` | Create or update `.okstra/project.json` in the current project |
|
|
826
|
+
| `okstra setup --project-id <id>` | Create or update `.okstra/project.json` in the current project. When `<PROJECT_ROOT>/CLAUDE.md` or `AGENTS.md` already exists, it also appends — or refreshes in place — an okstra-managed block between `<!-- okstra:citation-guidance:begin -->` / `end` telling agents not to cite okstra-internal references (report section numbers, `C-NNN` ids, run/stage ids, `.okstra/...` paths) outside an okstra report. Neither file is created, and a failure is a warning, not an error |
|
|
827
827
|
| `okstra check-project [--json]` | Verify that the current project is registered |
|
|
828
828
|
| `okstra preflight [--runtime <name>] [--cwd <dir>] [--machine]` | Single skill-preflight call combining `ensure-installed`, with silent reinstall when stale, `check-project`, and host-specific `runtimeReadiness`. It defaults to a fixed text projection. `--machine` returns the automation JSON contract, and `--json` is a deprecated one-release alias. A `claude-code` host checks project workspace trust. A `codex` current-session host verifies write access to `~/.okstra/worktrees/registry.lock`; a sandbox denial blocks before the wizard with the `switch-codex-to-full-access-and-rerun` action. `antigravity` and `external` hosts return ready without reading Claude Code state. Step 0 of every project-scoped skill converges on this command |
|
|
829
829
|
| `okstra convergence seed --groups <path> --work-state <path> --final-state <path> --migration-dir <dir> [--restart-from-round0]` | Create, resume, reuse, or explicitly recover deterministic convergence state |
|
|
@@ -856,7 +856,7 @@ The `okstra` Node CLI (`bin/okstra`) provides both installer/admin commands and
|
|
|
856
856
|
| `okstra model-io active-context-input --project-root <dir> --run-manifest <path>` | Resolve the prior implementation-planning active context only through the current project and run authority, then emit fixed fields such as the executor base ref. Caller-supplied active-context paths are not accepted. |
|
|
857
857
|
| `okstra report-translate <source\|write\|check-data> --run-manifest <path> …` | Resolve the report data and translation sidecar from the run manifest. `source` emits a source digest with the fixed translation queue; `write` requires that digest and rejects a stale report; `check-data` verifies the derived sidecar. Models never choose the data or sidecar path. |
|
|
858
858
|
| `okstra convergence prepare-groups --run-manifest <path> --input <grouping.md>` | Parse fixed grouping Markdown, validate distinct per-worker evidence and group semantics against the run authority, then publish the schema-valid groups artifact at the run-owned path. |
|
|
859
|
-
| `okstra manager <init\|discover-projects\|new\|task> [--json]` | Public CLI for grouping cross-project okstra tasks into manager-owned context. The default is purpose-specific fixed text for model use; `--json` preserves the machine contract and exit codes. `new project --project-root` accepts only existing directories and performs setup-equivalent registration only if `.okstra/project.json` is absent. |
|
|
859
|
+
| `okstra manager <init\|discover-projects\|new\|task\|list\|view> [--json]` | Public CLI for grouping cross-project okstra tasks into manager-owned context. The default is purpose-specific fixed text for model use; `--json` preserves the machine contract and exit codes. `new project --project-root` accepts only existing directories and performs setup-equivalent registration only if `.okstra/project.json` is absent. `list managers`, `list projects --manager-id <id>` and `list tasks --manager-id <id>` enumerate manager state; `view --manager-id <id>` writes `~/.okstra/managers/<id>/view/index.html` and prints its path and `file://` URL. `task split --plan <json>` writes one validated brief with a `## Project Scope` section into each project an issue is assigned to and registers those children; `task run` then passes `--task-brief`. |
|
|
860
860
|
| `okstra rollup [--task-group <group>] [--project-root <dir>] [--cwd <dir>] [--text\|--json]` | Read-only backend for the okstra-rollup skill. `--text` emits ordered fixed labels for model use. The default and `--json` preserve the full machine JSON contract and exit codes. Omitting `--task-group` targets the whole project catalog. |
|
|
861
861
|
| `okstra usage-report [--days <positive-int>] [--project-root <dir>] [--cwd <dir>] [--text\|--json]` | Read-only backend for the okstra-usage skill. `--text` emits ordered fixed labels for model use. The default and `--json` preserve the full machine JSON contract and exit codes. Defaults to the current project's last 30 days. |
|
|
862
862
|
| `okstra worker-state transition --team-state <path> --worker <id> --status <in-progress\|completed\|timeout\|error\|not-run> [--reason <text>] [--model <execution-value>]` | Atomically update one persisted worker row. `in-progress` records the authoritative `startedAt` and clears `endedAt`; terminal states record `endedAt`; `timeout`, `error`, and `not-run` require a reason. Dispatch adapters use this same transition path, so CLI-backed and in-process orchestration share the status timestamp contract |
|
|
@@ -33,8 +33,19 @@ okstra manager task note --manager-id <manager-id> --task-group <task-group> --t
|
|
|
33
33
|
okstra manager task sync --manager-id <manager-id> --task-group <task-group> --task-id <task-id>
|
|
34
34
|
okstra manager task status --manager-id <manager-id> --task-group <task-group> --task-id <task-id>
|
|
35
35
|
okstra manager task run --manager-id <manager-id> --project-id <project-id> --task-group <task-group> --task-id <task-id> [--child-task-id <child-task-id>]
|
|
36
|
+
okstra manager task split --manager-id <manager-id> --task-group <task-group> --task-id <task-id> --plan <split-plan.json> [--overwrite]
|
|
37
|
+
okstra manager list managers
|
|
38
|
+
okstra manager list projects --manager-id <manager-id>
|
|
39
|
+
okstra manager list tasks --manager-id <manager-id>
|
|
40
|
+
okstra manager view --manager-id <manager-id>
|
|
36
41
|
```
|
|
37
42
|
|
|
43
|
+
- `list managers`: every manager in this home with its project count and manager-task count.
|
|
44
|
+
- `list projects`: the manager's registered projects with root, role, tags and link time.
|
|
45
|
+
- `list tasks`: the manager's tasks by task-group and task-id with objective, progress mode and child count.
|
|
46
|
+
- `task split`: reads a tracker split plan (one Linear project or parent issue, each issue assigned to one or more projects with a scope), writes one brief per (issue, project) pair to `<projectRoot>/.okstra/briefs/<task-group>/<ticketId>-<file-title>.md` with a `## Project Scope` section, and registers each pair as child `<project-id>:<task-group>:<slug(ticketId)>`. Every brief passes the brief validator before any file is written; an existing brief with different content stops the run unless `--overwrite` is given. The skill's Tracker Split section defines the plan JSON and the fetch/confirm procedure.
|
|
47
|
+
- `view`: writes `view/index.html` (summary tiles, project table, one panel per task with child rows, directives and events) and returns `View path` and `View URL`. It does not sync; each panel shows its last sync time and the sync command.
|
|
48
|
+
|
|
38
49
|
## Storage Model
|
|
39
50
|
|
|
40
51
|
Manager state is stored under `~/.okstra/managers/<manager-id>/`, split into two layers: the manager root and the task directory.
|
|
@@ -47,11 +58,13 @@ Directly under the manager root:
|
|
|
47
58
|
Under the task directory `task-groups/<safe-group>/<safe-task>/`:
|
|
48
59
|
|
|
49
60
|
- `manifest.json`: manager task objective, common brief, progress mode
|
|
50
|
-
- `children.json`: child task plan, assignment, launch metadata
|
|
61
|
+
- `children.json`: child task plan, assignment, launch metadata; children made by `task split` also carry `ticketId`, `briefPath`, `scope` and `recommendedPhase`
|
|
62
|
+
- `split-plan.json`: the last plan `task split` applied
|
|
51
63
|
- `directives.jsonl`: shared/project directive rows
|
|
52
64
|
- `snapshots.json`: the read-side snapshot `task sync` read from the project-local `.okstra`
|
|
53
|
-
- `events.jsonl`: manager events such as `task-created` and `child-launch-prepared`
|
|
65
|
+
- `events.jsonl`: manager events such as `task-created`, `task-split` and `child-launch-prepared`
|
|
54
66
|
- `child-context/<safe-project>-<safe-task>.md`: the child lead context `task run` produced
|
|
67
|
+
- `view/index.html` (under the manager root): the overview page `view` writes; rewritten on every run
|
|
55
68
|
|
|
56
69
|
A segment whose slug is empty (e.g. a non-ASCII task-group/task-id) uses a `u-<sha1-prefix>` path segment, but the manifest and the child `taskKey` preserve the original input value.
|
|
57
70
|
|
|
@@ -60,10 +73,14 @@ A segment whose slug is empty (e.g. a non-ASCII task-group/task-id) uses a `u-<s
|
|
|
60
73
|
`task run` does not run the child work directly; it prepares a launch packet. The key fixed fields of the returned packet:
|
|
61
74
|
|
|
62
75
|
- `Task key`: the child's `project-id:task-group:task-id` (the public child-identity key — also recorded on the `child-launch-prepared` event)
|
|
63
|
-
- `Backend`: always `
|
|
76
|
+
- `Backend`: always `spawn-process` — the child lead runs as a separate host process started by the installed launcher
|
|
64
77
|
- `Worker dispatch backend`: always `subagent` in v1
|
|
65
78
|
- `Project root`: the child project root
|
|
66
79
|
- `Context path`: the manager child context markdown
|
|
67
|
-
-
|
|
80
|
+
- `Run command`: the installed launcher, `~/.okstra/bin/okstra.sh`
|
|
81
|
+
- every numbered `Run arg N`: the ordered launcher arguments `--project-root … --project-id … --task-group … --task-id … --directive "Read manager child context: …"`. A child made by `task split` also gets `--task-brief <briefPath>`, and `--task-type <recommendedPhase>` while the child task does not exist yet in its project
|
|
82
|
+
- `Shell command`: `Run command` plus every `Run arg N`, shell-quoted; the skill hands this line to the user to run in a new terminal
|
|
83
|
+
|
|
84
|
+
The launcher fills the task type and brief from the child task manifest when it exists and asks for the rest, then prepares the run and starts the lead with the directive in its prompt. `okstra run` is not a substitute: for a lead host it adds `--launch-only`, which drops the task inputs and the directive.
|
|
68
85
|
|
|
69
86
|
When packet creation succeeds, that child launch's status in `children.json` is updated to `prepared`, and a `child-launch-prepared` is appended to `events.jsonl`. On failure it does not modify the project-local task state.
|
|
@@ -91,6 +91,15 @@ Create command:
|
|
|
91
91
|
okstra setup --yes --project-root /abs/project --project-id my-project
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
`okstra setup` also refreshes the okstra-managed citation-guidance block in
|
|
95
|
+
`<PROJECT_ROOT>/CLAUDE.md` and `AGENTS.md` when those files already exist (it never
|
|
96
|
+
creates them). The block tells agents not to carry okstra-internal references — report
|
|
97
|
+
section numbers, `C-NNN` clarification ids, run/stage ids, `.okstra/...` paths — into
|
|
98
|
+
writing that is not an okstra report, where the reader cannot resolve them. The command
|
|
99
|
+
reports the files it touched in its JSON `citationGuidance` array; a failure there is a
|
|
100
|
+
`warning:` line, not a non-zero exit. Tell the user which guidance files were updated so
|
|
101
|
+
they can review the appended block.
|
|
102
|
+
|
|
94
103
|
## Optional configuration
|
|
95
104
|
|
|
96
105
|
Per the source, Step 3.5 is optional configuration performed only when the user explicitly wants it — read `references/project-config.md` in the skill directory for the detailed procedure. If the defaults are enough, skip it and go to doctor.
|
|
@@ -29,7 +29,7 @@ Current baseline:
|
|
|
29
29
|
- Python orchestration authority: `scripts/okstra_ctl/run.py::prepare_task_bundle`
|
|
30
30
|
- lifecycle: `requirements-discovery → error-analysis → implementation-option-selection → implementation-planning → implementation → final-verification → release-handoff`
|
|
31
31
|
- installed skills: 13
|
|
32
|
-
- provider workers: `claude`, `codex`, `antigravity`, `grok`, `kimi
|
|
32
|
+
- provider workers: `claude`, `codex`, `antigravity`, `grok`, `kimi`, `zai` (GLM via Claude Code); functional report writer: `report-writer`
|
|
33
33
|
- final report SSOT: `schemas/final-report-v2.0.schema.json` + `*.data.json`
|
|
34
34
|
|
|
35
35
|
Design principles:
|
|
@@ -224,7 +224,7 @@ Top-level scripts:
|
|
|
224
224
|
| File | Role |
|
|
225
225
|
|---|---|
|
|
226
226
|
| `okstra.sh` | Bash CLI wrapper around `prepare_task_bundle`, optionally launches `claude` |
|
|
227
|
-
| `okstra-{claude,codex,antigravity,grok,kimi}-exec.sh` | Worker CLI entrypoints — four lines each, `exec`ing `okstra-provider-exec.py` with the provider id. They hold no provider logic; adding a flag to one of these instead of to the provider adapter is exactly the drift this shape exists to prevent |
|
|
227
|
+
| `okstra-{claude,codex,antigravity,grok,kimi,zai}-exec.sh` | Worker CLI entrypoints — four lines each, `exec`ing `okstra-provider-exec.py` with the provider id (`zai` selects the Z.ai GLM provider, which reuses the installed `claude` executable with process-local connection settings). They hold no provider logic; adding a flag to one of these instead of to the provider adapter is exactly the drift this shape exists to prevent |
|
|
228
228
|
| `okstra-provider-exec.py` | The one worker entrypoint: parses the shared positional contract plus `--presentation`, resolves the provider's `ExecutionStrategy` from the registry, refuses a missing CLI before any artifact is written, then hands the run to `okstra_ctl.worker_runner` |
|
|
229
229
|
| `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 |
|
|
230
230
|
| `okstra-token-usage.py` | Token usage CLI entrypoint |
|
|
@@ -245,6 +245,8 @@ Important modules:
|
|
|
245
245
|
| `exact_coverage.py` | Shared pure calculator for requirement coverage and scope precision in option selection and selected-direction planning |
|
|
246
246
|
| `implementation_options.py` | Option-selection criteria, weighting, candidate fingerprint convergence, ranking, and semantic validation |
|
|
247
247
|
| `implementation_direction.py` | Selected report/response validation, direction snapshot materialization, and selected-direction reference validation |
|
|
248
|
+
| `technical_verification.py` | Optional `technical-verification` phase backend — resolves and freezes the explicitly classified unresolved facts from the same task's implementation-option-selection report into `state/technical-verification-input-<seq>.json` (`write_technical_verification_input` / `resolve_technical_verification_input`, driven from `run.py`). No selected direction is required and unresolved user decisions still block entry; it links test inputs to observed results and never produces adoption approval or changes candidate feasibility |
|
|
249
|
+
| `verification_target.py` | Shared reader for the prepared final-verification target snapshot (`verification-target.md`) written by `run.write_verification_target_snapshot`. One implementation of the digest/scope rule serves both consumers — report assembly (records `verificationScope`) and `validators/validate-run.py` (re-checks the published report against the target) — so the two cannot drift |
|
|
248
250
|
| `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`) |
|
|
249
251
|
| `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 |
|
|
250
252
|
| `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 |
|
|
@@ -300,7 +302,8 @@ Important modules:
|
|
|
300
302
|
| `wizard/confirmation.py` | `confirmation_block` and the confirm step |
|
|
301
303
|
| `wizard/registry.py` | the ordered `STEPS` literal (order is question order), `STEP_BY_ID`, `_reset_from`, and the steps that rewind the registry (edit target, brief carry) |
|
|
302
304
|
| `wizard/engine.py` | public API — `init_state`, `next_prompt`, `submit`, progress / simulation, host interaction payloads |
|
|
303
|
-
| `wizard/render.py` | `render_args`, `render_role_args`,
|
|
305
|
+
| `wizard/render.py` | `render_args`, `render_role_args`, and the stage-intent helpers |
|
|
306
|
+
| `wizard/outcome.py` | `wizard_outcome` — assembles the run argv, confirmation screen, and persistence actions from an approved `WizardState` (extracted from `render.py`) |
|
|
304
307
|
| `wizard/cli.py`, `wizard/__main__.py` | `okstra wizard` argparse entrypoint (`main`); `python3 -m okstra_ctl.wizard` |
|
|
305
308
|
| `wizard_stage_intent.py` | stage-related intent projection of the `okstra-run` wizard output — normalizes whole-task (`__whole_task__`) vs single/multi stage selection into render-args (`resolve_wizard_stage_intent`) |
|
|
306
309
|
| `index.py`, `jsonl.py`, `reconcile.py`, `listing.py`, `backfill.py` | `~/.okstra` run index and history operations — `record_start` (index.py) writes a run's start; the end is closed either by `settle_run_row` (reconcile.py, records a verdict the caller already knows — used by `validate-run.py`) or by `reconcile_home` (infers one from disk — used by `run._reconcile_prior_runs` as the backstop for runs that died before validation) |
|
|
@@ -324,10 +327,13 @@ Important modules:
|
|
|
324
327
|
| `plan_run_root.py` | shared helper deriving `approved_plan_path` → `plan_run_root` and back-tracing the task-key |
|
|
325
328
|
| `manager_cli.py` | `okstra manager` Python entrypoint — purpose-specific fixed text by default, machine JSON with `--json` |
|
|
326
329
|
| `manager_paths.py` | Manager state path SSOT under `~/.okstra/managers/<manager-id>/`; slug fallback uses `u-<sha1-prefix>` when a safe segment would be empty |
|
|
327
|
-
| `manager_store.py` | Manager-owned state mutation — project membership, task planning, assignment, directives, event append |
|
|
330
|
+
| `manager_store.py` | Manager-owned state mutation — project membership, task planning, assignment, directives, event append — plus the `list managers/projects/tasks` readers |
|
|
328
331
|
| `manager_sync.py` | One-way child project `.okstra` snapshot reader; corrupt child state becomes row-level `error` so other children continue |
|
|
329
332
|
| `manager_launch.py` | Child launch packet and manager child context renderer; records `prepared` launch metadata/events without changing project-local task state |
|
|
333
|
+
| `manager_view.py` | `okstra manager view` — renders one manager's projects, tasks, child summaries, directives and events into `view/index.html` from `templates/manager/view.template.html`; reads manager-owned files only |
|
|
334
|
+
| `manager_split.py` | `okstra manager task split` — validates a tracker split plan, renders one brief per (issue, project) with a `## Project Scope` section, checks each with `validators/validate-brief.py` before writing, and registers the children |
|
|
330
335
|
| `agent/invocation.py` | Deep invocation-contract module — composes model assignment, common/functional duty, and task instructions; publishes immutable prompt/metadata pairs; verifies five digests; owns standalone result/completion envelopes |
|
|
336
|
+
| `agent/evidence_recovery.py` | Issues a same-model, same-role evidence-recovery invocation over a terminal-state attempt — verifies the source invocation metadata and existing result, then republishes a suffixed prompt/metadata/result triple (`-evidence-recovery-<attempt>`) that preserves the original model assignment while confining the child to preserving the earlier result's evidence rather than re-running the completed work (`prepare_evidence_recovery`, driven from `dispatch_core`) |
|
|
331
337
|
| `agent/prompt_cli/` | CLI boundary for run-backed and standalone materialization/verification plus host-native dispatch and result-link records. `inputs` resolves the path arguments this model-facing surface cannot trust and `emit` writes the result; above them `run_identity` refuses a role the run never issued and `dynamic_verifier` reserves a re-verification slot only after that role qualifies; `materialize` authors the specification (every report-writer prompt gets the okstra-rendered `## Output`; with `--corrections` it runs the ledger check in `corrections` and prepends `## Corrections`; without one it refuses a corrective dispatch over a parsing narrative), `results` links what came back, and `cli` is the argparse surface with the command's canonical USAGE epilog (`check-corrections` runs the ledger check without materializing; `apply-corrections` writes a mechanical ledger to the narrative and records the `lead-correction-applied` activity row via `corrections.run_corrections_apply`) |
|
|
332
338
|
| `dispatch_state.py` | Provider-neutral `WorkerJob`, invocation metadata validation, immutable host-native dispatch/result-link recording, and shared team-state mutation helpers |
|
|
333
339
|
| `dispatch_core.py` | Backend-neutral worker dispatch core — verifies invocation metadata immediately before worker execution, then records and collects code-owned process/pane attempts shared by every lead runtime |
|
|
@@ -392,7 +398,7 @@ Project resolver and read-only state helpers:
|
|
|
392
398
|
|
|
393
399
|
Token/cost accounting:
|
|
394
400
|
|
|
395
|
-
- provider adapters: `claude.py`, `codex.py`, `antigravity.py`, `grok.py` (`grok.py` reads the Grok Build session docs under `~/.grok/sessions/<percent-encoded-cwd>/`, taking cumulative tokens from the last `params.update.usage.modelUsage` snapshot in `updates.jsonl`)
|
|
401
|
+
- provider adapters: `claude.py`, `codex.py`, `antigravity.py`, `grok.py`, `kimi.py`, `zai/adapter.py` (`grok.py` reads the Grok Build session docs under `~/.grok/sessions/<percent-encoded-cwd>/`, taking cumulative tokens from the last `params.update.usage.modelUsage` snapshot in `updates.jsonl`; `zai/adapter.py` wraps the Claude Code executor for GLM workers — reads `ZAI_API_KEY` from the process env or the current user's `~/.env`, runs each child against `https://api.z.ai/api/anthropic` with `--setting-sources ""`, attests the served model only from response `message.model`, and prices usage at Z.ai's public API rates for `glm-5.3` / `glm-5.3-flash`)
|
|
396
402
|
- aggregation: `collect.py`, `blocks.py`, `jsonl_io.py`, `paths.py`
|
|
397
403
|
- incremental scan cache: `cursor.py` (`$OKSTRA_HOME/cache/token-usage/` byte cursor + usage event extracts; bypass with `--no-cache`)
|
|
398
404
|
- pricing: `pricing.py`
|
package/package.json
CHANGED
package/runtime/BUILD.json
CHANGED
|
@@ -76,7 +76,7 @@ For every other task type:
|
|
|
76
76
|
- Pointer `status: pending` with a `rationale` → the user's own input is what comes next. Quote the `rationale` and issue the command it names. Do not re-run the phase that just completed, and do not send the user to `/okstra-inspect`: a finished phase has nothing to inspect, and re-running it discards the result the user is being asked to act on.
|
|
77
77
|
- Otherwise → `/okstra-inspect status` for this task.
|
|
78
78
|
|
|
79
|
-
For file links in progress updates and closeout, use a short descriptive label in the Report Language, such as `[<선택 언어> 보고서 열기](<
|
|
79
|
+
For file links in progress updates and closeout, use a short descriptive label in the Report Language, such as `[<선택 언어> 보고서 열기](<absolute-report-path>)`, replacing `<선택 언어>` with the run's selected report language name. The destination is always an absolute path: a project-relative destination does not open when the host's working directory differs or the user opens the file in an external program. `reportPaths.markdown` destinations are already absolute; for a project-relative path from this prompt, prefix `{{PROJECT_ROOT}}/`. Wrap a destination that contains spaces in `<...>`. Put each link on its own line. Keep the complete destination on one source line without inserted newlines; never abbreviate the destination or repeat the long path beside the label. Change only the display label. Commands stay in backticks.
|
|
80
80
|
|
|
81
81
|
Some terminal hosts expand Markdown links into visible paths. If that happens, provide a copyable file-opening command for the verified host OS in a code block, on one source line with the actual path safely shell-quoted (for example, `open` on macOS). Do not execute it unless asked. Do not promise that Markdown prevents visual wrapping, or create a shortened copy or symlink merely for display. This is presentation guidance, not runtime validation of the emitted message.
|
|
82
82
|
|
|
@@ -106,7 +106,7 @@ User-utterance interpretation rule:
|
|
|
106
106
|
|
|
107
107
|
At each phase or implementation-stage boundary, at task completion, and before a controlled session pause or handoff, follow the launch prompt's "Progress, remaining work, and recommendation" guidance. Include the result and evidence, unfinished work and blockers, and the next action with its reason. During an authorized continuous run, deliver this update beside the checkpoint and continue; do not turn the update into an approval gate. The same guidance applies to the final reply after persistence below.
|
|
108
108
|
|
|
109
|
-
Apply the launch prompt's file-link presentation guidance to these updates as well: short localized labels, one link per line, an intact
|
|
109
|
+
Apply the launch prompt's file-link presentation guidance to these updates as well: short localized labels, one link per line, an intact absolute destination, and a copyable file-opening command when the terminal expands links. Keep file links separate from the raw progress checkpoint line.
|
|
110
110
|
|
|
111
111
|
Follow the launch prompt's operation-level progress guidance: name the actual prepared artifact or executed check, distinguish preparation from execution and results, and cite the observed error when blocked. Apply its existing-authorization guidance before asking about provider data transfer again; reuse approval for the same recipients and material while respecting separate host execution permission.
|
|
112
112
|
|
|
@@ -343,6 +343,8 @@ For `improvement-discovery`, Lead records `## Primary Pass Assignments` in the P
|
|
|
343
343
|
|
|
344
344
|
### Phase 4 / Phase 5 — Dispatch, await, and error-log recording
|
|
345
345
|
|
|
346
|
+
Before redispatch, inspect the invocation's last attempt in the run manifest. A running attempt is awaited; only `failed-no-mutation` can append another attempt within its retry budget. Other terminal states retain their original result and audit. For a legacy implementer rejected solely by `declared out-of-plan path did not change`, `okstra team dispatch` prepares a separate evidence-recovery invocation with the same assignment and model and distinct prompt/result paths. Collect that recovery result, then continue the selected independent verifier. Do not replay completed implementation or ask the user to reauthorize unchanged scope. For other terminal failures, use `okstra agent-prompt materialize` with a new `--invocation-id` and distinct `--prompt`/`--result` paths for the bounded verified defect or missing evidence. These retry restrictions are enforced by `dispatch_core._next_attempt` and `execution_manifest._validate_next_attempt`.
|
|
347
|
+
|
|
346
348
|
For each selected worker assignment, persist the exact prompt history, emit the per-worker Phase 4 checkpoint, and call `dispatch_worker(assignment, promptPath)` through the selected adapter — the dispatch hands the worker the persisted prompt's path, never a re-inlined copy of its body. Then call `await_workers(handles)`. A dispatch acknowledgement or process/pane creation is never completion: verify the terminal status, Result Path, and worker-results audit path required by `team-contract` before emitting the Phase 5 collection checkpoint.
|
|
347
349
|
|
|
348
350
|
Retries and convergence re-verification always call `redispatch_worker` to create a fresh one-shot session. Never reuse a worker conversation or switch adapters/providers to hide a failed assignment.
|
|
@@ -357,7 +359,7 @@ The launch prompt's `## Run Logs (error-log wiring)` section gives Lead the reso
|
|
|
357
359
|
|
|
358
360
|
Workers are contractually required to extract this line and abort with `<WORKER>_ERRORS_PATH_MISSING` if it is absent (see each worker definition's "Path extraction (BLOCKING)" block). A worker records its tool failure through the typed `okstra error-log append-observed` form in that contract; it does not write an intermediate JSON file.
|
|
359
361
|
|
|
360
|
-
After each worker terminates,
|
|
362
|
+
After each worker terminates, verify the canonical result file at `**Result Path:**` and inspect the recorded mutation status. A missing result permits the same worker/prompt retry only for `failed-no-mutation` within its retry budget. A terminal state with changes or unresolved attribution requires a separate bounded corrective invocation, preserving existing work and evidence. Full rules: [team-contract](./team-contract.md) "Lead Redispatch Policy on Result-Missing".
|
|
361
363
|
|
|
362
364
|
`--agent`, `--agent-role`, and `--error-type` are **closed enums**, not free-form labels — the role names used elsewhere in these contracts (`Codex worker`, `Claude worker`) are rejected. Use exactly:
|
|
363
365
|
|
|
@@ -527,7 +529,7 @@ When the host native picker is available and two of those rows could apply, ask
|
|
|
527
529
|
|
|
528
530
|
**Cite run-artifact paths, do not assemble them.** The `report-finalize` result's `reportPaths` carries this run's `humanReport`, `reportRecord`, `teamState`, and `renderFullCopy` command, each already rooted at the project (`.okstra/tasks/<task-group>/<task-id>/runs/...`). Every other run-artifact path the reply cites — the resume command among them — comes from the launch prompt's `## Manifests` / `## Run Paths` lists, which are rooted the same way. A path you compose from a `runs/<task-type>/...` pattern instead is identical across every task of that task-type, so it names no task and does not resolve from the project root either.
|
|
529
531
|
|
|
530
|
-
Write file references as Markdown links with short labels in the Report Language, following the launch prompt's file-link presentation guidance. `reportPaths.markdown` supplies
|
|
532
|
+
Write file references as Markdown links with short labels in the Report Language, following the launch prompt's file-link presentation guidance. `reportPaths.markdown` supplies absolute destinations for the report, report record, and team state; preserve those destinations and shorten only their display labels. Put each link on its own line without repeating the path in prose or inserting a line break inside the destination. Apply the same format to worker results, error logs, and briefs: take the project-rooted path from `## Manifests` / `## Run Paths` and prefix the absolute project root, so every link destination is absolute. Relative paths stay in commands, not in link destinations. If the terminal expands links into long paths, offer the host-appropriate copyable file-opening command described in the launch prompt. Markdown alone does not guarantee clickable links in every terminal.
|
|
531
533
|
|
|
532
534
|
**Enforced:** `scripts/okstra_ctl/report_finalize.py` `_closeout_report_paths` builds the task-qualified paths and `closeout_command` builds the close, so neither is re-derived; `validators/validate_session_conformance.py` `_check_progress_checkpoints` requires the `phase-7-persist` checkpoint this phase opens with.
|
|
533
535
|
|
|
@@ -568,3 +570,13 @@ The run-level error log lives at `<runDir>/logs/errors-<task-type>-<seq>.jsonl`.
|
|
|
568
570
|
| Re-sending a finding absent from the persisted round plan | Dispatch exactly the engine-returned `findingIds`; see [convergence](./convergence.md) "Re-verification Dispatch" |
|
|
569
571
|
| Aggregating a `timeout`/`error` reverify dispatch as `DISAGREE` | Put the terminal outcome in round results; `apply-round` records `verification-error`. See [convergence](./convergence.md) "Worker failure handling in reverify" |
|
|
570
572
|
| Bypassing `report-finalize` and running its Phase 7 steps manually | Run `okstra report-finalize ...`; it owns token substitution and the remaining persistence order. |
|
|
573
|
+
|
|
574
|
+
## Recoverable completion discrepancies
|
|
575
|
+
|
|
576
|
+
Treat `plannedPaths` as an expected change inventory, not an exhaustive authorization list. `ExecutionMutationAudit.compare` enforces write authority and emits plan discrepancies as warnings; `dispatch_state.missing_completion_paths` checks required result availability and usability. Collect usable results with warnings and pass the observed changes and unresolved evidence to independent verification before declaring task completion.
|
|
577
|
+
|
|
578
|
+
Preserve original results and attempt identities when correcting declaration formatting, missing rationale, or required artifacts. Continue the smallest affected repair within the approved objectives. Do not restart implementation or request renewed permission solely for a plan-path mismatch. If a required artifact is unusable, repair that artifact and keep only its dependent steps waiting. If the same repair produces no new evidence, report the unresolved requirement and resume point instead of repeating the whole implementation.
|
|
579
|
+
|
|
580
|
+
Ask for user judgment only when the proposed work changes approved objectives or acceptance conditions, crosses an explicit authority boundary, or adds an unapproved external action. A warning does not waive read-only roles, protected paths, independent verification, or final acceptance checks. Never convert an old closed failed attempt into success by overwriting its audit; use a recorded recovery with independent evidence.
|
|
581
|
+
|
|
582
|
+
For a closed attempt whose only failure was a declaration discrepancy, preserve that attempt and its original result. Use the existing `agent-prompt materialize` and dispatch workflow to create a bounded evidence-recovery invocation in the same run, with a distinct result path and explicit references to the original invocation, result, and audit. Ask it to reconcile the declaration and required artifacts against current evidence, not repeat completed implementation. Then dispatch the selected independent verifiers against the current source and artifacts. Adopt the new verified result through normal result collection; retain the original failure as history. Do not use this route to bypass a real authority violation or unresolved code defect.
|
|
@@ -167,6 +167,8 @@ Branch on the exit code, not the JSON: without `--wait`, `0` = every probe healt
|
|
|
167
167
|
|
|
168
168
|
## Lead Redispatch Policy on Result-Missing
|
|
169
169
|
|
|
170
|
+
For V2 calls, check the recorded attempt before applying any retry below. Only `failed-no-mutation` may append an attempt within its budget. Await an unfinished attempt. Preserve other terminal attempts and use a separate bounded corrective invocation with the same assignment/model and distinct prompt/result paths; do not replay implementation that already changed source or artifacts. `dispatch_core._next_attempt` and `execution_manifest._validate_next_attempt` enforce this restriction. A legacy declaration-only implementer rejection is routed by `okstra team dispatch` to evidence recovery before independent verification.
|
|
171
|
+
|
|
170
172
|
After each worker attempt returns (regardless of role), Lead MUST verify the canonical result file exists at the absolute path resolved from the `**Result Path:**` anchor header (against `**Project Root:**`). The check is identical for host-native workers and deterministic CLI processes.
|
|
171
173
|
|
|
172
174
|
**Triggers (any of):**
|
|
@@ -92,8 +92,8 @@ template's check; that template is gone.
|
|
|
92
92
|
|
|
93
93
|
## Allowed actions during the run
|
|
94
94
|
|
|
95
|
-
- **Edit / Write on approved project source files**: scope is bounded
|
|
96
|
-
-
|
|
95
|
+
- **Edit / Write on approved project source files**: scope is bounded by the shared Resource boundary and the approved objectives and acceptance conditions; the plan's file list predicts expected changes. Editing files outside the plan's list is permitted only when strictly needed to satisfy a step, and MUST be recorded in your worker result's `Out-of-plan edits` block with rationale.
|
|
96
|
+
- Use `## Out-of-plan edits` with a backticked path and rationale per item when convenient. The dispatcher reads this shape as supporting evidence, not write authorization. `ExecutionMutationAudit.compare` records observed changes independently and treats missing declarations or declaration/diff mismatches as warnings. Do not rerun implementation merely to repair this block; reconcile the explanation while preserving the original result. Required result usability is checked by `dispatch_state.missing_completion_paths`; source-readonly, protected paths, assigned roots and Git authority remain enforced by the write audit.
|
|
97
97
|
- read-only inspection commands: `git status`, `git diff`, `git log`, `grep`, `rg`, `find`, `cat`, `ls`, file Read tools
|
|
98
98
|
- build, lint, type-check, and test commands (`npm test`, `pytest`, `go build`, `cargo test`, `bash -n`, etc.)
|
|
99
99
|
- **local git operations only**: `git add`, `git commit`. Prefer small commits keyed to plan steps.
|
|
@@ -23,7 +23,7 @@ Every verifier acts as a QA gate, not just a diff reviewer. Trusting the executo
|
|
|
23
23
|
|
|
24
24
|
### Record the verification target
|
|
25
25
|
|
|
26
|
-
Before each declared check, run `okstra verification-target --project-root <project-root> --run-manifest <run-manifest> --expected-head <executor-head> --command <exact-declared-command>` and preserve its JSON output under this run's artifact directory. This tool reads the active run's recorded worktree and checks its HEAD and source fingerprint; it never executes the command. Execute the
|
|
26
|
+
Before each declared check, run `okstra verification-target --project-root <project-root> --run-manifest <run-manifest> --expected-head <executor-head> --command <exact-declared-command>` and preserve its JSON output under this run's artifact directory. This tool reads the active run's recorded worktree and checks its HEAD and source fingerprint; it never executes the command. Execute exactly the returned `target.command` through the host's authorized tool with `target.cwd` as its separate working-directory argument. The tool separates a legacy trailing `; existing helper: <file>:<lines>` annotation and removes a leading `cd` only when it names that exact worktree. Preserve `declaredCommand` and `commandAnnotation` when returned; never independently trim prose or rewrite shell syntax. Repeat the target check with the same original declaration and `--baseline <saved-json>` after execution. Include both target-check results and the actual command outcome in `readOnlyCommandLog`. Enforcement: `capture_verification_target` and `test_verification_target_returns_one_command_without_executing_it`.
|
|
27
27
|
|
|
28
28
|
A target mismatch or changed fingerprint invalidates this check's evidence. Record it as an execution-target problem, preserve the source, and rerun only the affected verification after the lead resolves it. An unavailable environment or a check that never ran is not a code rejection. A matching target fingerprint proves source stability at the two observations; it does not prove the command ran or that the test covers the requirement. Keep the independent command outcome and coverage assessment.
|
|
29
29
|
|
|
@@ -256,3 +256,9 @@ If every verifier present in the resolved roster ends with a non-result terminal
|
|
|
256
256
|
## Executor completion self-check (not this role's gate)
|
|
257
257
|
|
|
258
258
|
- The executor's `Implementation self-check` gate (`prompts/profiles/_implementation-self-check.md`) belongs to the worker that owns the diff, and its body is deliberately not delivered here: it asks for in-place fixes and break-then-restore mutation checks, every one of which this verifier is forbidden to perform. Do not re-derive its items or claim to have run it. What grades the same defects from this side is the blocking taxonomy above, applied to the diff you re-read yourself. When the executor's `Coverage:` / `Self-check coverage:` lines are among the inputs this prompt enumerates, a missing line or one whose file list does not reconcile with the diff is a blocking finding — the gate was skipped or partially run.
|
|
259
|
+
|
|
260
|
+
## Plan differences and completion recovery
|
|
261
|
+
|
|
262
|
+
Review the observed source and artifact changes, including paths absent from the planned file list or the executor's declaration. Link necessary changes to the approved objectives and acceptance conditions. A file-list discrepancy, declaration spelling, or a restored file is not an implementation failure by itself. Record missing rationale as evidence to reconcile. Reject unrelated scope expansion or weakened acceptance checks on their substantive impact, with the affected requirement and evidence.
|
|
263
|
+
|
|
264
|
+
When the audit reports unavailable historical artifact coverage, verify the current artifact content and its acceptance checks independently. Do not reconstruct missing before-state from the current file or claim that a source-only diff proves an artifact did not change. Preserve the original result and qualify any unverified attribution. Required independent validation remains enforced by `validate-run.py::_validate_verifier_reran_independently` and the existing conformance gates.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Implementation Planning Profile
|
|
2
2
|
|
|
3
|
+
Keep `commandOrObservation` executable when the checklist calls for a command. Put explanations and existing-helper citations in the checklist's `check` text, outside the command. Do not append prose after a semicolon. The plan-item renderer separates legacy `existing helper: <file>:<lines>` suffixes, and `verification-target` supplies the same executable command to every verifier.
|
|
4
|
+
|
|
3
5
|
Validation commands are executable inputs: preserve their newlines, quotes, and code bodies. Use frozen dependency installation (`npm ci`, `pnpm install --frozen-lockfile`, or the package manager's equivalent). Name QA scripts with absolute task-artifact paths when a command runs from a stage worktree; `.okstra/tasks/...` relative to that worktree does not point to the project task. `stage_validation_executability_errors` enforces command restrictions at planning validation, implementation entry, and report preflight, including advisory plan-body runs.
|
|
4
6
|
|
|
5
7
|
Plan for the actual worktree layout before approval. Shared documentation directories can be links to the main checkout. Choose a build command compatible with those links (for example, an installed Next.js version may provide `next build --webpack`); verify the available option rather than assuming it. Do not plan for a verifier to move links or repair its environment. Compare negative-case assertions with the brief and the script body: a requirement to cache existing assets does not establish that missing assets should be cached. Record any changed expectation in a new plan revision; preserve the earlier approved plan.
|