okstra 0.232.0 → 0.234.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -283
- package/dist/cli-registry.mjs +14 -1
- package/dist/cli-registry.mjs.map +1 -1
- package/dist/commands/execute/render-bundle.d.mts +6 -1
- package/dist/commands/execute/render-bundle.mjs +139 -32
- package/dist/commands/execute/render-bundle.mjs.map +1 -1
- package/dist/commands/lifecycle/config.mjs +6 -74
- package/dist/commands/lifecycle/config.mjs.map +1 -1
- package/dist/commands/trace/capacity.d.mts +12 -0
- package/dist/commands/trace/capacity.mjs +21 -0
- package/dist/commands/trace/capacity.mjs.map +1 -0
- package/dist/commands/trace/model.d.mts +89 -0
- package/dist/commands/trace/model.mjs +251 -0
- package/dist/commands/trace/model.mjs.map +1 -0
- package/dist/commands/trace/progression.d.mts +11 -0
- package/dist/commands/trace/progression.mjs +194 -0
- package/dist/commands/trace/progression.mjs.map +1 -0
- package/dist/commands/trace/review.d.mts +7 -0
- package/dist/commands/trace/review.mjs +51 -0
- package/dist/commands/trace/review.mjs.map +1 -0
- package/dist/commands/trace/task-link.d.mts +18 -0
- package/dist/commands/trace/task-link.mjs +72 -0
- package/dist/commands/trace/task-link.mjs.map +1 -0
- package/dist/commands/trace/trace.d.mts +1 -0
- package/dist/commands/trace/trace.mjs +293 -0
- package/dist/commands/trace/trace.mjs.map +1 -0
- package/dist/lib/bounded-file.d.mts +1 -0
- package/dist/lib/bounded-file.mjs +36 -0
- package/dist/lib/bounded-file.mjs.map +1 -0
- package/dist/lib/config-store.d.mts +34 -0
- package/dist/lib/config-store.mjs +70 -0
- package/dist/lib/config-store.mjs.map +1 -0
- package/dist/lib/file-lock.mjs +4 -5
- package/dist/lib/file-lock.mjs.map +1 -1
- package/dist/lib/input-limit.d.mts +4 -0
- package/dist/lib/input-limit.mjs +8 -0
- package/dist/lib/input-limit.mjs.map +1 -0
- package/dist/lib/memory-auto-register.mjs +2 -17
- package/dist/lib/memory-auto-register.mjs.map +1 -1
- package/dist/lib/report-language-tag.d.mts +1 -0
- package/dist/lib/report-language-tag.mjs +4 -0
- package/dist/lib/report-language-tag.mjs.map +1 -0
- package/dist/lib/report-language.d.mts +1 -0
- package/dist/lib/report-language.mjs +50 -0
- package/dist/lib/report-language.mjs.map +1 -0
- package/dist/lib/skill-catalog.mjs +3 -0
- package/dist/lib/skill-catalog.mjs.map +1 -1
- package/docs/architecture/storage-model.md +55 -5
- package/docs/architecture.md +10 -4
- package/docs/cli.md +320 -3
- package/docs/contributor-change-matrix.md +1 -2
- package/docs/project-structure-overview.md +34 -43
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/operations/trace-interface-review.json +6 -0
- package/runtime/agents/operations/trace-scope-review.json +6 -0
- package/runtime/prompts/coding-preflight/authoring-checks.md +1 -1
- package/runtime/prompts/coding-preflight/clean-code.md +18 -20
- package/runtime/prompts/coding-preflight/overview.md +1 -1
- package/runtime/prompts/duties/code-reviewer.json +1 -1
- package/runtime/prompts/duties/interface-reviewer.json +32 -0
- package/runtime/prompts/host-orchestration/README.md +18 -9
- package/runtime/prompts/launch.template.md +3 -2
- package/runtime/prompts/lead/context-loader.md +2 -0
- package/runtime/prompts/lead/okstra-lead-contract.md +7 -7
- package/runtime/prompts/lead/report-writer.md +6 -6
- package/runtime/prompts/profiles/_coding-conventions-preflight.md +2 -2
- package/runtime/prompts/profiles/_common-contract.md +1 -1
- package/runtime/python/okstra_ctl/agent/invocation.py +1 -0
- package/runtime/python/okstra_ctl/agent/prompt_cli/cli.py +66 -26
- package/runtime/python/okstra_ctl/agent/prompt_cli/corrections.py +23 -8
- package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +28 -10
- package/runtime/python/okstra_ctl/agent/prompt_cli/results.py +8 -11
- package/runtime/python/okstra_ctl/agent/standalone.py +12 -0
- package/runtime/python/okstra_ctl/analysis_packet.py +22 -11
- package/runtime/python/okstra_ctl/business_flow/cli.py +60 -6
- package/runtime/python/okstra_ctl/business_flow/contracts.py +12 -1
- package/runtime/python/okstra_ctl/business_flow/engine.py +17 -5
- package/runtime/python/okstra_ctl/business_flow/history.py +60 -0
- package/runtime/python/okstra_ctl/business_flow/source.py +35 -2
- package/runtime/python/okstra_ctl/business_flow/store.py +51 -14
- package/runtime/python/okstra_ctl/business_flow/sweep.py +124 -0
- package/runtime/python/okstra_ctl/code_review_census.py +93 -2
- package/runtime/python/okstra_ctl/code_review_prepare.py +381 -0
- package/runtime/python/okstra_ctl/code_review_run.py +384 -0
- package/runtime/python/okstra_ctl/code_review_scope.py +13 -0
- package/runtime/python/okstra_ctl/code_review_supervisor.py +41 -0
- package/runtime/python/okstra_ctl/code_review_target.py +140 -15
- package/runtime/python/okstra_ctl/coverage_census.py +11 -2
- package/runtime/python/okstra_ctl/design_snapshot.py +16 -9
- package/runtime/python/okstra_ctl/direct_work.py +45 -3
- package/runtime/python/okstra_ctl/dispatch_core.py +31 -15
- package/runtime/python/okstra_ctl/dispatch_state.py +9 -2
- package/runtime/python/okstra_ctl/domain/role.py +1 -0
- package/runtime/python/okstra_ctl/doyouknow/cli.py +9 -9
- package/runtime/python/okstra_ctl/doyouknow/config.py +2 -2
- package/runtime/python/okstra_ctl/doyouknow/group_view.py +152 -0
- package/runtime/python/okstra_ctl/doyouknow/source_contracts.py +4 -3
- package/runtime/python/okstra_ctl/doyouknow/source_store.py +2 -2
- package/runtime/python/okstra_ctl/doyouknow/sources/business.py +116 -0
- package/runtime/python/okstra_ctl/doyouknow/sources/manager.py +48 -9
- package/runtime/python/okstra_ctl/doyouknow/sync.py +34 -9
- package/runtime/python/okstra_ctl/final_report_schema.py +37 -34
- package/runtime/python/okstra_ctl/fixed_text.py +10 -0
- package/runtime/python/okstra_ctl/incremental_carry.py +6 -7
- package/runtime/python/okstra_ctl/initial_prompt_materialization.py +9 -2
- package/runtime/python/okstra_ctl/json_boundary.py +33 -6
- package/runtime/python/okstra_ctl/manager_cli.py +122 -1
- package/runtime/python/okstra_ctl/manager_journal.py +126 -0
- package/runtime/python/okstra_ctl/manager_launch.py +3 -3
- package/runtime/python/okstra_ctl/manager_log.py +221 -0
- package/runtime/python/okstra_ctl/manager_paths.py +8 -0
- package/runtime/python/okstra_ctl/manager_resume.py +59 -0
- package/runtime/python/okstra_ctl/manager_split.py +2 -2
- package/runtime/python/okstra_ctl/manager_store.py +116 -17
- package/runtime/python/okstra_ctl/manager_sync.py +42 -3
- package/runtime/python/okstra_ctl/manager_view.py +35 -2
- package/runtime/python/okstra_ctl/material.py +2 -0
- package/runtime/python/okstra_ctl/model_cli.py +64 -14
- package/runtime/python/okstra_ctl/model_defaults.py +22 -0
- package/runtime/python/okstra_ctl/model_io/renderers.py +3 -0
- package/runtime/python/okstra_ctl/operation_invocation.py +207 -28
- package/runtime/python/okstra_ctl/path_hints.py +14 -3
- package/runtime/python/okstra_ctl/paths.py +6 -1
- package/runtime/python/okstra_ctl/phases/catalog.py +24 -7
- package/runtime/python/okstra_ctl/phases/implementation/host-rules.md +3 -3
- package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-diff-review.md +8 -6
- package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-self-check.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation_option_selection/profile.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation_option_selection/votes.py +11 -11
- package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +12 -9
- package/runtime/python/okstra_ctl/phases/implementation_planning/host-rules.md +3 -6
- package/runtime/python/okstra_ctl/phases/implementation_planning/instructions/plan-body-verification.md +12 -10
- package/runtime/python/okstra_ctl/phases/implementation_planning/profile.md +5 -5
- package/runtime/python/okstra_ctl/phases/improvement_discovery/lenses.py +12 -0
- package/runtime/python/okstra_ctl/phases/improvement_discovery/profile.md +7 -6
- package/runtime/python/okstra_ctl/phases/improvement_discovery/resolved_census.py +159 -0
- package/runtime/python/okstra_ctl/phases/improvement_discovery/spec.md +5 -2
- package/runtime/python/okstra_ctl/phases/improvement_discovery/validation.py +21 -7
- package/runtime/python/okstra_ctl/phases/release_handoff/boundary.json +1 -1
- package/runtime/python/okstra_ctl/phases/release_handoff/profile.md +4 -1
- package/runtime/python/okstra_ctl/plan_verify_cli.py +6 -4
- package/runtime/python/okstra_ctl/project_group.py +175 -0
- package/runtime/python/okstra_ctl/project_group_cli.py +62 -0
- package/runtime/python/okstra_ctl/render.py +28 -2
- package/runtime/python/okstra_ctl/report_assembly.py +38 -11
- package/runtime/python/okstra_ctl/report_contract.py +26 -0
- package/runtime/python/okstra_ctl/report_corrections.py +36 -20
- package/runtime/python/okstra_ctl/report_inputs.py +1 -0
- package/runtime/python/okstra_ctl/report_language.py +4 -1
- package/runtime/python/okstra_ctl/report_narrative.py +179 -7
- package/runtime/python/okstra_ctl/report_projections.py +64 -18
- package/runtime/python/okstra_ctl/report_synthesis_packet.py +86 -36
- package/runtime/python/okstra_ctl/run.py +43 -35
- package/runtime/python/okstra_ctl/run_context.py +10 -1
- package/runtime/python/okstra_ctl/set_work_status.py +4 -15
- package/runtime/python/okstra_ctl/task_list_cli.py +34 -8
- package/runtime/python/okstra_ctl/task_query.py +239 -0
- package/runtime/python/okstra_ctl/trace_review.py +264 -0
- package/runtime/python/okstra_ctl/trace_tasks.py +197 -0
- package/runtime/python/okstra_ctl/user_authorization.py +14 -0
- package/runtime/python/okstra_ctl/wizard/confirmation.py +7 -3
- package/runtime/python/okstra_ctl/wizard/launch.py +52 -0
- package/runtime/python/okstra_ctl/wizard/launch_cli.py +39 -0
- package/runtime/python/okstra_ctl/wizard/outcome.py +17 -16
- package/runtime/python/okstra_ctl/wizard/registry.py +1 -1
- package/runtime/python/okstra_ctl/wizard/render.py +8 -0
- package/runtime/python/okstra_ctl/wizard/state.py +2 -1
- package/runtime/python/okstra_project/state.py +20 -0
- package/runtime/python/okstra_token_usage/blocks.py +74 -0
- package/runtime/python/okstra_token_usage/cli.py +23 -10
- package/runtime/python/okstra_token_usage/collect.py +25 -22
- package/runtime/python/okstra_token_usage/policy.py +193 -0
- package/runtime/schemas/business-flow-v1.schema.json +3 -0
- package/runtime/schemas/doyouknow-config-v1.schema.json +1 -1
- package/runtime/schemas/report-synthesis-packet-v1.0.schema.json +1 -1
- package/runtime/skills/_fragments/wizard-confirm-step.md +1 -1
- package/runtime/skills/_fragments/wizard-preflight.md +1 -1
- package/runtime/skills/_fragments/wizard-prompt-loop.md +3 -5
- package/runtime/skills/_fragments/wizard-relay-protocol.md +1 -1
- package/runtime/skills/_fragments/wizard-render-bundle.md +15 -29
- package/runtime/skills/okstra-brief-gen/SKILL.md +7 -7
- package/runtime/skills/okstra-brief-gen/references/tracker-recursion.md +1 -1
- package/runtime/skills/okstra-code-review/SKILL.md +58 -50
- package/runtime/skills/okstra-code-review/references/census-rules.md +6 -6
- package/runtime/skills/okstra-code-review/references/review-calibration.md +8 -12
- package/runtime/skills/okstra-discussion/SKILL.md +22 -38
- package/runtime/skills/okstra-explain-flow/SKILL.md +33 -4
- package/runtime/skills/okstra-manager/SKILL.md +24 -0
- package/runtime/skills/okstra-memory/SKILL.md +1 -1
- package/runtime/skills/okstra-pr-gen/SKILL.md +1 -1
- package/runtime/skills/okstra-run/SKILL.md +55 -183
- package/runtime/skills/okstra-schedule-gen/SKILL.md +9 -13
- package/runtime/skills/okstra-setup/SKILL.md +3 -2
- package/runtime/skills/okstra-setup/references/project-config.md +2 -4
- package/runtime/skills/okstra-tdd/SKILL.md +187 -0
- package/runtime/skills/okstra-user-response/SKILL.md +4 -2
- package/runtime/templates/doyouknow/group-view.css +103 -0
- package/runtime/templates/doyouknow/group-view.js +317 -0
- package/runtime/templates/doyouknow/group-view.template.html +72 -0
- package/runtime/templates/manager/view.template.html +4 -0
- package/runtime/templates/report-writer-prompt-preamble.md +15 -3
- package/runtime/templates/trace/trace.template.md +42 -0
- package/runtime/validators/checks/fixtures-02.py +25 -33
- 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
|
-
|
|
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,IAA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KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI;SAClE,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isReportLanguageTag(value: unknown): value is string;
|
|
@@ -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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AK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,kCAAkC,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,QAAQ,GAAG,gBAAgB,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAC9E,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,kDAAkD,IAAI,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,WAAmB;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,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;
|
|
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
|
|
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
|
-
|
|
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,12 +660,33 @@ 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
|
-
-
|
|
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
|
|
|
674
|
+
### 5. 프로젝트 그룹 등록부
|
|
675
|
+
|
|
676
|
+
`okstra project-group`은 제품이나 조직 단위로 프로젝트 루트를 묶는다. 매니저 상태와 별개이며 작업·일지를 갖지 않는다.
|
|
677
|
+
|
|
678
|
+
```text
|
|
679
|
+
~/.okstra/project-groups/<safe-project-group>.json
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
- 파일 하나가 그룹 하나다. `projectGroup`에 원래 이름을, `projects`에 `projectId`·`projectRoot`·`linkedAt` 행을 `projectId` 순으로 둔다.
|
|
683
|
+
- 한 프로젝트는 여러 그룹 파일에 등록될 수 있다. 프로젝트의 `.okstra/project.json`에는 그룹을 기록하지 않으므로 이 파일이 소속의 유일한 기록이다.
|
|
684
|
+
- 파일명은 매니저 경로와 같은 슬러그 규칙을 따른다. 슬러그가 같은 다른 이름은 처음 저장된 이름의 파일을 공유하지 못하고 거부된다.
|
|
685
|
+
- `add`는 존재하는 디렉터리만 받는다. 그룹 파일을 먼저 검증하고, 등록 행이 새로 생기거나 루트가 바뀔 때만 `upsert_project_json`을 호출한다. 이때 `.okstra/project.json`이 없으면 만들고, 있으면 `projectId`가 일치해야 한다. 거부된 등록과 변경 없는 재등록은 프로젝트 디렉터리에 쓰지 않는다.
|
|
686
|
+
- `remove`는 등록 행만 지운다. 그룹 파일과 프로젝트의 `.okstra/`는 남는다.
|
|
687
|
+
|
|
688
|
+
적용 여부는 `tests/doyouknow/test_project_group.py`가 확인한다.
|
|
689
|
+
|
|
647
690
|
## Task manifest contract
|
|
648
691
|
|
|
649
692
|
`okstra set-work-status` can register an existing brief without creating a run. Such a task
|
|
@@ -731,6 +774,10 @@ The rendered `task-index.md` is an English-literal artifact. The headings, field
|
|
|
731
774
|
|
|
732
775
|
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
776
|
|
|
777
|
+
새 3.0 실행은 `reportAuthoringFormat: "json-v1"`·`usageAccountingPolicy: "advisory"`를 준비 시 기록한다. 각 필드가 없는 기존 실행은 각각 `markdown-v1`·`strict`로 읽는다. 이 두 필드는 결과 보고서의 `schemaVersion`이나 `reportContractVersion: "3.0"`을 변경하지 않는다. 알 수 없는 형식·정책은 거부하며, 기존 manifest·승인·digest를 일괄 변환하지 않는다. compact context의 `pathHints`에도 선언을 보존해 복원 시 기존 입력 확장자와 정책을 유지한다.
|
|
778
|
+
|
|
779
|
+
`advisory`에서 확인된 사용량 부재는 보고서에 `null`과 원인 진단으로 투영한다. 수집기의 원래 합계·출처·note는 team-state에 보존한다. 게시 후 재수집 결과는 team-state에만 반영하고 `data.json`·HTML을 다시 쓰지 않는다. 실제 실행·검증·generation·봉인·승인 근거가 누락되거나 변조된 경우의 차단은 사용량 정책과 별개로 유지한다.
|
|
780
|
+
|
|
734
781
|
`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
782
|
|
|
736
783
|
`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.
|
|
@@ -846,6 +893,8 @@ Business artifacts use the original project root even when source inspection tar
|
|
|
846
893
|
- Adjacent `<final-report.data.json>.business-flow.json`: human-report link projection, without changing the final-report schema or task routing.
|
|
847
894
|
- `.okstra/agent-invocations/explain-flow/`: frozen investigator prompt, role/duty snapshots, assignment metadata, process log/status, result envelope and verified completion.
|
|
848
895
|
|
|
896
|
+
후보 프로젝트는 기본으로 okstra 홈의 `projects/*/meta.json`에 기록된 모든 프로젝트와 현재 프로젝트다. 요청에 `project_group`이 있으면 조사 대상은 그 프로젝트 그룹 등록부의 프로젝트와 현재 프로젝트로 바뀐다. 지식 저장소를 읽는 범위는 좁아지지 않고 실행 이력의 프로젝트에 그룹 구성원을 더한 집합이며, 충돌 표시와 충돌 해소 검증은 이 넓은 집합에서 한다. 조회 결과는 그룹 구성원이 소유한 claim만 돌려주되 상태는 넓은 집합의 판정을 유지한다. 충돌 재조사(`reconcile`)는 그룹 밖 claim이 상대일 수 있으므로 넓은 집합을 조사한다. 그룹이 읽기 범위를 좁히면 범위 밖 claim을 포함한 해소 기록이 적용되지 않아 같은 저장소에 모순된 해소가 쌓일 수 있어서 이렇게 둔다. 등록되지 않은 그룹 이름은 실행을 실패로 끝낸다. `okstra explain-flow sweep`은 새 저장물을 만들지 않는다. 계획은 구성원 프로젝트의 실행 기록과 현재 소스 버전만 읽고, `--run`은 대상마다 일반 실행 기록을 하나씩 만든다. 적용 여부는 `tests/run/test_business_flow_invocation.py`가 확인한다.
|
|
897
|
+
|
|
849
898
|
The JSON boundary validates artifact schemas and atomically replaces files. Directory locks merge concurrent knowledge contributions and task links. Claims found in another project's knowledge store retain that owner; lookup does not copy them into another canonical store. A retry creates another execution id, and the original baseline and reports remain available.
|
|
850
899
|
|
|
851
900
|
## Linked work records
|
|
@@ -860,6 +909,7 @@ read-only. `schemas/doyouknow-v1.schema.json` defines normalized write inputs.
|
|
|
860
909
|
Existing `memory-book/` notes, manager state, task artifacts, and shared business
|
|
861
910
|
knowledge retain their current owners. Explicit `sync` collects memory, manager
|
|
862
911
|
and manager-registered project task references; `list` reads current projections.
|
|
912
|
+
`sync`는 프로젝트 그룹 등록부의 프로젝트에서 업무 흐름 실행 기록(`.okstra/business/executions/<id>/execution.json`)도 `business` 수집원으로 읽는다. 실행 기록이 원본이고 그래프에는 질문별 최신 설명의 투영만 둔다. `okstra doyouknow view`가 쓰는 `doyouknow/view/<safe-project-group>/index.html`은 실행할 때마다 다시 쓰는 파생 뷰다.
|
|
863
913
|
Native memory and manager writes request registration after their original save;
|
|
864
914
|
failures preserve identity-only pending UUIDs separately from SQLite. The
|
|
865
915
|
`pending/`, `registrations/` and `refusals/` directories under `doyouknow/` hold
|
package/docs/architecture.md
CHANGED
|
@@ -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
|
-
|
|
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 <
|
|
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
|
-
|
|
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
|
-
|
|
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:
|