okstra 0.232.0 → 0.233.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.
Files changed (183) hide show
  1. package/README.md +19 -283
  2. package/dist/cli-registry.mjs +8 -1
  3. package/dist/cli-registry.mjs.map +1 -1
  4. package/dist/commands/execute/render-bundle.d.mts +6 -1
  5. package/dist/commands/execute/render-bundle.mjs +139 -32
  6. package/dist/commands/execute/render-bundle.mjs.map +1 -1
  7. package/dist/commands/lifecycle/config.mjs +6 -74
  8. package/dist/commands/lifecycle/config.mjs.map +1 -1
  9. package/dist/commands/trace/capacity.d.mts +12 -0
  10. package/dist/commands/trace/capacity.mjs +21 -0
  11. package/dist/commands/trace/capacity.mjs.map +1 -0
  12. package/dist/commands/trace/model.d.mts +89 -0
  13. package/dist/commands/trace/model.mjs +251 -0
  14. package/dist/commands/trace/model.mjs.map +1 -0
  15. package/dist/commands/trace/progression.d.mts +11 -0
  16. package/dist/commands/trace/progression.mjs +194 -0
  17. package/dist/commands/trace/progression.mjs.map +1 -0
  18. package/dist/commands/trace/review.d.mts +7 -0
  19. package/dist/commands/trace/review.mjs +51 -0
  20. package/dist/commands/trace/review.mjs.map +1 -0
  21. package/dist/commands/trace/task-link.d.mts +18 -0
  22. package/dist/commands/trace/task-link.mjs +72 -0
  23. package/dist/commands/trace/task-link.mjs.map +1 -0
  24. package/dist/commands/trace/trace.d.mts +1 -0
  25. package/dist/commands/trace/trace.mjs +293 -0
  26. package/dist/commands/trace/trace.mjs.map +1 -0
  27. package/dist/lib/bounded-file.d.mts +1 -0
  28. package/dist/lib/bounded-file.mjs +36 -0
  29. package/dist/lib/bounded-file.mjs.map +1 -0
  30. package/dist/lib/config-store.d.mts +34 -0
  31. package/dist/lib/config-store.mjs +70 -0
  32. package/dist/lib/config-store.mjs.map +1 -0
  33. package/dist/lib/file-lock.mjs +4 -5
  34. package/dist/lib/file-lock.mjs.map +1 -1
  35. package/dist/lib/input-limit.d.mts +4 -0
  36. package/dist/lib/input-limit.mjs +8 -0
  37. package/dist/lib/input-limit.mjs.map +1 -0
  38. package/dist/lib/memory-auto-register.mjs +2 -17
  39. package/dist/lib/memory-auto-register.mjs.map +1 -1
  40. package/dist/lib/report-language-tag.d.mts +1 -0
  41. package/dist/lib/report-language-tag.mjs +4 -0
  42. package/dist/lib/report-language-tag.mjs.map +1 -0
  43. package/dist/lib/report-language.d.mts +1 -0
  44. package/dist/lib/report-language.mjs +50 -0
  45. package/dist/lib/report-language.mjs.map +1 -0
  46. package/dist/lib/skill-catalog.mjs +3 -0
  47. package/dist/lib/skill-catalog.mjs.map +1 -1
  48. package/docs/architecture/storage-model.md +36 -5
  49. package/docs/architecture.md +10 -4
  50. package/docs/cli.md +279 -2
  51. package/docs/contributor-change-matrix.md +1 -2
  52. package/docs/project-structure-overview.md +31 -41
  53. package/package.json +1 -1
  54. package/runtime/BUILD.json +2 -2
  55. package/runtime/agents/operations/trace-interface-review.json +6 -0
  56. package/runtime/agents/operations/trace-scope-review.json +6 -0
  57. package/runtime/prompts/coding-preflight/authoring-checks.md +1 -1
  58. package/runtime/prompts/coding-preflight/clean-code.md +18 -20
  59. package/runtime/prompts/coding-preflight/overview.md +1 -1
  60. package/runtime/prompts/duties/code-reviewer.json +1 -1
  61. package/runtime/prompts/duties/interface-reviewer.json +32 -0
  62. package/runtime/prompts/host-orchestration/README.md +18 -9
  63. package/runtime/prompts/launch.template.md +3 -2
  64. package/runtime/prompts/lead/context-loader.md +2 -0
  65. package/runtime/prompts/lead/okstra-lead-contract.md +7 -7
  66. package/runtime/prompts/lead/report-writer.md +6 -6
  67. package/runtime/prompts/profiles/_coding-conventions-preflight.md +2 -2
  68. package/runtime/prompts/profiles/_common-contract.md +1 -1
  69. package/runtime/python/okstra_ctl/agent/invocation.py +1 -0
  70. package/runtime/python/okstra_ctl/agent/prompt_cli/cli.py +66 -26
  71. package/runtime/python/okstra_ctl/agent/prompt_cli/corrections.py +23 -8
  72. package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +28 -10
  73. package/runtime/python/okstra_ctl/agent/prompt_cli/results.py +8 -11
  74. package/runtime/python/okstra_ctl/agent/standalone.py +12 -0
  75. package/runtime/python/okstra_ctl/analysis_packet.py +22 -11
  76. package/runtime/python/okstra_ctl/code_review_census.py +93 -2
  77. package/runtime/python/okstra_ctl/code_review_prepare.py +381 -0
  78. package/runtime/python/okstra_ctl/code_review_run.py +384 -0
  79. package/runtime/python/okstra_ctl/code_review_scope.py +13 -0
  80. package/runtime/python/okstra_ctl/code_review_supervisor.py +41 -0
  81. package/runtime/python/okstra_ctl/code_review_target.py +140 -15
  82. package/runtime/python/okstra_ctl/coverage_census.py +11 -2
  83. package/runtime/python/okstra_ctl/design_snapshot.py +16 -9
  84. package/runtime/python/okstra_ctl/direct_work.py +45 -3
  85. package/runtime/python/okstra_ctl/dispatch_core.py +31 -15
  86. package/runtime/python/okstra_ctl/dispatch_state.py +9 -2
  87. package/runtime/python/okstra_ctl/domain/role.py +1 -0
  88. package/runtime/python/okstra_ctl/doyouknow/sources/manager.py +48 -9
  89. package/runtime/python/okstra_ctl/final_report_schema.py +37 -34
  90. package/runtime/python/okstra_ctl/incremental_carry.py +6 -7
  91. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +9 -2
  92. package/runtime/python/okstra_ctl/json_boundary.py +33 -6
  93. package/runtime/python/okstra_ctl/manager_cli.py +122 -1
  94. package/runtime/python/okstra_ctl/manager_journal.py +126 -0
  95. package/runtime/python/okstra_ctl/manager_launch.py +3 -3
  96. package/runtime/python/okstra_ctl/manager_log.py +221 -0
  97. package/runtime/python/okstra_ctl/manager_paths.py +8 -0
  98. package/runtime/python/okstra_ctl/manager_resume.py +59 -0
  99. package/runtime/python/okstra_ctl/manager_split.py +2 -2
  100. package/runtime/python/okstra_ctl/manager_store.py +116 -17
  101. package/runtime/python/okstra_ctl/manager_sync.py +42 -3
  102. package/runtime/python/okstra_ctl/manager_view.py +35 -2
  103. package/runtime/python/okstra_ctl/material.py +2 -0
  104. package/runtime/python/okstra_ctl/model_cli.py +64 -14
  105. package/runtime/python/okstra_ctl/model_defaults.py +22 -0
  106. package/runtime/python/okstra_ctl/model_io/renderers.py +3 -0
  107. package/runtime/python/okstra_ctl/operation_invocation.py +207 -28
  108. package/runtime/python/okstra_ctl/path_hints.py +14 -3
  109. package/runtime/python/okstra_ctl/paths.py +6 -1
  110. package/runtime/python/okstra_ctl/phases/catalog.py +24 -7
  111. package/runtime/python/okstra_ctl/phases/implementation/host-rules.md +3 -3
  112. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-diff-review.md +8 -6
  113. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-self-check.md +1 -1
  114. package/runtime/python/okstra_ctl/phases/implementation_option_selection/profile.md +1 -1
  115. package/runtime/python/okstra_ctl/phases/implementation_option_selection/votes.py +11 -11
  116. package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +12 -9
  117. package/runtime/python/okstra_ctl/phases/implementation_planning/host-rules.md +3 -6
  118. package/runtime/python/okstra_ctl/phases/implementation_planning/instructions/plan-body-verification.md +12 -10
  119. package/runtime/python/okstra_ctl/phases/implementation_planning/profile.md +5 -5
  120. package/runtime/python/okstra_ctl/phases/improvement_discovery/lenses.py +12 -0
  121. package/runtime/python/okstra_ctl/phases/improvement_discovery/profile.md +7 -6
  122. package/runtime/python/okstra_ctl/phases/improvement_discovery/resolved_census.py +159 -0
  123. package/runtime/python/okstra_ctl/phases/improvement_discovery/spec.md +5 -2
  124. package/runtime/python/okstra_ctl/phases/improvement_discovery/validation.py +21 -7
  125. package/runtime/python/okstra_ctl/phases/release_handoff/boundary.json +1 -1
  126. package/runtime/python/okstra_ctl/phases/release_handoff/profile.md +4 -1
  127. package/runtime/python/okstra_ctl/plan_verify_cli.py +6 -4
  128. package/runtime/python/okstra_ctl/render.py +28 -2
  129. package/runtime/python/okstra_ctl/report_assembly.py +38 -11
  130. package/runtime/python/okstra_ctl/report_contract.py +26 -0
  131. package/runtime/python/okstra_ctl/report_corrections.py +36 -20
  132. package/runtime/python/okstra_ctl/report_inputs.py +1 -0
  133. package/runtime/python/okstra_ctl/report_language.py +4 -1
  134. package/runtime/python/okstra_ctl/report_narrative.py +179 -7
  135. package/runtime/python/okstra_ctl/report_projections.py +64 -18
  136. package/runtime/python/okstra_ctl/report_synthesis_packet.py +86 -36
  137. package/runtime/python/okstra_ctl/run.py +43 -35
  138. package/runtime/python/okstra_ctl/run_context.py +10 -1
  139. package/runtime/python/okstra_ctl/set_work_status.py +4 -15
  140. package/runtime/python/okstra_ctl/task_list_cli.py +34 -8
  141. package/runtime/python/okstra_ctl/task_query.py +239 -0
  142. package/runtime/python/okstra_ctl/trace_review.py +264 -0
  143. package/runtime/python/okstra_ctl/trace_tasks.py +197 -0
  144. package/runtime/python/okstra_ctl/user_authorization.py +14 -0
  145. package/runtime/python/okstra_ctl/wizard/confirmation.py +7 -3
  146. package/runtime/python/okstra_ctl/wizard/launch.py +52 -0
  147. package/runtime/python/okstra_ctl/wizard/launch_cli.py +39 -0
  148. package/runtime/python/okstra_ctl/wizard/outcome.py +17 -16
  149. package/runtime/python/okstra_ctl/wizard/registry.py +1 -1
  150. package/runtime/python/okstra_ctl/wizard/render.py +8 -0
  151. package/runtime/python/okstra_ctl/wizard/state.py +2 -1
  152. package/runtime/python/okstra_project/state.py +20 -0
  153. package/runtime/python/okstra_token_usage/blocks.py +74 -0
  154. package/runtime/python/okstra_token_usage/cli.py +23 -10
  155. package/runtime/python/okstra_token_usage/collect.py +25 -22
  156. package/runtime/python/okstra_token_usage/policy.py +193 -0
  157. package/runtime/schemas/report-synthesis-packet-v1.0.schema.json +1 -1
  158. package/runtime/skills/_fragments/wizard-confirm-step.md +1 -1
  159. package/runtime/skills/_fragments/wizard-preflight.md +1 -1
  160. package/runtime/skills/_fragments/wizard-prompt-loop.md +3 -5
  161. package/runtime/skills/_fragments/wizard-relay-protocol.md +1 -1
  162. package/runtime/skills/_fragments/wizard-render-bundle.md +15 -29
  163. package/runtime/skills/okstra-brief-gen/SKILL.md +7 -7
  164. package/runtime/skills/okstra-brief-gen/references/tracker-recursion.md +1 -1
  165. package/runtime/skills/okstra-code-review/SKILL.md +58 -50
  166. package/runtime/skills/okstra-code-review/references/census-rules.md +6 -6
  167. package/runtime/skills/okstra-code-review/references/review-calibration.md +8 -12
  168. package/runtime/skills/okstra-discussion/SKILL.md +22 -38
  169. package/runtime/skills/okstra-explain-flow/SKILL.md +6 -2
  170. package/runtime/skills/okstra-manager/SKILL.md +24 -0
  171. package/runtime/skills/okstra-memory/SKILL.md +1 -1
  172. package/runtime/skills/okstra-pr-gen/SKILL.md +1 -1
  173. package/runtime/skills/okstra-run/SKILL.md +55 -183
  174. package/runtime/skills/okstra-schedule-gen/SKILL.md +9 -13
  175. package/runtime/skills/okstra-setup/SKILL.md +3 -2
  176. package/runtime/skills/okstra-setup/references/project-config.md +2 -4
  177. package/runtime/skills/okstra-tdd/SKILL.md +187 -0
  178. package/runtime/skills/okstra-user-response/SKILL.md +4 -2
  179. package/runtime/templates/manager/view.template.html +4 -0
  180. package/runtime/templates/report-writer-prompt-preamble.md +15 -3
  181. package/runtime/templates/trace/trace.template.md +42 -0
  182. package/runtime/validators/checks/fixtures-02.py +25 -33
  183. package/runtime/validators/validate-run.py +93 -36
