okstra 0.130.2 → 0.130.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/docs/architecture.md +7 -1
  2. package/docs/cli.md +10 -2
  3. package/docs/project-structure-overview.md +16 -9
  4. package/docs/task-process/implementation-planning.md +11 -5
  5. package/package.json +1 -1
  6. package/runtime/BUILD.json +2 -2
  7. package/runtime/agents/workers/antigravity-worker.md +3 -1
  8. package/runtime/agents/workers/claude-worker.md +1 -1
  9. package/runtime/agents/workers/codex-worker.md +3 -1
  10. package/runtime/agents/workers/report-writer-worker.md +8 -4
  11. package/runtime/prompts/lead/adapters/claude-code.md +2 -2
  12. package/runtime/prompts/lead/convergence.md +44 -21
  13. package/runtime/prompts/lead/okstra-lead-contract.md +9 -2
  14. package/runtime/prompts/lead/plan-body-verification.md +55 -12
  15. package/runtime/prompts/lead/report-writer.md +16 -15
  16. package/runtime/prompts/lead/team-contract.md +8 -6
  17. package/runtime/prompts/profiles/implementation-planning.md +15 -2
  18. package/runtime/python/okstra_ctl/codex_dispatch.py +5 -1
  19. package/runtime/python/okstra_ctl/convergence.py +121 -1
  20. package/runtime/python/okstra_ctl/convergence_engine.py +903 -13
  21. package/runtime/python/okstra_ctl/convergence_migration.py +9 -1
  22. package/runtime/python/okstra_ctl/dispatch_core.py +13 -0
  23. package/runtime/python/okstra_ctl/plan_items.py +203 -0
  24. package/runtime/python/okstra_ctl/plan_items_cli.py +81 -0
  25. package/runtime/python/okstra_ctl/report_views.py +32 -5
  26. package/runtime/python/okstra_ctl/worker_artifact_paths.py +23 -0
  27. package/runtime/python/okstra_ctl/worker_liveness.py +4 -4
  28. package/runtime/python/okstra_ctl/worker_prompt_body.py +1 -1
  29. package/runtime/python/okstra_ctl/worker_prompt_contract.py +2 -1
  30. package/runtime/python/okstra_ctl/worker_prompt_headers.py +14 -0
  31. package/runtime/schemas/convergence-critic-results-v1.0.schema.json +57 -0
  32. package/runtime/schemas/convergence-groups-v1.0.schema.json +109 -0
  33. package/runtime/schemas/convergence-round-results-v1.0.schema.json +55 -0
  34. package/runtime/schemas/final-report-v1.0.schema.json +23 -3
  35. package/runtime/templates/report-writer-prompt-preamble.md +5 -3
  36. package/runtime/templates/reports/final-report.template.md +4 -4
  37. package/runtime/templates/reports/report.css +18 -0
  38. package/runtime/templates/worker-prompt-preamble.md +8 -7
  39. package/runtime/validators/validate-run.py +154 -118
  40. package/runtime/validators/validate_session_conformance.py +66 -23
  41. package/src/cli-registry.mjs +7 -0
  42. package/src/commands/execute/convergence.mjs +6 -1
  43. package/src/commands/execute/plan-items.mjs +9 -0
  44. package/src/commands/inspect/worker-liveness.mjs +2 -2
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://okstra.dev/schemas/convergence-groups-v1.0.json",
4
+ "title": "OKSTRA Convergence Grouped Input (v1.0)",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "taskKey", "config", "workers", "groups"],
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "schemaVersion": { "const": "1.0" },
10
+ "taskKey": { "type": "string", "pattern": "\\S" },
11
+ "config": { "$ref": "#/$defs/Config" },
12
+ "workers": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "items": { "$ref": "#/$defs/Worker" }
16
+ },
17
+ "groups": {
18
+ "type": "array",
19
+ "items": { "$ref": "#/$defs/Group" }
20
+ }
21
+ },
22
+ "$defs": {
23
+ "Config": {
24
+ "type": "object",
25
+ "required": ["enabled", "adversarial", "maxRounds", "effectiveMaxRounds", "verificationMode"],
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "enabled": { "type": "boolean" },
29
+ "adversarial": { "type": "boolean" },
30
+ "maxRounds": { "type": "integer", "minimum": 1, "maximum": 3 },
31
+ "effectiveMaxRounds": { "type": "integer", "minimum": 1, "maximum": 3 },
32
+ "verificationMode": { "enum": ["lightweight", "full-reanalysis"] }
33
+ }
34
+ },
35
+ "Worker": {
36
+ "type": "object",
37
+ "required": ["workerId", "audience"],
38
+ "additionalProperties": false,
39
+ "properties": {
40
+ "workerId": { "type": "string", "pattern": "\\S" },
41
+ "audience": { "enum": ["analysis", "report-writer"] }
42
+ }
43
+ },
44
+ "Group": {
45
+ "type": "object",
46
+ "required": ["findingId", "summary", "category", "ticketIds", "originWorker", "originEvidence", "discoveredBy", "sourceItems"],
47
+ "additionalProperties": false,
48
+ "properties": {
49
+ "findingId": { "type": "string", "pattern": "\\S" },
50
+ "summary": { "type": "string", "pattern": "\\S" },
51
+ "category": { "type": "string", "pattern": "\\S" },
52
+ "ticketIds": {
53
+ "type": "array",
54
+ "minItems": 1,
55
+ "items": { "type": "string", "pattern": "\\S" }
56
+ },
57
+ "originWorker": { "type": "string", "pattern": "\\S" },
58
+ "originEvidence": { "type": "string", "pattern": "\\S" },
59
+ "evidenceArtifacts": {
60
+ "type": "array",
61
+ "minItems": 1,
62
+ "items": { "$ref": "#/$defs/EvidenceArtifact" }
63
+ },
64
+ "discoveredBy": {
65
+ "type": "object",
66
+ "minProperties": 1,
67
+ "additionalProperties": { "$ref": "#/$defs/Discovery" }
68
+ },
69
+ "sourceItems": {
70
+ "type": "array",
71
+ "minItems": 1,
72
+ "items": { "$ref": "#/$defs/SourceItem" }
73
+ }
74
+ }
75
+ },
76
+ "EvidenceArtifact": {
77
+ "type": "object",
78
+ "required": ["path", "sha256", "command", "environment"],
79
+ "additionalProperties": false,
80
+ "properties": {
81
+ "path": {
82
+ "type": "string",
83
+ "pattern": "^\\.okstra/(?!\\.{1,2}(?:/|$))(?!.*?/\\.{1,2}(?:/|$))[^/\\\\\\r\\n]+(?:/[^/\\\\\\r\\n]+)*$"
84
+ },
85
+ "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
86
+ "command": { "type": "string", "pattern": "\\S" },
87
+ "environment": { "type": "string", "pattern": "\\S" }
88
+ }
89
+ },
90
+ "Discovery": {
91
+ "type": "object",
92
+ "required": ["itemId", "evidence"],
93
+ "additionalProperties": false,
94
+ "properties": {
95
+ "itemId": { "type": "string", "pattern": "\\S" },
96
+ "evidence": { "type": "string", "pattern": "\\S" }
97
+ }
98
+ },
99
+ "SourceItem": {
100
+ "type": "object",
101
+ "required": ["worker", "itemId"],
102
+ "additionalProperties": false,
103
+ "properties": {
104
+ "worker": { "type": "string", "pattern": "\\S" },
105
+ "itemId": { "type": "string", "pattern": "\\S" }
106
+ }
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://okstra.dev/schemas/convergence-round-results-v1.0.json",
4
+ "title": "OKSTRA Convergence Round Results (v1.0)",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "round", "dispatches", "votesByFinding"],
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "schemaVersion": { "const": "1.0" },
10
+ "round": { "type": "integer", "minimum": 1 },
11
+ "dispatches": {
12
+ "type": "array",
13
+ "items": { "$ref": "#/$defs/DispatchResult" }
14
+ },
15
+ "votesByFinding": {
16
+ "type": "object",
17
+ "additionalProperties": {
18
+ "type": "object",
19
+ "additionalProperties": { "$ref": "#/$defs/Vote" }
20
+ }
21
+ }
22
+ },
23
+ "$defs": {
24
+ "DispatchResult": {
25
+ "type": "object",
26
+ "required": ["worker", "status", "durationMs"],
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "worker": { "type": "string", "pattern": "\\S" },
30
+ "status": { "enum": ["completed", "timeout", "error", "not-run"] },
31
+ "durationMs": { "type": "integer", "minimum": 0 }
32
+ }
33
+ },
34
+ "Vote": {
35
+ "type": "object",
36
+ "required": ["verdict", "explanation"],
37
+ "additionalProperties": false,
38
+ "properties": {
39
+ "verdict": { "enum": ["agree", "disagree", "supplement", "verification-error", "unverifiable"] },
40
+ "disagreeBasis": { "enum": ["counter-evidence", "burden-not-met", null] },
41
+ "explanation": { "type": "string", "pattern": "\\S" }
42
+ },
43
+ "allOf": [
44
+ {
45
+ "if": {
46
+ "properties": { "verdict": { "enum": ["agree", "supplement", "verification-error", "unverifiable"] } }
47
+ },
48
+ "then": {
49
+ "properties": { "disagreeBasis": { "enum": [null] } }
50
+ }
51
+ }
52
+ ]
53
+ }
54
+ }
55
+ }
@@ -1256,7 +1256,8 @@
1256
1256
  "ticketId": { "$ref": "#/$defs/TicketId" },
