@interf/compiler 0.33.0 → 0.50.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 +122 -226
- package/dist/cli/commands/agents.js +1 -32
- package/dist/cli/commands/benchmark.d.ts +2 -3
- package/dist/cli/commands/benchmark.js +1 -31
- package/dist/cli/commands/build-plan.js +26 -50
- package/dist/cli/commands/build.d.ts +2 -3
- package/dist/cli/commands/build.js +1 -31
- package/dist/cli/commands/graphs.js +177 -32
- package/dist/cli/commands/mcp.d.ts +1 -0
- package/dist/cli/commands/mcp.js +223 -126
- package/dist/cli/commands/project.js +10 -36
- package/dist/cli/commands/reset.d.ts +2 -3
- package/dist/cli/commands/reset.js +1 -22
- package/dist/cli/commands/runs.js +86 -33
- package/dist/cli/commands/status.js +3 -24
- package/dist/cli/commands/traces.js +1 -29
- package/dist/cli/commands/wizard.js +17 -29
- package/dist/cli/lib/http-client.d.ts +39 -0
- package/dist/cli/lib/http-client.js +73 -0
- package/dist/packages/build-plans/authoring/brief.d.ts +25 -4
- package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +42 -1
- package/dist/packages/build-plans/authoring/build-plan-authoring.js +470 -63
- package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +9 -0
- package/dist/packages/build-plans/authoring/build-plan-edit-session.js +27 -10
- package/dist/packages/build-plans/authoring/build-plan-improvement.js +62 -8
- package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.d.ts +1 -0
- package/dist/packages/build-plans/package/build-plan-definitions.d.ts +0 -1
- package/dist/packages/build-plans/package/build-plan-definitions.js +5 -3
- package/dist/packages/build-plans/package/build-plan-stage-runner.d.ts +1 -0
- package/dist/packages/build-plans/package/build-plan-stage-runner.js +2 -1
- package/dist/packages/build-plans/package/builtin-build-plan.d.ts +2 -2
- package/dist/packages/build-plans/package/builtin-build-plan.js +3 -3
- package/dist/packages/build-plans/package/context-interface.d.ts +3 -0
- package/dist/packages/build-plans/package/context-interface.js +5 -5
- package/dist/packages/build-plans/package/interf-build-plan-package.js +22 -22
- package/dist/packages/build-plans/package/local-build-plans.d.ts +10 -5
- package/dist/packages/build-plans/package/local-build-plans.js +57 -32
- package/dist/packages/contracts/index.d.ts +4 -3
- package/dist/packages/contracts/index.js +2 -1
- package/dist/packages/contracts/lib/context-graph-layer.d.ts +161 -0
- package/dist/packages/contracts/lib/context-graph-layer.js +216 -0
- package/dist/packages/contracts/lib/project-paths.d.ts +7 -0
- package/dist/packages/contracts/lib/project-paths.js +9 -0
- package/dist/packages/contracts/lib/project-schema.d.ts +264 -1
- package/dist/packages/contracts/lib/project-schema.js +38 -13
- package/dist/packages/contracts/lib/schema.d.ts +556 -23
- package/dist/packages/contracts/lib/schema.js +279 -18
- package/dist/packages/contracts/utils/filesystem.d.ts +1 -0
- package/dist/packages/contracts/utils/filesystem.js +29 -1
- package/dist/packages/projects/lib/schema.d.ts +6 -8
- package/dist/packages/projects/lib/schema.js +3 -1
- package/dist/packages/projects/source-config.d.ts +0 -5
- package/dist/packages/projects/source-config.js +9 -22
- package/dist/packages/runtime/actions/fields.d.ts +4 -0
- package/dist/packages/runtime/actions/form-builders.js +79 -31
- package/dist/packages/runtime/actions/form-validators.js +9 -3
- package/dist/packages/runtime/actions/helpers.js +3 -3
- package/dist/packages/runtime/actions/registry.d.ts +1 -1
- package/dist/packages/runtime/actions/registry.js +1 -1
- package/dist/packages/runtime/actions/requests.d.ts +1 -1
- package/dist/packages/runtime/actions/requests.js +12 -6
- package/dist/packages/runtime/actions/schemas.d.ts +7 -0
- package/dist/packages/runtime/actions/schemas.js +1 -0
- package/dist/packages/runtime/agent-handoff.js +8 -7
- package/dist/packages/runtime/agents/lib/execution-profile.d.ts +14 -0
- package/dist/packages/runtime/agents/lib/execution-profile.js +23 -0
- package/dist/packages/runtime/agents/lib/execution.js +14 -8
- package/dist/packages/runtime/agents/lib/executors.d.ts +1 -0
- package/dist/packages/runtime/agents/lib/executors.js +11 -2
- package/dist/packages/runtime/agents/lib/logs.d.ts +10 -0
- package/dist/packages/runtime/agents/lib/logs.js +32 -8
- package/dist/packages/runtime/agents/lib/preflight.js +4 -1
- package/dist/packages/runtime/agents/lib/render.d.ts +18 -0
- package/dist/packages/runtime/agents/lib/render.js +44 -18
- package/dist/packages/runtime/agents/lib/shell-templates.js +105 -63
- package/dist/packages/runtime/agents/lib/shells.d.ts +29 -0
- package/dist/packages/runtime/agents/lib/shells.js +158 -32
- package/dist/packages/runtime/agents/lib/source-context-scan.d.ts +10 -0
- package/dist/packages/runtime/agents/lib/source-context-scan.js +388 -0
- package/dist/packages/runtime/agents/lib/status.js +1 -14
- package/dist/packages/runtime/agents/lib/string-utils.d.ts +16 -0
- package/dist/packages/runtime/agents/lib/string-utils.js +36 -0
- package/dist/packages/runtime/agents/lib/types.d.ts +1 -0
- package/dist/packages/runtime/agents/providers/codex.js +2 -0
- package/dist/packages/runtime/agents/role-executors.js +2 -1
- package/dist/packages/runtime/auth/session-store.js +11 -3
- package/dist/packages/runtime/benchmark-question-draft.d.ts +3 -0
- package/dist/packages/runtime/benchmark-question-draft.js +57 -28
- package/dist/packages/runtime/build/artifact-status.d.ts +1 -1
- package/dist/packages/runtime/build/artifact-status.js +1 -1
- package/dist/packages/runtime/build/build-evidence.d.ts +2 -1
- package/dist/packages/runtime/build/build-evidence.js +11 -5
- package/dist/packages/runtime/build/build-pipeline.js +89 -5
- package/dist/packages/runtime/build/build-stage-plan.js +3 -1
- package/dist/packages/runtime/build/build-stage-runner.js +169 -32
- package/dist/packages/runtime/build/build-target.d.ts +3 -0
- package/dist/packages/runtime/build/build-target.js +25 -1
- package/dist/packages/runtime/build/check-evaluator.d.ts +1 -1
- package/dist/packages/runtime/build/check-evaluator.js +655 -4
- package/dist/packages/runtime/build/context-graph-paths.d.ts +13 -0
- package/dist/packages/runtime/build/context-graph-paths.js +27 -0
- package/dist/packages/runtime/build/index.d.ts +2 -2
- package/dist/packages/runtime/build/index.js +2 -2
- package/dist/packages/runtime/build/inspect-map.d.ts +10 -0
- package/dist/packages/runtime/build/inspect-map.js +270 -0
- package/dist/packages/runtime/build/lib/schema.d.ts +246 -53
- package/dist/packages/runtime/build/lib/schema.js +173 -15
- package/dist/packages/runtime/build/native-entrypoint.d.ts +2 -0
- package/dist/packages/runtime/build/native-entrypoint.js +286 -0
- package/dist/packages/runtime/build/runtime-contracts.js +9 -3
- package/dist/packages/runtime/build/runtime-log-paths.d.ts +3 -0
- package/dist/packages/runtime/build/runtime-log-paths.js +16 -0
- package/dist/packages/runtime/build/runtime-prompt.js +6 -4
- package/dist/packages/runtime/build/runtime-runs.js +63 -10
- package/dist/packages/runtime/build/runtime-types.d.ts +4 -1
- package/dist/packages/runtime/build/runtime.d.ts +3 -1
- package/dist/packages/runtime/build/runtime.js +3 -1
- package/dist/packages/runtime/build/source-files.js +11 -2
- package/dist/packages/runtime/build/source-inventory.d.ts +1 -0
- package/dist/packages/runtime/build/source-inventory.js +246 -7
- package/dist/packages/runtime/build/source-manifest.d.ts +11 -0
- package/dist/packages/runtime/build/source-manifest.js +30 -2
- package/dist/packages/runtime/build/stage-evidence.js +80 -11
- package/dist/packages/runtime/build/stage-manifest.d.ts +45 -0
- package/dist/packages/runtime/build/stage-manifest.js +1125 -0
- package/dist/packages/runtime/build/stage-reuse.js +12 -0
- package/dist/packages/runtime/build/stage-session.d.ts +81 -0
- package/dist/packages/runtime/build/stage-session.js +308 -0
- package/dist/packages/runtime/build/state-io.js +10 -11
- package/dist/packages/runtime/build/state-view.js +1 -1
- package/dist/packages/runtime/build/state.d.ts +1 -1
- package/dist/packages/runtime/build/state.js +1 -1
- package/dist/packages/runtime/build/summary-coverage-index.d.ts +21 -0
- package/dist/packages/runtime/build/summary-coverage-index.js +189 -0
- package/dist/packages/runtime/build/traces.js +3 -3
- package/dist/packages/runtime/build/validate-context-graph.d.ts +1 -1
- package/dist/packages/runtime/build/validate-context-graph.js +5 -5
- package/dist/packages/runtime/build/validate.d.ts +1 -1
- package/dist/packages/runtime/build/validate.js +1 -1
- package/dist/packages/runtime/client.d.ts +3 -3
- package/dist/packages/runtime/client.js +8 -13
- package/dist/packages/runtime/context-checks.js +13 -0
- package/dist/packages/runtime/context-graph-scaffold.js +2 -1
- package/dist/packages/runtime/context-graph-semantic-graph.d.ts +9 -0
- package/dist/packages/runtime/context-graph-semantic-graph.js +416 -0
- package/dist/packages/runtime/execution/lib/schema.d.ts +34 -31
- package/dist/packages/runtime/index.d.ts +2 -2
- package/dist/packages/runtime/index.js +1 -1
- package/dist/packages/runtime/native-run-handlers.d.ts +38 -0
- package/dist/packages/runtime/native-run-handlers.js +52 -33
- package/dist/packages/runtime/plan-artifact-contract.js +1 -1
- package/dist/packages/runtime/project-source-state.d.ts +4 -4
- package/dist/packages/runtime/project-source-state.js +5 -2
- package/dist/packages/runtime/project-store.d.ts +5 -0
- package/dist/packages/runtime/project-store.js +30 -3
- package/dist/packages/runtime/requested-artifacts.js +1 -1
- package/dist/packages/runtime/run-observability.js +9 -4
- package/dist/packages/runtime/runtime-action-proposals.js +3 -3
- package/dist/packages/runtime/runtime-build-plans.js +47 -3
- package/dist/packages/runtime/runtime-build-runs.js +9 -16
- package/dist/packages/runtime/runtime-caches.d.ts +26 -0
- package/dist/packages/runtime/runtime-caches.js +47 -0
- package/dist/packages/runtime/runtime-jobs.js +6 -6
- package/dist/packages/runtime/runtime-project-mutations.js +1 -0
- package/dist/packages/runtime/runtime-project-reads.d.ts +4 -1
- package/dist/packages/runtime/runtime-project-reads.js +229 -36
- package/dist/packages/runtime/runtime-proposal-helpers.js +6 -6
- package/dist/packages/runtime/runtime-resource-builders.d.ts +4 -2
- package/dist/packages/runtime/runtime-resource-builders.js +16 -14
- package/dist/packages/runtime/runtime-status.d.ts +14 -0
- package/dist/packages/runtime/runtime-status.js +15 -0
- package/dist/packages/runtime/runtime-verify-runs.js +6 -5
- package/dist/packages/runtime/runtime.d.ts +439 -22
- package/dist/packages/runtime/runtime.js +16 -2
- package/dist/packages/runtime/schemas/actions.d.ts +24 -0
- package/dist/packages/runtime/schemas/agents.d.ts +28 -0
- package/dist/packages/runtime/schemas/agents.js +33 -0
- package/dist/packages/runtime/schemas/build-plans.d.ts +181 -8
- package/dist/packages/runtime/schemas/build-plans.js +36 -2
- package/dist/packages/runtime/schemas/context-graphs.d.ts +1522 -0
- package/dist/packages/runtime/schemas/context-graphs.js +110 -0
- package/dist/packages/runtime/schemas/files.d.ts +7 -347
- package/dist/packages/runtime/schemas/files.js +1 -24
- package/dist/packages/runtime/schemas/index.d.ts +1 -0
- package/dist/packages/runtime/schemas/index.js +1 -0
- package/dist/packages/runtime/schemas/jobs.js +4 -0
- package/dist/packages/runtime/schemas/projects.d.ts +48 -21
- package/dist/packages/runtime/schemas/projects.js +34 -10
- package/dist/packages/runtime/schemas/runs.d.ts +1009 -240
- package/dist/packages/runtime/schemas/runs.js +17 -0
- package/dist/packages/runtime/service/openapi.js +1 -0
- package/dist/packages/runtime/service/operations.d.ts +1666 -145
- package/dist/packages/runtime/service/operations.js +147 -17
- package/dist/packages/runtime/service/routes.d.ts +11 -3
- package/dist/packages/runtime/service/routes.js +11 -3
- package/dist/packages/runtime/service/server-app-boot.js +2 -2
- package/dist/packages/runtime/service/server-helpers.d.ts +11 -0
- package/dist/packages/runtime/service/server-helpers.js +19 -0
- package/dist/packages/runtime/service/server-routes-action-proposals.js +4 -2
- package/dist/packages/runtime/service/server-routes-agents.js +19 -85
- package/dist/packages/runtime/service/server-routes-build-plans.js +14 -11
- package/dist/packages/runtime/service/server-routes-project-context.js +102 -7
- package/dist/packages/runtime/service/server-routes-project-jobs.js +19 -12
- package/dist/packages/runtime/service/server-routes-project-runs.js +5 -2
- package/dist/packages/runtime/service/server-routes-projects.js +6 -2
- package/dist/packages/runtime/service/server-routes-runs.js +11 -4
- package/dist/packages/runtime/verify/lib/schema.js +12 -0
- package/dist/packages/runtime/verify/test-file-guard.d.ts +2 -0
- package/dist/packages/runtime/verify/test-file-guard.js +29 -0
- package/dist/packages/runtime/verify/verify-execution.d.ts +7 -0
- package/dist/packages/runtime/verify/verify-execution.js +109 -35
- package/dist/packages/runtime/verify/verify-paths.d.ts +1 -0
- package/dist/packages/runtime/verify/verify-paths.js +4 -0
- package/dist/packages/runtime/verify/verify-specs.js +49 -39
- package/dist/packages/runtime/wire-schemas.d.ts +1 -1
- package/dist/packages/runtime/wire-schemas.js +1 -1
- package/package.json +2 -8
- package/public-repo/CONTRIBUTING.md +10 -3
- package/public-repo/README.md +122 -226
- package/public-repo/build-plans/interf-default/README.md +15 -12
- package/public-repo/build-plans/interf-default/build/stages/entrypoint/SKILL.md +74 -0
- package/public-repo/build-plans/interf-default/build/stages/knowledge/SKILL.md +95 -0
- package/public-repo/build-plans/interf-default/build/stages/summarize/SKILL.md +38 -5
- package/public-repo/build-plans/interf-default/build-plan.json +27 -23
- package/public-repo/build-plans/interf-default/build-plan.schema.json +24 -20
- package/public-repo/build-plans/interf-default/use/query/SKILL.md +8 -7
- package/public-repo/openapi/local-service.openapi.json +11637 -4213
- package/public-repo/skills/interf/SKILL.md +174 -134
- package/dist/packages/runtime/build/runtime-paths.d.ts +0 -8
- package/dist/packages/runtime/build/runtime-paths.js +0 -26
- package/dist/packages/runtime/build/state-paths.d.ts +0 -7
- package/dist/packages/runtime/build/state-paths.js +0 -22
- package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +0 -34
- package/public-repo/build-plans/interf-default/build/stages/structure/SKILL.md +0 -28
|
@@ -13,6 +13,12 @@ export declare const CONTEXT_GRAPH_RUNTIME_SOURCE_FILES_FILE = "source-files.jso
|
|
|
13
13
|
export declare const CONTEXT_GRAPH_RUNTIME_SOURCE_STATE_FILE = "source-state.json";
|
|
14
14
|
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_INPUTS_DIR = "stages";
|
|
15
15
|
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_INPUTS_FILE = "inputs.json";
|
|
16
|
+
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_EXPECTED_INPUTS_FILE = "expected-inputs.json";
|
|
17
|
+
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_REVIEWED_INPUTS_FILE = "reviewed-inputs.json";
|
|
18
|
+
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_MANIFEST_FILE = "manifest.json";
|
|
19
|
+
export declare const CONTEXT_GRAPH_RUNTIME_GRAPH_MANIFEST_FILE = "graph-manifest.json";
|
|
20
|
+
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_SESSIONS_DIR = "stage-sessions";
|
|
21
|
+
export declare const CONTEXT_GRAPH_RUNTIME_STAGE_SESSION_FILE = "session.json";
|
|
16
22
|
export declare const CONTEXT_GRAPH_RUNTIME_INVENTORY_FILE = "inventory.json";
|
|
17
23
|
export declare const CONTEXT_GRAPH_RUNTIME_RUN_FILE = "run.json";
|
|
18
24
|
export declare const CONTEXT_GRAPH_RUNTIME_RUN_HISTORY_FILE = "run-history.jsonl";
|
|
@@ -25,6 +31,9 @@ export declare function buildPlanPackagePathForContextGraph(contextGraphPath: st
|
|
|
25
31
|
export declare function testRootForContextGraph(contextGraphPath: string): string;
|
|
26
32
|
export declare function testTargetsRootForContextGraph(contextGraphPath: string): string;
|
|
27
33
|
export declare function stageExecutionShellsRoot(contextGraphPath: string): string;
|
|
34
|
+
export declare function contextGraphRuntimeStageSessionsRoot(contextGraphPath: string): string;
|
|
35
|
+
export declare function contextGraphRuntimeStageSessionRoot(contextGraphPath: string, stageId: string, stageRunId: string): string;
|
|
36
|
+
export declare function contextGraphRuntimeStageSessionPath(contextGraphPath: string, stageId: string, stageRunId: string): string;
|
|
28
37
|
export declare function buildPlanImprovementLoopsRoot(contextGraphPath: string): string;
|
|
29
38
|
export declare function buildPlanImprovementRunRoot(contextGraphPath: string, runId: string): string;
|
|
30
39
|
export declare function buildPlanImprovementLoopRoot(contextGraphPath: string, runId: string, loopIndex: number): string;
|
|
@@ -43,6 +52,10 @@ export declare function contextGraphRuntimeSourceStatePath(contextGraphPath: str
|
|
|
43
52
|
export declare function contextGraphRuntimeStagesRoot(contextGraphPath: string): string;
|
|
44
53
|
export declare function contextGraphRuntimeStageRoot(contextGraphPath: string, stageId: string): string;
|
|
45
54
|
export declare function contextGraphRuntimeStageInputsPath(contextGraphPath: string, stageId: string): string;
|
|
55
|
+
export declare function contextGraphRuntimeStageExpectedInputsPath(contextGraphPath: string, stageId: string): string;
|
|
56
|
+
export declare function contextGraphRuntimeStageReviewedInputsPath(contextGraphPath: string, stageId: string): string;
|
|
57
|
+
export declare function contextGraphRuntimeStageManifestPath(contextGraphPath: string, stageId: string): string;
|
|
58
|
+
export declare function contextGraphRuntimeGraphManifestPath(contextGraphPath: string): string;
|
|
46
59
|
export declare function contextGraphExecutionInventoryPath(contextGraphPath: string): string;
|
|
47
60
|
export declare function contextGraphExecutionStageLedgerPath(contextGraphPath: string): string;
|
|
48
61
|
export declare function contextGraphExecutionStageLedgerHistoryPath(contextGraphPath: string): string;
|
|
@@ -15,6 +15,12 @@ export const CONTEXT_GRAPH_RUNTIME_SOURCE_FILES_FILE = "source-files.json";
|
|
|
15
15
|
export const CONTEXT_GRAPH_RUNTIME_SOURCE_STATE_FILE = "source-state.json";
|
|
16
16
|
export const CONTEXT_GRAPH_RUNTIME_STAGE_INPUTS_DIR = "stages";
|
|
17
17
|
export const CONTEXT_GRAPH_RUNTIME_STAGE_INPUTS_FILE = "inputs.json";
|
|
18
|
+
export const CONTEXT_GRAPH_RUNTIME_STAGE_EXPECTED_INPUTS_FILE = "expected-inputs.json";
|
|
19
|
+
export const CONTEXT_GRAPH_RUNTIME_STAGE_REVIEWED_INPUTS_FILE = "reviewed-inputs.json";
|
|
20
|
+
export const CONTEXT_GRAPH_RUNTIME_STAGE_MANIFEST_FILE = "manifest.json";
|
|
21
|
+
export const CONTEXT_GRAPH_RUNTIME_GRAPH_MANIFEST_FILE = "graph-manifest.json";
|
|
22
|
+
export const CONTEXT_GRAPH_RUNTIME_STAGE_SESSIONS_DIR = "stage-sessions";
|
|
23
|
+
export const CONTEXT_GRAPH_RUNTIME_STAGE_SESSION_FILE = "session.json";
|
|
18
24
|
export const CONTEXT_GRAPH_RUNTIME_INVENTORY_FILE = "inventory.json";
|
|
19
25
|
export const CONTEXT_GRAPH_RUNTIME_RUN_FILE = "run.json";
|
|
20
26
|
export const CONTEXT_GRAPH_RUNTIME_RUN_HISTORY_FILE = "run-history.jsonl";
|
|
@@ -43,6 +49,15 @@ export function testTargetsRootForContextGraph(contextGraphPath) {
|
|
|
43
49
|
export function stageExecutionShellsRoot(contextGraphPath) {
|
|
44
50
|
return join(contextGraphRuntimeRoot(contextGraphPath), "execution-shells");
|
|
45
51
|
}
|
|
52
|
+
export function contextGraphRuntimeStageSessionsRoot(contextGraphPath) {
|
|
53
|
+
return join(contextGraphRuntimeRoot(contextGraphPath), CONTEXT_GRAPH_RUNTIME_STAGE_SESSIONS_DIR);
|
|
54
|
+
}
|
|
55
|
+
export function contextGraphRuntimeStageSessionRoot(contextGraphPath, stageId, stageRunId) {
|
|
56
|
+
return join(contextGraphRuntimeStageSessionsRoot(contextGraphPath), stageId, stageRunId);
|
|
57
|
+
}
|
|
58
|
+
export function contextGraphRuntimeStageSessionPath(contextGraphPath, stageId, stageRunId) {
|
|
59
|
+
return join(contextGraphRuntimeStageSessionRoot(contextGraphPath, stageId, stageRunId), CONTEXT_GRAPH_RUNTIME_STAGE_SESSION_FILE);
|
|
60
|
+
}
|
|
46
61
|
export function buildPlanImprovementLoopsRoot(contextGraphPath) {
|
|
47
62
|
return join(contextGraphRuntimeRoot(contextGraphPath), "improvement-loops");
|
|
48
63
|
}
|
|
@@ -97,6 +112,18 @@ export function contextGraphRuntimeStageRoot(contextGraphPath, stageId) {
|
|
|
97
112
|
export function contextGraphRuntimeStageInputsPath(contextGraphPath, stageId) {
|
|
98
113
|
return join(contextGraphRuntimeStageRoot(contextGraphPath, stageId), CONTEXT_GRAPH_RUNTIME_STAGE_INPUTS_FILE);
|
|
99
114
|
}
|
|
115
|
+
export function contextGraphRuntimeStageExpectedInputsPath(contextGraphPath, stageId) {
|
|
116
|
+
return join(contextGraphRuntimeStageRoot(contextGraphPath, stageId), CONTEXT_GRAPH_RUNTIME_STAGE_EXPECTED_INPUTS_FILE);
|
|
117
|
+
}
|
|
118
|
+
export function contextGraphRuntimeStageReviewedInputsPath(contextGraphPath, stageId) {
|
|
119
|
+
return join(contextGraphRuntimeStageRoot(contextGraphPath, stageId), CONTEXT_GRAPH_RUNTIME_STAGE_REVIEWED_INPUTS_FILE);
|
|
120
|
+
}
|
|
121
|
+
export function contextGraphRuntimeStageManifestPath(contextGraphPath, stageId) {
|
|
122
|
+
return join(contextGraphRuntimeStageRoot(contextGraphPath, stageId), CONTEXT_GRAPH_RUNTIME_STAGE_MANIFEST_FILE);
|
|
123
|
+
}
|
|
124
|
+
export function contextGraphRuntimeGraphManifestPath(contextGraphPath) {
|
|
125
|
+
return contextGraphRuntimeFilePath(contextGraphPath, CONTEXT_GRAPH_RUNTIME_GRAPH_MANIFEST_FILE);
|
|
126
|
+
}
|
|
100
127
|
export function contextGraphExecutionInventoryPath(contextGraphPath) {
|
|
101
128
|
return contextGraphRuntimeFilePath(contextGraphPath, CONTEXT_GRAPH_RUNTIME_INVENTORY_FILE);
|
|
102
129
|
}
|
|
@@ -6,7 +6,7 @@ export * as buildEvidence from "./build-evidence.js";
|
|
|
6
6
|
export * as runtime from "./runtime.js";
|
|
7
7
|
export * as runtimeContracts from "./runtime-contracts.js";
|
|
8
8
|
export * as runtimeInventory from "./runtime-inventory.js";
|
|
9
|
-
export * as
|
|
9
|
+
export * as runtimeLogPaths from "./runtime-log-paths.js";
|
|
10
10
|
export * as runtimePrompt from "./runtime-prompt.js";
|
|
11
11
|
export * as runtimeReconcile from "./runtime-reconcile.js";
|
|
12
12
|
export * as runtimeRuns from "./runtime-runs.js";
|
|
@@ -18,8 +18,8 @@ export * as state from "./state.js";
|
|
|
18
18
|
export * as stateArtifacts from "./state-artifacts.js";
|
|
19
19
|
export * as stateHealth from "./state-health.js";
|
|
20
20
|
export * as stateIo from "./state-io.js";
|
|
21
|
-
export * as statePaths from "./state-paths.js";
|
|
22
21
|
export * as stateView from "./state-view.js";
|
|
22
|
+
export * as summaryCoverageIndex from "./summary-coverage-index.js";
|
|
23
23
|
export * as validate from "./validate.js";
|
|
24
24
|
export * as validateContextGraphSetup from "./validate-context-graph.js";
|
|
25
25
|
export * as buildPlanRuns from "./build-plan-runs.js";
|
|
@@ -6,7 +6,7 @@ export * as buildEvidence from "./build-evidence.js";
|
|
|
6
6
|
export * as runtime from "./runtime.js";
|
|
7
7
|
export * as runtimeContracts from "./runtime-contracts.js";
|
|
8
8
|
export * as runtimeInventory from "./runtime-inventory.js";
|
|
9
|
-
export * as
|
|
9
|
+
export * as runtimeLogPaths from "./runtime-log-paths.js";
|
|
10
10
|
export * as runtimePrompt from "./runtime-prompt.js";
|
|
11
11
|
export * as runtimeReconcile from "./runtime-reconcile.js";
|
|
12
12
|
export * as runtimeRuns from "./runtime-runs.js";
|
|
@@ -18,8 +18,8 @@ export * as state from "./state.js";
|
|
|
18
18
|
export * as stateArtifacts from "./state-artifacts.js";
|
|
19
19
|
export * as stateHealth from "./state-health.js";
|
|
20
20
|
export * as stateIo from "./state-io.js";
|
|
21
|
-
export * as statePaths from "./state-paths.js";
|
|
22
21
|
export * as stateView from "./state-view.js";
|
|
22
|
+
export * as summaryCoverageIndex from "./summary-coverage-index.js";
|
|
23
23
|
export * as validate from "./validate.js";
|
|
24
24
|
export * as validateContextGraphSetup from "./validate-context-graph.js";
|
|
25
25
|
export * as buildPlanRuns from "./build-plan-runs.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const CONTEXT_GRAPH_INSPECT_MAP_FILE = "INSPECT.md";
|
|
2
|
+
/**
|
|
3
|
+
* Render `<graph>/.interf/INSPECT.md` from already-recorded build state.
|
|
4
|
+
*
|
|
5
|
+
* Reads the GraphManifest, the stage execution sessions, and the Project's
|
|
6
|
+
* plan-draft/improve job runs; writes a pointer map. Returns the absolute path
|
|
7
|
+
* written, or null when there is nothing to map / a read failed. Best-effort:
|
|
8
|
+
* callers in the build success path must not let a failure here fail the build.
|
|
9
|
+
*/
|
|
10
|
+
export declare function writeContextGraphInspectMap(contextGraphPath: string): string | null;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* INSPECT.md — the DEVELOPER/agent map of a built project folder.
|
|
3
|
+
*
|
|
4
|
+
* `home.md` is the entrypoint for an agent doing the PROJECT TASK (read the
|
|
5
|
+
* prepared context). INSPECT.md is the entrypoint for a developer or coding
|
|
6
|
+
* agent doing DEVELOPMENT on the build itself: it points at how every agent job
|
|
7
|
+
* ran so a bad stage SKILL can be debugged and self-improved. This is engine
|
|
8
|
+
* policy rule 6 ("THE FOLDER IS LEGIBLE") made concrete: open the folder cold,
|
|
9
|
+
* read one file, and reach every job's prompt / reasoning / output / verdict.
|
|
10
|
+
*
|
|
11
|
+
* It is a POINTER MAP, not a new data model. It RECOMPUTES NOTHING and persists
|
|
12
|
+
* no new state: it reads what the build already recorded —
|
|
13
|
+
* - the GraphManifest (intent, Build Plan, readiness, primary metrics)
|
|
14
|
+
* via `loadGraphManifest`,
|
|
15
|
+
* - the per-attempt stage execution sessions (the graph-scoped record model)
|
|
16
|
+
* via `listStageExecutionSessions`, grouped by `build_run_id`,
|
|
17
|
+
* - the graph-less plan-draft / plan-improve job runs (the LocalJobRun record
|
|
18
|
+
* model) read through their owning Zod schema from the Project job store —
|
|
19
|
+
* and renders their already-recorded paths. Every record it reads is parsed by
|
|
20
|
+
* its owner; this module adds no schema. Pointers stay relative to the graph
|
|
21
|
+
* root (so the map travels with the folder); the plan-job shells live under the
|
|
22
|
+
* Project, so those pointers are rendered relative to the Project data dir.
|
|
23
|
+
*
|
|
24
|
+
* Written best-effort at the end of a successful build (beside the GraphManifest
|
|
25
|
+
* write). A failure to render the map must never fail a build.
|
|
26
|
+
*/
|
|
27
|
+
import { existsSync, readFileSync, readdirSync, } from "node:fs";
|
|
28
|
+
import { join, relative } from "node:path";
|
|
29
|
+
import { writeFileAtomic } from "./atomic-fs.js";
|
|
30
|
+
import { contextGraphInterfRoot, resolveSourceControlPathForContextGraph, } from "./context-graph-paths.js";
|
|
31
|
+
import { loadGraphManifest, } from "./stage-manifest.js";
|
|
32
|
+
import { listStageExecutionSessions, } from "./stage-session.js";
|
|
33
|
+
import { LocalJobRunResourceSchema, } from "../schemas/jobs.js";
|
|
34
|
+
import { projectServiceJobsRoot, asProjectDataDir, } from "../../contracts/lib/project-paths.js";
|
|
35
|
+
export const CONTEXT_GRAPH_INSPECT_MAP_FILE = "INSPECT.md";
|
|
36
|
+
/**
|
|
37
|
+
* The graph-less LocalJobRun types whose preserved shells this map points at:
|
|
38
|
+
* plan-authoring (draft/improve) and benchmark-question drafting. Each freezes a
|
|
39
|
+
* preserved shell (prompt / reasoning / verdict) and records a `shell_path` in
|
|
40
|
+
* its result, so the map can point a developer at how that job ran.
|
|
41
|
+
*/
|
|
42
|
+
const PLAN_JOB_TYPES = new Set([
|
|
43
|
+
"build-plan-draft",
|
|
44
|
+
"build-plan-improvement",
|
|
45
|
+
"benchmark-question-draft",
|
|
46
|
+
]);
|
|
47
|
+
function inspectMapPath(contextGraphPath) {
|
|
48
|
+
return join(contextGraphInterfRoot(contextGraphPath), CONTEXT_GRAPH_INSPECT_MAP_FILE);
|
|
49
|
+
}
|
|
50
|
+
/** Context-relative, forward-slashed pointer for a path under the graph root. */
|
|
51
|
+
function graphRel(contextGraphPath, target) {
|
|
52
|
+
if (!target)
|
|
53
|
+
return null;
|
|
54
|
+
const rel = relative(contextGraphPath, target);
|
|
55
|
+
return rel ? rel.replaceAll("\\", "/") : ".";
|
|
56
|
+
}
|
|
57
|
+
/** A session pointer is already stored context-relative; just normalize null. */
|
|
58
|
+
function sessionPointer(value) {
|
|
59
|
+
return value && value.length > 0 ? value : null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The output location an attempt wrote. A stage session records its write mounts
|
|
63
|
+
* (artifact id -> path under the graph); we point at those so a reviewer lands on
|
|
64
|
+
* what the attempt produced. Falls back to the shell root when no write mount was
|
|
65
|
+
* recorded (e.g. the native entrypoint). Never recomputed — read from the record.
|
|
66
|
+
*/
|
|
67
|
+
function sessionOutputPointer(session) {
|
|
68
|
+
const firstWrite = session.artifacts.writes[0];
|
|
69
|
+
if (firstWrite?.artifact_path)
|
|
70
|
+
return firstWrite.artifact_path;
|
|
71
|
+
return sessionPointer(session.shell.root_path);
|
|
72
|
+
}
|
|
73
|
+
function metricLine(metric) {
|
|
74
|
+
const total = typeof metric.total === "number" ? `/${metric.total}` : "";
|
|
75
|
+
const unit = metric.unit ? ` ${metric.unit}` : "";
|
|
76
|
+
return `${metric.label}: ${metric.value}${total}${unit}`;
|
|
77
|
+
}
|
|
78
|
+
/** Read the graph-less plan-draft / plan-improve job runs for this graph's Project. */
|
|
79
|
+
function readPlanJobRuns(contextGraphPath) {
|
|
80
|
+
let projectDataDir;
|
|
81
|
+
try {
|
|
82
|
+
projectDataDir = resolveSourceControlPathForContextGraph(contextGraphPath);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return { projectDataDir: contextGraphPath, runs: [] };
|
|
86
|
+
}
|
|
87
|
+
const jobsRoot = projectServiceJobsRoot(asProjectDataDir(projectDataDir));
|
|
88
|
+
if (!existsSync(jobsRoot))
|
|
89
|
+
return { projectDataDir, runs: [] };
|
|
90
|
+
const runs = [];
|
|
91
|
+
for (const entry of readdirSync(jobsRoot)) {
|
|
92
|
+
if (!entry.endsWith(".json"))
|
|
93
|
+
continue;
|
|
94
|
+
try {
|
|
95
|
+
const parsed = LocalJobRunResourceSchema.safeParse(JSON.parse(readFileSync(join(jobsRoot, entry), "utf8")));
|
|
96
|
+
if (parsed.success && PLAN_JOB_TYPES.has(parsed.data.job_type))
|
|
97
|
+
runs.push(parsed.data);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// A malformed job record is skipped, not fatal — the map is best-effort.
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
runs.sort((left, right) => Date.parse(left.created_at) - Date.parse(right.created_at));
|
|
104
|
+
return { projectDataDir, runs };
|
|
105
|
+
}
|
|
106
|
+
/** One bullet pointing at a plan-authoring job's preserved shell + verdict. */
|
|
107
|
+
function renderPlanJobLines(projectDataDir, run) {
|
|
108
|
+
const result = (run.result ?? {});
|
|
109
|
+
const shellPath = typeof result.shell_path === "string" ? result.shell_path : null;
|
|
110
|
+
const shellRel = shellPath ? graphRel(projectDataDir, shellPath) : null;
|
|
111
|
+
const lines = [
|
|
112
|
+
`- ${run.job_type} \`${run.run_id}\` — ${run.status}: ${run.title}`,
|
|
113
|
+
];
|
|
114
|
+
if (shellRel) {
|
|
115
|
+
lines.push(` - preserved shell (prompt / reasoning / output / verdict): \`${shellRel}\``);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
lines.push(" - preserved shell: not recorded for this job");
|
|
119
|
+
}
|
|
120
|
+
return lines;
|
|
121
|
+
}
|
|
122
|
+
/** Per-stage attempt pointer block under a Build run heading. */
|
|
123
|
+
function renderStageSessionLines(session) {
|
|
124
|
+
const stage = session.stage_label ?? session.stage_id ?? session.job_type;
|
|
125
|
+
const model = session.executor.model ? ` · model ${session.executor.model}` : "";
|
|
126
|
+
const verdict = session.summary ?? session.error ?? "(no summary recorded)";
|
|
127
|
+
const lines = [
|
|
128
|
+
`- ${stage} \`${session.stage_run_id}\` — ${session.status} (attempt ${session.attempt})${model}`,
|
|
129
|
+
` - verdict: ${verdict}`,
|
|
130
|
+
];
|
|
131
|
+
// The shell and every pointer rooted under it (prompt / reasoning / status log,
|
|
132
|
+
// and the output fallback to the shell root) only resolve while the shell is on
|
|
133
|
+
// disk. `replay_ready` IS that fact: true when the preserved shell exists,
|
|
134
|
+
// flipped false by reconcilePrunedStageExecutionSessions once retention pruned
|
|
135
|
+
// it. So a non-replay-ready session must print NO shell-rooted path (it would
|
|
136
|
+
// dangle); it prints the recorded retention reason instead. The map stays a
|
|
137
|
+
// pointer map whose pointers resolve (policy rule 6).
|
|
138
|
+
const shellRoot = sessionPointer(session.shell.root_path);
|
|
139
|
+
if (session.shell.replay_ready && shellRoot && shellRoot !== ".") {
|
|
140
|
+
lines.push(` - preserved shell (replay-ready): \`${shellRoot}\``);
|
|
141
|
+
const prompt = sessionPointer(session.logs.prompt_path);
|
|
142
|
+
if (prompt)
|
|
143
|
+
lines.push(` - prompt: \`${prompt}\``);
|
|
144
|
+
const reasoning = sessionPointer(session.runtime_files.reasoning_path);
|
|
145
|
+
if (reasoning)
|
|
146
|
+
lines.push(` - reasoning: \`${reasoning}\``);
|
|
147
|
+
const status = sessionPointer(session.logs.status_path);
|
|
148
|
+
if (status)
|
|
149
|
+
lines.push(` - status log: \`${status}\``);
|
|
150
|
+
}
|
|
151
|
+
else if (session.shell.retention_reason) {
|
|
152
|
+
lines.push(` - preserved shell: not retained — ${session.shell.retention_reason}`);
|
|
153
|
+
}
|
|
154
|
+
// The output is the build artifact the attempt wrote (under the graph, not the
|
|
155
|
+
// shell), so it survives a shell prune and is rendered regardless. It only
|
|
156
|
+
// falls back to the shell root when no artifact write was recorded; suppress
|
|
157
|
+
// that fallback when the shell is gone so it never dangles.
|
|
158
|
+
const output = sessionOutputPointer(session);
|
|
159
|
+
const outputIsShellFallback = output !== null && output === shellRoot;
|
|
160
|
+
if (output && !(outputIsShellFallback && !session.shell.replay_ready)) {
|
|
161
|
+
lines.push(` - output: \`${output}\``);
|
|
162
|
+
}
|
|
163
|
+
return lines;
|
|
164
|
+
}
|
|
165
|
+
/** Group stage sessions by their Build run id, preserving first-seen order. */
|
|
166
|
+
function groupSessionsByRun(sessions) {
|
|
167
|
+
const byRun = new Map();
|
|
168
|
+
for (const session of sessions) {
|
|
169
|
+
const key = session.build_run_id ?? "(no build run id)";
|
|
170
|
+
const bucket = byRun.get(key);
|
|
171
|
+
if (bucket)
|
|
172
|
+
bucket.push(session);
|
|
173
|
+
else
|
|
174
|
+
byRun.set(key, [session]);
|
|
175
|
+
}
|
|
176
|
+
return byRun;
|
|
177
|
+
}
|
|
178
|
+
function renderInspectMap(options) {
|
|
179
|
+
const { contextGraphPath, manifest, sessions, projectDataDir, planRuns } = options;
|
|
180
|
+
const intent = manifest?.intent ?? "(no Project intent recorded)";
|
|
181
|
+
const buildPlan = manifest?.build_plan ?? "(unknown Build Plan)";
|
|
182
|
+
const projectId = manifest?.project ?? "(unknown Project)";
|
|
183
|
+
const readiness = manifest?.readiness;
|
|
184
|
+
const lines = [
|
|
185
|
+
"# INSPECT — how this project folder was built",
|
|
186
|
+
"",
|
|
187
|
+
"Developer/agent map of this built project. `home.md` is the entrypoint for",
|
|
188
|
+
"doing the project TASK (the prepared context). This file is the entrypoint",
|
|
189
|
+
"for DEVELOPMENT: every agent job's preserved shell — prompt, reasoning,",
|
|
190
|
+
"output, verdict — so a coding agent can debug a bad stage SKILL and",
|
|
191
|
+
"self-improve. All paths are relative to this Context Graph folder unless",
|
|
192
|
+
"noted. Nothing here is recomputed; it points at what the build recorded.",
|
|
193
|
+
"",
|
|
194
|
+
"## Project",
|
|
195
|
+
"",
|
|
196
|
+
`- Project: \`${projectId}\``,
|
|
197
|
+
`- Intent: ${intent}`,
|
|
198
|
+
`- Build Plan: \`${buildPlan}\``,
|
|
199
|
+
];
|
|
200
|
+
if (readiness) {
|
|
201
|
+
lines.push(`- Readiness: ${readiness.status} — ${readiness.summary}`);
|
|
202
|
+
}
|
|
203
|
+
const primaryMetrics = (manifest?.primary_metrics ?? []).filter((metric) => metric.primary);
|
|
204
|
+
const metricsToShow = primaryMetrics.length > 0 ? primaryMetrics : (manifest?.primary_metrics ?? []);
|
|
205
|
+
if (metricsToShow.length > 0) {
|
|
206
|
+
lines.push("- Primary metrics:");
|
|
207
|
+
for (const metric of metricsToShow)
|
|
208
|
+
lines.push(` - ${metricLine(metric)}`);
|
|
209
|
+
}
|
|
210
|
+
lines.push("", "## How the Build Plan was built", "");
|
|
211
|
+
if (planRuns.length > 0) {
|
|
212
|
+
lines.push("Plan-authoring jobs for this Project (paths relative to the Project data dir):", "");
|
|
213
|
+
for (const run of planRuns) {
|
|
214
|
+
for (const line of renderPlanJobLines(projectDataDir, run))
|
|
215
|
+
lines.push(line);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
lines.push("- No plan-draft or plan-improve job was recorded for this Project (e.g. a built-in Build Plan was selected directly).");
|
|
220
|
+
}
|
|
221
|
+
lines.push("", "## Build runs", "");
|
|
222
|
+
if (sessions.length === 0) {
|
|
223
|
+
lines.push("- No stage execution sessions were recorded for this Context Graph.");
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
const byRun = groupSessionsByRun(sessions);
|
|
227
|
+
for (const [runId, runSessions] of byRun) {
|
|
228
|
+
lines.push(`### Build run \`${runId}\``, "");
|
|
229
|
+
for (const session of runSessions) {
|
|
230
|
+
for (const line of renderStageSessionLines(session))
|
|
231
|
+
lines.push(line);
|
|
232
|
+
}
|
|
233
|
+
lines.push("");
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// One trailing pointer back to the agent-task entrypoint so a reader who opened
|
|
237
|
+
// INSPECT.md first still finds home.md.
|
|
238
|
+
if (existsSync(join(contextGraphPath, "home.md"))) {
|
|
239
|
+
lines.push("---", "", "Agent task entrypoint: `home.md`.", "");
|
|
240
|
+
}
|
|
241
|
+
return `${lines.join("\n").replace(/\n{3,}$/, "\n")}\n`;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Render `<graph>/.interf/INSPECT.md` from already-recorded build state.
|
|
245
|
+
*
|
|
246
|
+
* Reads the GraphManifest, the stage execution sessions, and the Project's
|
|
247
|
+
* plan-draft/improve job runs; writes a pointer map. Returns the absolute path
|
|
248
|
+
* written, or null when there is nothing to map / a read failed. Best-effort:
|
|
249
|
+
* callers in the build success path must not let a failure here fail the build.
|
|
250
|
+
*/
|
|
251
|
+
export function writeContextGraphInspectMap(contextGraphPath) {
|
|
252
|
+
try {
|
|
253
|
+
const manifest = loadGraphManifest(contextGraphPath);
|
|
254
|
+
const sessions = listStageExecutionSessions(contextGraphPath);
|
|
255
|
+
const { projectDataDir, runs: planRuns } = readPlanJobRuns(contextGraphPath);
|
|
256
|
+
const content = renderInspectMap({
|
|
257
|
+
contextGraphPath,
|
|
258
|
+
manifest,
|
|
259
|
+
sessions,
|
|
260
|
+
projectDataDir,
|
|
261
|
+
planRuns,
|
|
262
|
+
});
|
|
263
|
+
const path = inspectMapPath(contextGraphPath);
|
|
264
|
+
writeFileAtomic(path, content);
|
|
265
|
+
return path;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
}
|