@jstn-sdk/ma 0.1.12 → 0.1.13
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/.agents/plugins/marketplace.json +0 -0
- package/.codex/agents/Architect.toml +0 -2
- package/.codex/agents/Auditor.toml +0 -2
- package/.codex/agents/Builder.toml +0 -2
- package/.codex/agents/Flow.toml +0 -2
- package/.codex/agents/Sage.toml +0 -2
- package/.codex/agents/Vibe.toml +0 -2
- package/.codex/hooks.json +14 -13
- package/.codex/prompts/enforcement.md +4 -0
- package/.codex/prompts/skill-contract.md +4 -0
- package/COVERAGE.md +211 -0
- package/DEMO.md +265 -0
- package/README.md +159 -16
- package/bin/ma.js +219 -14
- package/data/clone-data.ledger.json +41 -0
- package/data/clone-data.proof.json +50 -0
- package/data/clone-data.rvf +37 -0
- package/docs/README.md +4 -1
- package/docs/assets/image/Screenshot(1).png +0 -0
- package/docs/assets/image/Screenshot(2).png +0 -0
- package/docs/assets/image/Screenshot(3).png +0 -0
- package/docs/assets/image/Screenshot(4).png +0 -0
- package/docs/assets/image/Screenshot(5).png +0 -0
- package/docs/assets/image/Screenshot(6).png +0 -0
- package/docs/assets/image/Screenshot(7).png +0 -0
- package/docs/assets/image/Screenshot(8).png +0 -0
- package/docs/assets/image/Screenshot(9).png +0 -0
- package/docs/assets/meta-architect-logo.png +0 -0
- package/docs/assets/meta-architect-logo.svg +0 -0
- package/docs/getting-started.md +38 -22
- package/docs/installed-sdk.md +0 -0
- package/docs/mcp-setup.md +35 -0
- package/docs/onboarding.md +18 -2
- package/docs/prompt-guidance-contract.md +17 -0
- package/docs/prompt-guidance-fragments/active-autonomy-core.md +7 -0
- package/docs/qa/release-issue-gates-0.1.13.json +644 -0
- package/docs/qa/{release-readiness-0.1.12.md → release-readiness-0.1.13.md} +25 -9
- package/docs/qa/release-readiness-0.1.5.md +1 -1
- package/docs/reference/native-engineering-patterns.md +0 -0
- package/docs/reference/native-security-playbooks.md +6 -0
- package/docs/reference/native-source-selection.md +6 -0
- package/docs/reference/native-style-and-deslop.md +0 -0
- package/docs/release-spec.md +25 -9
- package/docs/skills.md +14 -1
- package/index.js +222 -2
- package/mcp/collections.json +23 -6
- package/mcp/local/code-intel.js +0 -0
- package/mcp/local/memory.js +0 -0
- package/mcp/local/playbooks.js +0 -0
- package/mcp/local/state.js +0 -0
- package/mcp/local/team-run.js +48 -1
- package/mcp/local/trace.js +0 -0
- package/mcp/local-capabilities.json +0 -0
- package/mcp/native-playbooks.json +0 -0
- package/mcp/servers.json +24 -0
- package/package.json +5 -2
- package/plugins/meta-architect/.app.json +1 -1
- package/plugins/meta-architect/.codex-plugin/plugin.json +1 -1
- package/plugins/meta-architect/.mcp.json +1 -1
- package/plugins/meta-architect/README.md +8 -1
- package/plugins/meta-architect/obsidian/main.js +401 -0
- package/plugins/meta-architect/obsidian/manifest.json +9 -0
- package/plugins/meta-architect/obsidian/styles.css +7 -0
- package/plugins/meta-architect/skills/align/SKILL.md +0 -0
- package/plugins/meta-architect/skills/align/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/align/references/shared-language.md +0 -0
- package/plugins/meta-architect/skills/arch/SKILL.md +2 -0
- package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/build/SKILL.md +3 -0
- package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/cleanup/SKILL.md +0 -0
- package/plugins/meta-architect/skills/cleanup/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/cleanup/references/style-and-deslop.md +0 -0
- package/plugins/meta-architect/skills/diagnose/SKILL.md +0 -0
- package/plugins/meta-architect/skills/diagnose/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/flow/SKILL.md +2 -0
- package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/maestro/SKILL.md +0 -0
- package/plugins/meta-architect/skills/maestro/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/maestro/references/core-release-rules.md +0 -0
- package/plugins/meta-architect/skills/maestro/references/native-ingest-map.md +0 -0
- package/plugins/meta-architect/skills/sage/SKILL.md +2 -0
- package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/sage/references/source-selection.md +8 -0
- package/plugins/meta-architect/skills/tdd/SKILL.md +0 -0
- package/plugins/meta-architect/skills/tdd/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/vet/SKILL.md +2 -0
- package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/vet/references/security-playbooks.md +7 -0
- package/plugins/meta-architect/skills/vibe/SKILL.md +2 -0
- package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -0
- package/scripts/active-autonomy-hook.mjs +96 -0
- package/scripts/biome-staged.js +0 -0
- package/scripts/build-linux-packages.mjs +0 -0
- package/scripts/doctor.js +17 -4
- package/scripts/install.sh +28 -0
- package/scripts/linux-package-lib.mjs +0 -0
- package/scripts/linux-package-smoke.mjs +0 -0
- package/scripts/plugin-sync.js +0 -0
- package/scripts/postinstall.js +0 -0
- package/scripts/ralph/prompt.md +35 -0
- package/scripts/release-metadata.js +0 -0
- package/scripts/release-sync.js +0 -0
- package/scripts/release-verify.js +166 -1
- package/scripts/setup-npmrc.js +0 -0
- package/skills/align/SKILL.md +0 -0
- package/skills/align/agents/openai.yaml +0 -0
- package/skills/align/references/shared-language.md +0 -0
- package/skills/arch/SKILL.md +2 -0
- package/skills/arch/agents/openai.yaml +0 -0
- package/skills/build/SKILL.md +3 -0
- package/skills/build/agents/openai.yaml +0 -0
- package/skills/cleanup/SKILL.md +0 -0
- package/skills/cleanup/agents/openai.yaml +0 -0
- package/skills/cleanup/references/style-and-deslop.md +0 -0
- package/skills/diagnose/SKILL.md +0 -0
- package/skills/diagnose/agents/openai.yaml +0 -0
- package/skills/flow/SKILL.md +2 -0
- package/skills/flow/agents/openai.yaml +0 -0
- package/skills/maestro/SKILL.md +0 -0
- package/skills/maestro/agents/openai.yaml +0 -0
- package/skills/maestro/references/core-release-rules.md +0 -0
- package/skills/maestro/references/native-ingest-map.md +0 -0
- package/skills/sage/SKILL.md +2 -0
- package/skills/sage/agents/openai.yaml +0 -0
- package/skills/sage/references/source-selection.md +8 -0
- package/skills/tdd/SKILL.md +0 -0
- package/skills/tdd/agents/openai.yaml +0 -0
- package/skills/vet/SKILL.md +2 -0
- package/skills/vet/agents/openai.yaml +0 -0
- package/skills/vet/references/security-playbooks.md +7 -0
- package/skills/vibe/SKILL.md +2 -0
- package/skills/vibe/agents/openai.yaml +0 -0
- package/src/bootstrap.js +17 -0
- package/src/build-gate.js +2 -2
- package/src/launcher.js +4 -0
- package/src/mcp-live-client.js +289 -3
- package/src/paths.js +4 -0
- package/src/policy.js +1 -1
- package/src/release-issue-gates.js +190 -0
- package/src/runtime/active-autonomy-core.js +208 -0
- package/src/runtime/alignment-sentinel.js +165 -0
- package/src/runtime/architect-review.js +88 -0
- package/src/runtime/build-readiness.js +28 -4
- package/src/runtime/code-graph-rehearse.js +113 -0
- package/src/runtime/context-economy-core.js +276 -0
- package/src/runtime/continuity-notes.js +0 -0
- package/src/runtime/core-source-ingest.js +379 -0
- package/src/runtime/detached-provider.js +74 -0
- package/src/runtime/environment-awareness-core.js +460 -0
- package/src/runtime/exposure-catalog.js +276 -0
- package/src/runtime/guidance-stack.js +0 -0
- package/src/runtime/helper-orchestration-core.js +307 -0
- package/src/runtime/learning-loop-core.js +238 -0
- package/src/runtime/maestro-events.js +18 -0
- package/src/runtime/maestro-manager.js +19 -0
- package/src/runtime/maestro-state.js +125 -0
- package/src/runtime/mcp-policy.js +192 -0
- package/src/runtime/obsidian-integration-core.js +851 -0
- package/src/runtime/obsidian-plugin-bridge.js +739 -0
- package/src/runtime/orchestrator.js +0 -0
- package/src/runtime/prompt-strategy-core.js +230 -0
- package/src/runtime/quorum-review.js +90 -0
- package/src/runtime/ralph-execution-core.js +217 -0
- package/src/runtime/redaction-gateway.js +174 -0
- package/src/runtime/runtime-state.js +843 -2
- package/src/runtime/semantic-recording-core.js +147 -0
- package/src/runtime/signal-hooks.js +15 -0
- package/src/runtime/skills-registry-export.js +670 -0
- package/src/runtime/startup-path.js +0 -0
- package/src/runtime/universal-plugin-broker-core.js +575 -0
- package/src/runtime/workspace-intelligence-runtime.js +674 -0
- package/src/runtime/workspace-virtualizer.js +102 -0
- package/src/runtime/workspaces.js +0 -0
- package/src/runtime-artifacts.js +225 -62
- package/src/skill-installer.js +0 -0
- package/src/skills.js +876 -84
|
@@ -2,30 +2,137 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { readJson, writeJson } from "../fs-utils.js";
|
|
5
|
-
import { getRuntimeReadPath } from "../paths.js";
|
|
5
|
+
import { getRepoRoot, getRuntimeReadPath } from "../paths.js";
|
|
6
|
+
import { summarizeReleaseIssueGateStatus } from "../release-issue-gates.js";
|
|
6
7
|
import { createDefaultReleaseState, validateReleaseState } from "../release-state.js";
|
|
8
|
+
import {
|
|
9
|
+
createDefaultActiveAutonomyCore,
|
|
10
|
+
getActiveAutonomyCorePath,
|
|
11
|
+
seedActiveAutonomyCoreArtifacts,
|
|
12
|
+
validateActiveAutonomyCore,
|
|
13
|
+
} from "./active-autonomy-core.js";
|
|
14
|
+
import { seedAlignmentSentinelArtifacts } from "./alignment-sentinel.js";
|
|
15
|
+
import { seedArchitectReviewArtifacts } from "./architect-review.js";
|
|
16
|
+
import {
|
|
17
|
+
createDefaultCodeGraphRehearse,
|
|
18
|
+
getCodeGraphRehearsePath,
|
|
19
|
+
seedCodeGraphRehearseArtifacts,
|
|
20
|
+
validateCodeGraphRehearse,
|
|
21
|
+
} from "./code-graph-rehearse.js";
|
|
22
|
+
import {
|
|
23
|
+
createDefaultContextEconomyCore,
|
|
24
|
+
getContextEconomyCorePath,
|
|
25
|
+
seedContextEconomyCoreArtifacts,
|
|
26
|
+
validateContextEconomyCore,
|
|
27
|
+
} from "./context-economy-core.js";
|
|
7
28
|
import {
|
|
8
29
|
getContinuityIndexPath,
|
|
9
30
|
getContinuityNotesPath,
|
|
10
31
|
seedContinuityArtifacts,
|
|
11
32
|
} from "./continuity-notes.js";
|
|
33
|
+
import {
|
|
34
|
+
createDefaultCoreSourceIngest,
|
|
35
|
+
getCoreSourceIngestPath,
|
|
36
|
+
seedCoreSourceIngestArtifacts,
|
|
37
|
+
validateCoreSourceIngest,
|
|
38
|
+
} from "./core-source-ingest.js";
|
|
39
|
+
import {
|
|
40
|
+
createDefaultEnvironmentAwarenessCore,
|
|
41
|
+
getEnvironmentAwarenessCorePath,
|
|
42
|
+
seedEnvironmentAwarenessCoreArtifacts,
|
|
43
|
+
validateEnvironmentAwarenessCore,
|
|
44
|
+
} from "./environment-awareness-core.js";
|
|
12
45
|
import {
|
|
13
46
|
getGuidanceIncludeGraphPath,
|
|
14
47
|
getMergedGuidancePath,
|
|
15
48
|
seedGuidanceStackArtifacts,
|
|
16
49
|
} from "./guidance-stack.js";
|
|
50
|
+
import {
|
|
51
|
+
createDefaultHelperOrchestrationCore,
|
|
52
|
+
getHelperOrchestrationCorePath,
|
|
53
|
+
seedHelperOrchestrationCoreArtifacts,
|
|
54
|
+
validateHelperOrchestrationCore,
|
|
55
|
+
} from "./helper-orchestration-core.js";
|
|
56
|
+
import {
|
|
57
|
+
createDefaultLearningLoopCore,
|
|
58
|
+
getLearningLoopCorePath,
|
|
59
|
+
seedLearningLoopCoreArtifacts,
|
|
60
|
+
validateLearningLoopCore,
|
|
61
|
+
} from "./learning-loop-core.js";
|
|
17
62
|
import { getManagerRunsPath, seedMaestroManagerArtifacts } from "./maestro-manager.js";
|
|
63
|
+
import {
|
|
64
|
+
createDefaultMaestroState,
|
|
65
|
+
getMaestroStatePath,
|
|
66
|
+
seedMaestroStateArtifacts,
|
|
67
|
+
} from "./maestro-state.js";
|
|
68
|
+
import {
|
|
69
|
+
createDefaultObsidianBridge,
|
|
70
|
+
createDefaultObsidianVaultIndex,
|
|
71
|
+
createDefaultObsidianVaultOperations,
|
|
72
|
+
getObsidianBridgePath,
|
|
73
|
+
getObsidianVaultIndexPath,
|
|
74
|
+
getObsidianVaultOperationsPath,
|
|
75
|
+
seedObsidianBridgeArtifacts,
|
|
76
|
+
validateObsidianBridge,
|
|
77
|
+
validateObsidianVaultIndex,
|
|
78
|
+
validateObsidianVaultOperations,
|
|
79
|
+
} from "./obsidian-integration-core.js";
|
|
18
80
|
import {
|
|
19
81
|
getTaskLockRoot,
|
|
20
82
|
getTaskMailboxRoot,
|
|
21
83
|
getTaskRegistryPath,
|
|
22
84
|
seedOrchestratorArtifacts,
|
|
23
85
|
} from "./orchestrator.js";
|
|
86
|
+
import {
|
|
87
|
+
createDefaultPromptStrategyCore,
|
|
88
|
+
getPromptStrategyCorePath,
|
|
89
|
+
seedPromptStrategyCoreArtifacts,
|
|
90
|
+
validatePromptStrategyCore,
|
|
91
|
+
} from "./prompt-strategy-core.js";
|
|
92
|
+
import {
|
|
93
|
+
createDefaultSemanticRecordingCore,
|
|
94
|
+
getSemanticRecordingCorePath,
|
|
95
|
+
seedSemanticRecordingCoreArtifacts,
|
|
96
|
+
validateSemanticRecordingCore,
|
|
97
|
+
} from "./semantic-recording-core.js";
|
|
24
98
|
import {
|
|
25
99
|
getRuntimeHooksAuditPath,
|
|
26
100
|
getRuntimeHooksConfigPath,
|
|
27
101
|
seedSignalHookArtifacts,
|
|
28
102
|
} from "./signal-hooks.js";
|
|
103
|
+
import {
|
|
104
|
+
createDefaultSkillsRegistryExport,
|
|
105
|
+
getSkillsRegistryExportPath,
|
|
106
|
+
seedSkillsRegistryExportArtifacts,
|
|
107
|
+
validateSkillsRegistryExport,
|
|
108
|
+
} from "./skills-registry-export.js";
|
|
109
|
+
import {
|
|
110
|
+
createDefaultUniversalPluginBrokerCore,
|
|
111
|
+
getUniversalPluginBrokerCorePath,
|
|
112
|
+
seedUniversalPluginBrokerCoreArtifacts,
|
|
113
|
+
validateUniversalPluginBrokerCore,
|
|
114
|
+
} from "./universal-plugin-broker-core.js";
|
|
115
|
+
import {
|
|
116
|
+
createDefaultCapabilityComposition,
|
|
117
|
+
createDefaultSemanticReceiptIndex,
|
|
118
|
+
createDefaultWorkspaceContextPack,
|
|
119
|
+
createDefaultWorkspaceEffectiveness,
|
|
120
|
+
getCapabilityCompositionPath,
|
|
121
|
+
getSemanticReceiptIndexPath,
|
|
122
|
+
getWorkspaceContextPackPath,
|
|
123
|
+
getWorkspaceEffectivenessPath,
|
|
124
|
+
seedWorkspaceIntelligenceArtifacts,
|
|
125
|
+
validateCapabilityComposition,
|
|
126
|
+
validateSemanticReceiptIndex,
|
|
127
|
+
validateWorkspaceContextPack,
|
|
128
|
+
validateWorkspaceEffectiveness,
|
|
129
|
+
} from "./workspace-intelligence-runtime.js";
|
|
130
|
+
import {
|
|
131
|
+
createDefaultWorkspaceVirtualizer,
|
|
132
|
+
getWorkspaceVirtualizerPath,
|
|
133
|
+
seedWorkspaceVirtualizerArtifacts,
|
|
134
|
+
validateWorkspaceVirtualizer,
|
|
135
|
+
} from "./workspace-virtualizer.js";
|
|
29
136
|
import { getWorkspacesIndexPath, seedWorkspaceArtifacts } from "./workspaces.js";
|
|
30
137
|
|
|
31
138
|
const runtimeSubsystemSeeders = [
|
|
@@ -35,6 +142,23 @@ const runtimeSubsystemSeeders = [
|
|
|
35
142
|
seedOrchestratorArtifacts,
|
|
36
143
|
seedWorkspaceArtifacts,
|
|
37
144
|
seedMaestroManagerArtifacts,
|
|
145
|
+
seedMaestroStateArtifacts,
|
|
146
|
+
seedArchitectReviewArtifacts,
|
|
147
|
+
seedAlignmentSentinelArtifacts,
|
|
148
|
+
seedSemanticRecordingCoreArtifacts,
|
|
149
|
+
seedHelperOrchestrationCoreArtifacts,
|
|
150
|
+
seedLearningLoopCoreArtifacts,
|
|
151
|
+
seedWorkspaceIntelligenceArtifacts,
|
|
152
|
+
seedPromptStrategyCoreArtifacts,
|
|
153
|
+
seedActiveAutonomyCoreArtifacts,
|
|
154
|
+
seedContextEconomyCoreArtifacts,
|
|
155
|
+
seedEnvironmentAwarenessCoreArtifacts,
|
|
156
|
+
seedCoreSourceIngestArtifacts,
|
|
157
|
+
seedUniversalPluginBrokerCoreArtifacts,
|
|
158
|
+
seedObsidianBridgeArtifacts,
|
|
159
|
+
seedWorkspaceVirtualizerArtifacts,
|
|
160
|
+
seedCodeGraphRehearseArtifacts,
|
|
161
|
+
seedSkillsRegistryExportArtifacts,
|
|
38
162
|
];
|
|
39
163
|
const defaultMergedGuidance = {
|
|
40
164
|
schemaVersion: "0.1.0",
|
|
@@ -65,6 +189,21 @@ const defaultHookConfig = {
|
|
|
65
189
|
"workspace_created",
|
|
66
190
|
],
|
|
67
191
|
hooks: [],
|
|
192
|
+
activeAutonomy: {
|
|
193
|
+
enabled: true,
|
|
194
|
+
stopPolicy: "block_passive_permission_handoff_when_auto_continue_applies",
|
|
195
|
+
defaultResponse:
|
|
196
|
+
"AUTO-CONTINUE: continue the current safe branch, execute the next reversible step, then verify before reporting.",
|
|
197
|
+
stallPatterns: [
|
|
198
|
+
"should i proceed",
|
|
199
|
+
"would you like me to continue",
|
|
200
|
+
"if you want, i can",
|
|
201
|
+
"if you'd like, i can",
|
|
202
|
+
"tell me if you want me to",
|
|
203
|
+
"i can continue if you want",
|
|
204
|
+
"let me know if you want me to continue",
|
|
205
|
+
],
|
|
206
|
+
},
|
|
68
207
|
};
|
|
69
208
|
const defaultTaskRegistry = {
|
|
70
209
|
schemaVersion: "0.1.0",
|
|
@@ -80,11 +219,77 @@ const defaultDecisions = {
|
|
|
80
219
|
schemaVersion: "0.1.0",
|
|
81
220
|
decisions: [],
|
|
82
221
|
};
|
|
222
|
+
const defaultAudits = {
|
|
223
|
+
schemaVersion: "0.1.0",
|
|
224
|
+
items: [],
|
|
225
|
+
};
|
|
226
|
+
const defaultCves = {
|
|
227
|
+
schemaVersion: "0.1.0",
|
|
228
|
+
items: [],
|
|
229
|
+
};
|
|
230
|
+
const defaultReleaseIssueGates = {
|
|
231
|
+
schemaVersion: "1.0.0",
|
|
232
|
+
releaseVersion: "0.0.0",
|
|
233
|
+
releaseTag: "v0.0.0",
|
|
234
|
+
passContract: {
|
|
235
|
+
allIssuesMustPassProduction: true,
|
|
236
|
+
allIssuesMustHaveLabels: true,
|
|
237
|
+
},
|
|
238
|
+
issues: [],
|
|
239
|
+
};
|
|
83
240
|
const defaultManagerRuns = {
|
|
84
241
|
schemaVersion: "0.1.0",
|
|
85
242
|
runs: [],
|
|
86
243
|
};
|
|
244
|
+
const defaultMaestroState = createDefaultMaestroState();
|
|
245
|
+
const defaultActiveAutonomyCore = createDefaultActiveAutonomyCore();
|
|
246
|
+
const defaultSemanticRecordingCore = createDefaultSemanticRecordingCore();
|
|
247
|
+
const defaultHelperOrchestrationCore = createDefaultHelperOrchestrationCore();
|
|
248
|
+
const defaultLearningLoopCore = createDefaultLearningLoopCore();
|
|
249
|
+
const defaultPromptStrategyCore = createDefaultPromptStrategyCore();
|
|
250
|
+
const defaultContextEconomyCore = createDefaultContextEconomyCore();
|
|
251
|
+
const defaultEnvironmentAwarenessCore = createDefaultEnvironmentAwarenessCore();
|
|
252
|
+
const defaultCoreSourceIngest = createDefaultCoreSourceIngest();
|
|
253
|
+
const defaultUniversalPluginBrokerCore = createDefaultUniversalPluginBrokerCore();
|
|
254
|
+
const defaultObsidianBridge = createDefaultObsidianBridge();
|
|
255
|
+
const defaultObsidianVaultIndex = createDefaultObsidianVaultIndex();
|
|
256
|
+
const defaultObsidianVaultOperations = createDefaultObsidianVaultOperations();
|
|
257
|
+
const defaultWorkspaceVirtualizer = createDefaultWorkspaceVirtualizer();
|
|
258
|
+
const defaultCodeGraphRehearse = createDefaultCodeGraphRehearse();
|
|
259
|
+
const defaultSkillsRegistryExport = createDefaultSkillsRegistryExport();
|
|
260
|
+
const defaultCapabilityComposition = createDefaultCapabilityComposition();
|
|
261
|
+
const defaultWorkspaceContextPack = createDefaultWorkspaceContextPack();
|
|
262
|
+
const defaultWorkspaceEffectiveness = createDefaultWorkspaceEffectiveness();
|
|
263
|
+
const defaultSemanticReceiptIndex = createDefaultSemanticReceiptIndex();
|
|
87
264
|
const terminalManagerStates = new Set(["completed", "blocked", "failed", "cancelled"]);
|
|
265
|
+
const repairableRuntimeArtifacts = new Set([
|
|
266
|
+
"guidance.merged",
|
|
267
|
+
"guidance.includeGraph",
|
|
268
|
+
"context.activeAutonomyCore",
|
|
269
|
+
"context.recordingCore",
|
|
270
|
+
"context.helperOrchestrationCore",
|
|
271
|
+
"context.learningLoopCore",
|
|
272
|
+
"context.promptStrategyCore",
|
|
273
|
+
"context.contextEconomyCore",
|
|
274
|
+
"context.environmentAwarenessCore",
|
|
275
|
+
"context.coreSourceIngest",
|
|
276
|
+
"context.universalPluginBrokerCore",
|
|
277
|
+
"context.obsidianBridge",
|
|
278
|
+
"context.obsidianVaultOperations",
|
|
279
|
+
"context.workspaceVirtualizer",
|
|
280
|
+
"context.codeGraphRehearse",
|
|
281
|
+
"context.skillsRegistryExport",
|
|
282
|
+
"context.capabilityComposition",
|
|
283
|
+
"context.workspaceContextPack",
|
|
284
|
+
"context.workspaceEffectiveness",
|
|
285
|
+
"evidence.semanticReceipts",
|
|
286
|
+
"memory.index",
|
|
287
|
+
"hooks.config",
|
|
288
|
+
"tasks.registry",
|
|
289
|
+
"workspaces.index",
|
|
290
|
+
"runtime.managerRuns",
|
|
291
|
+
"runtime.maestroState",
|
|
292
|
+
]);
|
|
88
293
|
|
|
89
294
|
function coerceValidated(value, fallback, label, predicate, invalidArtifacts) {
|
|
90
295
|
if (predicate(value)) {
|
|
@@ -224,7 +429,30 @@ export async function loadRuntimeSnapshot() {
|
|
|
224
429
|
workspaceIndex,
|
|
225
430
|
release,
|
|
226
431
|
decisions,
|
|
432
|
+
audits,
|
|
433
|
+
cves,
|
|
434
|
+
releaseIssueGates,
|
|
227
435
|
managerRuns,
|
|
436
|
+
maestroState,
|
|
437
|
+
activeAutonomyCore,
|
|
438
|
+
semanticRecordingCore,
|
|
439
|
+
helperOrchestrationCore,
|
|
440
|
+
learningLoopCore,
|
|
441
|
+
promptStrategyCore,
|
|
442
|
+
contextEconomyCore,
|
|
443
|
+
environmentAwarenessCore,
|
|
444
|
+
coreSourceIngest,
|
|
445
|
+
universalPluginBrokerCore,
|
|
446
|
+
obsidianBridge,
|
|
447
|
+
obsidianVaultIndex,
|
|
448
|
+
obsidianVaultOperations,
|
|
449
|
+
workspaceVirtualizer,
|
|
450
|
+
codeGraphRehearse,
|
|
451
|
+
skillsRegistryExport,
|
|
452
|
+
capabilityComposition,
|
|
453
|
+
workspaceContextPack,
|
|
454
|
+
workspaceEffectiveness,
|
|
455
|
+
semanticReceiptIndex,
|
|
228
456
|
] = await Promise.all([
|
|
229
457
|
readJsonWithStatus(getMergedGuidancePath(), defaultMergedGuidance, "guidance.merged"),
|
|
230
458
|
readJsonWithStatus(
|
|
@@ -253,7 +481,110 @@ export async function loadRuntimeSnapshot() {
|
|
|
253
481
|
}
|
|
254
482
|
})(),
|
|
255
483
|
readJsonWithStatus(getRuntimeReadPath("decisions.json"), defaultDecisions, "runtime.decisions"),
|
|
484
|
+
readJsonWithStatus(
|
|
485
|
+
getRuntimeReadPath("evidence", "audits.json"),
|
|
486
|
+
defaultAudits,
|
|
487
|
+
"runtime.audits",
|
|
488
|
+
),
|
|
489
|
+
readJsonWithStatus(getRuntimeReadPath("evidence", "cves.json"), defaultCves, "runtime.cves"),
|
|
490
|
+
readJsonWithStatus(
|
|
491
|
+
path.join(getRepoRoot(), "docs", "qa", "release-issue-gates-0.1.13.json"),
|
|
492
|
+
defaultReleaseIssueGates,
|
|
493
|
+
"release.issueGates",
|
|
494
|
+
),
|
|
256
495
|
readJsonWithStatus(getManagerRunsPath(), defaultManagerRuns, "runtime.managerRuns"),
|
|
496
|
+
readJsonWithStatus(getMaestroStatePath(), defaultMaestroState, "runtime.maestroState"),
|
|
497
|
+
readJsonWithStatus(
|
|
498
|
+
getActiveAutonomyCorePath(),
|
|
499
|
+
defaultActiveAutonomyCore,
|
|
500
|
+
"context.activeAutonomyCore",
|
|
501
|
+
),
|
|
502
|
+
readJsonWithStatus(
|
|
503
|
+
getSemanticRecordingCorePath(),
|
|
504
|
+
defaultSemanticRecordingCore,
|
|
505
|
+
"context.recordingCore",
|
|
506
|
+
),
|
|
507
|
+
readJsonWithStatus(
|
|
508
|
+
getHelperOrchestrationCorePath(),
|
|
509
|
+
defaultHelperOrchestrationCore,
|
|
510
|
+
"context.helperOrchestrationCore",
|
|
511
|
+
),
|
|
512
|
+
readJsonWithStatus(
|
|
513
|
+
getLearningLoopCorePath(),
|
|
514
|
+
defaultLearningLoopCore,
|
|
515
|
+
"context.learningLoopCore",
|
|
516
|
+
),
|
|
517
|
+
readJsonWithStatus(
|
|
518
|
+
getPromptStrategyCorePath(),
|
|
519
|
+
defaultPromptStrategyCore,
|
|
520
|
+
"context.promptStrategyCore",
|
|
521
|
+
),
|
|
522
|
+
readJsonWithStatus(
|
|
523
|
+
getContextEconomyCorePath(),
|
|
524
|
+
defaultContextEconomyCore,
|
|
525
|
+
"context.contextEconomyCore",
|
|
526
|
+
),
|
|
527
|
+
readJsonWithStatus(
|
|
528
|
+
getEnvironmentAwarenessCorePath(),
|
|
529
|
+
defaultEnvironmentAwarenessCore,
|
|
530
|
+
"context.environmentAwarenessCore",
|
|
531
|
+
),
|
|
532
|
+
readJsonWithStatus(
|
|
533
|
+
getCoreSourceIngestPath(),
|
|
534
|
+
defaultCoreSourceIngest,
|
|
535
|
+
"context.coreSourceIngest",
|
|
536
|
+
),
|
|
537
|
+
readJsonWithStatus(
|
|
538
|
+
getUniversalPluginBrokerCorePath(),
|
|
539
|
+
defaultUniversalPluginBrokerCore,
|
|
540
|
+
"context.universalPluginBrokerCore",
|
|
541
|
+
),
|
|
542
|
+
readJsonWithStatus(getObsidianBridgePath(), defaultObsidianBridge, "context.obsidianBridge"),
|
|
543
|
+
readJsonWithStatus(
|
|
544
|
+
getObsidianVaultIndexPath(),
|
|
545
|
+
defaultObsidianVaultIndex,
|
|
546
|
+
"context.obsidianVaultIndex",
|
|
547
|
+
),
|
|
548
|
+
readJsonWithStatus(
|
|
549
|
+
getObsidianVaultOperationsPath(),
|
|
550
|
+
defaultObsidianVaultOperations,
|
|
551
|
+
"context.obsidianVaultOperations",
|
|
552
|
+
),
|
|
553
|
+
readJsonWithStatus(
|
|
554
|
+
getWorkspaceVirtualizerPath(),
|
|
555
|
+
defaultWorkspaceVirtualizer,
|
|
556
|
+
"context.workspaceVirtualizer",
|
|
557
|
+
),
|
|
558
|
+
readJsonWithStatus(
|
|
559
|
+
getCodeGraphRehearsePath(),
|
|
560
|
+
defaultCodeGraphRehearse,
|
|
561
|
+
"context.codeGraphRehearse",
|
|
562
|
+
),
|
|
563
|
+
readJsonWithStatus(
|
|
564
|
+
getSkillsRegistryExportPath(),
|
|
565
|
+
defaultSkillsRegistryExport,
|
|
566
|
+
"context.skillsRegistryExport",
|
|
567
|
+
),
|
|
568
|
+
readJsonWithStatus(
|
|
569
|
+
getCapabilityCompositionPath(),
|
|
570
|
+
defaultCapabilityComposition,
|
|
571
|
+
"context.capabilityComposition",
|
|
572
|
+
),
|
|
573
|
+
readJsonWithStatus(
|
|
574
|
+
getWorkspaceContextPackPath(),
|
|
575
|
+
defaultWorkspaceContextPack,
|
|
576
|
+
"context.workspaceContextPack",
|
|
577
|
+
),
|
|
578
|
+
readJsonWithStatus(
|
|
579
|
+
getWorkspaceEffectivenessPath(),
|
|
580
|
+
defaultWorkspaceEffectiveness,
|
|
581
|
+
"context.workspaceEffectiveness",
|
|
582
|
+
),
|
|
583
|
+
readJsonWithStatus(
|
|
584
|
+
getSemanticReceiptIndexPath(),
|
|
585
|
+
defaultSemanticReceiptIndex,
|
|
586
|
+
"evidence.semanticReceipts",
|
|
587
|
+
),
|
|
257
588
|
]);
|
|
258
589
|
const validatedMergedGuidance = coerceValidated(
|
|
259
590
|
mergedGuidance,
|
|
@@ -297,7 +628,11 @@ export async function loadRuntimeSnapshot() {
|
|
|
297
628
|
typeof value === "object" &&
|
|
298
629
|
Array.isArray(value.compatibilityNamespace) &&
|
|
299
630
|
Array.isArray(value.runtimeNamespace) &&
|
|
300
|
-
Array.isArray(value.hooks)
|
|
631
|
+
Array.isArray(value.hooks) &&
|
|
632
|
+
value.activeAutonomy &&
|
|
633
|
+
typeof value.activeAutonomy === "object" &&
|
|
634
|
+
value.activeAutonomy.enabled === true &&
|
|
635
|
+
Array.isArray(value.activeAutonomy.stallPatterns),
|
|
301
636
|
invalidArtifacts,
|
|
302
637
|
);
|
|
303
638
|
const validatedTaskRegistry = coerceValidated(
|
|
@@ -326,6 +661,23 @@ export async function loadRuntimeSnapshot() {
|
|
|
326
661
|
(value) => value && typeof value === "object" && Array.isArray(value.decisions),
|
|
327
662
|
invalidArtifacts,
|
|
328
663
|
);
|
|
664
|
+
const validatedAudits = coerceValidated(
|
|
665
|
+
audits,
|
|
666
|
+
defaultAudits,
|
|
667
|
+
"runtime.audits",
|
|
668
|
+
(value) => value && typeof value === "object" && Array.isArray(value.items),
|
|
669
|
+
invalidArtifacts,
|
|
670
|
+
);
|
|
671
|
+
const validatedCves = coerceValidated(
|
|
672
|
+
cves,
|
|
673
|
+
defaultCves,
|
|
674
|
+
"runtime.cves",
|
|
675
|
+
(value) => value && typeof value === "object" && Array.isArray(value.items),
|
|
676
|
+
invalidArtifacts,
|
|
677
|
+
);
|
|
678
|
+
const releaseIssueGateStatus = summarizeReleaseIssueGateStatus(releaseIssueGates, {
|
|
679
|
+
version: releaseIssueGates.releaseVersion,
|
|
680
|
+
});
|
|
329
681
|
const validatedManagerRuns = coerceValidated(
|
|
330
682
|
managerRuns,
|
|
331
683
|
defaultManagerRuns,
|
|
@@ -333,6 +685,286 @@ export async function loadRuntimeSnapshot() {
|
|
|
333
685
|
(value) => value && typeof value === "object" && Array.isArray(value.runs),
|
|
334
686
|
invalidArtifacts,
|
|
335
687
|
);
|
|
688
|
+
const validatedMaestroState = coerceValidated(
|
|
689
|
+
maestroState,
|
|
690
|
+
defaultMaestroState,
|
|
691
|
+
"runtime.maestroState",
|
|
692
|
+
(value) =>
|
|
693
|
+
value &&
|
|
694
|
+
typeof value === "object" &&
|
|
695
|
+
typeof value.global_status === "string" &&
|
|
696
|
+
value.runtime_tracks &&
|
|
697
|
+
typeof value.runtime_tracks === "object" &&
|
|
698
|
+
value.downstream_lock_table &&
|
|
699
|
+
typeof value.downstream_lock_table === "object",
|
|
700
|
+
invalidArtifacts,
|
|
701
|
+
);
|
|
702
|
+
const validatedActiveAutonomyCore = coerceValidated(
|
|
703
|
+
activeAutonomyCore,
|
|
704
|
+
defaultActiveAutonomyCore,
|
|
705
|
+
"context.activeAutonomyCore",
|
|
706
|
+
(value) => {
|
|
707
|
+
try {
|
|
708
|
+
validateActiveAutonomyCore(value);
|
|
709
|
+
return true;
|
|
710
|
+
} catch {
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
invalidArtifacts,
|
|
715
|
+
);
|
|
716
|
+
const validatedSemanticRecordingCore = coerceValidated(
|
|
717
|
+
semanticRecordingCore,
|
|
718
|
+
defaultSemanticRecordingCore,
|
|
719
|
+
"context.recordingCore",
|
|
720
|
+
(value) => {
|
|
721
|
+
try {
|
|
722
|
+
validateSemanticRecordingCore(value);
|
|
723
|
+
return true;
|
|
724
|
+
} catch {
|
|
725
|
+
return false;
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
invalidArtifacts,
|
|
729
|
+
);
|
|
730
|
+
const validatedHelperOrchestrationCore = coerceValidated(
|
|
731
|
+
helperOrchestrationCore,
|
|
732
|
+
defaultHelperOrchestrationCore,
|
|
733
|
+
"context.helperOrchestrationCore",
|
|
734
|
+
(value) => {
|
|
735
|
+
try {
|
|
736
|
+
validateHelperOrchestrationCore(value);
|
|
737
|
+
return true;
|
|
738
|
+
} catch {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
invalidArtifacts,
|
|
743
|
+
);
|
|
744
|
+
const validatedLearningLoopCore = coerceValidated(
|
|
745
|
+
learningLoopCore,
|
|
746
|
+
defaultLearningLoopCore,
|
|
747
|
+
"context.learningLoopCore",
|
|
748
|
+
(value) => {
|
|
749
|
+
try {
|
|
750
|
+
validateLearningLoopCore(value);
|
|
751
|
+
return true;
|
|
752
|
+
} catch {
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
invalidArtifacts,
|
|
757
|
+
);
|
|
758
|
+
const validatedPromptStrategyCore = coerceValidated(
|
|
759
|
+
promptStrategyCore,
|
|
760
|
+
defaultPromptStrategyCore,
|
|
761
|
+
"context.promptStrategyCore",
|
|
762
|
+
(value) => {
|
|
763
|
+
try {
|
|
764
|
+
validatePromptStrategyCore(value);
|
|
765
|
+
return true;
|
|
766
|
+
} catch {
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
invalidArtifacts,
|
|
771
|
+
);
|
|
772
|
+
const validatedContextEconomyCore = coerceValidated(
|
|
773
|
+
contextEconomyCore,
|
|
774
|
+
defaultContextEconomyCore,
|
|
775
|
+
"context.contextEconomyCore",
|
|
776
|
+
(value) => {
|
|
777
|
+
try {
|
|
778
|
+
validateContextEconomyCore(value);
|
|
779
|
+
return true;
|
|
780
|
+
} catch {
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
invalidArtifacts,
|
|
785
|
+
);
|
|
786
|
+
const validatedEnvironmentAwarenessCore = coerceValidated(
|
|
787
|
+
environmentAwarenessCore,
|
|
788
|
+
defaultEnvironmentAwarenessCore,
|
|
789
|
+
"context.environmentAwarenessCore",
|
|
790
|
+
(value) => {
|
|
791
|
+
try {
|
|
792
|
+
validateEnvironmentAwarenessCore(value);
|
|
793
|
+
return true;
|
|
794
|
+
} catch {
|
|
795
|
+
return false;
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
invalidArtifacts,
|
|
799
|
+
);
|
|
800
|
+
const validatedCoreSourceIngest = coerceValidated(
|
|
801
|
+
coreSourceIngest,
|
|
802
|
+
defaultCoreSourceIngest,
|
|
803
|
+
"context.coreSourceIngest",
|
|
804
|
+
(value) => {
|
|
805
|
+
try {
|
|
806
|
+
validateCoreSourceIngest(value);
|
|
807
|
+
return true;
|
|
808
|
+
} catch {
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
invalidArtifacts,
|
|
813
|
+
);
|
|
814
|
+
const validatedUniversalPluginBrokerCore = coerceValidated(
|
|
815
|
+
universalPluginBrokerCore,
|
|
816
|
+
defaultUniversalPluginBrokerCore,
|
|
817
|
+
"context.universalPluginBrokerCore",
|
|
818
|
+
(value) => {
|
|
819
|
+
try {
|
|
820
|
+
validateUniversalPluginBrokerCore(value);
|
|
821
|
+
return true;
|
|
822
|
+
} catch {
|
|
823
|
+
return false;
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
invalidArtifacts,
|
|
827
|
+
);
|
|
828
|
+
const validatedObsidianBridge = coerceValidated(
|
|
829
|
+
obsidianBridge,
|
|
830
|
+
defaultObsidianBridge,
|
|
831
|
+
"context.obsidianBridge",
|
|
832
|
+
(value) => {
|
|
833
|
+
try {
|
|
834
|
+
validateObsidianBridge(value);
|
|
835
|
+
return true;
|
|
836
|
+
} catch {
|
|
837
|
+
return false;
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
invalidArtifacts,
|
|
841
|
+
);
|
|
842
|
+
const validatedObsidianVaultIndex = coerceValidated(
|
|
843
|
+
obsidianVaultIndex,
|
|
844
|
+
defaultObsidianVaultIndex,
|
|
845
|
+
"context.obsidianVaultIndex",
|
|
846
|
+
(value) => {
|
|
847
|
+
try {
|
|
848
|
+
validateObsidianVaultIndex(value);
|
|
849
|
+
return true;
|
|
850
|
+
} catch {
|
|
851
|
+
return false;
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
invalidArtifacts,
|
|
855
|
+
);
|
|
856
|
+
const validatedObsidianVaultOperations = coerceValidated(
|
|
857
|
+
obsidianVaultOperations,
|
|
858
|
+
defaultObsidianVaultOperations,
|
|
859
|
+
"context.obsidianVaultOperations",
|
|
860
|
+
(value) => {
|
|
861
|
+
try {
|
|
862
|
+
validateObsidianVaultOperations(value);
|
|
863
|
+
return true;
|
|
864
|
+
} catch {
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
invalidArtifacts,
|
|
869
|
+
);
|
|
870
|
+
const validatedWorkspaceVirtualizer = coerceValidated(
|
|
871
|
+
workspaceVirtualizer,
|
|
872
|
+
defaultWorkspaceVirtualizer,
|
|
873
|
+
"context.workspaceVirtualizer",
|
|
874
|
+
(value) => {
|
|
875
|
+
try {
|
|
876
|
+
validateWorkspaceVirtualizer(value);
|
|
877
|
+
return true;
|
|
878
|
+
} catch {
|
|
879
|
+
return false;
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
invalidArtifacts,
|
|
883
|
+
);
|
|
884
|
+
const validatedCodeGraphRehearse = coerceValidated(
|
|
885
|
+
codeGraphRehearse,
|
|
886
|
+
defaultCodeGraphRehearse,
|
|
887
|
+
"context.codeGraphRehearse",
|
|
888
|
+
(value) => {
|
|
889
|
+
try {
|
|
890
|
+
validateCodeGraphRehearse(value);
|
|
891
|
+
return true;
|
|
892
|
+
} catch {
|
|
893
|
+
return false;
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
invalidArtifacts,
|
|
897
|
+
);
|
|
898
|
+
const validatedSkillsRegistryExport = coerceValidated(
|
|
899
|
+
skillsRegistryExport,
|
|
900
|
+
defaultSkillsRegistryExport,
|
|
901
|
+
"context.skillsRegistryExport",
|
|
902
|
+
(value) => {
|
|
903
|
+
try {
|
|
904
|
+
validateSkillsRegistryExport(value);
|
|
905
|
+
return true;
|
|
906
|
+
} catch {
|
|
907
|
+
return false;
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
invalidArtifacts,
|
|
911
|
+
);
|
|
912
|
+
const validatedCapabilityComposition = coerceValidated(
|
|
913
|
+
capabilityComposition,
|
|
914
|
+
defaultCapabilityComposition,
|
|
915
|
+
"context.capabilityComposition",
|
|
916
|
+
(value) => {
|
|
917
|
+
try {
|
|
918
|
+
validateCapabilityComposition(value);
|
|
919
|
+
return true;
|
|
920
|
+
} catch {
|
|
921
|
+
return false;
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
invalidArtifacts,
|
|
925
|
+
);
|
|
926
|
+
const validatedWorkspaceContextPack = coerceValidated(
|
|
927
|
+
workspaceContextPack,
|
|
928
|
+
defaultWorkspaceContextPack,
|
|
929
|
+
"context.workspaceContextPack",
|
|
930
|
+
(value) => {
|
|
931
|
+
try {
|
|
932
|
+
validateWorkspaceContextPack(value);
|
|
933
|
+
return true;
|
|
934
|
+
} catch {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
invalidArtifacts,
|
|
939
|
+
);
|
|
940
|
+
const validatedWorkspaceEffectiveness = coerceValidated(
|
|
941
|
+
workspaceEffectiveness,
|
|
942
|
+
defaultWorkspaceEffectiveness,
|
|
943
|
+
"context.workspaceEffectiveness",
|
|
944
|
+
(value) => {
|
|
945
|
+
try {
|
|
946
|
+
validateWorkspaceEffectiveness(value);
|
|
947
|
+
return true;
|
|
948
|
+
} catch {
|
|
949
|
+
return false;
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
invalidArtifacts,
|
|
953
|
+
);
|
|
954
|
+
const validatedSemanticReceiptIndex = coerceValidated(
|
|
955
|
+
semanticReceiptIndex,
|
|
956
|
+
defaultSemanticReceiptIndex,
|
|
957
|
+
"evidence.semanticReceipts",
|
|
958
|
+
(value) => {
|
|
959
|
+
try {
|
|
960
|
+
validateSemanticReceiptIndex(value);
|
|
961
|
+
return true;
|
|
962
|
+
} catch {
|
|
963
|
+
return false;
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
invalidArtifacts,
|
|
967
|
+
);
|
|
336
968
|
|
|
337
969
|
return {
|
|
338
970
|
mergedGuidance: validatedMergedGuidance,
|
|
@@ -345,7 +977,30 @@ export async function loadRuntimeSnapshot() {
|
|
|
345
977
|
workspaceIndex: validatedWorkspaceIndex,
|
|
346
978
|
release,
|
|
347
979
|
decisions: validatedDecisions,
|
|
980
|
+
audits: validatedAudits,
|
|
981
|
+
cves: validatedCves,
|
|
982
|
+
releaseIssueGateStatus,
|
|
348
983
|
managerRuns: validatedManagerRuns,
|
|
984
|
+
maestroState: validatedMaestroState,
|
|
985
|
+
activeAutonomyCore: validatedActiveAutonomyCore,
|
|
986
|
+
semanticRecordingCore: validatedSemanticRecordingCore,
|
|
987
|
+
helperOrchestrationCore: validatedHelperOrchestrationCore,
|
|
988
|
+
learningLoopCore: validatedLearningLoopCore,
|
|
989
|
+
promptStrategyCore: validatedPromptStrategyCore,
|
|
990
|
+
contextEconomyCore: validatedContextEconomyCore,
|
|
991
|
+
environmentAwarenessCore: validatedEnvironmentAwarenessCore,
|
|
992
|
+
coreSourceIngest: validatedCoreSourceIngest,
|
|
993
|
+
universalPluginBrokerCore: validatedUniversalPluginBrokerCore,
|
|
994
|
+
obsidianBridge: validatedObsidianBridge,
|
|
995
|
+
obsidianVaultIndex: validatedObsidianVaultIndex,
|
|
996
|
+
obsidianVaultOperations: validatedObsidianVaultOperations,
|
|
997
|
+
workspaceVirtualizer: validatedWorkspaceVirtualizer,
|
|
998
|
+
codeGraphRehearse: validatedCodeGraphRehearse,
|
|
999
|
+
skillsRegistryExport: validatedSkillsRegistryExport,
|
|
1000
|
+
capabilityComposition: validatedCapabilityComposition,
|
|
1001
|
+
workspaceContextPack: validatedWorkspaceContextPack,
|
|
1002
|
+
workspaceEffectiveness: validatedWorkspaceEffectiveness,
|
|
1003
|
+
semanticReceiptIndex: validatedSemanticReceiptIndex,
|
|
349
1004
|
missingArtifacts,
|
|
350
1005
|
invalidArtifacts,
|
|
351
1006
|
};
|
|
@@ -353,6 +1008,16 @@ export async function loadRuntimeSnapshot() {
|
|
|
353
1008
|
|
|
354
1009
|
export function createRuntimeSummary(snapshot) {
|
|
355
1010
|
const trimmedNotes = snapshot.continuityNotes.trim();
|
|
1011
|
+
const criticalPackageExposureCount = snapshot.audits.items.filter(
|
|
1012
|
+
(item) =>
|
|
1013
|
+
item?.record_type === "finding:package_exposure" &&
|
|
1014
|
+
`${item.severity}`.toLowerCase() === "critical",
|
|
1015
|
+
).length;
|
|
1016
|
+
const mcpPolicyViolationCount = snapshot.audits.items.filter(
|
|
1017
|
+
(item) =>
|
|
1018
|
+
item?.record_type === "policy:mcp_validation" &&
|
|
1019
|
+
["critical", "high"].includes(`${item.severity}`.toLowerCase()),
|
|
1020
|
+
).length;
|
|
356
1021
|
return {
|
|
357
1022
|
guidanceSourceCount: snapshot.mergedGuidance.sources.length,
|
|
358
1023
|
guidanceIncludeRoots: snapshot.guidanceGraph.roots.length,
|
|
@@ -368,6 +1033,7 @@ export function createRuntimeSummary(snapshot) {
|
|
|
368
1033
|
pendingMailboxCount: snapshot.mailboxEntries.length,
|
|
369
1034
|
workspaceCount: snapshot.workspaceIndex.items.length,
|
|
370
1035
|
decisionCount: snapshot.decisions.decisions.length,
|
|
1036
|
+
mcpPolicyViolationCount,
|
|
371
1037
|
managerRunCount: snapshot.managerRuns.runs.length,
|
|
372
1038
|
activeManagerRunCount: snapshot.managerRuns.runs.filter(
|
|
373
1039
|
(run) => !terminalManagerStates.has(run.state),
|
|
@@ -375,8 +1041,183 @@ export function createRuntimeSummary(snapshot) {
|
|
|
375
1041
|
waitingReviewManagerRunCount: snapshot.managerRuns.runs.filter(
|
|
376
1042
|
(run) => run.state === "waiting-review",
|
|
377
1043
|
).length,
|
|
1044
|
+
maestroGlobalStatus: snapshot.maestroState.global_status,
|
|
1045
|
+
maestroTrackCount: Object.keys(snapshot.maestroState.runtime_tracks).length,
|
|
1046
|
+
semanticRecordingLayerCount: snapshot.semanticRecordingCore.layers.length,
|
|
1047
|
+
semanticDefaultCoreCount: Object.keys(snapshot.semanticRecordingCore.default_core_capabilities)
|
|
1048
|
+
.length,
|
|
1049
|
+
helperCoreContractCount: snapshot.helperOrchestrationCore.helper_contracts.length,
|
|
1050
|
+
helperCoreNonGating: snapshot.helperOrchestrationCore.composition_rules.non_gating === true,
|
|
1051
|
+
helperCoreReleaseMutationAllowed:
|
|
1052
|
+
snapshot.helperOrchestrationCore.composition_rules.release_state_mutation_allowed === true,
|
|
1053
|
+
learningLoopDomainCount: snapshot.learningLoopCore.domains.length,
|
|
1054
|
+
learningLoopRecordCount: snapshot.learningLoopCore.records.length,
|
|
1055
|
+
activeAutonomyAskOnlyCount: snapshot.activeAutonomyCore.decision_rule.ask_only_when.length,
|
|
1056
|
+
activeAutonomyStallPatternCount:
|
|
1057
|
+
snapshot.activeAutonomyCore.runtime_enforcement.stall_patterns.length,
|
|
1058
|
+
activeAutonomyHookEnabled: snapshot.hookConfig.activeAutonomy.enabled,
|
|
1059
|
+
promptStrategyTechniqueFamilyCount: snapshot.promptStrategyCore.technique_families.length,
|
|
1060
|
+
promptStrategyLaneCount: Object.keys(snapshot.promptStrategyCore.lane_policy).length,
|
|
1061
|
+
contextEconomyAppliesToCount: snapshot.contextEconomyCore.applies_to.length,
|
|
1062
|
+
contextEconomyPreserveExactCount: snapshot.contextEconomyCore.preserve_exact.length,
|
|
1063
|
+
contextEconomySafetyValveCount: snapshot.contextEconomyCore.safety_valves.length,
|
|
1064
|
+
environmentCapabilityCount: snapshot.environmentAwarenessCore.capabilities.length,
|
|
1065
|
+
environmentCapabilityTypes: [
|
|
1066
|
+
...new Set(
|
|
1067
|
+
snapshot.environmentAwarenessCore.capabilities.map(
|
|
1068
|
+
(capability) => capability.capability_type,
|
|
1069
|
+
),
|
|
1070
|
+
),
|
|
1071
|
+
].sort(),
|
|
1072
|
+
environmentRecordsAs: snapshot.environmentAwarenessCore.discovery_policy.records_as,
|
|
1073
|
+
environmentNeverRecordsAs: snapshot.environmentAwarenessCore.discovery_policy.never_records_as,
|
|
1074
|
+
coreSourceIngestStatus: snapshot.coreSourceIngest.status ?? "NOT_INGESTED",
|
|
1075
|
+
coreSourceIngestCount: snapshot.coreSourceIngest.sources.filter((source) =>
|
|
1076
|
+
["INGESTED", "LOCAL_CORE"].includes(source.status),
|
|
1077
|
+
).length,
|
|
1078
|
+
coreSourceRuntimeFetchRequired: snapshot.coreSourceIngest.runtime_fetch_required,
|
|
1079
|
+
universalPluginBrokerSupportedAgentCount:
|
|
1080
|
+
snapshot.universalPluginBrokerCore.supported_agents.length,
|
|
1081
|
+
universalPluginBrokerMcpInjectorHosts:
|
|
1082
|
+
snapshot.universalPluginBrokerCore.mcp_injector_hosts.length,
|
|
1083
|
+
universalPluginBrokerRecordsAs: snapshot.universalPluginBrokerCore.mutation_policy.records_as,
|
|
1084
|
+
universalPluginBrokerNeverRecordsAs:
|
|
1085
|
+
snapshot.universalPluginBrokerCore.mutation_policy.never_records_as,
|
|
1086
|
+
obsidianBridgeRecordsAs: snapshot.obsidianBridge.semantic_boundary.records_as,
|
|
1087
|
+
obsidianBridgeNeverRecordsAs: snapshot.obsidianBridge.semantic_boundary.never_records_as,
|
|
1088
|
+
obsidianBridgeQueuedRequestCount: snapshot.obsidianBridge.default_request_queue.length,
|
|
1089
|
+
obsidianBridgeNoteSelectionCount: snapshot.obsidianBridge.note_selection_metadata.length,
|
|
1090
|
+
obsidianBridgeTagGraphClaimCount: snapshot.obsidianBridge.tag_graph_claims.length,
|
|
1091
|
+
obsidianVaultIndexed: snapshot.obsidianVaultIndex.note_count > 0,
|
|
1092
|
+
obsidianVaultPath: snapshot.obsidianVaultIndex.vault_path,
|
|
1093
|
+
obsidianVaultNoteCount: snapshot.obsidianVaultIndex.note_count,
|
|
1094
|
+
obsidianVaultTagCount: snapshot.obsidianVaultIndex.tags.length,
|
|
1095
|
+
obsidianVaultUnresolvedLinkCount: snapshot.obsidianVaultIndex.unresolved_links.length,
|
|
1096
|
+
obsidianVaultOperationCount: snapshot.obsidianVaultOperations.operations.length,
|
|
1097
|
+
workspaceVirtualizerRecordsAs: snapshot.workspaceVirtualizer.evidence_boundary.records_as,
|
|
1098
|
+
workspaceVirtualizerNeverRecordsAs:
|
|
1099
|
+
snapshot.workspaceVirtualizer.evidence_boundary.never_records_as,
|
|
1100
|
+
workspaceVirtualizerSourceMutationAllowed:
|
|
1101
|
+
snapshot.workspaceVirtualizer.mutation_policy.may_mutate_source,
|
|
1102
|
+
codeGraphRehearseRecordsAs: snapshot.codeGraphRehearse.evidence_boundary.records_as,
|
|
1103
|
+
codeGraphRehearseSourceMutationAllowed:
|
|
1104
|
+
snapshot.codeGraphRehearse.mutation_policy.may_mutate_source,
|
|
1105
|
+
codeGraphRehearseMaxSteps: snapshot.codeGraphRehearse.max_steps,
|
|
1106
|
+
skillsRegistryCanonicalDir: snapshot.skillsRegistryExport.canonical_dir,
|
|
1107
|
+
skillsRegistryReleaseMutationAllowed:
|
|
1108
|
+
snapshot.skillsRegistryExport.authority_boundary.exported_payloads_may_mutate_release_state,
|
|
1109
|
+
skillsRegistryUniversalTargetCount: snapshot.skillsRegistryExport.universal_targets.length,
|
|
1110
|
+
skillsRegistryNonUniversalTargetCount:
|
|
1111
|
+
snapshot.skillsRegistryExport.non_universal_targets.length,
|
|
1112
|
+
capabilityCompositionCount: snapshot.capabilityComposition.capability_matrix.length,
|
|
1113
|
+
workspaceContextChannelCount: Object.keys(snapshot.workspaceContextPack.semantic_channels)
|
|
1114
|
+
.length,
|
|
1115
|
+
workspaceEffectivenessReady: snapshot.workspaceEffectiveness.ready,
|
|
1116
|
+
workspaceEffectivenessCheckCount: snapshot.workspaceEffectiveness.checks.length,
|
|
1117
|
+
semanticReceiptCount: snapshot.semanticReceiptIndex.receipts.length,
|
|
1118
|
+
obsidianSemanticRole:
|
|
1119
|
+
snapshot.semanticRecordingCore.default_core_capabilities.obsidian_integration_core
|
|
1120
|
+
.semantic_role,
|
|
1121
|
+
obsidianRecordsAs:
|
|
1122
|
+
snapshot.semanticRecordingCore.default_core_capabilities.obsidian_integration_core.records_as,
|
|
378
1123
|
buildStatus: snapshot.release.build_status,
|
|
1124
|
+
auditCount: snapshot.audits.items.length,
|
|
1125
|
+
cveCount: snapshot.cves.items.length,
|
|
1126
|
+
releaseIssueGateTotal: snapshot.releaseIssueGateStatus.total,
|
|
1127
|
+
releaseIssueGatePassed: snapshot.releaseIssueGateStatus.passed,
|
|
1128
|
+
releaseIssueGateBlockerCount: snapshot.releaseIssueGateStatus.blockers.length,
|
|
1129
|
+
criticalPackageExposureCount,
|
|
379
1130
|
missingArtifacts: snapshot.missingArtifacts,
|
|
380
1131
|
invalidArtifacts: snapshot.invalidArtifacts,
|
|
381
1132
|
};
|
|
382
1133
|
}
|
|
1134
|
+
|
|
1135
|
+
export async function repairRuntimeScratchpadArtifacts(artifactLabels = []) {
|
|
1136
|
+
const labels = [...new Set(artifactLabels)].filter((label) =>
|
|
1137
|
+
repairableRuntimeArtifacts.has(label),
|
|
1138
|
+
);
|
|
1139
|
+
|
|
1140
|
+
for (const label of labels) {
|
|
1141
|
+
switch (label) {
|
|
1142
|
+
case "guidance.merged":
|
|
1143
|
+
await writeJson(getMergedGuidancePath(), defaultMergedGuidance);
|
|
1144
|
+
break;
|
|
1145
|
+
case "guidance.includeGraph":
|
|
1146
|
+
await writeJson(getGuidanceIncludeGraphPath(), defaultGuidanceGraph);
|
|
1147
|
+
break;
|
|
1148
|
+
case "context.activeAutonomyCore":
|
|
1149
|
+
await writeJson(getActiveAutonomyCorePath(), defaultActiveAutonomyCore);
|
|
1150
|
+
break;
|
|
1151
|
+
case "context.recordingCore":
|
|
1152
|
+
await writeJson(getSemanticRecordingCorePath(), defaultSemanticRecordingCore);
|
|
1153
|
+
break;
|
|
1154
|
+
case "context.helperOrchestrationCore":
|
|
1155
|
+
await writeJson(getHelperOrchestrationCorePath(), defaultHelperOrchestrationCore);
|
|
1156
|
+
break;
|
|
1157
|
+
case "context.learningLoopCore":
|
|
1158
|
+
await writeJson(getLearningLoopCorePath(), defaultLearningLoopCore);
|
|
1159
|
+
break;
|
|
1160
|
+
case "context.promptStrategyCore":
|
|
1161
|
+
await writeJson(getPromptStrategyCorePath(), defaultPromptStrategyCore);
|
|
1162
|
+
break;
|
|
1163
|
+
case "context.contextEconomyCore":
|
|
1164
|
+
await writeJson(getContextEconomyCorePath(), defaultContextEconomyCore);
|
|
1165
|
+
break;
|
|
1166
|
+
case "context.environmentAwarenessCore":
|
|
1167
|
+
await writeJson(getEnvironmentAwarenessCorePath(), defaultEnvironmentAwarenessCore);
|
|
1168
|
+
break;
|
|
1169
|
+
case "context.coreSourceIngest":
|
|
1170
|
+
await writeJson(getCoreSourceIngestPath(), defaultCoreSourceIngest);
|
|
1171
|
+
break;
|
|
1172
|
+
case "context.universalPluginBrokerCore":
|
|
1173
|
+
await writeJson(getUniversalPluginBrokerCorePath(), defaultUniversalPluginBrokerCore);
|
|
1174
|
+
break;
|
|
1175
|
+
case "context.obsidianVaultOperations":
|
|
1176
|
+
await writeJson(getObsidianVaultOperationsPath(), defaultObsidianVaultOperations);
|
|
1177
|
+
break;
|
|
1178
|
+
case "context.workspaceVirtualizer":
|
|
1179
|
+
await writeJson(getWorkspaceVirtualizerPath(), defaultWorkspaceVirtualizer);
|
|
1180
|
+
break;
|
|
1181
|
+
case "context.codeGraphRehearse":
|
|
1182
|
+
await writeJson(getCodeGraphRehearsePath(), defaultCodeGraphRehearse);
|
|
1183
|
+
break;
|
|
1184
|
+
case "context.skillsRegistryExport":
|
|
1185
|
+
await writeJson(getSkillsRegistryExportPath(), defaultSkillsRegistryExport);
|
|
1186
|
+
break;
|
|
1187
|
+
case "context.capabilityComposition":
|
|
1188
|
+
await writeJson(getCapabilityCompositionPath(), defaultCapabilityComposition);
|
|
1189
|
+
break;
|
|
1190
|
+
case "context.workspaceContextPack":
|
|
1191
|
+
await writeJson(getWorkspaceContextPackPath(), defaultWorkspaceContextPack);
|
|
1192
|
+
break;
|
|
1193
|
+
case "context.workspaceEffectiveness":
|
|
1194
|
+
await writeJson(getWorkspaceEffectivenessPath(), defaultWorkspaceEffectiveness);
|
|
1195
|
+
break;
|
|
1196
|
+
case "evidence.semanticReceipts":
|
|
1197
|
+
await writeJson(getSemanticReceiptIndexPath(), defaultSemanticReceiptIndex);
|
|
1198
|
+
break;
|
|
1199
|
+
case "memory.index":
|
|
1200
|
+
await writeJson(getContinuityIndexPath(), defaultContinuityIndex);
|
|
1201
|
+
break;
|
|
1202
|
+
case "hooks.config":
|
|
1203
|
+
await writeJson(getRuntimeHooksConfigPath(), defaultHookConfig);
|
|
1204
|
+
break;
|
|
1205
|
+
case "tasks.registry":
|
|
1206
|
+
await writeJson(getTaskRegistryPath(), defaultTaskRegistry);
|
|
1207
|
+
break;
|
|
1208
|
+
case "workspaces.index":
|
|
1209
|
+
await writeJson(getWorkspacesIndexPath(), defaultWorkspaceIndex);
|
|
1210
|
+
break;
|
|
1211
|
+
case "runtime.managerRuns":
|
|
1212
|
+
await writeJson(getManagerRunsPath(), defaultManagerRuns);
|
|
1213
|
+
break;
|
|
1214
|
+
case "runtime.maestroState":
|
|
1215
|
+
await writeJson(getMaestroStatePath(), defaultMaestroState);
|
|
1216
|
+
break;
|
|
1217
|
+
default:
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
return labels;
|
|
1223
|
+
}
|