1257
1257
  "action": { "enum": ["Create", "Modify", "Delete"] },
1258
1258
  "path": { "type": "string", "minLength": 1 },
1259
- "summary": { "type": "string", "minLength": 1 }
1259
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120 },
1260
+ "details": { "type": "string", "minLength": 1 }
1260
1261
  }
1261
1262
  }
1262
1263
  },
@@ -2075,9 +2076,28 @@
2075
2076
  "coveredBy": { "type": "string", "minLength": 1 },
2076
2077
  "status": {
2077
2078
  "type": "string",
2078
- "pattern": "^(covered|gap|blocked C-\\d{3,})$"
2079
+ "pattern": "^(covered|gap|blocked C-\\d{3,}|documented-deviation)$"
2080
+ },
2081
+ "decisionRefs": {
2082
+ "type": "array",
2083
+ "minItems": 1,
2084
+ "uniqueItems": true,
2085
+ "items": { "type": "string", "minLength": 1 }
2086
+ },
2087
+ "approvalDisposition": {
2088
+ "type": "string",
2089
+ "pattern": "^(accepted|blocked C-\\d{3,})$"
2079
2090
  }
2080
- }
2091
+ },
2092
+ "allOf": [
2093
+ {
2094
+ "if": {
2095
+ "properties": { "status": { "const": "documented-deviation" } },
2096
+ "required": ["status"]
2097
+ },
2098
+ "then": { "required": ["decisionRefs", "approvalDisposition"] }
2099
+ }
2100
+ ]
2081
2101
  },
