@jstn-sdk/ma 0.1.12 → 0.14.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/.codex/agents/Architect.toml +1 -2
- package/.codex/agents/Auditor.toml +1 -2
- package/.codex/agents/Builder.toml +1 -2
- package/.codex/agents/Flow.toml +1 -2
- package/.codex/agents/Sage.toml +1 -2
- package/.codex/agents/Vibe.toml +1 -2
- package/.codex/hooks.json +24 -13
- package/.codex/prompts/enforcement.md +4 -0
- package/.codex/prompts/onboarding.md +6 -1
- package/.codex/prompts/release-rules.md +0 -0
- package/.codex/prompts/skill-contract.md +4 -0
- package/COVERAGE.md +211 -0
- package/DEMO.md +274 -0
- package/LICENSE +0 -0
- package/README.md +132 -656
- package/bin/ma.js +748 -55
- 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 +10 -1
- package/docs/autonomous-tasks.md +46 -0
- package/docs/codex-integration.md +16 -0
- package/docs/getting-started.md +62 -22
- package/docs/mcp-setup.md +64 -0
- package/docs/qa/release-issue-gates-0.14.0.json +644 -0
- package/docs/qa/release-readiness-0.1.5.md +1 -1
- package/docs/qa/{release-readiness-0.1.12.md → release-readiness-0.14.0.md} +25 -9
- package/docs/quality.md +24 -0
- package/docs/reference/native-security-playbooks.md +6 -0
- package/docs/reference/native-source-selection.md +6 -0
- package/docs/release-spec.md +39 -10
- package/docs/skills.md +14 -1
- package/index.js +295 -2
- package/mcp/collections.json +23 -6
- package/mcp/fallback.json +0 -0
- package/mcp/local/code-intel.js +179 -41
- package/mcp/local/context.js +180 -0
- package/mcp/local/memory.js +17 -6
- package/mcp/local/quality.js +39 -0
- package/mcp/local/state.js +7 -3
- package/mcp/local/team-run.js +56 -4
- package/mcp/local-capabilities.json +9 -0
- package/mcp/servers.json +24 -0
- package/package.json +29 -4
- 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 +534 -0
- package/plugins/meta-architect/obsidian/manifest.json +9 -0
- package/plugins/meta-architect/obsidian/styles.css +7 -0
- package/plugins/meta-architect/skills/arch/SKILL.md +2 -0
- package/plugins/meta-architect/skills/build/SKILL.md +3 -0
- package/plugins/meta-architect/skills/flow/SKILL.md +2 -0
- package/plugins/meta-architect/skills/sage/SKILL.md +2 -0
- package/plugins/meta-architect/skills/sage/references/source-selection.md +8 -0
- package/plugins/meta-architect/skills/vet/SKILL.md +2 -0
- package/plugins/meta-architect/skills/vet/references/security-playbooks.md +7 -0
- package/plugins/meta-architect/skills/vibe/SKILL.md +2 -0
- package/schemas/autonomous-task-queue.schema.json +56 -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 +226 -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 +27 -12
- package/scripts/install.sh +57 -0
- package/scripts/install.sh.sha256 +1 -0
- package/scripts/linux-package-smoke.mjs +2 -2
- package/scripts/package-size-check.mjs +26 -0
- package/scripts/plugin-sync.js +83 -17
- package/scripts/postinstall.js +17 -10
- package/scripts/prepack.js +9 -0
- package/scripts/ralph/prompt.md +35 -0
- package/scripts/release-sync.js +72 -7
- package/scripts/release-verify.js +260 -2
- 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/arch/SKILL.md +2 -0
- package/skills/build/SKILL.md +3 -0
- package/skills/flow/SKILL.md +2 -0
- package/skills/index.json +0 -0
- package/skills/sage/SKILL.md +2 -0
- package/skills/sage/references/source-selection.md +8 -0
- package/skills/vet/SKILL.md +2 -0
- package/skills/vet/references/security-playbooks.md +7 -0
- package/skills/vibe/SKILL.md +2 -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 +0 -0
- package/src/agents.js +279 -0
- package/src/bootstrap.js +268 -62
- package/src/build-gate.js +2 -2
- 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 +28 -21
- package/src/mcp-config.js +9 -1
- package/src/mcp-live-client.js +422 -3
- package/src/paths.js +10 -1
- package/src/policy.js +3 -3
- package/src/prelaunch.js +189 -0
- package/src/quality/ai-quality-orchestrator.js +328 -0
- package/src/release-issue-gates.js +252 -0
- package/src/release-operations.js +62 -0
- package/src/release-state.js +0 -0
- package/src/runtime/active-autonomy-core.js +208 -0
- package/src/runtime/agent-compat.js +31 -0
- package/src/runtime/alignment-sentinel.js +165 -0
- package/src/runtime/architect-review.js +326 -0
- package/src/runtime/autonomous-tasks.js +408 -0
- package/src/runtime/build-readiness.js +28 -4
- package/src/runtime/code-graph-rehearse.js +113 -0
- package/src/runtime/codeburn-core.js +112 -0
- package/src/runtime/context-authority.js +40 -0
- package/src/runtime/context-economy-core.js +316 -0
- package/src/runtime/continuity-graph.js +201 -0
- package/src/runtime/continuity-notes.js +71 -26
- package/src/runtime/core-source-ingest.js +379 -0
- package/src/runtime/detached-provider.js +142 -0
- package/src/runtime/doctor-report.js +18 -0
- package/src/runtime/environment-awareness-core.js +460 -0
- package/src/runtime/exposure-catalog.js +276 -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 +307 -0
- package/src/runtime/hook-profiles.js +20 -0
- package/src/runtime/learning-loop-core.js +344 -0
- package/src/runtime/live-agent-verification.js +122 -0
- package/src/runtime/maestro-events.js +18 -0
- package/src/runtime/maestro-manager.js +19 -0
- package/src/runtime/maestro-output.js +58 -0
- package/src/runtime/maestro-state.js +125 -0
- package/src/runtime/managed-markdown.js +29 -0
- package/src/runtime/mcp-authority.js +147 -0
- package/src/runtime/mcp-policy.js +192 -0
- package/src/runtime/obsidian-integration-core.js +1089 -0
- package/src/runtime/obsidian-plugin-bridge.js +1045 -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 +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 +373 -0
- package/src/runtime/runtime-state.js +935 -2
- package/src/runtime/schema-migrations.js +162 -0
- package/src/runtime/semantic-recording-core.js +147 -0
- package/src/runtime/signal-hooks.js +28 -0
- package/src/runtime/skills-registry-export.js +754 -0
- package/src/runtime/task-contracts.js +83 -0
- package/src/runtime/universal-plugin-broker-core.js +898 -0
- package/src/runtime/workspace-intelligence-runtime.js +674 -0
- package/src/runtime/workspace-virtualizer.js +102 -0
- package/src/runtime-artifacts.js +225 -62
- 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 +1166 -96
- 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 -65
- package/docs/skills-publishing.md +0 -255
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { readJson, writeJson } from "../fs-utils.js";
|
|
4
|
+
|
|
5
|
+
export const runtimeSchemaVersion = "0.1.0";
|
|
6
|
+
|
|
7
|
+
const SCAN_ROOTS = [".ma/context", ".ma/learning", ".ma/hooks/receipts", ".ma/obsidian", "mcp"];
|
|
8
|
+
const ROOT_FILES = [".ma/setup-receipt.json"];
|
|
9
|
+
|
|
10
|
+
async function listJsonFiles(root, relative = "") {
|
|
11
|
+
const directory = path.join(root, relative);
|
|
12
|
+
let entries;
|
|
13
|
+
try {
|
|
14
|
+
entries = await fs.readdir(directory, { withFileTypes: true });
|
|
15
|
+
} catch {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const files = [];
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
const child = path.join(relative, entry.name);
|
|
21
|
+
if (entry.isDirectory()) files.push(...(await listJsonFiles(root, child)));
|
|
22
|
+
else if (entry.isFile() && entry.name.endsWith(".json")) files.push(child);
|
|
23
|
+
}
|
|
24
|
+
return files;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function migrationFiles(root) {
|
|
28
|
+
const nested = (
|
|
29
|
+
await Promise.all(SCAN_ROOTS.map((relative) => listJsonFiles(root, relative)))
|
|
30
|
+
).flat();
|
|
31
|
+
return [...new Set([...nested, ...ROOT_FILES])].filter(async (relative) => {
|
|
32
|
+
try {
|
|
33
|
+
return (await fs.stat(path.join(root, relative))).isFile();
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Promise.filter is intentionally avoided: this keeps the scan synchronous in its final form.
|
|
41
|
+
async function existingMigrationFiles(root) {
|
|
42
|
+
const files = await migrationFiles(root);
|
|
43
|
+
return (
|
|
44
|
+
await Promise.all(
|
|
45
|
+
files.map(async (relative) => {
|
|
46
|
+
try {
|
|
47
|
+
return (await fs.stat(path.join(root, relative))).isFile() ? relative : null;
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
)
|
|
53
|
+
).filter(Boolean);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function findOutdatedSchemas(root) {
|
|
57
|
+
const outdated = [];
|
|
58
|
+
for (const relative of await existingMigrationFiles(root)) {
|
|
59
|
+
try {
|
|
60
|
+
const value = await readJson(path.join(root, relative));
|
|
61
|
+
if (!value || Array.isArray(value) || typeof value !== "object") {
|
|
62
|
+
outdated.push({ path: relative, schemaVersion: null, error: "invalid_shape" });
|
|
63
|
+
} else if (value.schemaVersion !== runtimeSchemaVersion) {
|
|
64
|
+
outdated.push({
|
|
65
|
+
path: relative,
|
|
66
|
+
schemaVersion: value.schemaVersion ?? null,
|
|
67
|
+
expected: runtimeSchemaVersion,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
outdated.push({ path: relative, schemaVersion: null, error: "invalid_json" });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return outdated;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function migrateSchemas(root, { dryRun = false, rollback = false } = {}) {
|
|
78
|
+
const files = await existingMigrationFiles(root);
|
|
79
|
+
if (rollback) return rollbackSchemas(root);
|
|
80
|
+
|
|
81
|
+
const plans = [];
|
|
82
|
+
for (const relative of files) {
|
|
83
|
+
try {
|
|
84
|
+
const value = await readJson(path.join(root, relative));
|
|
85
|
+
if (!value || Array.isArray(value) || typeof value !== "object") {
|
|
86
|
+
return {
|
|
87
|
+
status: "failed",
|
|
88
|
+
migrated: [],
|
|
89
|
+
errors: [{ path: relative, error: "invalid_shape" }],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (value.schemaVersion !== runtimeSchemaVersion) {
|
|
93
|
+
plans.push({ relative, value, from: value.schemaVersion ?? null });
|
|
94
|
+
}
|
|
95
|
+
} catch {
|
|
96
|
+
return {
|
|
97
|
+
status: "failed",
|
|
98
|
+
migrated: [],
|
|
99
|
+
errors: [{ path: relative, error: "invalid_json" }],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (dryRun)
|
|
104
|
+
return {
|
|
105
|
+
status: plans.length ? "outdated" : "current",
|
|
106
|
+
dryRun: true,
|
|
107
|
+
migrated: plans.map(({ relative, from }) => ({
|
|
108
|
+
path: relative,
|
|
109
|
+
from,
|
|
110
|
+
to: runtimeSchemaVersion,
|
|
111
|
+
})),
|
|
112
|
+
errors: [],
|
|
113
|
+
};
|
|
114
|
+
if (plans.length === 0) return { status: "current", migrated: [], errors: [] };
|
|
115
|
+
|
|
116
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
117
|
+
const backupRoot = path.join(root, ".ma", "migrations", "backups", stamp);
|
|
118
|
+
for (const { relative, value } of plans) {
|
|
119
|
+
const target = path.join(root, relative);
|
|
120
|
+
const backup = path.join(backupRoot, relative);
|
|
121
|
+
await fs.mkdir(path.dirname(backup), { recursive: true });
|
|
122
|
+
await fs.copyFile(target, backup);
|
|
123
|
+
await writeJson(target, { ...value, schemaVersion: runtimeSchemaVersion });
|
|
124
|
+
}
|
|
125
|
+
await writeJson(path.join(root, ".ma", "migrations", "latest.json"), {
|
|
126
|
+
schemaVersion: runtimeSchemaVersion,
|
|
127
|
+
createdAt: new Date().toISOString(),
|
|
128
|
+
backupRoot: path.relative(root, backupRoot),
|
|
129
|
+
files: plans.map(({ relative }) => relative),
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
status: "migrated",
|
|
133
|
+
backupRoot: path.relative(root, backupRoot),
|
|
134
|
+
migrated: plans.map(({ relative, from }) => ({
|
|
135
|
+
path: relative,
|
|
136
|
+
from,
|
|
137
|
+
to: runtimeSchemaVersion,
|
|
138
|
+
})),
|
|
139
|
+
errors: [],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function rollbackSchemas(root) {
|
|
144
|
+
let receipt;
|
|
145
|
+
try {
|
|
146
|
+
receipt = await readJson(path.join(root, ".ma", "migrations", "latest.json"));
|
|
147
|
+
} catch {
|
|
148
|
+
return { status: "current", restored: [], errors: [] };
|
|
149
|
+
}
|
|
150
|
+
const restored = [];
|
|
151
|
+
for (const relative of receipt.files ?? []) {
|
|
152
|
+
const source = path.join(root, receipt.backupRoot, relative);
|
|
153
|
+
const target = path.join(root, relative);
|
|
154
|
+
try {
|
|
155
|
+
await fs.copyFile(source, target);
|
|
156
|
+
restored.push(relative);
|
|
157
|
+
} catch {
|
|
158
|
+
return { status: "failed", restored, errors: [{ path: relative, error: "backup_missing" }] };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return { status: "rolled_back", restored, errors: [] };
|
|
162
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ensureDir, readJson, writeFileIfMissing } from "../fs-utils.js";
|
|
2
|
+
import { getRuntimeSubsystemPath } from "../paths.js";
|
|
3
|
+
|
|
4
|
+
export const semanticRecordingCoreSchemaVersion = "0.1.0";
|
|
5
|
+
|
|
6
|
+
export function getSemanticRecordingCorePath() {
|
|
7
|
+
return getRuntimeSubsystemPath("context", "recording-core.json");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function createDefaultSemanticRecordingCore() {
|
|
11
|
+
return {
|
|
12
|
+
schemaVersion: semanticRecordingCoreSchemaVersion,
|
|
13
|
+
product: "Meta-Architect",
|
|
14
|
+
purpose:
|
|
15
|
+
"First-party semantic recording map for MA runtime context, coordination, evidence, memory, and execution artifacts.",
|
|
16
|
+
layers: [
|
|
17
|
+
{
|
|
18
|
+
id: "activity_trace",
|
|
19
|
+
semantic_role: "automatic_runtime_trace",
|
|
20
|
+
mechanism: "runtime_hooks",
|
|
21
|
+
authority: "append_only_hook_layer",
|
|
22
|
+
paths: [".ma/logs/maestro-events.ndjson", ".ma/hooks/audit.log"],
|
|
23
|
+
applies_to: ["$maestro", "gated_lanes", "helper_skills", "team_workers"],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "lifecycle_state",
|
|
27
|
+
semantic_role: "mode_and_run_lifecycle",
|
|
28
|
+
mechanism: "ma_runtime_state_api",
|
|
29
|
+
authority: "leader_or_owning_lane",
|
|
30
|
+
paths: [".ma/state/maestro-state.json", ".ma/state/manager-runs.json"],
|
|
31
|
+
applies_to: ["$maestro", "owning_lanes", "executor_roles", "verifier_roles"],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "brain_context",
|
|
35
|
+
semantic_role: "operator_brain_and_project_context",
|
|
36
|
+
mechanism: "ma_context_memory_api",
|
|
37
|
+
authority: "provenance_marked_context_only",
|
|
38
|
+
paths: [".ma/context/project.md", ".ma/context/recording-core.json", ".ma/memory/notes.md"],
|
|
39
|
+
applies_to: ["all_applicable_agents", "all_applicable_roles"],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "executable_intent",
|
|
43
|
+
semantic_role: "approved_plan_and_test_shape",
|
|
44
|
+
mechanism: "lane_owned_artifacts",
|
|
45
|
+
authority: "owning_lane",
|
|
46
|
+
paths: [".ma/plans/", ".ma/specs/", ".ma/decisions.json"],
|
|
47
|
+
applies_to: ["$arch", "$sage", "$flow", "$vet", "$vibe", "$build", "ralph_execution_core"],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "technical_evidence",
|
|
51
|
+
semantic_role: "build_and_release_evidence",
|
|
52
|
+
mechanism: "evidence_lane_and_mcp_sources",
|
|
53
|
+
authority: "$sage_or_owning_review_lane",
|
|
54
|
+
paths: [".ma/evidence/sources.json", ".ma/evidence/audits.json", "mcp/servers.json"],
|
|
55
|
+
applies_to: ["$sage", "$vet", "$build", "reviewer_roles"],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "coordination_plane",
|
|
59
|
+
semantic_role: "task_claims_mailbox_and_workspace_scope",
|
|
60
|
+
mechanism: "ma_task_workspace_runtime",
|
|
61
|
+
authority: "leader_dispatch_with_worker_proposals",
|
|
62
|
+
paths: [".ma/tasks/", ".ma/workspaces/"],
|
|
63
|
+
applies_to: ["$maestro", "team_workers", "executor_roles", "verifier_roles"],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
default_core_capabilities: {
|
|
67
|
+
obsidian_integration_core: {
|
|
68
|
+
semantic_role: "brain_context",
|
|
69
|
+
meaning: "Obsidian supplies operator notes, vault graph, and long-lived brain context.",
|
|
70
|
+
records_as: "vault_context",
|
|
71
|
+
never_records_as: "build_evidence",
|
|
72
|
+
authority:
|
|
73
|
+
"Plugin-side actions may queue requests or expose note-selection metadata; authoritative changes return through MA lanes.",
|
|
74
|
+
applies_to: ["all_applicable_agents", "all_applicable_roles", "exported_host_payloads"],
|
|
75
|
+
},
|
|
76
|
+
context_economy_core: {
|
|
77
|
+
semantic_role: "context_budget",
|
|
78
|
+
meaning:
|
|
79
|
+
"MA-owned terse summaries reduce context load while preserving exact technical terms, warnings, schemas, and evidence.",
|
|
80
|
+
safety_valves: [
|
|
81
|
+
"security_warning",
|
|
82
|
+
"irreversible_action",
|
|
83
|
+
"user_confusion",
|
|
84
|
+
"legal_financial_medical_or_high_stakes_guidance",
|
|
85
|
+
"verification_failure",
|
|
86
|
+
],
|
|
87
|
+
applies_to: [
|
|
88
|
+
"all_applicable_agents",
|
|
89
|
+
"all_applicable_roles",
|
|
90
|
+
"mcp_descriptors",
|
|
91
|
+
"docs_issues_summaries",
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
ralph_execution_core: {
|
|
95
|
+
semantic_role: "story_execution",
|
|
96
|
+
meaning:
|
|
97
|
+
"Executor-capable agents and roles consume the same approved PRD/progress contract after MA gates pass.",
|
|
98
|
+
authority: "$maestro_or_owning_lane_dispatch",
|
|
99
|
+
applies_to: ["executor_roles", "team_workers", "verifier_followups", "reviewer_followups"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
hard_rules: [
|
|
103
|
+
"MA runtime artifacts use first-party .ma paths and product language.",
|
|
104
|
+
"Obsidian-derived claims are vault_context unless another owning lane explicitly promotes them with evidence.",
|
|
105
|
+
"Context Economy Core cannot remove warnings, schemas, authority fields, verification failures, or known gaps.",
|
|
106
|
+
"Ralph Execution Core cannot bypass $arch -> $sage -> $flow -> $vet -> $vibe -> $build.",
|
|
107
|
+
"Helper roles and workers inherit default-core contracts but do not gain independent release-state authority.",
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function validateSemanticRecordingCore(value) {
|
|
113
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
114
|
+
throw new Error("semantic recording core must be an object");
|
|
115
|
+
}
|
|
116
|
+
if (value.schemaVersion !== semanticRecordingCoreSchemaVersion) {
|
|
117
|
+
throw new Error(`Unsupported semantic recording core schemaVersion: ${value.schemaVersion}`);
|
|
118
|
+
}
|
|
119
|
+
if (!Array.isArray(value.layers) || value.layers.length === 0) {
|
|
120
|
+
throw new Error("semantic recording core requires non-empty layers");
|
|
121
|
+
}
|
|
122
|
+
if (!value.default_core_capabilities || typeof value.default_core_capabilities !== "object") {
|
|
123
|
+
throw new Error("semantic recording core requires default_core_capabilities");
|
|
124
|
+
}
|
|
125
|
+
if (
|
|
126
|
+
value.default_core_capabilities.obsidian_integration_core?.records_as !== "vault_context" ||
|
|
127
|
+
value.default_core_capabilities.obsidian_integration_core?.never_records_as !== "build_evidence"
|
|
128
|
+
) {
|
|
129
|
+
throw new Error("Obsidian Integration Core must record as vault_context, not build_evidence");
|
|
130
|
+
}
|
|
131
|
+
if (JSON.stringify(value).includes(".omx")) {
|
|
132
|
+
throw new Error("semantic recording core must not expose OMX runtime paths");
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export async function seedSemanticRecordingCoreArtifacts() {
|
|
138
|
+
await ensureDir(getRuntimeSubsystemPath("context"));
|
|
139
|
+
await writeFileIfMissing(
|
|
140
|
+
getSemanticRecordingCorePath(),
|
|
141
|
+
`${JSON.stringify(createDefaultSemanticRecordingCore(), null, 2)}\n`,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export async function loadSemanticRecordingCore() {
|
|
146
|
+
return validateSemanticRecordingCore(await readJson(getSemanticRecordingCorePath()));
|
|
147
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import { ensureDir, readJson, writeFileIfMissing } from "../fs-utils.js";
|
|
3
4
|
import { getRuntimeSubsystemPath } from "../paths.js";
|
|
4
5
|
|
|
@@ -34,6 +35,21 @@ export async function seedSignalHookArtifacts() {
|
|
|
34
35
|
schemaVersion: "0.1.0",
|
|
35
36
|
compatibilityNamespace: ["prebuild", "prerelease"],
|
|
36
37
|
runtimeNamespace: runtimeEvents,
|
|
38
|
+
activeAutonomy: {
|
|
39
|
+
enabled: true,
|
|
40
|
+
stopPolicy: "block_passive_permission_handoff_when_auto_continue_applies",
|
|
41
|
+
defaultResponse:
|
|
42
|
+
"AUTO-CONTINUE: continue the current safe branch, execute the next reversible step, then verify before reporting.",
|
|
43
|
+
stallPatterns: [
|
|
44
|
+
"should i proceed",
|
|
45
|
+
"would you like me to continue",
|
|
46
|
+
"if you want, i can",
|
|
47
|
+
"if you'd like, i can",
|
|
48
|
+
"tell me if you want me to",
|
|
49
|
+
"i can continue if you want",
|
|
50
|
+
"let me know if you want me to continue",
|
|
51
|
+
],
|
|
52
|
+
},
|
|
37
53
|
hooks: [],
|
|
38
54
|
},
|
|
39
55
|
null,
|
|
@@ -50,3 +66,15 @@ export async function loadRuntimeHooksConfig() {
|
|
|
50
66
|
export async function loadRuntimeHooksAuditLog() {
|
|
51
67
|
return fs.readFile(getRuntimeHooksAuditPath(), "utf8");
|
|
52
68
|
}
|
|
69
|
+
|
|
70
|
+
export async function loadRuntimeHookReceipts() {
|
|
71
|
+
const root = path.join(getRuntimeHooksRoot(), "receipts");
|
|
72
|
+
const entries = await fs.readdir(root, { withFileTypes: true }).catch(() => []);
|
|
73
|
+
return Promise.all(
|
|
74
|
+
entries
|
|
75
|
+
.filter((entry) => entry.isFile() && entry.name.endsWith(".json"))
|
|
76
|
+
.sort((left, right) => right.name.localeCompare(left.name))
|
|
77
|
+
.slice(0, 20)
|
|
78
|
+
.map((entry) => readJson(path.join(root, entry.name))),
|
|
79
|
+
);
|
|
80
|
+
}
|