@@ -4,6 +4,7 @@ import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
4
  import { resolveOkstraHome } from "./paths.mjs";
5
5
  import { runPythonModule } from "./python-helper.mjs";
6
6
  import { detectRecordSecrets } from "./record-secrets.mjs";
7
+ import { readBoundedUtf8 } from "./bounded-file.mjs";
7
8
  const MAX_CONFIG_BYTES = 2_000_000;
8
9
  const REGISTRATION_WARNING = "warning: Memory Book saved; doyouknow registration did not complete. Run 'okstra doyouknow sync' to recover.\n";
9
10
  function isMissingFile(error) {
@@ -36,23 +37,7 @@ async function containedAutomaticPath(home, ...segments) {
36
37
  return current;
37
38
  }
38
39
  async function readBoundedConfig(path) {
39
- const handle = await fs.open(path, "r");
40
- try {
41
- const buffer = Buffer.alloc(MAX_CONFIG_BYTES + 1);
42
- let length = 0;
43
- while (length < buffer.length) {
44
- const { bytesRead } = await handle.read(buffer, length, buffer.length - length, null);
45
- if (bytesRead === 0)
46
- break;
47
- length += bytesRead;
48
- }
49
- if (length > MAX_CONFIG_BYTES)
50
- throw new Error("Automatic registration config exceeds its input limit");
51
- return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0, length)));
52
- }
53
- finally {
54
- await handle.close();
55
- }
40
+ return JSON.parse(await readBoundedUtf8(path, MAX_CONFIG_BYTES));
56
41
  }