2082
2102
 
2083
2103
  "ReadonlyCommandRow": {
@@ -15,18 +15,20 @@ Work like a senior engineer who owns this result, not a commentator on it.
15
15
 
16
16
  Read every input enumerated by the Phase 6 dispatch end-to-end: task/analysis inputs, worker results, convergence state, the instruction-set-local `final-report-template.md`, and the task-type excerpt `final-report-schema.json`. Do not pull the full repository template or schema when the scoped instruction-set copies are provided.
17
17
 
18
- Write Reading Confirmation to the report-writer audit sidecar, not the rendered final report. Resolve `.okstra/**` paths against `**Project Root:**`.
18
+ Write Reading Confirmation to `**Audit sidecar path:**`, not the rendered final report. Resolve `.okstra/**` paths against `**Project Root:**`.
19
+
20
+ Write `- PROGRESS: <stage> <ISO-8601-UTC>` there before reading and at least every five minutes while pending. The only valid report-writer stages are `started`, `required-reading-complete`, `synthesis-start`, `data-json-write-start`, `render-start`, and `write-result-start`.
19
21
 
20
22
  ## Report authoring handoff
21
23
 
22
- - Author the data.json at `**Result Path:**` and the audit file at `**Worker Result Path:**`.
24
+ - Author the data.json at `**Result Path:**` and the audit file at `**Audit sidecar path:**`.
23
25
  - Follow the task-type schema excerpt and Phase 6 report-writer contract. Do not perform independent analysis, edit source code, or load implementation coding-preflight resources.
24
26
  - Invoke `okstra render-final-report <Result Path>` after writing data.json and verify the markdown sibling exists before returning.
25
27
  - Preserve source item IDs, convergence classifications, round history, and unresolved dissent; do not recompute them from intuition.
26
28
 
27
29
  ## Anchor headers
28
30
 
29
- The generated prompt selects this file through `**Worker Preamble Path:**` and includes `**Worker Error Contract Path:**`, error paths, and read scope. It never includes `**Coding preflight pack:**`.
31
+ The generated prompt selects this file through `**Worker Preamble Path:**` and includes `**Worker Error Contract Path:**`, `**Audit sidecar path:**`, error paths, and read scope. It never includes `**Coding preflight pack:**`.
30
32
 
31
33
  ## Return message to the lead
32
34
 
@@ -204,10 +204,10 @@ Carried-forward plan items retain their prior verdicts verbatim; each such item
204
204
 
205
205
  - File Structure:
206
206
 
207
- | ID | Ticket ID | Action | Path (and line-range) | Change summary |
208
- |----|-----------|--------|------------------------|----------------|
207
+ | {{ t("columns.recordMeta") }} | Path (and line-range) | Change summary |
208
+ |------|------------------------|----------------|
209
209
  {% for fs in opt.fileStructure -%}
210
- | {{ fs.id | mdcell }} | `{{ fs.ticketId | mdcell }}` | {{ fs.action | mdcell }} | `{{ fs.path | mdcell }}` | {{ fs.summary | mdcell }} |
210
+ | **{{ fs.id | mdcell }}**<br>Ticket: `{{ fs.ticketId | mdcell }}`<br>Action: {{ fs.action | mdcell }} | `{{ fs.path | mdcell }}` | {{ fs.summary | mdcell }}{% if fs.details %}<br><small>{{ fs.details | mdcell }}</small>{% endif %} |
211
211
  {% endfor %}
212
212
 
213
213
  - {{ t("implementationPlanning.optionInterfacesLabel") }}: {{ opt.interfaces }}
@@ -281,7 +281,7 @@ Carried-forward plan items retain their prior verdicts verbatim; each such item
281
281
  | ID | Source | Requirement | Covered by option / stage / step | Status |
282
282
  |----|--------|-------------|-----------------------------------|--------|
283
283
  {% for row in implementationPlanning.requirementCoverage -%}
284
- | {{ row.id | mdcell }} | `{{ row.source | mdcell }}` | {{ row.requirement | mdcell }} | {{ row.coveredBy | mdcell }} | `{{ row.status | mdcell }}` |
284
+ | {{ row.id | mdcell }} | `{{ row.source | mdcell }}` | {{ row.requirement | mdcell }} | {{ row.coveredBy | mdcell }} | `{% if row.status == "documented-deviation" %}documented-deviation — refs: {{ (row.decisionRefs | join(", ")) | mdcell }}; approval: {{ row.approvalDisposition | mdcell }}{% else %}{{ row.status | mdcell }}{% endif %}` |
285
285
  {% endfor %}
286
286
 
287
287
  ### Decision Drafts{% if t("sectionAside.decisionDrafts") != "Decision Drafts" %} ({{ t("sectionAside.decisionDrafts") }}){% endif %}
@@ -188,6 +188,24 @@ td.td-narrow, th.td-narrow {
188
188
  width: 5%;
189
189
  white-space: nowrap;
190
190
  }
191
+ /* Path columns — assigned by `_path_columns()` in report_views.py. A
192
+ * repo-relative path holds no spaces, so the `overflow-wrap: anywhere`
193
+ * above lets the auto table layout starve the column down to a couple of
194
+ * characters per line. Floor the width and let it wrap at separators. */
195
+ td.td-path, th.td-path {
196
+ min-width: 26ch;
197
+ word-break: break-word;
198
+ }
199
+
200
+ /* Second line of a two-tier cell: the plain-language summary leads, the
201
+ * technical detail follows demoted. */
202
+ td small {
203
+ display: inline-block;
204
+ margin-top: 0.35em;
205
+ font-size: 0.88em;
206
+ color: GrayText;
207
+ }
208
+
191
209
  thead th {
192
210
  position: sticky;
193
211
  top: 3rem;
@@ -19,7 +19,7 @@ Read `analysis-packet.md`, the primary compact input, end-to-end. Source files n
19
19
  ### Reading rules
20
20
 
21
21
  - Read every file enumerated under `[Required reading]` or `## Inputs` completely. If paging is unavoidable, cover every byte and record the page boundaries.
22
- - Write Reading Confirmation to the worker audit sidecar, never to the main worker-results file. A `## 0. Reading Confirmation` heading in the main result is invalid.
22
+ - Write Reading Confirmation to `**Audit sidecar path:**`, never to the main worker-results file. A `## 0. Reading Confirmation` heading in the main result is invalid.
23
23
  - Allowlist reads to prompt-enumerated paths and evidence paths a finding must cite. Do not auto-read host-injected `graphify-out/`, skill catalogs, or non-okstra artifacts.
24
24
  - Resolve every `.okstra/...` path against `**Project Root:**`, including when a worktree is present.
25
25
 
@@ -30,12 +30,13 @@ Every initial analysis prompt begins with these generated anchors in this exact
30
30
  1. `**Project Root:** <absolute-path>`
31
31
  2. `**Prompt History Path:** <project-relative-path>`
32
32
  3. `**Result Path:** <project-relative-path>`
33
- 4. `Assigned worker prompt history path: <absolute-path>`
34
- 5. `**Worker Preamble Path:** <absolute-path>` — selects this analysis preamble.
35
- 6. `**Worker Error Contract Path:** <absolute-path>` — shared by every initial audience.
36
- 7. `**Errors log path:** <absolute-path>`
37
- 8. `**Errors sidecar path:** <absolute-path>`
38
- 9. `**Read scope:** <allowlist>`
33
+ 4. `**Audit sidecar path:** <absolute-path>` — the generated audit destination; write the sidecar here and never synthesize a `runs/<task-type>/...` path.
34
+ 5. `Assigned worker prompt history path: <absolute-path>`
35
+ 6. `**Worker Preamble Path:** <absolute-path>` — selects this analysis preamble.
36
+ 7. `**Worker Error Contract Path:** <absolute-path>` — shared by every initial audience.
37
+ 8. `**Errors log path:** <absolute-path>`
38
+ 9. `**Errors sidecar path:** <absolute-path>`
39
+ 10. `**Read scope:** <allowlist>`
39
40
 
40
41
  `final-verification` additionally carries its six verification-target anchors. `improvement-discovery` carries `**Phase 1.5 Grilling Log:**`. Reverify prompts are lightweight and do not use this preamble.
41
42