archgraph-argo 0.10.21 → 0.10.23
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.
|
@@ -99,7 +99,7 @@ You MUST read/write the intent architecture through the tools provided by the AR
|
|
|
99
99
|
16. queryNeo4jGraph: run a read-only Cypher query against the Neo4j structural projection of the intent graph, or request the projection schema with {schema: true}. Use for structural/type-based graph queries (see <GraphQueryGuideline>).
|
|
100
100
|
|
|
101
101
|
<GraphQueryGuideline>
|
|
102
|
-
For structural/type-based graph lookups, use the read-only Neo4j Cypher interface `queryNeo4jGraph` instead of reading the canonical JSON file directly. It never mutates the graph; all writes still go through the mutation tools.
|
|
102
|
+
For structural/type-based graph lookups, use the read-only Neo4j Cypher interface `queryNeo4jGraph` instead of reading the canonical JSON file directly. It never mutates the canonical graph; all writes still go through the mutation tools.
|
|
103
103
|
1. Ask for the projection schema first: call `queryNeo4jGraph` with {schema: true} to learn node labels (ArchitectureGraph, Element, ArchitectureRelationship, View), relationship types (OWNS_ELEMENT, OWNS_RELATIONSHIP, OWNS_VIEW, RELATIONSHIP_SOURCE, RELATIONSHIP_TARGET, ARCHIMATE_RELATES, VIEW_OF, INCLUDES_ELEMENT, INCLUDES_RELATIONSHIP, HAS_SUBDIAGRAM), property keys, and the legal ArchiMate element/relationship type enums (e.g. 'Business Actor', 'Assignment').
|
|
104
104
|
2. Construct a read-only Cypher statement and scope every pattern to the current graph with the server-injected `$graphKey` parameter (the value is filled by the server; the agent only writes the placeholder):
|
|
105
105
|
MATCH (e:Element {graphKey: $graphKey, type: 'Business Actor'}) RETURN e.id, e.name ORDER BY e.name
|
|
@@ -164,6 +164,7 @@ const {
|
|
|
164
164
|
} = require('./graph-rag/mutationEmbeddingVectorLifecycle.js');
|
|
165
165
|
const {
|
|
166
166
|
DEFAULT_GRAPH_PATH: NEO4J_DEFAULT_GRAPH_PATH,
|
|
167
|
+
assertReadOnlyCypher,
|
|
167
168
|
buildGraphKey,
|
|
168
169
|
buildNeo4jGraphSchema,
|
|
169
170
|
recoverNeo4jSyncIfNeeded,
|
|
@@ -2188,20 +2189,43 @@ async function queryNeo4jGraphTool(args = {}) {
|
|
|
2188
2189
|
return queryNeo4jGraphSchemaResult(architecturePath, workspaceRoot);
|
|
2189
2190
|
}
|
|
2190
2191
|
|
|
2192
|
+
let recovery = null;
|
|
2191
2193
|
try {
|
|
2194
|
+
// Reject invalid/write queries before any side effect.
|
|
2195
|
+
assertReadOnlyCypher(args.cypher);
|
|
2196
|
+
|
|
2197
|
+
// Same projection-recovery mechanism as the loadContext-based tools
|
|
2198
|
+
// (e.g. getSystemArchitecture): when the sync state is dirty or the
|
|
2199
|
+
// recorded canonicalDigest no longer matches the canonical JSON, rebuild
|
|
2200
|
+
// the Neo4j projection before servicing the read-only query.
|
|
2201
|
+
recovery = await recoverNeo4jSyncIfNeeded({
|
|
2202
|
+
architecturePath,
|
|
2203
|
+
workspaceRoot,
|
|
2204
|
+
});
|
|
2205
|
+
|
|
2192
2206
|
const result = await runNeo4jCypherQuery({
|
|
2193
2207
|
architecturePath,
|
|
2194
2208
|
cypher: args.cypher,
|
|
2195
2209
|
workspaceRoot,
|
|
2196
2210
|
});
|
|
2197
|
-
|
|
2211
|
+
const payload = {
|
|
2198
2212
|
status: 'passed',
|
|
2199
2213
|
architecturePath: result.architecturePath,
|
|
2200
2214
|
graphKey: result.graphKey,
|
|
2201
2215
|
database: result.database,
|
|
2202
2216
|
records: result.records,
|
|
2203
2217
|
summary: result.summary,
|
|
2204
|
-
}
|
|
2218
|
+
};
|
|
2219
|
+
if (recovery.attempted) {
|
|
2220
|
+
payload.neo4jRecovery = recovery;
|
|
2221
|
+
if (recovery.status === 'failed') {
|
|
2222
|
+
payload.warnings = [
|
|
2223
|
+
`Neo4j automatic resync failed before servicing ${architecturePath}: ${recovery.error}`,
|
|
2224
|
+
'The read-only query still ran against the current projection. Neo4j will be retried on the next canonical read or write, or you can run node .argo/scripts/syncSystemArchitectureToNeo4j.js manually.',
|
|
2225
|
+
];
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
return toolResult(payload);
|
|
2205
2229
|
} catch (error) {
|
|
2206
2230
|
return toolResult(queryError(
|
|
2207
2231
|
error && error.category ? error.category : 'NEO4J_QUERY_FAILED',
|
|
@@ -2212,6 +2236,7 @@ async function queryNeo4jGraphTool(args = {}) {
|
|
|
2212
2236
|
...(error && error.clause ? { clause: error.clause } : {}),
|
|
2213
2237
|
...(error && error.queriedDatabase ? { queriedDatabase: error.queriedDatabase } : {}),
|
|
2214
2238
|
...(error && error.expectedDatabase ? { expectedDatabase: error.expectedDatabase } : {}),
|
|
2239
|
+
...(recovery && recovery.attempted ? { neo4jRecovery: recovery } : {}),
|
|
2215
2240
|
},
|
|
2216
2241
|
));
|
|
2217
2242
|
}
|
package/install-argo.ps1
CHANGED
|
@@ -726,7 +726,7 @@ if ($SkipDsh) {
|
|
|
726
726
|
Write-DshManagedBlock -Path $patchPath -Block $block -MarkerStart '# BEGIN ArchGraph ARGO deployment' -MarkerEnd '# END ArchGraph ARGO deployment'
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
-
Write-Host "[19/19] argo\
|
|
729
|
+
Write-Host "[19/19] argo\agents11 -> $DshHome\.agent-presets\<id> (DeepSeek Harness agent presets)"
|
|
730
730
|
New-DshAgentPresets -DshHome $DshHome -AgentsSrc (Join-Path $argoDir 'agents')
|
|
731
731
|
|
|
732
732
|
Write-Host ' Restart `dsh web` to activate the MCP bridge and the wakeup plugin;'
|
package/package.json
CHANGED