@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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ensureDir, readJson, writeFileIfMissing } from "../fs-utils.js";
|
|
2
|
+
import { getRepoRoot, getRuntimeSubsystemPath } from "../paths.js";
|
|
3
|
+
|
|
4
|
+
export const workspaceVirtualizerSchemaVersion = "0.1.0";
|
|
5
|
+
|
|
6
|
+
export function getWorkspaceVirtualizerPath() {
|
|
7
|
+
return getRuntimeSubsystemPath("context", "workspace-virtualizer.json");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function createDefaultWorkspaceVirtualizer() {
|
|
11
|
+
return {
|
|
12
|
+
schemaVersion: workspaceVirtualizerSchemaVersion,
|
|
13
|
+
product: "Meta-Architect",
|
|
14
|
+
purpose:
|
|
15
|
+
"Defines bounded synthetic workspace verification without replacing real source or production release evidence.",
|
|
16
|
+
evidence_boundary: {
|
|
17
|
+
records_as: "virtual_workspace_result",
|
|
18
|
+
never_records_as: "production_evidence",
|
|
19
|
+
production_promotion_requires: ["real_workspace_test", "release_issue_gate_proof"],
|
|
20
|
+
},
|
|
21
|
+
mutation_policy: {
|
|
22
|
+
default: "read_only",
|
|
23
|
+
may_mutate_source: false,
|
|
24
|
+
may_mutate_release_state: false,
|
|
25
|
+
},
|
|
26
|
+
applies_to: ["$build", "executor_roles", "verifier_roles"],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function validateWorkspaceVirtualizer(value) {
|
|
31
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
32
|
+
throw new Error("workspace virtualizer must be an object");
|
|
33
|
+
}
|
|
34
|
+
if (value.schemaVersion !== workspaceVirtualizerSchemaVersion) {
|
|
35
|
+
throw new Error(`Unsupported workspace virtualizer schemaVersion: ${value.schemaVersion}`);
|
|
36
|
+
}
|
|
37
|
+
if (value.evidence_boundary?.records_as !== "virtual_workspace_result") {
|
|
38
|
+
throw new Error("workspace virtualizer must record as virtual_workspace_result");
|
|
39
|
+
}
|
|
40
|
+
if (value.evidence_boundary?.never_records_as !== "production_evidence") {
|
|
41
|
+
throw new Error("workspace virtualizer must not record as production_evidence");
|
|
42
|
+
}
|
|
43
|
+
if (value.mutation_policy?.may_mutate_source !== false) {
|
|
44
|
+
throw new Error("workspace virtualizer must not mutate source by default");
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function seedWorkspaceVirtualizerArtifacts() {
|
|
50
|
+
await ensureDir(getRuntimeSubsystemPath("context"));
|
|
51
|
+
await writeFileIfMissing(
|
|
52
|
+
getWorkspaceVirtualizerPath(),
|
|
53
|
+
`${JSON.stringify(createDefaultWorkspaceVirtualizer(), null, 2)}\n`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function loadWorkspaceVirtualizer() {
|
|
58
|
+
return validateWorkspaceVirtualizer(await readJson(getWorkspaceVirtualizerPath()));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function createVirtualWorkspacePlan({
|
|
62
|
+
commands = [],
|
|
63
|
+
touchpoints = [],
|
|
64
|
+
root = getRepoRoot(),
|
|
65
|
+
}) {
|
|
66
|
+
return {
|
|
67
|
+
record_type: "virtual_workspace_result",
|
|
68
|
+
root,
|
|
69
|
+
source_mutation_allowed: false,
|
|
70
|
+
production_evidence: false,
|
|
71
|
+
commands: commands.filter((command) => typeof command === "string" && command.trim()),
|
|
72
|
+
touchpoints: touchpoints.filter((filePath) => typeof filePath === "string" && filePath.trim()),
|
|
73
|
+
required_followup:
|
|
74
|
+
"Run the equivalent checks against the real workspace before production pass.",
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function createVirtualVerificationReceipt({ plan, commandResults = [] }) {
|
|
79
|
+
if (plan?.record_type !== "virtual_workspace_result") {
|
|
80
|
+
throw new Error("Virtual verification receipt requires a virtual workspace plan");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const normalizedResults = commandResults.map((result) => ({
|
|
84
|
+
command: `${result.command ?? ""}`.trim(),
|
|
85
|
+
exitCode: Number.isInteger(result.exitCode) ? result.exitCode : null,
|
|
86
|
+
outputPreview: `${result.outputPreview ?? ""}`.slice(0, 500),
|
|
87
|
+
}));
|
|
88
|
+
const passed =
|
|
89
|
+
normalizedResults.length > 0 &&
|
|
90
|
+
normalizedResults.every((result) => result.command && result.exitCode === 0);
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
record_type: "virtual_verification_receipt",
|
|
94
|
+
records_as: "virtual_workspace_result",
|
|
95
|
+
passed,
|
|
96
|
+
production_evidence: false,
|
|
97
|
+
source_mutation_allowed: false,
|
|
98
|
+
commands: normalizedResults,
|
|
99
|
+
touchpoints: plan.touchpoints,
|
|
100
|
+
required_followup: plan.required_followup,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
File without changes
|
package/src/runtime-artifacts.js
CHANGED
|
@@ -52,6 +52,36 @@ function renderRuntimeSummary(summary) {
|
|
|
52
52
|
`- manager runs: ${summary.managerRunCount}`,
|
|
53
53
|
`- active manager runs: ${summary.activeManagerRunCount}`,
|
|
54
54
|
`- waiting-review manager runs: ${summary.waitingReviewManagerRunCount}`,
|
|
55
|
+
`- maestro global status: ${summary.maestroGlobalStatus}`,
|
|
56
|
+
`- maestro runtime tracks: ${summary.maestroTrackCount}`,
|
|
57
|
+
`- active autonomy ask-only reasons: ${summary.activeAutonomyAskOnlyCount}`,
|
|
58
|
+
`- active autonomy stall patterns: ${summary.activeAutonomyStallPatternCount}`,
|
|
59
|
+
`- active autonomy hook enabled: ${summary.activeAutonomyHookEnabled}`,
|
|
60
|
+
`- semantic recording layers: ${summary.semanticRecordingLayerCount}`,
|
|
61
|
+
`- default core capabilities: ${summary.semanticDefaultCoreCount}`,
|
|
62
|
+
`- learning loop domains: ${summary.learningLoopDomainCount}`,
|
|
63
|
+
`- learning loop records: ${summary.learningLoopRecordCount}`,
|
|
64
|
+
`- prompt strategy technique families: ${summary.promptStrategyTechniqueFamilyCount}`,
|
|
65
|
+
`- prompt strategy lane policies: ${summary.promptStrategyLaneCount}`,
|
|
66
|
+
`- context economy applies-to surfaces: ${summary.contextEconomyAppliesToCount}`,
|
|
67
|
+
`- context economy exact-preserve rules: ${summary.contextEconomyPreserveExactCount}`,
|
|
68
|
+
`- context economy safety valves: ${summary.contextEconomySafetyValveCount}`,
|
|
69
|
+
`- Obsidian bridge records as: ${summary.obsidianBridgeRecordsAs}`,
|
|
70
|
+
`- Obsidian bridge never records as: ${summary.obsidianBridgeNeverRecordsAs}`,
|
|
71
|
+
`- Obsidian queued plugin requests: ${summary.obsidianBridgeQueuedRequestCount}`,
|
|
72
|
+
`- Obsidian note selections: ${summary.obsidianBridgeNoteSelectionCount}`,
|
|
73
|
+
`- Obsidian tag graph claims: ${summary.obsidianBridgeTagGraphClaimCount}`,
|
|
74
|
+
`- workspace virtualizer records as: ${summary.workspaceVirtualizerRecordsAs}`,
|
|
75
|
+
`- code graph rehearse max steps: ${summary.codeGraphRehearseMaxSteps}`,
|
|
76
|
+
`- skills registry universal targets: ${summary.skillsRegistryUniversalTargetCount}`,
|
|
77
|
+
`- skills registry non-universal targets: ${summary.skillsRegistryNonUniversalTargetCount}`,
|
|
78
|
+
`- capability composition entries: ${summary.capabilityCompositionCount}`,
|
|
79
|
+
`- workspace context channels: ${summary.workspaceContextChannelCount}`,
|
|
80
|
+
`- workspace effectiveness ready: ${summary.workspaceEffectivenessReady}`,
|
|
81
|
+
`- workspace effectiveness checks: ${summary.workspaceEffectivenessCheckCount}`,
|
|
82
|
+
`- semantic receipts: ${summary.semanticReceiptCount}`,
|
|
83
|
+
`- Obsidian semantic role: ${summary.obsidianSemanticRole}`,
|
|
84
|
+
`- Obsidian records as: ${summary.obsidianRecordsAs}`,
|
|
55
85
|
`- build status: ${summary.buildStatus}`,
|
|
56
86
|
`- missing runtime artifacts: ${summary.missingArtifacts.length}`,
|
|
57
87
|
`- invalid runtime artifacts: ${summary.invalidArtifacts.length}`,
|
|
@@ -59,6 +89,51 @@ function renderRuntimeSummary(summary) {
|
|
|
59
89
|
];
|
|
60
90
|
}
|
|
61
91
|
|
|
92
|
+
function renderListSection(title, items, fallback = "None.") {
|
|
93
|
+
return [
|
|
94
|
+
`## ${title}`,
|
|
95
|
+
"",
|
|
96
|
+
...(items.length === 0 ? [fallback] : items.map((item) => `- ${item}`)),
|
|
97
|
+
"",
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function renderKeyValueSection(title, entries, fallback = "None.") {
|
|
102
|
+
const lines = [`## ${title}`, ""];
|
|
103
|
+
if (entries.length === 0) {
|
|
104
|
+
lines.push(fallback, "");
|
|
105
|
+
return lines;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
for (const [label, value] of entries) {
|
|
109
|
+
lines.push(`- ${label}: ${value}`);
|
|
110
|
+
}
|
|
111
|
+
lines.push("");
|
|
112
|
+
return lines;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function renderSharedDecisionSections({
|
|
116
|
+
decision,
|
|
117
|
+
status,
|
|
118
|
+
evidence = [],
|
|
119
|
+
blockers = [],
|
|
120
|
+
nextAllowedTriggers = [],
|
|
121
|
+
}) {
|
|
122
|
+
return [
|
|
123
|
+
"## Decision",
|
|
124
|
+
"",
|
|
125
|
+
decision,
|
|
126
|
+
"",
|
|
127
|
+
"## Status",
|
|
128
|
+
"",
|
|
129
|
+
status,
|
|
130
|
+
"",
|
|
131
|
+
...renderListSection("Evidence", evidence),
|
|
132
|
+
...renderListSection("Blockers", blockers),
|
|
133
|
+
...renderListSection("Next Allowed Triggers", nextAllowedTriggers, "`$maestro`"),
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
|
|
62
137
|
function formatManagerHelper(helper) {
|
|
63
138
|
return `${helper.skill}: ${helper.objective} [${helper.status}]`;
|
|
64
139
|
}
|
|
@@ -110,12 +185,49 @@ function renderManagerSection(managerRun) {
|
|
|
110
185
|
return lines;
|
|
111
186
|
}
|
|
112
187
|
|
|
188
|
+
function renderBuildContextBoundaries(runtimeSummary) {
|
|
189
|
+
if (!runtimeSummary) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return [
|
|
194
|
+
"## Context Boundaries",
|
|
195
|
+
"",
|
|
196
|
+
"- Virtual workspace output is context only; it must not be counted as production proof.",
|
|
197
|
+
`- virtual workspace records as: ${runtimeSummary.workspaceVirtualizerRecordsAs}`,
|
|
198
|
+
`- virtual workspace never records as: ${runtimeSummary.workspaceVirtualizerNeverRecordsAs}`,
|
|
199
|
+
`- virtual workspace source mutation allowed: ${runtimeSummary.workspaceVirtualizerSourceMutationAllowed}`,
|
|
200
|
+
"- Code-graph rehearsal is a bounded read-only preview; it must not unlock source mutation or release promotion.",
|
|
201
|
+
`- code graph rehearsal records as: ${runtimeSummary.codeGraphRehearseRecordsAs}`,
|
|
202
|
+
`- code graph rehearsal max steps: ${runtimeSummary.codeGraphRehearseMaxSteps}`,
|
|
203
|
+
`- code graph rehearsal source mutation allowed: ${runtimeSummary.codeGraphRehearseSourceMutationAllowed}`,
|
|
204
|
+
"- Exported skills are compatibility payloads; canonical authority stays with `$maestro` or the owning lane.",
|
|
205
|
+
`- skills registry canonical dir: ${runtimeSummary.skillsRegistryCanonicalDir}`,
|
|
206
|
+
`- exported skills may mutate release state: ${runtimeSummary.skillsRegistryReleaseMutationAllowed}`,
|
|
207
|
+
`- Obsidian context records as: ${runtimeSummary.obsidianRecordsAs}`,
|
|
208
|
+
`- Obsidian bridge records as: ${runtimeSummary.obsidianBridgeRecordsAs}`,
|
|
209
|
+
"- Obsidian/vault-derived claims are brain context, not build evidence.",
|
|
210
|
+
"",
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
|
|
113
214
|
function renderArchitectureSpec({ idea, blueprint, runtimeSummary }) {
|
|
215
|
+
const evidence = blueprint.evidence ?? [
|
|
216
|
+
`Workload assumptions: ${(blueprint.workloadAssumptions ?? []).join(", ") || "baseline assumptions only"}`,
|
|
217
|
+
`Suggested stack count: ${blueprint.suggestedStack.length}`,
|
|
218
|
+
];
|
|
114
219
|
return [
|
|
115
220
|
"# Architecture Spec",
|
|
116
221
|
"",
|
|
117
222
|
`Updated: ${new Date().toISOString()}`,
|
|
118
223
|
"",
|
|
224
|
+
...renderSharedDecisionSections({
|
|
225
|
+
decision: blueprint.decision ?? "Approve the first bounded architecture direction.",
|
|
226
|
+
status: blueprint.status ?? "APPROVED",
|
|
227
|
+
evidence,
|
|
228
|
+
blockers: blueprint.blockers ?? [],
|
|
229
|
+
nextAllowedTriggers: blueprint.nextAllowedTriggers ?? ["`$sage`"],
|
|
230
|
+
}),
|
|
119
231
|
"## Problem Statement",
|
|
120
232
|
"",
|
|
121
233
|
idea,
|
|
@@ -128,32 +240,42 @@ function renderArchitectureSpec({ idea, blueprint, runtimeSummary }) {
|
|
|
128
240
|
"",
|
|
129
241
|
...blueprint.suggestedStack.map((item) => `- ${item}`),
|
|
130
242
|
"",
|
|
243
|
+
...renderListSection("Rejected Alternatives", blueprint.rejectedAlternatives ?? []),
|
|
131
244
|
"## Intended Outcome",
|
|
132
245
|
"",
|
|
133
246
|
blueprint.outcome,
|
|
134
247
|
"",
|
|
135
248
|
...renderRuntimeSummary(runtimeSummary),
|
|
136
|
-
"## Next Recommended Trigger",
|
|
137
|
-
"",
|
|
138
|
-
"`$sage`",
|
|
139
|
-
"",
|
|
140
249
|
].join("\n");
|
|
141
250
|
}
|
|
142
251
|
|
|
143
252
|
function renderEvidenceSpec({ idea, sourceEntries, verified, blockers, runtimeSummary }) {
|
|
144
253
|
const status = verified ? "VERIFIED" : sourceEntries.length > 0 ? "PARTIAL" : "MISSING";
|
|
254
|
+
const evidenceGrade = verified ? "VERIFIED" : sourceEntries.length > 0 ? "PARTIAL" : "MISSING";
|
|
145
255
|
const lines = [
|
|
146
256
|
"# Evidence Spec",
|
|
147
257
|
"",
|
|
148
258
|
`Updated: ${new Date().toISOString()}`,
|
|
149
259
|
"",
|
|
260
|
+
...renderSharedDecisionSections({
|
|
261
|
+
decision: verified
|
|
262
|
+
? "Approve the current source-backed stack direction."
|
|
263
|
+
: "Evidence remains incomplete; keep the recommendation conditional.",
|
|
264
|
+
status,
|
|
265
|
+
evidence: sourceEntries.map((source) => `${source.repo} (${source.category})`),
|
|
266
|
+
blockers,
|
|
267
|
+
nextAllowedTriggers: verified ? ["`$flow`"] : ["`$sage`"],
|
|
268
|
+
}),
|
|
150
269
|
"## Probe Basis",
|
|
151
270
|
"",
|
|
152
271
|
idea,
|
|
153
272
|
"",
|
|
154
|
-
"
|
|
273
|
+
...renderKeyValueSection("Evidence Grade", [["grade", evidenceGrade]]),
|
|
274
|
+
"## Exact Upstream Mapping",
|
|
155
275
|
"",
|
|
156
|
-
|
|
276
|
+
...(sourceEntries.length === 0
|
|
277
|
+
? ["No upstream mappings recorded."]
|
|
278
|
+
: sourceEntries.map((source) => `- ${source.repo} -> ${source.endpoint}`)),
|
|
157
279
|
"",
|
|
158
280
|
"## Sources",
|
|
159
281
|
"",
|
|
@@ -176,15 +298,7 @@ function renderEvidenceSpec({ idea, sourceEntries, verified, blockers, runtimeSu
|
|
|
176
298
|
lines.push("");
|
|
177
299
|
}
|
|
178
300
|
|
|
179
|
-
lines.push("## Blockers", "");
|
|
180
|
-
if (blockers.length === 0) {
|
|
181
|
-
lines.push("None.", "");
|
|
182
|
-
} else {
|
|
183
|
-
lines.push(...blockers.map((blocker) => `- ${blocker}`), "");
|
|
184
|
-
}
|
|
185
|
-
|
|
186
301
|
lines.push(...renderRuntimeSummary(runtimeSummary));
|
|
187
|
-
lines.push("## Next Recommended Trigger", "", verified ? "`$flow`" : "`$sage`", "");
|
|
188
302
|
return lines.join("\n");
|
|
189
303
|
}
|
|
190
304
|
|
|
@@ -194,22 +308,17 @@ function renderLogicSpec(logicMap) {
|
|
|
194
308
|
"",
|
|
195
309
|
`Updated: ${new Date().toISOString()}`,
|
|
196
310
|
"",
|
|
197
|
-
...(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
311
|
+
...renderSharedDecisionSections({
|
|
312
|
+
decision:
|
|
313
|
+
logicMap.decision ?? "Validate the current behavioral model before later gates proceed.",
|
|
314
|
+
status: logicMap.status ?? (logicMap.blockers.length === 0 ? "GREEN" : "RED"),
|
|
315
|
+
evidence: logicMap.evidence ?? logicMap.actors.map((actor) => `actor: ${actor}`),
|
|
316
|
+
blockers: logicMap.blockers,
|
|
317
|
+
nextAllowedTriggers: logicMap.nextAllowedTriggers ?? [logicMap.nextTrigger ?? "`$vet`"],
|
|
318
|
+
}),
|
|
319
|
+
...renderListSection("State Map", logicMap.stateMap ?? logicMap.states),
|
|
320
|
+
...renderListSection("Failure Flows", logicMap.failureFlows ?? []),
|
|
204
321
|
...(logicMap.runtimeSummary ? renderRuntimeSummary(logicMap.runtimeSummary) : []),
|
|
205
|
-
"## Blockers",
|
|
206
|
-
"",
|
|
207
|
-
...(logicMap.blockers.length === 0 ? ["None."] : logicMap.blockers.map((item) => `- ${item}`)),
|
|
208
|
-
"",
|
|
209
|
-
"## Next Recommended Trigger",
|
|
210
|
-
"",
|
|
211
|
-
logicMap.nextTrigger ?? "`$vet`",
|
|
212
|
-
"",
|
|
213
322
|
].join("\n");
|
|
214
323
|
}
|
|
215
324
|
|
|
@@ -225,22 +334,26 @@ function renderSecuritySpec({
|
|
|
225
334
|
"",
|
|
226
335
|
`Updated: ${new Date().toISOString()}`,
|
|
227
336
|
"",
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
337
|
+
...renderSharedDecisionSections({
|
|
338
|
+
decision:
|
|
339
|
+
finding.unresolved === false
|
|
340
|
+
? "Security posture is acceptable for the current bounded release step."
|
|
341
|
+
: "Security review remains provisional until explicit approval evidence exists.",
|
|
342
|
+
status: finding.unresolved === false ? "GREEN" : "PENDING",
|
|
343
|
+
evidence: [`severity: ${finding.severity}`, `summary: ${finding.summary}`],
|
|
344
|
+
blockers: finding.unresolved
|
|
345
|
+
? ["Security review evidence has not been explicitly approved yet."]
|
|
346
|
+
: [],
|
|
347
|
+
nextAllowedTriggers: [nextTrigger],
|
|
348
|
+
}),
|
|
349
|
+
...renderListSection("Trust Boundaries", finding.trustBoundaries ?? []),
|
|
350
|
+
...renderListSection("Accepted Risks", finding.acceptedRisks ?? []),
|
|
234
351
|
"## Evidence Files",
|
|
235
352
|
"",
|
|
236
353
|
`- audits logged: ${auditCount}`,
|
|
237
354
|
`- cve entries logged: ${cveCount}`,
|
|
238
355
|
"",
|
|
239
356
|
...renderRuntimeSummary(runtimeSummary),
|
|
240
|
-
"## Next Recommended Trigger",
|
|
241
|
-
"",
|
|
242
|
-
nextTrigger,
|
|
243
|
-
"",
|
|
244
357
|
].join("\n");
|
|
245
358
|
}
|
|
246
359
|
|
|
@@ -250,20 +363,26 @@ function renderExperienceSpec({ note, outcomeCount, runtimeSummary, nextTrigger
|
|
|
250
363
|
"",
|
|
251
364
|
`Updated: ${new Date().toISOString()}`,
|
|
252
365
|
"",
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
366
|
+
...renderSharedDecisionSections({
|
|
367
|
+
decision:
|
|
368
|
+
note.approved === true
|
|
369
|
+
? "DX/UX friction is acceptable for the current bounded release step."
|
|
370
|
+
: "DX/UX review remains provisional until explicit approval evidence exists.",
|
|
371
|
+
status: note.approved === true ? "GREEN" : "PENDING",
|
|
372
|
+
evidence: [`area: ${note.area}`, `summary: ${note.summary}`],
|
|
373
|
+
blockers:
|
|
374
|
+
note.approved === true
|
|
375
|
+
? []
|
|
376
|
+
: ["DX/UX review evidence has not been explicitly approved yet."],
|
|
377
|
+
nextAllowedTriggers: [nextTrigger],
|
|
378
|
+
}),
|
|
379
|
+
...renderListSection("Operator Friction", note.operatorFriction ?? []),
|
|
380
|
+
...renderListSection("User Friction", note.userFriction ?? []),
|
|
258
381
|
"## Evidence Files",
|
|
259
382
|
"",
|
|
260
383
|
`- outcomes logged: ${outcomeCount}`,
|
|
261
384
|
"",
|
|
262
385
|
...renderRuntimeSummary(runtimeSummary),
|
|
263
|
-
"## Next Recommended Trigger",
|
|
264
|
-
"",
|
|
265
|
-
nextTrigger,
|
|
266
|
-
"",
|
|
267
386
|
].join("\n");
|
|
268
387
|
}
|
|
269
388
|
|
|
@@ -351,9 +470,14 @@ function renderMaestroPlan({
|
|
|
351
470
|
|
|
352
471
|
function renderBuildPlan({
|
|
353
472
|
allowed,
|
|
473
|
+
gateState = allowed ? "READY" : "LOCKED",
|
|
354
474
|
blockers,
|
|
355
475
|
nextTriggers,
|
|
356
476
|
suggestedBranches = [],
|
|
477
|
+
buildSlice = [],
|
|
478
|
+
verificationPlan = [],
|
|
479
|
+
repairPath = [],
|
|
480
|
+
completionEvidence = [],
|
|
357
481
|
runtimeSummary = null,
|
|
358
482
|
}) {
|
|
359
483
|
const lines = [
|
|
@@ -361,27 +485,48 @@ function renderBuildPlan({
|
|
|
361
485
|
"",
|
|
362
486
|
`Updated: ${new Date().toISOString()}`,
|
|
363
487
|
"",
|
|
488
|
+
...renderSharedDecisionSections({
|
|
489
|
+
decision:
|
|
490
|
+
gateState === "DONE"
|
|
491
|
+
? "Complete the current bounded build slice and proceed to merge."
|
|
492
|
+
: gateState === "RUNNING"
|
|
493
|
+
? "Continue the active bounded build execution substep."
|
|
494
|
+
: gateState === "READY"
|
|
495
|
+
? "Prepare and begin the next bounded build execution substep."
|
|
496
|
+
: "Build execution remains locked under the current runtime and release state.",
|
|
497
|
+
status: gateState,
|
|
498
|
+
evidence: completionEvidence,
|
|
499
|
+
blockers,
|
|
500
|
+
nextAllowedTriggers: nextTriggers,
|
|
501
|
+
}),
|
|
364
502
|
"## Gate State",
|
|
365
503
|
"",
|
|
366
|
-
|
|
367
|
-
"",
|
|
368
|
-
"## Blockers",
|
|
504
|
+
gateState,
|
|
369
505
|
"",
|
|
370
506
|
];
|
|
371
507
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
508
|
+
lines.push(...renderRuntimeSummary(runtimeSummary));
|
|
509
|
+
lines.push(...renderBuildContextBoundaries(runtimeSummary));
|
|
510
|
+
|
|
511
|
+
if (buildSlice.length > 0) {
|
|
512
|
+
lines.push("## Build Slice", "");
|
|
513
|
+
lines.push(...buildSlice.map((item) => `- ${item}`), "");
|
|
376
514
|
}
|
|
377
515
|
|
|
378
|
-
|
|
516
|
+
if (verificationPlan.length > 0) {
|
|
517
|
+
lines.push("## Verification Plan", "");
|
|
518
|
+
lines.push(...verificationPlan.map((item) => `- ${item}`), "");
|
|
519
|
+
}
|
|
379
520
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
...
|
|
383
|
-
|
|
384
|
-
|
|
521
|
+
if (repairPath.length > 0) {
|
|
522
|
+
lines.push("## Repair Path", "");
|
|
523
|
+
lines.push(...repairPath.map((item) => `- ${item}`), "");
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
if (completionEvidence.length > 0) {
|
|
527
|
+
lines.push("## Completion Evidence", "");
|
|
528
|
+
lines.push(...completionEvidence.map((item) => `- ${item}`), "");
|
|
529
|
+
}
|
|
385
530
|
|
|
386
531
|
if (suggestedBranches.length > 0) {
|
|
387
532
|
lines.push(
|
|
@@ -422,6 +567,8 @@ function renderRunbook() {
|
|
|
422
567
|
"- `.ma/specs/experience.md`",
|
|
423
568
|
"- `.ma/plans/implementation.md`",
|
|
424
569
|
"- `.ma/plans/build.md`",
|
|
570
|
+
"- `.ma/state/manager-runs.json`",
|
|
571
|
+
"- `.ma/state/maestro-state.json`",
|
|
425
572
|
"- `.ma/decisions.json`",
|
|
426
573
|
"- `.ma/release.json`",
|
|
427
574
|
"",
|
|
@@ -540,14 +687,30 @@ export async function writeExperienceSpec({
|
|
|
540
687
|
|
|
541
688
|
export async function writeBuildPlanArtifact({
|
|
542
689
|
allowed,
|
|
690
|
+
gateState = allowed ? "READY" : "LOCKED",
|
|
543
691
|
blockers,
|
|
544
692
|
nextTriggers,
|
|
545
693
|
suggestedBranches = [],
|
|
694
|
+
buildSlice = [],
|
|
695
|
+
verificationPlan = [],
|
|
696
|
+
repairPath = [],
|
|
697
|
+
completionEvidence = [],
|
|
546
698
|
runtimeSummary = null,
|
|
547
699
|
}) {
|
|
548
700
|
await writeArtifact(
|
|
549
701
|
"plans/build.md",
|
|
550
|
-
renderBuildPlan({
|
|
702
|
+
renderBuildPlan({
|
|
703
|
+
allowed,
|
|
704
|
+
gateState,
|
|
705
|
+
blockers,
|
|
706
|
+
nextTriggers,
|
|
707
|
+
suggestedBranches,
|
|
708
|
+
buildSlice,
|
|
709
|
+
verificationPlan,
|
|
710
|
+
repairPath,
|
|
711
|
+
completionEvidence,
|
|
712
|
+
runtimeSummary,
|
|
713
|
+
}),
|
|
551
714
|
);
|
|
552
715
|
}
|
|
553
716
|
|
package/src/skill-installer.js
CHANGED
|
File without changes
|