@jstn-sdk/ma 0.1.13 → 0.14.1
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 +1 -0
- package/.codex/agents/Auditor.toml +1 -0
- package/.codex/agents/Builder.toml +1 -0
- package/.codex/agents/Flow.toml +1 -0
- package/.codex/agents/Sage.toml +1 -0
- package/.codex/agents/Vibe.toml +1 -0
- package/.codex/hooks.json +12 -2
- package/.codex/prompts/enforcement.md +0 -0
- package/.codex/prompts/onboarding.md +6 -1
- package/.codex/prompts/release-rules.md +0 -0
- package/.codex/prompts/skill-contract.md +0 -0
- package/COVERAGE.md +9 -9
- package/DEMO.md +15 -6
- package/LICENSE +0 -0
- package/README.md +127 -784
- package/bin/ma.js +591 -105
- package/data/clone-data.ledger.json +0 -0
- package/data/clone-data.proof.json +0 -0
- package/data/clone-data.rvf +0 -0
- package/docs/README.md +8 -2
- package/docs/assets/banner.png +0 -0
- package/docs/autonomous-tasks.md +46 -0
- package/docs/codex-integration.md +16 -0
- package/docs/getting-started.md +32 -8
- package/docs/installed-sdk.md +0 -0
- package/docs/mcp-setup.md +30 -1
- package/docs/qa/{release-issue-gates-0.1.13.json → release-issue-gates-0.14.1.json} +77 -77
- package/docs/qa/release-readiness-0.1.5.md +0 -0
- package/docs/qa/{release-readiness-0.1.13.md → release-readiness-0.14.1.md} +12 -12
- package/docs/quality.md +24 -0
- package/docs/reference/native-engineering-patterns.md +0 -0
- package/docs/reference/native-security-playbooks.md +0 -0
- package/docs/reference/native-source-selection.md +0 -0
- package/docs/reference/native-style-and-deslop.md +0 -0
- package/docs/release-spec.md +27 -14
- package/docs/skills.md +1 -1
- package/docs/vendor-plugin-publishing.md +49 -0
- package/index.js +73 -0
- package/mcp/collections.json +0 -0
- package/mcp/fallback.json +0 -0
- package/mcp/local/code-intel.js +185 -41
- package/mcp/local/context.js +180 -0
- package/mcp/local/memory.js +17 -6
- package/mcp/local/playbooks.js +0 -0
- package/mcp/local/quality.js +39 -0
- package/mcp/local/state.js +7 -3
- package/mcp/local/team-run.js +8 -3
- package/mcp/local/trace.js +0 -0
- package/mcp/local-capabilities.json +9 -0
- package/mcp/native-playbooks.json +0 -0
- package/mcp/servers.json +0 -0
- package/package.json +37 -6
- package/plugins/meta-architect/.app.json +1 -1
- package/plugins/meta-architect/.claude-plugin/plugin.json +12 -0
- package/plugins/meta-architect/.codex-plugin/plugin.json +1 -1
- package/plugins/meta-architect/.mcp.json +1 -1
- package/plugins/meta-architect/README.md +14 -2
- package/plugins/meta-architect/obsidian/main.js +137 -4
- package/plugins/meta-architect/obsidian/manifest.json +1 -1
- package/plugins/meta-architect/obsidian/styles.css +0 -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 +0 -0
- package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/build/SKILL.md +0 -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 +0 -0
- package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/maestro/SKILL.md +17 -1
- package/plugins/meta-architect/skills/maestro/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/maestro/references/core-release-rules.md +2 -2
- package/plugins/meta-architect/skills/maestro/references/native-ingest-map.md +0 -0
- package/plugins/meta-architect/skills/sage/SKILL.md +0 -0
- package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/sage/references/source-selection.md +0 -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 +0 -0
- package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/vet/references/security-playbooks.md +0 -0
- package/plugins/meta-architect/skills/vibe/SKILL.md +0 -0
- package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -0
- package/schemas/autonomous-task-queue.schema.json +58 -0
- package/schemas/handoff-packet.schema.json +36 -0
- package/schemas/setup-receipt.schema.json +28 -0
- package/schemas/skill-frontmatter.schema.json +20 -0
- package/schemas/support-bundle.schema.json +37 -0
- package/schemas/task-contract.schema.json +31 -0
- package/scripts/active-autonomy-hook.mjs +141 -11
- package/scripts/biome-staged.js +0 -0
- package/scripts/build-linux-packages.mjs +7 -3
- package/scripts/cleanup-test-fixtures.sh +55 -0
- package/scripts/context-hydration-hook.mjs +89 -0
- package/scripts/demo-smoke.js +285 -0
- package/scripts/doctor.js +10 -8
- package/scripts/install.sh +33 -4
- package/scripts/install.sh.sha256 +1 -0
- package/scripts/linux-package-lib.mjs +0 -0
- package/scripts/linux-package-smoke.mjs +2 -2
- package/scripts/package-size-check.mjs +26 -0
- package/scripts/plugin-build.js +314 -0
- package/scripts/plugin-publish.js +77 -0
- package/scripts/plugin-sync.js +83 -17
- package/scripts/prepack.js +9 -0
- package/scripts/ralph/prompt.md +0 -0
- package/scripts/release-metadata.js +0 -0
- package/scripts/release-sync.js +83 -7
- package/scripts/release-verify.js +131 -7
- package/scripts/setup-npmrc.js +48 -23
- package/scripts/skills-install.js +9 -2
- package/scripts/skills-manifest.js +2 -21
- package/scripts/skills-pack.js +2 -2
- package/scripts/skills-validate.js +5 -55
- 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 +0 -0
- package/skills/arch/agents/openai.yaml +0 -0
- package/skills/build/SKILL.md +0 -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 +0 -0
- package/skills/flow/agents/openai.yaml +0 -0
- package/skills/index.json +0 -0
- package/skills/maestro/SKILL.md +17 -1
- package/skills/maestro/agents/openai.yaml +0 -0
- package/skills/maestro/references/core-release-rules.md +2 -2
- package/skills/maestro/references/native-ingest-map.md +0 -0
- package/skills/sage/SKILL.md +0 -0
- package/skills/sage/agents/openai.yaml +0 -0
- package/skills/sage/references/source-selection.md +0 -0
- package/skills/tdd/SKILL.md +0 -0
- package/skills/tdd/agents/openai.yaml +0 -0
- package/skills/vet/SKILL.md +0 -0
- package/skills/vet/agents/openai.yaml +0 -0
- package/skills/vet/references/security-playbooks.md +0 -0
- package/skills/vibe/SKILL.md +0 -0
- package/skills/vibe/agents/openai.yaml +0 -0
- package/sprint/00-idea.md +0 -0
- package/sprint/01-architecture.md +0 -0
- package/sprint/02-oss-evidence.md +0 -0
- package/sprint/03-logic.md +0 -0
- package/sprint/04-security.md +0 -0
- package/sprint/05-dx-ux.md +0 -0
- package/sprint/06-build-plan.md +0 -0
- package/sprint/07-release.md +2 -2
- package/src/agents.js +281 -0
- package/src/bootstrap.js +272 -65
- package/src/build-gate.js +0 -0
- package/src/codex-app-server.js +291 -0
- package/src/decision-log.js +0 -0
- package/src/fs-utils.js +175 -4
- package/src/launcher.js +26 -23
- package/src/mcp-config.js +9 -1
- package/src/mcp-live-client.js +141 -8
- package/src/paths.js +6 -1
- package/src/policy.js +2 -2
- package/src/prelaunch.js +223 -0
- package/src/process-utils.js +62 -0
- package/src/quality/ai-quality-orchestrator.js +328 -0
- package/src/release-issue-gates.js +62 -0
- package/src/release-operations.js +72 -0
- package/src/release-state.js +0 -0
- package/src/runtime/active-autonomy-core.js +0 -0
- package/src/runtime/agent-compat.js +31 -0
- package/src/runtime/alignment-sentinel.js +0 -0
- package/src/runtime/architect-review.js +249 -11
- package/src/runtime/autonomous-tasks.js +585 -0
- package/src/runtime/build-readiness.js +0 -0
- package/src/runtime/code-graph-rehearse.js +0 -0
- package/src/runtime/codeburn-core.js +118 -0
- package/src/runtime/context-authority.js +40 -0
- package/src/runtime/context-economy-core.js +40 -0
- package/src/runtime/continuity-graph.js +201 -0
- package/src/runtime/continuity-notes.js +71 -26
- package/src/runtime/core-source-ingest.js +2 -2
- package/src/runtime/detached-provider.js +90 -13
- package/src/runtime/doctor-report.js +18 -0
- package/src/runtime/environment-awareness-core.js +0 -0
- package/src/runtime/exposure-catalog.js +0 -0
- package/src/runtime/graphify-core.js +167 -0
- package/src/runtime/guidance-stack.js +9 -2
- package/src/runtime/handoff-packets.js +92 -0
- package/src/runtime/headroom-core.js +104 -0
- package/src/runtime/helper-orchestration-core.js +0 -0
- package/src/runtime/hook-profiles.js +20 -0
- package/src/runtime/learning-loop-core.js +110 -4
- package/src/runtime/live-agent-verification.js +122 -0
- package/src/runtime/maestro-events.js +0 -0
- package/src/runtime/maestro-manager.js +0 -0
- package/src/runtime/maestro-output.js +58 -0
- package/src/runtime/maestro-state.js +0 -0
- package/src/runtime/managed-markdown.js +29 -0
- package/src/runtime/mcp-authority.js +147 -0
- package/src/runtime/mcp-policy.js +0 -0
- package/src/runtime/obsidian-integration-core.js +255 -17
- package/src/runtime/obsidian-plugin-bridge.js +344 -38
- package/src/runtime/orchestrator.js +0 -0
- package/src/runtime/pi-maestro-core.js +89 -0
- package/src/runtime/preferences.js +79 -0
- package/src/runtime/project-context.js +636 -0
- package/src/runtime/prompt-strategy-core.js +0 -0
- package/src/runtime/quorum-review.js +0 -0
- package/src/runtime/ralph-execution-core.js +0 -0
- package/src/runtime/redaction-gateway.js +218 -19
- package/src/runtime/runtime-state.js +94 -2
- package/src/runtime/schema-migrations.js +162 -0
- package/src/runtime/semantic-recording-core.js +0 -0
- package/src/runtime/signal-hooks.js +13 -0
- package/src/runtime/skills-registry-export.js +96 -8
- package/src/runtime/startup-path.js +0 -0
- package/src/runtime/task-contracts.js +83 -0
- package/src/runtime/universal-plugin-broker-core.js +373 -50
- package/src/runtime/workspace-intelligence-runtime.js +0 -0
- package/src/runtime/workspace-virtualizer.js +0 -0
- package/src/runtime/workspaces.js +0 -0
- package/src/runtime-artifacts.js +0 -0
- package/src/setup-lifecycle.js +359 -0
- package/src/skill-frontmatter.js +78 -0
- package/src/skill-installer.js +226 -71
- package/src/skills.js +309 -31
- package/src/state-sync.js +0 -0
- package/src/test-fixtures.js +543 -0
- package/src/tui/grid.js +67 -0
- package/src/tui/status-grid.js +23 -0
- package/support-bundle.json +114 -0
- package/templates/AGENTS.md +6 -2
- package/templates/catalog-manifest.json +0 -0
- package/templates/model-instructions/core.md +0 -0
- package/templates/model-instructions/release.md +0 -0
- package/templates/model-instructions/security.md +0 -0
- package/templates/quality/ai-quality-rules.yml +37 -0
- 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 -8
- package/docs/onboarding.md +0 -81
- package/docs/prompt-guidance-contract.md +0 -17
- package/docs/prompt-guidance-fragments/active-autonomy-core.md +0 -7
- package/docs/skills-publishing.md +0 -255
- package/scripts/postinstall.js +0 -23
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
2
4
|
import { readJson, writeFileIfMissing, writeJson } from "../fs-utils.js";
|
|
3
5
|
import { getRuntimeStatePath } from "../paths.js";
|
|
4
6
|
import { appendMaestroEvent } from "./maestro-events.js";
|
|
@@ -21,6 +23,11 @@ const redactionRules = [
|
|
|
21
23
|
regex:
|
|
22
24
|
/\b(?:sk-[A-Za-z0-9_-]{16,}|gh[pousr]_[A-Za-z0-9_]{16,}|xox[baprs]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z-_]{20,})\b/g,
|
|
23
25
|
},
|
|
26
|
+
{
|
|
27
|
+
placeholderBase: "__MA_SECURE_ASSIGNMENT__",
|
|
28
|
+
regex:
|
|
29
|
+
/\b(?:API_KEY|API_TOKEN|AUTH_TOKEN|SECRET_KEY|DATABASE_URL|PRIVATE_KEY|PASSWORD)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s,;]+)/gi,
|
|
30
|
+
},
|
|
24
31
|
];
|
|
25
32
|
|
|
26
33
|
export function getRedactionVaultPath() {
|
|
@@ -34,9 +41,23 @@ function createDefaultVault() {
|
|
|
34
41
|
};
|
|
35
42
|
}
|
|
36
43
|
|
|
44
|
+
export function getRedactionVaultPolicy() {
|
|
45
|
+
const retentionDays = Number.parseInt(process.env.MA_REDACTION_VAULT_RETENTION_DAYS ?? "30", 10);
|
|
46
|
+
const maxEntries = Number.parseInt(process.env.MA_REDACTION_VAULT_MAX_ENTRIES ?? "200", 10);
|
|
47
|
+
return {
|
|
48
|
+
retentionDays: Number.isFinite(retentionDays) ? Math.min(Math.max(retentionDays, 1), 3650) : 30,
|
|
49
|
+
maxEntries: Number.isFinite(maxEntries) ? Math.min(Math.max(maxEntries, 1), 10000) : 200,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
37
53
|
export async function loadRedactionVaultOrDefault() {
|
|
38
54
|
try {
|
|
39
|
-
|
|
55
|
+
const vault = await readJson(getRedactionVaultPath());
|
|
56
|
+
const normalized = applyRedactionVaultPolicy(vault);
|
|
57
|
+
if (JSON.stringify(vault) !== JSON.stringify(normalized)) {
|
|
58
|
+
await saveRedactionVault(normalized);
|
|
59
|
+
}
|
|
60
|
+
return normalized;
|
|
40
61
|
} catch (error) {
|
|
41
62
|
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
42
63
|
return createDefaultVault();
|
|
@@ -47,15 +68,75 @@ export async function loadRedactionVaultOrDefault() {
|
|
|
47
68
|
}
|
|
48
69
|
|
|
49
70
|
export async function seedRedactionVault() {
|
|
71
|
+
const vaultPath = getRedactionVaultPath();
|
|
50
72
|
await writeFileIfMissing(
|
|
51
|
-
|
|
52
|
-
`${JSON.stringify(createDefaultVault(), null, 2)}\n`,
|
|
73
|
+
vaultPath,
|
|
74
|
+
`${JSON.stringify(applyRedactionVaultPolicy(createDefaultVault()), null, 2)}\n`,
|
|
53
75
|
);
|
|
76
|
+
await secureRedactionVaultPermissions(vaultPath);
|
|
54
77
|
}
|
|
55
78
|
|
|
56
79
|
export async function saveRedactionVault(vault) {
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
const normalized = applyRedactionVaultPolicy(vault);
|
|
81
|
+
const vaultPath = getRedactionVaultPath();
|
|
82
|
+
await writeJson(vaultPath, normalized);
|
|
83
|
+
await secureRedactionVaultPermissions(vaultPath);
|
|
84
|
+
return normalized;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function secureRedactionVaultPermissions(vaultPath) {
|
|
88
|
+
const directory = path.dirname(vaultPath);
|
|
89
|
+
await fs.mkdir(directory, { recursive: true, mode: 0o700 });
|
|
90
|
+
await fs.chmod(directory, 0o700);
|
|
91
|
+
await fs.chmod(vaultPath, 0o600);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export async function inspectRedactionVault() {
|
|
95
|
+
const vaultPath = getRedactionVaultPath();
|
|
96
|
+
try {
|
|
97
|
+
const [file, directory] = await Promise.all([
|
|
98
|
+
fs.stat(vaultPath),
|
|
99
|
+
fs.stat(path.dirname(vaultPath)),
|
|
100
|
+
]);
|
|
101
|
+
const fileMode = file.mode & 0o777;
|
|
102
|
+
const directoryMode = directory.mode & 0o777;
|
|
103
|
+
const issues = [];
|
|
104
|
+
if (fileMode !== 0o600) issues.push(`vault file mode ${fileMode.toString(8)}; expected 600`);
|
|
105
|
+
if (directoryMode !== 0o700) {
|
|
106
|
+
issues.push(`vault directory mode ${directoryMode.toString(8)}; expected 700`);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
exists: true,
|
|
110
|
+
path: vaultPath,
|
|
111
|
+
status: issues.length > 0 ? "warning" : "ok",
|
|
112
|
+
issues,
|
|
113
|
+
policy: getRedactionVaultPolicy(),
|
|
114
|
+
};
|
|
115
|
+
} catch (error) {
|
|
116
|
+
if (error?.code === "ENOENT") {
|
|
117
|
+
return {
|
|
118
|
+
exists: false,
|
|
119
|
+
path: vaultPath,
|
|
120
|
+
status: "ok",
|
|
121
|
+
issues: [],
|
|
122
|
+
policy: getRedactionVaultPolicy(),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export async function purgeRedactionVault({ dryRun = false } = {}) {
|
|
130
|
+
const vaultPath = getRedactionVaultPath();
|
|
131
|
+
const exists = await fs
|
|
132
|
+
.stat(vaultPath)
|
|
133
|
+
.then(() => true)
|
|
134
|
+
.catch((error) => {
|
|
135
|
+
if (error?.code === "ENOENT") return false;
|
|
136
|
+
throw error;
|
|
137
|
+
});
|
|
138
|
+
if (exists && !dryRun) await fs.rm(vaultPath, { force: true });
|
|
139
|
+
return { status: exists ? (dryRun ? "would-purge" : "purged") : "absent", path: vaultPath };
|
|
59
140
|
}
|
|
60
141
|
|
|
61
142
|
async function appendRedactionEvent({ replacementCount, metadata }) {
|
|
@@ -67,7 +148,7 @@ async function appendRedactionEvent({ replacementCount, metadata }) {
|
|
|
67
148
|
});
|
|
68
149
|
}
|
|
69
150
|
|
|
70
|
-
|
|
151
|
+
function maskSensitiveTextInternal(rawText) {
|
|
71
152
|
let sanitizedText = rawText;
|
|
72
153
|
const replacements = [];
|
|
73
154
|
const seen = new Set();
|
|
@@ -89,19 +170,27 @@ export function maskSensitiveText(rawText) {
|
|
|
89
170
|
}
|
|
90
171
|
|
|
91
172
|
return {
|
|
92
|
-
sanitizedText,
|
|
173
|
+
sanitizedText: redactPreviewPaths(sanitizedText),
|
|
93
174
|
replacements,
|
|
94
175
|
};
|
|
95
176
|
}
|
|
96
177
|
|
|
178
|
+
export function maskSensitiveText(rawText) {
|
|
179
|
+
const result = maskSensitiveTextInternal(rawText);
|
|
180
|
+
return {
|
|
181
|
+
sanitizedText: result.sanitizedText,
|
|
182
|
+
replacements: result.replacements.map(publicReplacement),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
97
186
|
export async function redactProviderBoundText(rawText, metadata = {}) {
|
|
98
187
|
const vault = await loadRedactionVaultOrDefault();
|
|
99
|
-
const { sanitizedText, replacements } =
|
|
188
|
+
const { sanitizedText, replacements } = maskSensitiveTextInternal(rawText);
|
|
100
189
|
|
|
101
190
|
if (replacements.length === 0) {
|
|
102
191
|
return {
|
|
103
192
|
sanitizedText,
|
|
104
|
-
replacements,
|
|
193
|
+
replacements: replacements.map(publicReplacement),
|
|
105
194
|
};
|
|
106
195
|
}
|
|
107
196
|
|
|
@@ -118,34 +207,107 @@ export async function redactProviderBoundText(rawText, metadata = {}) {
|
|
|
118
207
|
await appendRedactionEvent({ replacementCount: replacements.length, metadata });
|
|
119
208
|
return {
|
|
120
209
|
sanitizedText,
|
|
121
|
-
replacements,
|
|
210
|
+
replacements: replacements.map(publicReplacement),
|
|
122
211
|
};
|
|
123
212
|
}
|
|
124
213
|
|
|
125
|
-
function redactPayloadValue(value, replacements) {
|
|
214
|
+
function redactPayloadValue(value, replacements, seen = new WeakSet()) {
|
|
126
215
|
if (typeof value === "string") {
|
|
127
|
-
const result =
|
|
216
|
+
const result = maskSensitiveTextInternal(value);
|
|
128
217
|
replacements.push(...result.replacements);
|
|
129
|
-
return result.sanitizedText;
|
|
218
|
+
return redactPreviewPaths(result.sanitizedText);
|
|
130
219
|
}
|
|
131
220
|
|
|
132
221
|
if (Array.isArray(value)) {
|
|
133
|
-
return value
|
|
222
|
+
return redactObjectValue(value, replacements, seen);
|
|
134
223
|
}
|
|
135
224
|
|
|
136
225
|
if (value && typeof value === "object") {
|
|
137
|
-
return
|
|
138
|
-
Object.entries(value).map(([key, entry]) => [key, redactPayloadValue(entry, replacements)]),
|
|
139
|
-
);
|
|
226
|
+
return redactObjectValue(value, replacements, seen);
|
|
140
227
|
}
|
|
141
228
|
|
|
142
229
|
return value;
|
|
143
230
|
}
|
|
144
231
|
|
|
232
|
+
function filterPublicValue(value, classes, seen = new WeakSet()) {
|
|
233
|
+
if (typeof value === "string") {
|
|
234
|
+
if (/(?:[A-Za-z]:\\|\/(?:Users|home|tmp|var|etc|opt|srv|mnt|private)[\\/])/.test(value)) {
|
|
235
|
+
classes.add("local_path");
|
|
236
|
+
}
|
|
237
|
+
return { value, omitted: false };
|
|
238
|
+
}
|
|
239
|
+
if (!value || typeof value !== "object") return { value, omitted: false };
|
|
240
|
+
if (
|
|
241
|
+
["personal/local", "user-local", "session-only"].includes(value.scope) ||
|
|
242
|
+
(value.freshness?.status === "stale" && !value.provenance && !value.sourceFiles)
|
|
243
|
+
) {
|
|
244
|
+
classes.add(value.scope ? "private_context" : "stale_without_provenance");
|
|
245
|
+
return { value: undefined, omitted: true };
|
|
246
|
+
}
|
|
247
|
+
if (seen.has(value)) return { value: "[Circular]", omitted: false };
|
|
248
|
+
seen.add(value);
|
|
249
|
+
if (Array.isArray(value)) {
|
|
250
|
+
const result = value
|
|
251
|
+
.map((item) => filterPublicValue(item, classes, seen))
|
|
252
|
+
.filter((item) => !item.omitted)
|
|
253
|
+
.map((item) => item.value);
|
|
254
|
+
seen.delete(value);
|
|
255
|
+
return { value: result, omitted: false };
|
|
256
|
+
}
|
|
257
|
+
const result = {};
|
|
258
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
259
|
+
const filtered = filterPublicValue(entry, classes, seen);
|
|
260
|
+
if (!filtered.omitted) result[key] = filtered.value;
|
|
261
|
+
}
|
|
262
|
+
seen.delete(value);
|
|
263
|
+
return { value: result, omitted: false };
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function redactObjectValue(value, replacements, seen) {
|
|
267
|
+
if (!value || typeof value !== "object") {
|
|
268
|
+
return value;
|
|
269
|
+
}
|
|
270
|
+
if (seen.has(value)) {
|
|
271
|
+
return "[Circular]";
|
|
272
|
+
}
|
|
273
|
+
seen.add(value);
|
|
274
|
+
|
|
275
|
+
if (Array.isArray(value)) {
|
|
276
|
+
const result = value.map((item) =>
|
|
277
|
+
typeof item === "string"
|
|
278
|
+
? redactPayloadValue(item, replacements, seen)
|
|
279
|
+
: redactObjectValue(item, replacements, seen),
|
|
280
|
+
);
|
|
281
|
+
seen.delete(value);
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const result = Object.fromEntries(
|
|
286
|
+
Object.entries(value).map(([key, entry]) => {
|
|
287
|
+
const redactedEntry =
|
|
288
|
+
typeof entry === "string"
|
|
289
|
+
? redactPayloadValue(entry, replacements, seen)
|
|
290
|
+
: redactObjectValue(entry, replacements, seen);
|
|
291
|
+
if (typeof redactedEntry === "string" && /(?:preview|excerpt|snippet|path|file)/i.test(key)) {
|
|
292
|
+
return [key, redactPreviewPaths(redactedEntry)];
|
|
293
|
+
}
|
|
294
|
+
return [key, redactedEntry];
|
|
295
|
+
}),
|
|
296
|
+
);
|
|
297
|
+
seen.delete(value);
|
|
298
|
+
return result;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function publicReplacement({ placeholder, placeholderBase }) {
|
|
302
|
+
return { placeholder, placeholderBase };
|
|
303
|
+
}
|
|
304
|
+
|
|
145
305
|
export async function redactProviderBoundPayload(payload, metadata = {}) {
|
|
146
306
|
const vault = await loadRedactionVaultOrDefault();
|
|
147
307
|
const replacements = [];
|
|
148
|
-
const
|
|
308
|
+
const classes = new Set();
|
|
309
|
+
const filtered = filterPublicValue(payload, classes).value;
|
|
310
|
+
const sanitizedPayload = redactPayloadValue(filtered, replacements);
|
|
149
311
|
|
|
150
312
|
for (const replacement of replacements) {
|
|
151
313
|
vault.entries[replacement.placeholder] = {
|
|
@@ -163,12 +325,49 @@ export async function redactProviderBoundPayload(payload, metadata = {}) {
|
|
|
163
325
|
|
|
164
326
|
return {
|
|
165
327
|
sanitizedPayload,
|
|
166
|
-
replacements,
|
|
328
|
+
replacements: replacements.map(publicReplacement),
|
|
167
329
|
redaction_receipt: {
|
|
168
330
|
record_type: "redaction_receipt",
|
|
169
331
|
replacement_count: replacements.length,
|
|
170
332
|
provider_safe: true,
|
|
171
333
|
raw_values_stored_locally: replacements.length > 0,
|
|
334
|
+
redacted_classes: [
|
|
335
|
+
...classes,
|
|
336
|
+
...new Set(replacements.map((replacement) => replacement.placeholderBase)),
|
|
337
|
+
],
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function redactPreviewPaths(value) {
|
|
343
|
+
return value.replace(
|
|
344
|
+
/(?:[A-Za-z]:\\|\/(?:Users|home|tmp|var|etc|opt|srv|mnt|private)[\\/])(?:[A-Za-z0-9._ -]+[\\/])+[A-Za-z0-9._ -]+(?:\.[A-Za-z0-9._ -]+)?/g,
|
|
345
|
+
"__MA_PATH_REDACTED__",
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function applyRedactionVaultPolicy(vault) {
|
|
350
|
+
const entries = Object.entries(vault?.entries ?? {});
|
|
351
|
+
entries.sort((left, right) => {
|
|
352
|
+
const leftTime = Date.parse(left[1]?.createdAt ?? "") || 0;
|
|
353
|
+
const rightTime = Date.parse(right[1]?.createdAt ?? "") || 0;
|
|
354
|
+
return rightTime - leftTime;
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
const policy = getRedactionVaultPolicy();
|
|
358
|
+
const cutoff = Date.now() - policy.retentionDays * 24 * 60 * 60 * 1000;
|
|
359
|
+
const retainedEntries = entries.filter(([, entry]) => {
|
|
360
|
+
const createdAt = Date.parse(entry?.createdAt ?? "") || 0;
|
|
361
|
+
return createdAt >= cutoff;
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
const limitedEntries = retainedEntries.slice(0, policy.maxEntries);
|
|
365
|
+
return {
|
|
366
|
+
...vault,
|
|
367
|
+
policy: {
|
|
368
|
+
retention_days: policy.retentionDays,
|
|
369
|
+
max_entries: policy.maxEntries,
|
|
172
370
|
},
|
|
371
|
+
entries: Object.fromEntries(limitedEntries),
|
|
173
372
|
};
|
|
174
373
|
}
|
|
@@ -3,7 +3,10 @@ import fs from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { readJson, writeJson } from "../fs-utils.js";
|
|
5
5
|
import { getRepoRoot, getRuntimeReadPath } from "../paths.js";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
resolveReleaseIssueGates,
|
|
8
|
+
summarizeReleaseIssueGateStatus,
|
|
9
|
+
} from "../release-issue-gates.js";
|
|
7
10
|
import { createDefaultReleaseState, validateReleaseState } from "../release-state.js";
|
|
8
11
|
import {
|
|
9
12
|
createDefaultActiveAutonomyCore,
|
|
@@ -13,18 +16,29 @@ import {
|
|
|
13
16
|
} from "./active-autonomy-core.js";
|
|
14
17
|
import { seedAlignmentSentinelArtifacts } from "./alignment-sentinel.js";
|
|
15
18
|
import { seedArchitectReviewArtifacts } from "./architect-review.js";
|
|
19
|
+
import { seedAutonomousTaskArtifacts } from "./autonomous-tasks.js";
|
|
16
20
|
import {
|
|
17
21
|
createDefaultCodeGraphRehearse,
|
|
18
22
|
getCodeGraphRehearsePath,
|
|
19
23
|
seedCodeGraphRehearseArtifacts,
|
|
20
24
|
validateCodeGraphRehearse,
|
|
21
25
|
} from "./code-graph-rehearse.js";
|
|
26
|
+
import {
|
|
27
|
+
createDefaultCodeburnUsage,
|
|
28
|
+
getCodeburnLogPath,
|
|
29
|
+
seedCodeburnArtifacts,
|
|
30
|
+
} from "./codeburn-core.js";
|
|
22
31
|
import {
|
|
23
32
|
createDefaultContextEconomyCore,
|
|
24
33
|
getContextEconomyCorePath,
|
|
25
34
|
seedContextEconomyCoreArtifacts,
|
|
26
35
|
validateContextEconomyCore,
|
|
27
36
|
} from "./context-economy-core.js";
|
|
37
|
+
import {
|
|
38
|
+
createDefaultContinuityGraph,
|
|
39
|
+
getContinuityGraphPath,
|
|
40
|
+
validateContinuityGraph,
|
|
41
|
+
} from "./continuity-graph.js";
|
|
28
42
|
import {
|
|
29
43
|
getContinuityIndexPath,
|
|
30
44
|
getContinuityNotesPath,
|
|
@@ -42,11 +56,18 @@ import {
|
|
|
42
56
|
seedEnvironmentAwarenessCoreArtifacts,
|
|
43
57
|
validateEnvironmentAwarenessCore,
|
|
44
58
|
} from "./environment-awareness-core.js";
|
|
59
|
+
import {
|
|
60
|
+
createDefaultGraphifyIndex,
|
|
61
|
+
getGraphifyIndexPath,
|
|
62
|
+
seedGraphifyArtifacts,
|
|
63
|
+
validateGraphifyIndex,
|
|
64
|
+
} from "./graphify-core.js";
|
|
45
65
|
import {
|
|
46
66
|
getGuidanceIncludeGraphPath,
|
|
47
67
|
getMergedGuidancePath,
|
|
48
68
|
seedGuidanceStackArtifacts,
|
|
49
69
|
} from "./guidance-stack.js";
|
|
70
|
+
import { seedHeadroomArtifacts } from "./headroom-core.js";
|
|
50
71
|
import {
|
|
51
72
|
createDefaultHelperOrchestrationCore,
|
|
52
73
|
getHelperOrchestrationCorePath,
|
|
@@ -137,9 +158,11 @@ import { getWorkspacesIndexPath, seedWorkspaceArtifacts } from "./workspaces.js"
|
|
|
137
158
|
|
|
138
159
|
const runtimeSubsystemSeeders = [
|
|
139
160
|
seedGuidanceStackArtifacts,
|
|
161
|
+
seedGraphifyArtifacts,
|
|
140
162
|
seedContinuityArtifacts,
|
|
141
163
|
seedSignalHookArtifacts,
|
|
142
164
|
seedOrchestratorArtifacts,
|
|
165
|
+
seedAutonomousTaskArtifacts,
|
|
143
166
|
seedWorkspaceArtifacts,
|
|
144
167
|
seedMaestroManagerArtifacts,
|
|
145
168
|
seedMaestroStateArtifacts,
|
|
@@ -147,6 +170,7 @@ const runtimeSubsystemSeeders = [
|
|
|
147
170
|
seedAlignmentSentinelArtifacts,
|
|
148
171
|
seedSemanticRecordingCoreArtifacts,
|
|
149
172
|
seedHelperOrchestrationCoreArtifacts,
|
|
173
|
+
seedHeadroomArtifacts,
|
|
150
174
|
seedLearningLoopCoreArtifacts,
|
|
151
175
|
seedWorkspaceIntelligenceArtifacts,
|
|
152
176
|
seedPromptStrategyCoreArtifacts,
|
|
@@ -158,6 +182,7 @@ const runtimeSubsystemSeeders = [
|
|
|
158
182
|
seedObsidianBridgeArtifacts,
|
|
159
183
|
seedWorkspaceVirtualizerArtifacts,
|
|
160
184
|
seedCodeGraphRehearseArtifacts,
|
|
185
|
+
seedCodeburnArtifacts,
|
|
161
186
|
seedSkillsRegistryExportArtifacts,
|
|
162
187
|
];
|
|
163
188
|
const defaultMergedGuidance = {
|
|
@@ -256,11 +281,13 @@ const defaultObsidianVaultIndex = createDefaultObsidianVaultIndex();
|
|
|
256
281
|
const defaultObsidianVaultOperations = createDefaultObsidianVaultOperations();
|
|
257
282
|
const defaultWorkspaceVirtualizer = createDefaultWorkspaceVirtualizer();
|
|
258
283
|
const defaultCodeGraphRehearse = createDefaultCodeGraphRehearse();
|
|
284
|
+
const defaultCodeburnUsage = createDefaultCodeburnUsage();
|
|
259
285
|
const defaultSkillsRegistryExport = createDefaultSkillsRegistryExport();
|
|
260
286
|
const defaultCapabilityComposition = createDefaultCapabilityComposition();
|
|
261
287
|
const defaultWorkspaceContextPack = createDefaultWorkspaceContextPack();
|
|
262
288
|
const defaultWorkspaceEffectiveness = createDefaultWorkspaceEffectiveness();
|
|
263
289
|
const defaultSemanticReceiptIndex = createDefaultSemanticReceiptIndex();
|
|
290
|
+
const defaultContinuityGraph = createDefaultContinuityGraph();
|
|
264
291
|
const terminalManagerStates = new Set(["completed", "blocked", "failed", "cancelled"]);
|
|
265
292
|
const repairableRuntimeArtifacts = new Set([
|
|
266
293
|
"guidance.merged",
|
|
@@ -284,6 +311,7 @@ const repairableRuntimeArtifacts = new Set([
|
|
|
284
311
|
"context.workspaceEffectiveness",
|
|
285
312
|
"evidence.semanticReceipts",
|
|
286
313
|
"memory.index",
|
|
314
|
+
"memory.graph",
|
|
287
315
|
"hooks.config",
|
|
288
316
|
"tasks.registry",
|
|
289
317
|
"workspaces.index",
|
|
@@ -418,11 +446,17 @@ export async function loadRuntimeSnapshot() {
|
|
|
418
446
|
await fs.access(getTaskLockRoot()).catch(() => {
|
|
419
447
|
missingArtifacts.push("tasks.locks");
|
|
420
448
|
});
|
|
449
|
+
const releaseIssueGatesResolution = resolveReleaseIssueGates(getRepoRoot());
|
|
450
|
+
if (!releaseIssueGatesResolution) {
|
|
451
|
+
missingArtifacts.push("release.issueGates");
|
|
452
|
+
}
|
|
421
453
|
|
|
422
454
|
const [
|
|
423
455
|
mergedGuidance,
|
|
424
456
|
guidanceGraph,
|
|
457
|
+
graphifyIndex,
|
|
425
458
|
continuityIndex,
|
|
459
|
+
continuityGraph,
|
|
426
460
|
continuityNotes,
|
|
427
461
|
hookConfig,
|
|
428
462
|
taskRegistry,
|
|
@@ -448,6 +482,7 @@ export async function loadRuntimeSnapshot() {
|
|
|
448
482
|
obsidianVaultOperations,
|
|
449
483
|
workspaceVirtualizer,
|
|
450
484
|
codeGraphRehearse,
|
|
485
|
+
codeburnUsage,
|
|
451
486
|
skillsRegistryExport,
|
|
452
487
|
capabilityComposition,
|
|
453
488
|
workspaceContextPack,
|
|
@@ -460,7 +495,9 @@ export async function loadRuntimeSnapshot() {
|
|
|
460
495
|
defaultGuidanceGraph,
|
|
461
496
|
"guidance.includeGraph",
|
|
462
497
|
),
|
|
498
|
+
readJsonWithStatus(getGraphifyIndexPath(), createDefaultGraphifyIndex(), "context.graphify"),
|
|
463
499
|
readJsonWithStatus(getContinuityIndexPath(), defaultContinuityIndex, "memory.index"),
|
|
500
|
+
readJsonWithStatus(getContinuityGraphPath(), defaultContinuityGraph, "memory.graph"),
|
|
464
501
|
readTextWithStatus(getContinuityNotesPath(), "", "memory.notes"),
|
|
465
502
|
readJsonWithStatus(getRuntimeHooksConfigPath(), defaultHookConfig, "hooks.config"),
|
|
466
503
|
readJsonWithStatus(getTaskRegistryPath(), defaultTaskRegistry, "tasks.registry"),
|
|
@@ -488,7 +525,8 @@ export async function loadRuntimeSnapshot() {
|
|
|
488
525
|
),
|
|
489
526
|
readJsonWithStatus(getRuntimeReadPath("evidence", "cves.json"), defaultCves, "runtime.cves"),
|
|
490
527
|
readJsonWithStatus(
|
|
491
|
-
path
|
|
528
|
+
releaseIssueGatesResolution?.path ??
|
|
529
|
+
path.join(getRepoRoot(), "docs", "qa", "release-issue-gates-missing.json"),
|
|
492
530
|
defaultReleaseIssueGates,
|
|
493
531
|
"release.issueGates",
|
|
494
532
|
),
|
|
@@ -560,6 +598,7 @@ export async function loadRuntimeSnapshot() {
|
|
|
560
598
|
defaultCodeGraphRehearse,
|
|
561
599
|
"context.codeGraphRehearse",
|
|
562
600
|
),
|
|
601
|
+
readJsonWithStatus(getCodeburnLogPath(), defaultCodeburnUsage, "context.codeburnUsage"),
|
|
563
602
|
readJsonWithStatus(
|
|
564
603
|
getSkillsRegistryExportPath(),
|
|
565
604
|
defaultSkillsRegistryExport,
|
|
@@ -608,6 +647,20 @@ export async function loadRuntimeSnapshot() {
|
|
|
608
647
|
Array.isArray(value.edges),
|
|
609
648
|
invalidArtifacts,
|
|
610
649
|
);
|
|
650
|
+
const validatedGraphifyIndex = coerceValidated(
|
|
651
|
+
graphifyIndex,
|
|
652
|
+
createDefaultGraphifyIndex(),
|
|
653
|
+
"context.graphify",
|
|
654
|
+
(value) => {
|
|
655
|
+
try {
|
|
656
|
+
validateGraphifyIndex(value);
|
|
657
|
+
return true;
|
|
658
|
+
} catch {
|
|
659
|
+
return false;
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
invalidArtifacts,
|
|
663
|
+
);
|
|
611
664
|
const validatedContinuityIndex = coerceValidated(
|
|
612
665
|
continuityIndex,
|
|
613
666
|
defaultContinuityIndex,
|
|
@@ -619,6 +672,20 @@ export async function loadRuntimeSnapshot() {
|
|
|
619
672
|
"lastUpdatedAt" in value,
|
|
620
673
|
invalidArtifacts,
|
|
621
674
|
);
|
|
675
|
+
const validatedContinuityGraph = coerceValidated(
|
|
676
|
+
continuityGraph,
|
|
677
|
+
defaultContinuityGraph,
|
|
678
|
+
"memory.graph",
|
|
679
|
+
(value) => {
|
|
680
|
+
try {
|
|
681
|
+
validateContinuityGraph(value);
|
|
682
|
+
return true;
|
|
683
|
+
} catch {
|
|
684
|
+
return false;
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
invalidArtifacts,
|
|
688
|
+
);
|
|
622
689
|
const validatedHookConfig = coerceValidated(
|
|
623
690
|
hookConfig,
|
|
624
691
|
defaultHookConfig,
|
|
@@ -895,6 +962,19 @@ export async function loadRuntimeSnapshot() {
|
|
|
895
962
|
},
|
|
896
963
|
invalidArtifacts,
|
|
897
964
|
);
|
|
965
|
+
const validatedCodeburnUsage = coerceValidated(
|
|
966
|
+
codeburnUsage,
|
|
967
|
+
defaultCodeburnUsage,
|
|
968
|
+
"context.codeburnUsage",
|
|
969
|
+
(value) =>
|
|
970
|
+
value &&
|
|
971
|
+
typeof value === "object" &&
|
|
972
|
+
value.schemaVersion === defaultCodeburnUsage.schemaVersion &&
|
|
973
|
+
Array.isArray(value.entries) &&
|
|
974
|
+
Number.isFinite(value.totalTokens) &&
|
|
975
|
+
Number.isFinite(value.totalCost),
|
|
976
|
+
invalidArtifacts,
|
|
977
|
+
);
|
|
898
978
|
const validatedSkillsRegistryExport = coerceValidated(
|
|
899
979
|
skillsRegistryExport,
|
|
900
980
|
defaultSkillsRegistryExport,
|
|
@@ -969,7 +1049,9 @@ export async function loadRuntimeSnapshot() {
|
|
|
969
1049
|
return {
|
|
970
1050
|
mergedGuidance: validatedMergedGuidance,
|
|
971
1051
|
guidanceGraph: validatedGuidanceGraph,
|
|
1052
|
+
graphifyIndex: validatedGraphifyIndex,
|
|
972
1053
|
continuityIndex: validatedContinuityIndex,
|
|
1054
|
+
continuityGraph: validatedContinuityGraph,
|
|
973
1055
|
continuityNotes,
|
|
974
1056
|
hookConfig: validatedHookConfig,
|
|
975
1057
|
taskRegistry: validatedTaskRegistry,
|
|
@@ -980,6 +1062,7 @@ export async function loadRuntimeSnapshot() {
|
|
|
980
1062
|
audits: validatedAudits,
|
|
981
1063
|
cves: validatedCves,
|
|
982
1064
|
releaseIssueGateStatus,
|
|
1065
|
+
releaseIssueGatesSource: releaseIssueGatesResolution,
|
|
983
1066
|
managerRuns: validatedManagerRuns,
|
|
984
1067
|
maestroState: validatedMaestroState,
|
|
985
1068
|
activeAutonomyCore: validatedActiveAutonomyCore,
|
|
@@ -996,6 +1079,7 @@ export async function loadRuntimeSnapshot() {
|
|
|
996
1079
|
obsidianVaultOperations: validatedObsidianVaultOperations,
|
|
997
1080
|
workspaceVirtualizer: validatedWorkspaceVirtualizer,
|
|
998
1081
|
codeGraphRehearse: validatedCodeGraphRehearse,
|
|
1082
|
+
codeburnUsage: validatedCodeburnUsage,
|
|
999
1083
|
skillsRegistryExport: validatedSkillsRegistryExport,
|
|
1000
1084
|
capabilityComposition: validatedCapabilityComposition,
|
|
1001
1085
|
workspaceContextPack: validatedWorkspaceContextPack,
|
|
@@ -1021,6 +1105,9 @@ export function createRuntimeSummary(snapshot) {
|
|
|
1021
1105
|
return {
|
|
1022
1106
|
guidanceSourceCount: snapshot.mergedGuidance.sources.length,
|
|
1023
1107
|
guidanceIncludeRoots: snapshot.guidanceGraph.roots.length,
|
|
1108
|
+
graphNodeCount: snapshot.graphifyIndex.nodes.length,
|
|
1109
|
+
graphEdgeCount: snapshot.graphifyIndex.edges.length,
|
|
1110
|
+
graphLastRebuiltAt: snapshot.graphifyIndex.lastRebuiltAt,
|
|
1024
1111
|
continuitySessionCount: snapshot.continuityIndex.sessionCount,
|
|
1025
1112
|
continuityHasNotes:
|
|
1026
1113
|
trimmedNotes.length > 0 &&
|
|
@@ -1103,6 +1190,8 @@ export function createRuntimeSummary(snapshot) {
|
|
|
1103
1190
|
codeGraphRehearseSourceMutationAllowed:
|
|
1104
1191
|
snapshot.codeGraphRehearse.mutation_policy.may_mutate_source,
|
|
1105
1192
|
codeGraphRehearseMaxSteps: snapshot.codeGraphRehearse.max_steps,
|
|
1193
|
+
tokenUsage: snapshot.codeburnUsage.totalTokens,
|
|
1194
|
+
estimatedCost: snapshot.codeburnUsage.totalCost,
|
|
1106
1195
|
skillsRegistryCanonicalDir: snapshot.skillsRegistryExport.canonical_dir,
|
|
1107
1196
|
skillsRegistryReleaseMutationAllowed:
|
|
1108
1197
|
snapshot.skillsRegistryExport.authority_boundary.exported_payloads_may_mutate_release_state,
|
|
@@ -1199,6 +1288,9 @@ export async function repairRuntimeScratchpadArtifacts(artifactLabels = []) {
|
|
|
1199
1288
|
case "memory.index":
|
|
1200
1289
|
await writeJson(getContinuityIndexPath(), defaultContinuityIndex);
|
|
1201
1290
|
break;
|
|
1291
|
+
case "memory.graph":
|
|
1292
|
+
await writeJson(getContinuityGraphPath(), defaultContinuityGraph);
|
|
1293
|
+
break;
|
|
1202
1294
|
case "hooks.config":
|
|
1203
1295
|
await writeJson(getRuntimeHooksConfigPath(), defaultHookConfig);
|
|
1204
1296
|
break;
|