57
42
  async function readAutomaticRegistrationEnabled(home) {
58
43
  let value;
@@ -1 +1 @@
1
- {"version":3,"file":"memory-auto-register.mjs","sourceRoot":"","sources":["../../src/lib/memory-auto-register.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,oBAAoB,GAAG,gHAAgH,CAAC;AAE9I,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,IAAY,EAAE,GAAG,QAA2B;IAChF,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,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{
2
+ return typeof value === "string" && /^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(value);
3
+ }
4
+ //# sourceMappingURL=report-language-tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-language-tag.mjs","sourceRoot":"","sources":["../../src/lib/report-language-tag.mts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function resolveReportLanguage(projectRoot: string): Promise<string>;
@@ -0,0 +1,50 @@
1
+ import { promises as fs } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { projectJsonPath } from "./okstra-dirs.mjs";
5
+ import { isReportLanguageTag } from "./report-language-tag.mjs";
6
+ import { readBoundedUtf8 } from "./bounded-file.mjs";
7
+ import { InputLimitError } from "./input-limit.mjs";
8
+ const MAX_REPORT_LANGUAGE_CONFIG_BYTES = 256 * 1024;
9
+ async function readReportLanguage(path, label) {
10
+ let text;
11
+ try {
12
+ const stat = await fs.stat(path);
13
+ if (!stat.isFile())
14
+ return "";
15
+ text = await readBoundedUtf8(path, MAX_REPORT_LANGUAGE_CONFIG_BYTES);
16
+ }
17
+ catch (cause) {
18
+ if (cause instanceof InputLimitError)
19
+ throw cause;
20
+ if (cause instanceof Error && "code" in cause && cause.code === "ENOENT")
21
+ return "";
22
+ throw new Error(`${label} config is unreadable: ${path}`, { cause });
23
+ }
24
+ let value;
25
+ try {
26
+ value = JSON.parse(text);
27
+ }
28
+ catch (cause) {
29
+ throw new Error(`${label} config is unreadable: ${path}`, { cause });
30
+ }
31
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
32
+ throw new Error(`${label} config must be a JSON object: ${path}`);
33
+ }
34
+ const language = "reportLanguage" in value ? value.reportLanguage : undefined;
35
+ if (language === undefined || language === null || language === "")
36
+ return "";
37
+ if (!isReportLanguageTag(language)) {
38
+ throw new Error(`${label} config reportLanguage must be a language tag: ${path}`);
39
+ }
40
+ return language;
41
+ }
42
+ export async function resolveReportLanguage(projectRoot) {
43
+ const home = process.env.OKSTRA_HOME || join(homedir(), ".okstra");
44
+ const candidates = await Promise.all([
45
+ readReportLanguage(projectJsonPath(projectRoot), "project"),
46
+ readReportLanguage(join(home, "config.json"), "global"),
47
+ ]);
48
+ return candidates.find(Boolean) || "en";
49
+ }
50
+ //# sourceMappingURL=report-language.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-language.mjs","sourceRoot":"","sources":["../../src/lib/report-language.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gCAAgC,GAAG,GAAG,GAAG,IAAI,CAAC;AAEpD,KAAK,UAAU,kBAAkB,CAAC,IAAY,EAAE,KAAa;IAC3D,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAAE,OAAO,EAAE,CAAC;QAC9B,IAAI,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;IACvE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,eAAe;YAAE,MAAM,KAA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AS,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnC,kBAAkB,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;QAC3D,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,QAAQ,CAAC;KACxD,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;AAC1C,CAAC"}
@@ -15,6 +15,7 @@ export const USER_SKILL_NAMES = Object.freeze([
15
15
  "okstra-pr-gen",
16
16
  "okstra-user-response",
17
17
  "okstra-code-review",
18
+ "okstra-tdd",
18
19
  "okstra-explain-flow",
19
20
  ]);
20
21
  // Names okstra used to install as skills before they were renamed or moved
@@ -43,6 +44,8 @@ export const OBSOLETE_SKILL_NAMES = Object.freeze([
43
44
  "okstra-logs",
44
45
  "okstra-report-finder",
45
46
  "okstra-time-summary",
47
+ // Renamed to okstra-tdd.
48
+ "okstra-trace",
46
49
  ]);
47
50
  export function userSkillNames() {
48
51
  return [...USER_SKILL_NAMES];
@@ -1 +1 @@
1
- {"version":3,"file":"skill-catalog.mjs","sourceRoot":"","sources":["../../src/lib/skill-catalog.mts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,8CAA8C;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAEH,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,QAAQ;IACR,uBAAuB;IACvB,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,kBAAkB;IAClB,wBAAwB;IACxB,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,sEAAsE;IACtE,0EAA0E;IAC1E,gEAAgE;IAChE,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,sBAAsB;IACtB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,CAAC,GAAG,oBAAoB,CAAC,CAAC;AACnC,CAAC"}
1
+ {"version":3,"file":"skill-catalog.mjs","sourceRoot":"","sources":["../../src/lib/skill-catalog.mts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,8CAA8C;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,oBAAoB;IACpB,YAAY;IACZ,qBAAqB;CACtB,CAAC,CAAC;AAEH,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,QAAQ;IACR,uBAAuB;IACvB,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,kBAAkB;IAClB,wBAAwB;IACxB,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,sEAAsE;IACtE,0EAA0E;IAC1E,gEAAgE;IAChE,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,sBAAsB;IACtB,qBAAqB;IACrB,yBAAyB;IACzB,cAAc;CACf,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,CAAC,GAAG,oBAAoB,CAAC,CAAC;AACnC,CAAC"}
@@ -1,5 +1,24 @@
1
1
  # Storage model & on-disk contracts
2
2
 
3
+ 새 `improvement-discovery` 실행은 실행 매니페스트에 `coverageCensusPolicy: "resolved-lenses-v1"`을 기록합니다. 준비 단계의 분석 자료는 관점 확정을 기다리는 상태이며, 최초 분석자 지침을 발행하기 전에 질문 기록의 `## Resolved lenses` 목록에서 1~4개 고유 관점을 읽습니다. 실행 준비와 같은 작업 잠금 안에서 범위표와 분석 자료를 완성하고, 범위표에 질문 기록·관점과 완성 전후 분석 자료의 내용 지문을 보존합니다. 셀 식별자와 범위표 파일 경로는 기존 계약을 사용합니다.
4
+
5
+ 공통 초기 지침과 네이티브 `agent-prompt materialize`는 단계 소유 `resolved_census.prepare_resolved_lens_census()`를 공유합니다. 이후 호출은 저장된 지문과 셀 집합을 확인하여 재사용하고, 범위표 저장 뒤 분석 자료 쓰기가 중단된 경우에만 같은 입력으로 완성합니다. 이미 발행한 지침이나 변경된 근거가 있으면 준비물을 재생성하지 않습니다. 정책 필드가 없는 기존 실행은 기존 범위표를 유지합니다. 관련 준비·배송·재시도 검사는 `tests/run/test_prepare.py`에 있으며, 셀 미응답의 경고 정책과 보고서 `lensCoverage`의 검사 범위는 변경하지 않습니다.
6
+
7
+ Implementation Traces keep version-1 JSON frontmatter in `.okstra/traces/`.
8
+ Optional `task` metadata binds an attempt to a project task key. The task manifest
9
+ retains `executionKind: "implementation-trace"`, `implementationTracePath`,
10
+ `traceMetadata`, `traceDigest` and a bounded `implementationTraces` list. Latest
11
+ selection uses numeric creation time and path; delayed older attempts cannot
12
+ replace it. `latestWorkRecordPath` still names task-local direct-work JSON with
13
+ `crossVerification: "not-performed"`, preserving its previous-record chain.
14
+ Task mutex filenames hash the project identity and normalized group/task
15
+ segments, so aliases serialize together and long keys fit the filesystem.
16
+ Preparation and trace projection hold that mutex throughout manifest mutation.
17
+ Trace publication and task projection are separate recoverable operations;
18
+ `trace sync` retries projection and status reads its digest acknowledgment.
19
+ `trace_tasks.py` enforces these boundaries; `tests/run/test_trace_tasks.py` and
20
+ `tests/run/test_prepare.py` verify retries, ownership and preservation.
21
+
3
22
  Verification inputs version `3.0` requires `reviewPolicy`: a versioned frozen
4
23
  architecture declaration and source bodies with SHA-256 digests. Preparation
5
24
  captures the coding-preflight pack, project-root `AGENTS.md` and `CLAUDE.md`,
@@ -78,7 +97,7 @@ The task manifest, task index, instruction set, runs, and history are collected
78
97
  - `instruction-set/`
79
98
  - `analysis-profile.md`, `analysis-packet.md`, `analysis-material.md`, `reference-expectations.md`, `task-brief.md`
80
99
  - `verification-target.md` for final verification and optional `directive.txt`
81
- - `host-orchestration-rules.md`, the staged copy of the host orchestration rules for this task type, when the run has one
100
+ - `host-orchestration-rules.md` — `implementation`·`implementation-planning`이 선언한 호스트 지침의 동결 사본. wizard는 준비 전에 정본 경로를 반환하고, 준비 후 재개는 이 사본을 사용한다.
82
101
  - `clarification-response.md`, the user's carried-in clarification answers, when the run has any
83
102
  - `selected-direction.json`, the validated implementation direction snapshot for a new `implementation-planning` run
84
103
  - `final-report-schema.json`, `final-report-template.md`
@@ -468,7 +487,7 @@ Design-preparation storage has three separate authorities:
468
487
  | `design-prep-inputs/design-prep-input-<seq>-PREP-<NNN>-r<revision>-<uuid>.md` | user or wizard | Append-only and written only after semantic confirmation. Existing revisions are never edited or reserved before confirmation. |
469
488
 
470
489
  The resolver selects the highest unique revision whose assessment fingerprint still matches the approved snapshot. Duplicate revision numbers and stale fingerprints are skipped with warnings rather than granted authority. A markerless legacy plan has no sidecars to migrate: it proceeds with the `legacy-unassessed` warning. This compatibility path does not rewrite its report.
471
- The final result files are not created by saving worker stdout. The report writer writes its narrative Markdown, and Phase 7 assembles `final-report-<task-type>-<seq>.data.json` from all role-owned inputs before deriving the human HTML sibling. The full reading copy Markdown is rendered on demand with `okstra render-final-report`. New bundles use `schemas/final-report-v3.0.schema.json`; historical v2 data remains readable through `schemas/final-report-v2.0.schema.json`. Both use `templates/reports/final-report-v2.template.md` for the reading copy. Rendering never modifies source data or a pre-existing Markdown input.
490
+ 최종 결과는 워커 stdout을 그대로 저장해서 만들지 않는다. 작성자는 manifest의 `reportNarrativePath`가 가리키는 소유 입력에 쓰고, Phase 7이 역할별 입력을 결합해 `final-report-<task-type>-<seq>.data.json`을 게시한 뒤 HTML을 만든다. 새 실행의 `json-v1` 입력은 `worker-results/report-writer-narrative-<task-type>-<seq>.json`이며, 기존 `markdown-v1`은 `.md` 경로와 줄 문법을 유지한다. 형식은 확장자가 아닌 manifest로 결정한다. 최종 데이터 스키마는 계속 `3.0`이며, 기존 v1·v2의 호환 판독도 유지한다. 읽기용 Markdown은 `okstra render-final-report`로 필요할 때 생성하며, 렌더링은 원본 데이터를 수정하지 않는다.
472
491
  For the standalone Claude launcher, `sessions/claude-resume-<task-type>-<seq>.sh` remains an interruption-recovery compatibility helper. In-host Codex runs use host task continuity plus the generic `leadSession` manifest identity.
473
492
 
474
493
  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`).
@@ -531,7 +550,8 @@ and `returnedBody`; the completion marker is published last and binds the
531
550
  canonical result envelope digest. The same raw returned body may be used by two
532
551
  independent invocations because identity comes from the envelope, while a
533
552
  cross-invocation envelope link is rejected. Code review uses purpose
534
- `code-review`; schedule narrative verification uses `schedule-verification`.
553
+ `code-review`; schedule narrative verification uses `schedule-verification`;
554
+ implementation-trace reviews use `trace-review`.
535
555
  Consumers parse only the `returnedBody` emitted by
536
556
  `agent-prompt verify-completion`. A branch review's final report may use the
537
557
  documented `.project-docs/code-reviews/<branch>/` exception, but its invocation
@@ -617,6 +637,8 @@ The following former files are no longer generated by okstra.
617
637
  ~/.okstra/managers/<manager-id>/
618
638
  ├── manager.json
619
639
  ├── projects.json
640
+ ├── events.jsonl
641
+ ├── journal.jsonl
620
642
  ├── view/index.html
621
643
  └── task-groups/<safe-task-group>/
622
644
  ├── group.json
@@ -638,9 +660,14 @@ Storage authority:
638
660
  - `group.json`: the task group's original name and creation time, written by `new task-group` and `new task`. The directory name is a slug and cannot give the name back.
639
661
  - `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`.
640
662
  - `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.
641
- - `events.jsonl`: manager events such as `task-created`, `task-updated`, `task-child-removed`, `project-unlinked` and `child-launch-prepared`. `remove task` and `remove task-group` delete the directory with its events.
663
+ - `<manager-id>/events.jsonl`: manager-level events. `manager-initialized` (new manager only), `project-linked` (new registration, or `changes` when an existing registration's root, role or tags changed), `project-unlinked` (with the kept child task keys and the affected manager tasks as `tasks`), `task-group-created` (only when the group directory did not exist yet; a group created before `group.json` existed gets none), and `task-removed` / `task-group-removed` (confirmed removals only, with the deleted task keys or task ids; `task-group-removed` names the group as stored, not as typed). Dry runs and identical re-runs write nothing.
664
+ - `<safe-task-id>/events.jsonl`: task-level events `task-created`, `task-children-added`, `task-updated`, `task-assigned` (changed role, tags or assignment as `from`/`to`), `task-synced` (children whose `task status` summary bucket changed since the previous snapshot, as `taskKey`/`from`/`to`; `from` is null without a previous snapshot or when it is damaged, which `task sync` reports on stderr before replacing it), `task-child-removed`, `project-unlinked`, `task-split` and `child-launch-prepared`. An assignment or sync that changes nothing writes no row. `remove task` and `remove task-group` delete the directory with its events; the manager-level `task-removed` / `task-group-removed` row remains.
665
+ - Event rows carry `event` and `createdAt` and do not copy directive bodies. They are appended after the state file is saved. A failed append leaves the command successful and prints `okstra manager: activity log write failed: <path>: <reason>` to stderr.
666
+ - `okstra manager log` merges both event files, `directives.jsonl` and `journal.jsonl` newest first. `--json` returns `{managerId, matchedCount, entries, damaged}`; each entry has `origin` (`manager-event`, `task-event`, `directive` or `journal`), `kind` (event name, `directive`, or the journal kind), `createdAt`, `taskGroup`, `taskId` and the stored object as `row`. Entries with the same `createdAt` come in reverse read order: later lines of one file first, and files read later (manager events, then each task's events and directives in task order, then the journal) first. `--task-group` / `--task-id` also selects manager-level rows and journal entries that name the task, so removals and unlinks stay visible after the task is deleted. `--grep` matches the body of directives and journal entries and the string values of events. `--open-followups` keeps only followups that no journal row resolves. It is read-only, reads task identities from manifests only, skips damaged lines and reports their line numbers per file.
667
+ - `journal.jsonl`: the manager-only journal written by `okstra manager journal add`. Each row is `{id, kind, body, createdAt, taskGroup, taskId, resolves}`; `id` is `j-<UTC stamp>-<4 hex digits>`, `kind` is `decision`, `finding`, `followup` or `session-summary`, `taskGroup`/`taskId` are both empty or hold the manifest's names of an existing manager task (another spelling with the same slug is stored as the manifest spells it), and `resolves` is empty or the id of an unresolved followup of the same manager. The body comes from `--body` or from a UTF-8 file given as `--body-file`; it must be non-empty, at most 4,000 characters and pass the record secret policy; a refused entry or a failed append exits 2 and writes nothing. `task run` does not read this file. doyouknow collects it as its own source under the manager (native id `journal`); a damaged journal reports `manager-journal-damaged` and an unreadable or oversized one `manager-journal-unavailable`, and the root and task sources still register.
668
+ - `okstra manager resume` is read-only. It reports the last `session-summary` entry, the number of entries listed before it in the `log` order (`Unsummarized activity`), open followups oldest first, the five most recent decisions, the newest `--recent` entries, and for each task the `task status` sync time, sync age, changed-since-sync count and unlinked child count; a task whose files cannot be read reports its `error` instead, and the rest is still printed. `--task-group` / `--task-id` given as empty strings are refused by `log` and `journal add`.
642
669
  - `child-context/*.md`: child lead context prepared by `task run`. Sibling project reports/snapshots are passed only as read-side source material.
643
- - `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`.
670
+ - `view/index.html`: the page `okstra manager view` writes from the files above, including open followups and manager-level events. 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`.
644
671
 
645
672
  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`).
646
673
 
@@ -731,6 +758,10 @@ The rendered `task-index.md` is an English-literal artifact. The headings, field
731
758
 
732
759
  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>`.
733
760
 
761
+ 새 3.0 실행은 `reportAuthoringFormat: "json-v1"`·`usageAccountingPolicy: "advisory"`를 준비 시 기록한다. 각 필드가 없는 기존 실행은 각각 `markdown-v1`·`strict`로 읽는다. 이 두 필드는 결과 보고서의 `schemaVersion`이나 `reportContractVersion: "3.0"`을 변경하지 않는다. 알 수 없는 형식·정책은 거부하며, 기존 manifest·승인·digest를 일괄 변환하지 않는다. compact context의 `pathHints`에도 선언을 보존해 복원 시 기존 입력 확장자와 정책을 유지한다.
762
+
763
+ `advisory`에서 확인된 사용량 부재는 보고서에 `null`과 원인 진단으로 투영한다. 수집기의 원래 합계·출처·note는 team-state에 보존한다. 게시 후 재수집 결과는 team-state에만 반영하고 `data.json`·HTML을 다시 쓰지 않는다. 실제 실행·검증·generation·봉인·승인 근거가 누락되거나 변조된 경우의 차단은 사용량 정책과 별개로 유지한다.
764
+
734
765
  `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.
735
766
 
736
767
  `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.
@@ -163,6 +163,8 @@ Runtime entry points are consolidated in Python packages. Bash and skills only c
163
163
  - Installation location: `~/.claude/skills/<name>/SKILL.md` or `~/.agents/skills/<name>/SKILL.md`.
164
164
  - Release procedure: [`../../RELEASING.md`](../RELEASING.md) — npm publish flow and release-please / manual fallback.
165
165
 
166
+ 새 코딩 정책 캡처에서는 함수의 줄별 영어 설명 검사를 사용하지 않는다. 함수 길이·중첩·숫자 자체는 검토 신호이며, 실제 오류·명시적 프로젝트 규칙 위반·구체적 설계 또는 유지보수 영향이 지적의 근거다. 변경한 핵심 동작과 실패 결과를 기존 테스트로 검증하고 필요할 때 선택적 변이를 수행한다. 프로젝트가 별도로 요구한 검사, 규칙별 판정표·증거·봉인과 이미 동결된 정책은 유지한다.
167
+
166
168
  ## Architecture: python authority + thin callers
167
169
 
168
170
  okstra's prepare stage follows an on-disk authority + single Python entry-point model. This design satisfies two goals simultaneously.
@@ -372,7 +374,7 @@ The complete artifact lifecycle is: worker results → Round 0 grouping → redu
372
374
 
373
375
  Cross-verification does not mean that worker A reviews worker B's entire result. Round 0 records multi-source agreement immediately, and the reducer asks independent analyser instances to vote only on single-source or still-unresolved findings selected in the persisted queue. The report writer is never a voter. It organizes the validated result, while the later plan-body round verifies the consolidated `P-*` plan items rather than reopening the `F-*` finding queue.
374
376
 
375
- The lead writes the grouped input, then advances it through the internal admin CLI operations `okstra convergence seed`, `plan-round`, `apply-round`, optional `apply-critic-gaps`, `finalize`, and `validate`. For worker W, each generated dispatch excludes findings originating from W; resolved findings leave the queue permanently. Lightweight reverify receives only its current persisted batch and embedded evidence, not the original analysis packet, profile, brief, or instruction set. Its prompt carries an exact task type and active-phase forbidden-actions block; dispatch validates those phase anchors, and the run validator rejects a recorded phase-boundary violation. Terminal worker non-results and completed per-finding `UNVERIFIABLE` responses become `verification-error`; the engine never fabricates a `DISAGREE` vote. The report writer does not vote and consumes the validated terminal convergence state and every analysis-worker result as read context. Under report contract v3 it writes only the narrative Markdown, a pointer, and its audit sidecar. Approval decisions, activity, execution, convergence, design preparation, and plan-body verification remain in their single-owner inputs. Phase 7 validates those inputs and atomically publishes `data.json` once. The full reading copy is rendered on demand. Newly finalized convergence output is schema v1.4; under the compatibility path, valid historical final schema versions v1.0, v1.1, v1.2, or v1.3 are reused and consumed without rewrite.
377
+ 리더는 묶은 입력을 `okstra convergence seed`, `plan-round`, `apply-round`, 선택적 `apply-critic-gaps`, `finalize`, `validate`로 진행한다. 각 워커의 재검증 묶음에서는 그 워커가 낸 지적을 제외하며, 해결된 지적은 큐에서 제거한다. 경량 재검증은 현재 묶음과 내장 근거만 받고, 태스크·단계 경계와 `verification-error`·`UNVERIFIABLE` 처리는 그대로 유지한다. 보고서 작성자는 투표하지 않고 검증된 수렴 결과와 모든 분석 결과를 읽는다. 계약 3.0에서는 선언된 형식의 작성자 입력, 포인터와 audit sidecar만 작성한다. 승인·활동·실행·수렴·설계 준비·계획 본문 검증 값은 각 소유자의 입력에 남고, Phase 7이 이를 검증해 `data.json`을 원자적으로 게시한다. 읽기용 Markdown은 요청 시 렌더링한다. 새 수렴 결과는 schema v1.4이며, 기존 v1.0–v1.3 결과의 호환 판독과 원본 보존도 유지한다.
376
378
 
377
379
  Coverage critic and plan-body verification remain separate from finding convergence. The critic audits the integrated Round 0 analysis, while implementation-planning's plan-body gate validates the later report draft through its own `P-*` queue and state file. Neither path changes the engine's `F-*` queue.
378
380
 
@@ -807,7 +809,7 @@ The default for an `implementation-planning` clarification rerun is **full re-ve
807
809
 
808
810
  ```bash
809
811
  okstra incremental-scope --prev-data <prev data.json> --cur-base-sha <sha> --prev-base-sha <sha> --impacted 2,3
810
- okstra incremental-carry --prev-data <prev data.json> --cur-narrative <cur narrative.md> --state <cur plan state.json> --prev-seq <prev-seq> --carry-stages <csv> --reverify-stages <csv> --out-state <cur plan state.json>
812
+ okstra incremental-carry --run-manifest <run-manifest> --prev-data <prev data.json> --cur-narrative <current writer input> --state <cur plan state.json> --prev-seq <prev-seq> --carry-stages <csv> --reverify-stages <csv> --out-state <cur plan state.json>
811
813
  ```
812
814
 
813
815
  When `mode == "incremental"`, worker dispatch is narrowed to `reverify_stages` (see *Cross-verification mode* in `scripts/okstra_ctl/phases/implementation_planning/profile.md`), and workers do not reopen or rejudge `carry_stages`. The report writer preserves carried stage rows in its narrative. After plan-item seeding, `okstra incremental-carry` verifies those rows and copies their previous `P-Step-*` and `P-Prep-*` verdicts, plus unchanged `P-Val-*` / `P-Req-*` / `P-Rb-*` rows, into the convergence-owned state with a `carriedForwardFromSeq` tag. It exits nonzero on a changed or omitted carried stage, missing item, or conflicting scope and falls back to full. If a reverified stage concludes that a plan item must be **deleted**, that indicates nonlocal impact and likewise triggers a full rerun. `verdictCard` / `finalVerdict` are never carried and are recomputed on every run.
@@ -901,7 +903,9 @@ Resume decision rules:
901
903
 
902
904
  ## Final report structure
903
905
 
904
- New task bundles use `schemas/final-report-v3.0.schema.json` as the final-report data contract. The report writer authors the `humanSummary` and exactly one task-type deliverable in narrative Markdown. Report assembly adds the single-owner machine inputs and atomically publishes one data.json source of truth. Two renderers consume it independently. Historical `schemas/final-report-v2.0.schema.json` records remain readable.
906
+ 새 태스크도 final-report 데이터 계약은 `schemas/final-report-v3.0.schema.json`의 `3.0`을 유지한다. 작성자는 `humanSummary`와 태스크별 허용 필드를 manifest가 선언한 입력에 작성한다. 새 실행은 `reportAuthoringFormat: "json-v1"`과 `.json` 경로를 사용하며, 설명 문자열 안에는 일반 Markdown을 쓸 수 있다. 형식 필드가 없는 기존 실행은 `markdown-v1` 줄 문법과 기존 `.md` 경로를 유지한다. 확장자나 내용으로 형식을 추측하지 않으며, 알 수 없는 형식은 오류다. 보고서 조립기는 기계 소유 입력을 결합해 `data.json`을 원자적으로 게시하고, 두 렌더러가 이를 독립적으로 소비한다. 기존 v1·v2 보고서의 호환 판독도 유지한다.
907
+
908
+ `reportNarrativePath`라는 manifest 키는 두 형식에서 그대로 사용한다. 작성자 입력의 최상위·중첩 소유권과 스키마·태스크 계약을 검사하며, JSON을 작성할 수 있다는 이유로 승인·실행 증거·수렴·사용량 같은 기계 소유 값을 작성할 권한이 생기지는 않는다. 준비 시 형식과 경로를 고정하고 compact context에도 보존하므로, 재개 시 최신 설치본의 기본값으로 바꾸지 않는다.
905
909
 
906
910
  - `templates/reports/final-report-v2.template.md` produces the full reading copy Markdown spine in a fixed order: handoff summary, decision context, next-task contract, clarifications, evidence ledger, one task deliverable, cross-verification audit, execution audit, and token/cost audit. The task deliverable body comes from `templates/reports/md/tasks/<task-type>.template.md`, the Markdown sibling of the HTML task template below. Human narrative fields are excluded from this artifact.
907
911
  - Section bodies are rendered as Markdown — headings, tables for uniform row sets, prose for narrative fields — by `scripts/okstra_ctl/report_markdown.py`, never serialized as JSON. Field order within a section comes from the record's versioned schema, whose properties are authored in reading order (a decision draft reads `context → decision → consequences`).
@@ -989,7 +993,9 @@ Errors that occur while provider workers, the report writer, or the Okstra lead
989
993
 
990
994
  ## Token usage and cost accounting
991
995
 
992
- Tokens used in each run are collected from lead/worker session transcripts and written back to `leadUsage` / `workers[].usage` in `team-state.json`.
996
+ 각 실행의 사용량은 리더·워커 세션 기록에서 수집해 team-state의 `leadUsage`·`workers[].usage`에 저장한다. 새 실행은 manifest에 `usageAccountingPolicy: "advisory"`를 고정하며, 필드가 없는 기존 실행은 `strict`를 유지한다. 정책을 모르는 값은 오류이며, 재개 시 기존 정책을 새 기본값으로 바꾸지 않는다.
997
+
998
+ `advisory`에서는 수집을 수행한 뒤 세션 부재·CLI 청구량 부재처럼 원인이 확인된 부재를 진단으로 기록한다. 수집기의 기존 카운터는 유지하고, 보고서를 조립할 때 미수집 값과 불완전 합계를 `null`로 투영한다. 그 부재만으로 실제 작업 검증을 실패시키지는 않는다. 수집 생략, 잘못된 수치, 모호한 세션 귀속이나 예상하지 못한 집계 오류는 계속 오류로 남는다. 수집기·보고서 투영·`validate-run`은 같은 정책을 사용한다. 이미 게시한 실행을 재수집하면 결과를 team-state에 보존하고 advisory로 알리며, 게시된 `data.json`·HTML과 digest는 바꾸지 않는다. `strict` 실행은 기존 판정과 갱신 경로를 유지한다.
993
999
 
994
1000
  - Helper CLI: `scripts/okstra-token-usage.py`
995
1001
  - Collection sources: