Skip to content

Commit 4d372ba

Browse files
committed
feat: Anchor Master Architecture to Context Frontier (Epic #9671)
Implemented the Global System Primer by injecting a Neo-Master-Architecture node with protected SYSTEM_TENET relationships during memory core initialization. This ensures all autonomous sessions automatically index the core Playwright testing and Neural Link MCP standards without relying on the legacy vector database infrastructure. (#9671)
1 parent 8f45e48 commit 4d372ba

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

ai/mcp/server/memory-core/services/DreamService.mjs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,16 @@ ${session.document}
207207
logger.info(`[DreamService] Successfully extracted Tri-Vector schema for session ${session.meta.sessionId}.`);
208208

209209
// --- VECTOR 1: SEMANTIC GRAPH ---
210-
// Check if frontier exists, if not, stub it so we can link to it
211-
GraphService.upsertNode({
212-
id: 'frontier',
213-
type: 'System',
214-
name: 'Strategic Frontier',
215-
description: 'The actively tracked development front for the current project scope.',
216-
semanticVectorId: null
217-
});
210+
// Ensure frontier exists, if not, stub it so we can link to it
211+
if (!GraphService.db.nodes.has('frontier')) {
212+
GraphService.upsertNode({
213+
id: 'frontier',
214+
type: 'SYSTEM_ANCHOR',
215+
name: 'Active Context Frontier',
216+
description: 'The actively tracked development front for the current project scope.',
217+
semanticVectorId: null
218+
});
219+
}
218220

219221
// Bridge to GraphService (SQLite)
220222
for (const node of payload.graph.nodes) {
@@ -492,6 +494,8 @@ ${contextText}
492494
const edgesToUpdate = [];
493495

494496
edges.forEach(e => {
497+
if (e.type === 'SYSTEM_TENET') return; // Protect structural system edges from fading
498+
495499
let currentWeight = e.properties?.weight || 1.0;
496500
// Apply geometric decay
497501
let newWeight = currentWeight * 0.9;

ai/mcp/server/memory-core/services/GraphService.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ class GraphService extends Base {
6565
});
6666
}
6767

68+
// --- 1. THE GLOBAL SYSTEM PRIMER (Epic #9671) ---
69+
// Inject the Master Architecture Tenets directly into the Native Graph at boot.
70+
// Because this is anchored to the 'frontier' with a protected SYSTEM_TENET edge,
71+
// it acts as a deterministic onboarding payload for every agent session.
72+
this.db.getAdjacentNodes('Neo-Master-Architecture', 'both');
73+
if (!this.db.nodes.has('Neo-Master-Architecture')) {
74+
this.upsertNode({
75+
id: 'Neo-Master-Architecture',
76+
type: 'System',
77+
name: 'Global System Primer',
78+
description: 'Core framework tenets: 1. All Playwright tests must be run using "npm run test-unit -- [file]". No npx. 2. UI debugging and application state inspection must use the Neural Link MCP tools. 3. Look at .agent/skills for reusable agent workflows.'
79+
});
80+
this.linkNodes('frontier', 'Neo-Master-Architecture', 'SYSTEM_TENET', 1.0);
81+
}
82+
6883
logger.log('[GraphService] SQLite database mounted securely via ai.graph.Database.');
6984
}
7085

0 commit comments

Comments
 (0)