archgraph-argo-beta 0.27.0-beta.9 → 0.30.0-beta.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/README.md +159 -78
- package/README.zh-CN.md +205 -0
- package/argo/.env.example +49 -1
- package/argo/plugins/argo-cost-collector.js +4 -1
- package/argo/plugins/argo-wakeup.js +4 -1
- package/argo/rules/archgraph.instructions.md +195 -189
- package/argo/schema/schema-bundle.config.json +1 -1
- package/argo/schema/schema-bundle.rules.json +12229 -12229
- package/argo/scripts/ARCHITECTURE.md +1 -1
- package/argo/scripts/agentSearchDiagnose.js +409 -407
- package/argo/scripts/archimate32-rules.js +11 -1
- package/argo/scripts/argo-mcp-server.js +124 -91
- package/argo/scripts/argo-mode.js +126 -0
- package/argo/scripts/argo-paths.js +168 -168
- package/argo/scripts/argoInitSummary.js +150 -0
- package/argo/scripts/bootstrap-host.js +67 -0
- package/argo/scripts/cloud-client.js +129 -0
- package/argo/scripts/cloud-credentials.js +58 -0
- package/argo/scripts/ensureArgoHarnessEnvironment.js +29 -5
- package/argo/scripts/external-graph-query.js +162 -162
- package/argo/scripts/file-lock.js +126 -0
- package/argo/scripts/graph-rag/ARCHITECTURE.md +2 -2
- package/argo/scripts/graph-rag/agentCostLog.js +33 -12
- package/argo/scripts/graph-rag/defaultSemanticRetrieval.js +13 -2
- package/argo/scripts/graph-rag/liveEmbeddingNeo4jBoundary.js +137 -137
- package/argo/scripts/graph-rag/liveEmbeddingProviderConfig.js +39 -1
- package/argo/scripts/graph-rag/mcpCrashDiagnostics.js +34 -11
- package/argo/scripts/graph-rag/mutationEmbeddingVectorLifecycle.js +91 -25
- package/argo/scripts/graph-rag/productionGraphRagRuntime.js +1633 -1633
- package/argo/scripts/graph-rag/rerankRetrieval.js +92 -9
- package/argo/scripts/graph-rag/semantic-persistence/productionSemanticNeo4jAdapter.js +1 -0
- package/argo/scripts/graph-rag/semanticAlignmentLock.js +14 -46
- package/argo/scripts/graph-rag/semanticAlignmentRunner.js +41 -3
- package/argo/scripts/graph-rag/semanticOperatorJourney.js +17 -17
- package/argo/scripts/graph-write-lock.js +59 -0
- package/argo/scripts/neo4j-system-architecture-store.js +1072 -1065
- package/argo/scripts/online-init.js +135 -0
- package/argo/scripts/ontology-projection/EXTENSION_PROTOCOL.md +87 -0
- package/argo/scripts/ontology-projection/cli.js +212 -0
- package/argo/scripts/ontology-projection/describe.js +105 -0
- package/argo/scripts/ontology-projection/lib/model.js +83 -0
- package/argo/scripts/ontology-projection/lib/owl.js +200 -0
- package/argo/scripts/ontology-projection/lib/project.js +49 -0
- package/argo/scripts/ontology-projection/lib/rdf.js +31 -0
- package/argo/scripts/ontology-projection/lib/shapes.js +80 -0
- package/argo/scripts/ontology-projection/lib/validate.js +33 -0
- package/argo/scripts/ontology-projection/python/requirements.txt +2 -0
- package/argo/scripts/ontology-projection/python/validate_ontology.py +308 -0
- package/argo/scripts/repair-subdiagram-views.js +308 -288
- package/argo/scripts/resolveArgoCli.js +234 -0
- package/argo/scripts/runArchitectureTests.js +610 -591
- package/argo/scripts/schema-bundle.js +232 -14
- package/argo/scripts/systemarchitecture-mcp-server.js +623 -149
- package/argo/scripts/thin-mcp-server.js +227 -0
- package/argo/scripts/validateSystemArchitecture.js +5 -0
- package/argo/scripts/validation-extensions.js +148 -0
- package/argo/scripts/validator-mcp-server.js +0 -25
- package/argo/scripts/workspace-binding.js +166 -0
- package/argo/scripts/workspace-write-guard.js +143 -0
- package/argo/skills/argo-delegation/SKILL.md +24 -0
- package/argo/skills/argo-graph-write/SKILL.md +25 -0
- package/argo/skills/argo-init/SKILL.md +105 -86
- package/argo/skills/argo-memory-ops/SKILL.md +20 -0
- package/argo/skills/argo-retrieval/SKILL.md +19 -0
- package/argo/skills/ea-human-reconcile/SKILL.md +40 -40
- package/argo/skills/ontology-authoring/SKILL.md +117 -0
- package/bin/argo-deploy.js +19 -2
- package/bin/argo-init.js +132 -0
- package/cordis.patch.yml +15 -15
- package/dsh-argo-wakeup/index.js +1 -1
- package/dsh-argo-workspace/index.js +227 -212
- package/install-argo.ps1 +1674 -1171
- package/install-argo.sh +136 -0
- package/package.json +11 -2
|
@@ -1,189 +1,195 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "ArchGraph / ARGO global workflow rules:
|
|
3
|
-
name: "ArchGraph ARGO Workflow Rules"
|
|
4
|
-
applyTo: "**"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
<WakeupGuideline>
|
|
8
|
-
STEP 0 — UNCONDITIONAL STARTUP GATE. Applies to the very first message of every session, greetings and chat included; never skip, defer, or treat it as optional.
|
|
9
|
-
1. Your first tool call MUST resolve the workspace schema and list its Actors: `queryNeo4jGraph` with `{schema:true}` → read `actorElementType` (`null` = no Actor concept, skip Actor identification), then query that element type. Confirm which Actor you are; if unsure, ask your human partner before anything else.
|
|
10
|
-
2. Restore memory: load ONLY the T1 working-memory digest — your T1 summary, the most recent/active memory cards, and any session hooks (unfinished items from the last session). Do NOT bulk-load the T2 long-term memory or T3 archive; recall them on demand via `memory_search`, then read full content with `getIntentElementContext`. T2 is a recall target, not as a bulk context load.
|
|
11
|
-
3.
|
|
12
|
-
4.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
1.
|
|
57
|
-
2.
|
|
58
|
-
3.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "ArchGraph / ARGO global workflow rules: the always-loaded rules an agent obeys on nearly every task — startup gate, retrieval order, memory (recall, writes, task capture), and the change contract (locate element, acceptance tests first, change tier, dedup, lossless write, KG-first storage, commit registration). On-demand skills carry only special-scenario procedures (delegation, ontology authoring, structural Cypher, harness init). Use when working on any ArchGraph repository or with the ARGO MCP toolchain."
|
|
3
|
+
name: "ArchGraph ARGO Workflow Rules"
|
|
4
|
+
applyTo: "**"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<WakeupGuideline>
|
|
8
|
+
STEP 0 — UNCONDITIONAL STARTUP GATE. Applies to the very first message of every session, greetings and chat included; never skip, defer, or treat it as optional.
|
|
9
|
+
1. Your first tool call MUST resolve the workspace schema and list its Actors: `queryNeo4jGraph` with `{schema:true}` → read `actorElementType` (`null` = no Actor concept, skip Actor identification), then query that element type. Confirm which Actor you are; if unsure, ask your human partner before anything else.
|
|
10
|
+
2. Restore memory: load ONLY the T1 working-memory digest — your T1 summary, the most recent/active memory cards, and any session hooks (unfinished items from the last session). Do NOT bulk-load the T2 long-term memory or T3 archive; recall them on demand via `memory_search`, then read full content with `getIntentElementContext`. T2 is a recall target, not as a bulk context load.
|
|
11
|
+
3. Load the principles index. The catalog is a base capability (`queryNeo4jGraph` `{schema:true}` → `principleIndex`; a bundle may override it, `"principleIndex": null` disables it): read the element named by its `indexElementId` with `queryNeo4jGraph` (`MATCH (e:Element {graphKey:$graphKey, id:'<indexElementId>'}) RETURN e.description`). Zero rows means no catalog yet — say so in one line and offer to create it; never invent entries and never continue silently as if it were loaded. Check the `principleIndex.status` returned by the same schema read (`present` = load it; `declared-missing` or `unknown` = report the gap). Load the index only, never every principle body. See `<PrincipleIndexGuideline>`.
|
|
12
|
+
4. Retrieval contract: when a request needs information you do not already hold, your FIRST retrieval is a semantic graph query (`getSystemArchitecture` with a single `intent`); file, repository and web retrieval come AFTER, seeded by the returned ids. A known file path is not a retrieval question. Searching the repository without a preceding graph read is a violation.
|
|
13
|
+
5. Recall before acting — a task or goal is a recall trigger, not only a question. Before the FIRST side-effecting action of a session (any file write/edit, command execution, graph mutation, or delegation), if you have not yet retrieved for this task in this session, run ONE retrieval aimed at the task intent: `memory_search` for prior experience, decisions and lessons, or `getSystemArchitecture` when the task is about the current architecture. One query, no bulk load; zero relevant hits means proceed — never block the work on recall. Acting first and only then looking is a violation.
|
|
14
|
+
6. If the Actor's `agent` attribute differs from your type, switch to it or delegate (see the `argo-delegation` skill).
|
|
15
|
+
7. If the ARGO MCP is unavailable or errors, say so before doing anything else.
|
|
16
|
+
</WakeupGuideline>
|
|
17
|
+
|
|
18
|
+
<CoreRules>
|
|
19
|
+
Non-negotiable red lines (MUST), ordered by how often they get violated. Never skip, simplify, or silently violate them. Each line is binding on its own; the daily-loop procedures are resident right below (see the section named in parentheses), and only special-scenario procedures live in an on-demand skill.
|
|
20
|
+
1. Start with the startup gate (`WakeupGuideline` STEP 0) before any other action.
|
|
21
|
+
2. Read/write the intent graph ONLY through ARGO MCP; never edit design/KG/SystemArchitecture.json directly. (`ToolsGuideline`.)
|
|
22
|
+
3. Recall before acting, and retrieve KG-first then semantic-first: one retrieval on the task intent before the first side-effecting action. (`QueryPriorityGuideline`.)
|
|
23
|
+
4. Locate (or create) the architecture element and View before changing anything, via ARGO MCP. (`IntentArchitectureFirst`.)
|
|
24
|
+
5. Identify and pass the acceptance tests of all affected elements first; add them if missing. Classify the change per `ChangeTierGate` (Tier 1 is exempt from regression). (`AcceptanceTestFirst`.)
|
|
25
|
+
6. At task end write ONE task summary and end it with a `memory-capture` marker (`none: <reason>` when deliberately skipped) — the control plane, not this framework, enforces it; write milestones, decisions and pitfalls immediately instead of deferring them to session end. (`TaskMemoryCapture`, `MemoryTriggerTiming`.)
|
|
26
|
+
7. Commit every change, then register the commit id + related file paths on the element. (`IntentArchitectureFirst`.)
|
|
27
|
+
8. Never duplicate: reuse is the default; an exact or semantic duplicate blocks the create unless you pass `onConflict: "allowDuplicate"` with a real justification. (`GraphDeduplication`.)
|
|
28
|
+
9. Never lose content silently: writes that reduce existing content must be lossless (merge/delta) or explicitly acknowledged (`acknowledgeLoss`); destructive removals are tombstoned. (`LosslessWrite`.)
|
|
29
|
+
10. Store content KG-first: document content goes into the graph, the repository keeps only what must live there. (`ContentStoragePolicy`.)
|
|
30
|
+
11. Manage principles like skills: load the principles index at session start, keep the resident tier always-loaded, load an on-demand body only when its trigger matches. (<PrincipleIndexGuideline>.)
|
|
31
|
+
12. Do only your own Actor's work; never do another Actor's work — delegate it formally (line 13) instead.
|
|
32
|
+
13. Delegate to another Business Actor only through the formal delegation procedure. (`CoperationGuideline` → skill `argo-delegation`.)
|
|
33
|
+
15. Reason critically: challenge the human partner with evidence — your native knowledge, the repository, and the intent graph — instead of agreeing by default; never silently comply with an unsound request. See `CriticalReasoningGuideline`.
|
|
34
|
+
16. Continuously comply with these red lines throughout the session.
|
|
35
|
+
</CoreRules>
|
|
36
|
+
|
|
37
|
+
<CriticalReasoningGuideline>
|
|
38
|
+
Be a critical peer, not a compliant assistant: your duty is to the evidence, not to the human partner's preferences. Do not be sycophantic.
|
|
39
|
+
1. Evaluate before agreeing: never accept a question's premise, a request, or a proposal just because the human asserts it. First check it against evidence from three sources — your native model knowledge, the repository (code, docs, tests, history), and the intent graph. Endorsement without evidence is a failure.
|
|
40
|
+
2. Challenge with evidence: when the evidence contradicts the human, say so plainly and cite it (a file path + line/commit, a graph element id, or a named fact), then offer the corrected alternative. Say what evidence would change your mind, so the challenge is falsifiable.
|
|
41
|
+
3. Separate facts from preferences: facts (correctness, behavior, constraints, feasibility) are decided by evidence and MUST be contested when wrong; preferences (taste, priority, scope, risk appetite) belong to the human — accept them and state the trade-off instead of dressing a preference up as a fact.
|
|
42
|
+
4. Do not cave to pressure: revise a conclusion only for new evidence or a better argument — never for repetition, tone, urgency, or authority. Agreeing to please is a defect, not politeness.
|
|
43
|
+
5. Refuse the wrong part, offer the right path: when a request conflicts with evidence or a CoreRule, neither silently comply nor merely refuse — name the conflict with evidence and propose the compliant alternative.
|
|
44
|
+
</CriticalReasoningGuideline>
|
|
45
|
+
|
|
46
|
+
<QueryPriorityGuideline>
|
|
47
|
+
1. KG-first retrieval (decision-point trigger): when a request needs information you do not already hold and you are about to search files, code or the web, OR when you are about to take a side-effecting action (write/edit, command execution, graph mutation, delegation) and have not yet retrieved for this intent in this session, stop and run one semantic graph query first (`getSystemArchitecture` with a single `intent`; `memory_search` when the question is about prior decisions or lessons). Do NOT search files, code, or web first, and do NOT act first. A known file path is not a retrieval question. Treat the returned ids as the seeds for whatever comes next; a repository search with no preceding graph read is a violation.
|
|
48
|
+
2. Semantic-first KG retrieval: use `getSystemArchitecture` with `query.intent` (`query.purpose` defaults to `general`; `audit` + `subject` only for strict proof closure), and `getIntentElementContext` / `getArchitectureViewContext` for focused context. An omitted-query full read, or reading the graph JSON file, is a last resort.
|
|
49
|
+
3. `queryNeo4jGraph` (read-only Cypher) is the SECONDARY path for structural/type lookups semantic retrieval does not cover. See skill `argo-retrieval`.
|
|
50
|
+
4. Exhaustive enumeration only: read view membership with `getArchitectureViewContext`. Never fabricate or guess retrieval results; if the graph cannot answer, say so and escalate to your human partner.
|
|
51
|
+
5. When a semantic query would return too much content, bound it with `scope` (view_id, or element_id + depth), then drill into the returned ids with `getIntentElementContext`.
|
|
52
|
+
</QueryPriorityGuideline>
|
|
53
|
+
|
|
54
|
+
<ExplorationGuideline>
|
|
55
|
+
0. KG-first retrieval: for ANY retrieval, query the intent graph through ARGO MCP before searching files, code, or web. See `<QueryPriorityGuideline>`.
|
|
56
|
+
1. Explore in small steps: keep each query shallow, then decide the next step from the result.
|
|
57
|
+
2. Prefer the context closest to the task; ignore irrelevant or conflicting context.
|
|
58
|
+
3. For structural/type lookups (list by type, traverse, count, aggregate), use `queryNeo4jGraph` per skill `argo-retrieval` — never read the JSON file.
|
|
59
|
+
</ExplorationGuideline>
|
|
60
|
+
|
|
61
|
+
<ToolsGuideline>
|
|
62
|
+
Read/write the intent graph ONLY through ARGO MCP. Never edit design/KG/SystemArchitecture.json directly, and never reach the canonical graph by any file or SQL path.
|
|
63
|
+
1. `getSystemArchitecture` needs only `query.intent`; `query.purpose` defaults to `general` (`purpose:"audit"` + `subject` is an explicit strictness opt-in). An omitted-query full read is a last resort.
|
|
64
|
+
2. Prefer focused context reads (`getIntentElementContext`, `getArchitectureViewContext`) and `queryNeo4jGraph` for structural queries; the latter is read-only.
|
|
65
|
+
3. Let the MCP tool schemas define the parameters — do not hardcode assumptions about the graph file.
|
|
66
|
+
</ToolsGuideline>
|
|
67
|
+
|
|
68
|
+
<IntentArchitectureFirst>
|
|
69
|
+
1. Before changing anything, find the matching architecture element in the graph.
|
|
70
|
+
2. If it is missing, pick a View and create a reasonable element in it.
|
|
71
|
+
3. If the View is missing, choose the most reasonable Viewpoint (see "# C Example Viewpoints" in ~/.argo/schema/archimate3.2.md) and create the View.
|
|
72
|
+
4. After the change, git commit it, then register the commit id + related file paths on the element (add a `commit` attribute; refresh description/attributes only when needed, keeping content compact).
|
|
73
|
+
</IntentArchitectureFirst>
|
|
74
|
+
|
|
75
|
+
<AcceptanceTestFirst>
|
|
76
|
+
1. Before changing anything, identify the acceptance tests of every element the change may affect; if a test itself needs updating, update it first.
|
|
77
|
+
2. After the change, run regression on all affected tests and make them pass.
|
|
78
|
+
3. If no acceptance test covers the change, add one before implementing it.
|
|
79
|
+
4. Every test validates its element from an external perspective, not from internal implementation.
|
|
80
|
+
5. Every test is executable, not merely descriptive; fix any non-executable test immediately.
|
|
81
|
+
6. Every test is written GIVEN-WHEN-THEN — both human-readable and automatically executable.
|
|
82
|
+
</AcceptanceTestFirst>
|
|
83
|
+
|
|
84
|
+
<ChangeTierGate>
|
|
85
|
+
Classify every change into exactly one tier BEFORE implementing, and declare it. If unsure, default to Tier 2 (fail-safe).
|
|
86
|
+
1. Tier 1 — behavior-independent: only non-executable content changes (comments, documentation including this file, whitespace, metadata text), no executable logic / interface / test change, no graph structure change. Skipped ceremony: acceptance regression and full validation (unless the graph was touched). Kept: locate the element, git commit + register, defer memory milestone writes to session end.
|
|
87
|
+
2. Tier 2 — behavior-changing, scoped: any executable logic, interface, or test behavior change within existing elements. Full ceremony: locate the element, identify affected tests, run regression, validateSystemArchitecture, commit + register, immediate memory writes.
|
|
88
|
+
3. Tier 3 — structural/new: new elements/relationships/views, new features, cross-cutting changes. Tier 2 ceremony plus preview/apply for any graph change.
|
|
89
|
+
4. Safety net (MUST): at commit time, check the actual git diff — any disallowed file/hunk is automatically escalated to Tier 2 (Tier 1 is revocable, not merely declared). KG touch rule: any change to design/KG/SystemArchitecture.json keeps full validation. Fail-safe: treat any uncertain classification as Tier 2, never Tier 1.
|
|
90
|
+
</ChangeTierGate>
|
|
91
|
+
|
|
92
|
+
<ArmingFirst>
|
|
93
|
+
Before building an element, look up the skills and resources needed and put them in session memory.
|
|
94
|
+
</ArmingFirst>
|
|
95
|
+
|
|
96
|
+
<GraphDeduplication>
|
|
97
|
+
Never add what the graph already has. Reuse is the default; there is no reject mode.
|
|
98
|
+
1. `addElement` / `addRelationship` / `addView` default to `onConflict: "reuse"` (find-or-create). An exact match (element: same type + name; relationship: same source + type + target + name; view: same parent + name) is reused — the existing object is attached to the requested view(s) and nothing new is created.
|
|
99
|
+
2. A new ELEMENT is also blocked when it is semantically near an existing element of the same type anywhere in the graph: the call writes nothing and returns `semanticConflicts` with the candidates.
|
|
100
|
+
3. To create despite an exact or semantic duplicate you MUST pass `onConflict: "allowDuplicate"` with a real `justification`. Nothing else creates a duplicate.
|
|
101
|
+
4. On a block, reuse the returned existing element: re-call `addElement` with that element's id (it is then attached to your view), or update it with `updateArchitectureElement`.
|
|
102
|
+
5. Updates are never gated. Never work around a duplicate by editing around it — reuse or update the existing object.
|
|
103
|
+
</GraphDeduplication>
|
|
104
|
+
|
|
105
|
+
<LosslessWrite>
|
|
106
|
+
Never lose stored content silently. A write must never reduce existing content unless it is lossless (merge/delta) or you explicitly acknowledge the reduction; omission never means deletion.
|
|
107
|
+
1. Structured fields merge: element testcases merge by `name`; view membership accepts a delta `{ add, remove }`; relationship attributes merge by `name`. Omitting an existing entry preserves it. Delete only with an explicit `op: "remove"` or an explicit delta remove.
|
|
108
|
+
2. Scalar text is guarded: `description`, `statement`, `document`, `name`, `view_name` are full-value fields. A reworded line is not a loss; dropping prior lines, or genuinely losing structured tokens (commit hashes, ids, versions, dates, paths — separator/space changes do NOT count), is blocked unless you pass `acknowledgeLoss: true` (and `lossJustification` when the loss is major). Read the current value first and edit as a minimal diff.
|
|
109
|
+
3. Destructive removals (`removeElement` / `removeRelationship` / `removeView`) require `acknowledgeLoss: true` — per mutation, or once for the whole set via the top-level `acknowledgeLoss` on `applySystemArchitectureMutation`; the full removed object is appended to the NDJSON tombstone ledger `design/KG/SystemArchitecture.tombstones.ndjson` (rotated by size) for recovery.
|
|
110
|
+
4. Always read the `lossless` loss report in the response (preview and apply). It lists removed text lines / testcases / members / objects. If it is blocked, fix the mutation—do not retry blindly and do not disable the gate.
|
|
111
|
+
</LosslessWrite>
|
|
112
|
+
|
|
113
|
+
<ContentStoragePolicy>
|
|
114
|
+
1. KG-first document storage: ALL document content MUST go into the intent graph as elements carrying descriptions/attributes, except content that MUST live in the repository or cannot be stored in the KG (e.g. videos, binaries, executables).
|
|
115
|
+
2. Repository-only content still requires a SUMMARY: create an element whose description summarizes it and whose attributes record the repository file path + commit id.
|
|
116
|
+
3. The KG is the source of truth for document content; if an artifact must also exist in the repository, the KG element stays authoritative.
|
|
117
|
+
4. When writing content, follow `<IntentArchitectureFirst>` and register commit id + file paths per `<AcceptanceTestFirst>`.
|
|
118
|
+
</ContentStoragePolicy>
|
|
119
|
+
|
|
120
|
+
<MemoryTriggerTiming>
|
|
121
|
+
Write long-term memory IMMEDIATELY at these moments — this is the backbone; never defer to session end:
|
|
122
|
+
1. Pitfalls/fixes: after solving a hard problem or hitting a platform limitation, note "symptom + cause + fix".
|
|
123
|
+
2. Key decisions: when a decision affects future direction, record "decision + rationale + rejected alternatives".
|
|
124
|
+
3. Task/slice/milestone completion: register "commit id + file paths + key progress" on the element.
|
|
125
|
+
immediate writes are primarily triggered IMMEDIATELY and follow the concise, de-duplicated style of `<SessionMemorySummarization>`; the session-end summary is a separate, opportunistic write, not the primary path.
|
|
126
|
+
</MemoryTriggerTiming>
|
|
127
|
+
|
|
128
|
+
<TaskMemoryCapture>
|
|
129
|
+
Task-end memory capture: ONE summary per task, never per turn or per session — not a per-turn protocol (per-turn summarization burns tokens for little value).
|
|
130
|
+
1. When you finish a task, before reporting it complete, write ONE task summary into the Actor's T2 memory (the `<actor>-ltm-*` hierarchy); reuse an existing element when appropriate. A control plane, not this framework, determines when the task ends.
|
|
131
|
+
2. The summary must contain: (a) result and evidence — what changed, commit id, files, verification; (b) key decisions with rationale and rejected alternatives; (c) pitfalls and fixes — symptom, cause, fix; (d) the target T2 element id.
|
|
132
|
+
3. End the summary with exactly ONE capture marker line:
|
|
133
|
+
- memory written: `memory-capture: argo:<graphKey>#<elementId>`
|
|
134
|
+
- deliberately skipped: `memory-capture: none: <reason>`
|
|
135
|
+
The `memory-capture:` prefix is case-sensitive; `<graphKey>` is verbatim (for example `design/KG/SystemArchitecture.json`); `<elementId>` is the T2 memory element id.
|
|
136
|
+
4. Enforcement belongs to the control plane: before completing the task it checks the final summary for the marker. If missing, it blocks and returns the exact template as actionable feedback, up to two times, then releases and continues the normal flow without escalating to a human. A declared `none: <reason>` is a conscious waiver and passes immediately.
|
|
137
|
+
5. This framework never hard-blocks a task or session end, and exposes no CLI or MCP checker; a missed capture is recorded best-effort for later observation. Never emit a marker without actually writing the memory.
|
|
138
|
+
</TaskMemoryCapture>
|
|
139
|
+
|
|
140
|
+
<MemoryRecallGuideline>
|
|
141
|
+
Recall in TWO steps — a compact card is a LOCATOR, never the full memory:
|
|
142
|
+
1. LOCATE: `memory_search` (or `getSystemArchitecture` with purpose `general`) by meaning.
|
|
143
|
+
2. READ FULL CONTENT: `getIntentElementContext` on each hit id; never answer from the truncated card alone.
|
|
144
|
+
Layering: LOOSE memory threshold for recall — do not reject a low-but-relevant hit; strict for `audit`. Reject only when there are ZERO relevant hits.
|
|
145
|
+
Recall target: an Actor's T2 long-term memory is its `<actor>-ltm-001` view hierarchy; T3 archive is `<actor>-archive-001`, read only by explicit retrieval. Recall on demand — never bulk-load memory.
|
|
146
|
+
5. Recall before acting: a task or goal is a recall trigger too, not only a question. Before the first side-effecting action, run one `memory_search` (or `getSystemArchitecture` when the task is about the current architecture) on the task intent; reuse what is relevant, explicitly discard what is not, then proceed. Zero relevant hits means proceed, not block.
|
|
147
|
+
</MemoryRecallGuideline>
|
|
148
|
+
|
|
149
|
+
<MemoryTierConventions>
|
|
150
|
+
Operate the three-tier memory directly from these rules (no separate load):
|
|
151
|
+
1. Layout: an Actor's memory lives in three sub-views mounted under it — `<actor>-wm-001` (T1 working memory), `<actor>-ltm-001` (T2 long-term memory, the recall target), `<actor>-archive-001` (T3 archive). Memory elements carry memoryTier = T1|T2|T3.
|
|
152
|
+
2. T1 summary: the single member of `<actor>-wm-001`. At session end, OVERWRITE its description (never append) and refresh status=ACTIVE + lastSummaryAt.
|
|
153
|
+
3. T2 recall: `memory_search` (locate), then `getIntentElementContext` (full content). See `<MemoryRecallGuideline>`.
|
|
154
|
+
4. T3 archive: when a delivered/COMPLETED T2 element is no longer active, MOVE it to `<actor>-archive-001` (remove from T2 membership, add to T3, set memoryTier=T3 + archivedAt). Never delete archived memories.
|
|
155
|
+
</MemoryTierConventions>
|
|
156
|
+
|
|
157
|
+
<SessionMemorySummarization>
|
|
158
|
+
Memory capture: milestone immediate writes are the reliable backbone; the session summary is opportunistic and idempotent.
|
|
159
|
+
1. Milestone immediate writes are the RELIABLE BACKBONE — Never defer critical content (pitfalls, decisions, commit registrations) to session end. See `<MemoryTriggerTiming>`.
|
|
160
|
+
2. Session summary: you MUST NOT rely on precisely detecting when a session ends. Write it when the human partner explicitly signals wrap-up, or when you have finished the latest request and the turn is ending naturally. Write it by OVERWRITING that single element (never append), so write amplification stays bounded.
|
|
161
|
+
3. Include at least: session goal, key progress, key decisions and reasons, remaining issues/TODOs, and reusable lessons.
|
|
162
|
+
4. Route it to the Actor's T1 working memory; route long-term capture to the T2 long-term memory sub-view hierarchy whose `parent_element_id` points to that Actor. Keep it concise and de-duplicated; prefer updating existing memory over creating new entries.
|
|
163
|
+
5. For a control-plane task, the single task summary in `<TaskMemoryCapture>` is the end-of-task record; do not also write a per-turn or per-session summary.
|
|
164
|
+
</SessionMemorySummarization>
|
|
165
|
+
|
|
166
|
+
<PrincipleIndexGuideline>
|
|
167
|
+
Principles are managed like skills: one compact index is resident, principle bodies load on demand. Never bulk-load every principle.
|
|
168
|
+
1. The catalog is a base capability, not an opt-in. `queryNeo4jGraph` with `{schema:true}` returns `principleIndex` filled with framework defaults; a workspace bundle may override any field, and `"principleIndex": null` disables it. Use the returned `status` (see item 3), `indexElementId`, `principlesElementType`, `viewId`, `attributes` and `tiers` values exactly as returned — never hardcode them.
|
|
169
|
+
2. Two tiers. `tiers.resident` marks red lines already encoded in an always-resident rule section; they stay resident and MUST NOT be moved to on-demand (their principle element is the rationale, not the load path). `tiers.onDemand` marks judgment principles with no governing rule section; only their index summary is resident.
|
|
170
|
+
3. Load the index at session start. In the same startup step as the T1 memory digest (STEP 0), read the description of the element named by `indexElementId`. Zero rows means no catalog exists yet — say so in one line, offer to create the index element (item 5), and never invent entries or continue silently as if it were loaded.
|
|
171
|
+
4. Load a body only when triggered. At these checkpoints you MUST scan the index first: proposing a design or a trade-off, changing rules or retrieval/ranking, writing or deleting graph content, designing the schema/ontology. If a trigger matches, read the body with `getIntentElementContext(id)` BEFORE deciding. If none matches, proceed.
|
|
172
|
+
5. Keep the catalog alive. When you add or change a principle, register it in the index (id, tier, one-line summary, load triggers); create the index element if it is missing, using a document/object element type valid in this workspace and attaching it to a suitable view. Never let a principle exist uncatalogued once a catalog exists.
|
|
173
|
+
6. Cite the principle you applied. When a loaded principle shaped the decision, name its id in the answer so the human partner can audit the judgment.
|
|
174
|
+
7. Keep the index cheap. It stays an id + one-line summary + trigger list, never full bodies. When it outgrows a few thousand characters, split it into themed sub-indexes rather than growing it.
|
|
175
|
+
8. Never let the catalog drift. If `principlesElementType` is set, every element of that type MUST be listed (no orphan); if it is null, the index itself is the only source of truth and MUST stay complete.
|
|
176
|
+
</PrincipleIndexGuideline>
|
|
177
|
+
|
|
178
|
+
<Ontology>
|
|
179
|
+
Resolve the workspace modeling language before acting; do not assume ArchiMate. `queryNeo4jGraph` with `{schema:true}` returns `schemaKind`, `schemaLanguage`, the element/relationship type enums, `actorElementType` and `bundleValidation`. Default mode reads the built-in structure at `~/.argo/schema/SystemArchitecture.schema.json`; a workspace/override mode uses the repository's own bundle and its types rule every read and write. A `failed` `bundleValidation` means the workspace schema is misconfigured: report it and do not write until fixed.
|
|
180
|
+
The ontology is replaceable: a workspace may ship its own bundle under `.argo/schema` (`extends:"default"` + `addElementTypes`/`addRelationships`/`overrideMatrix`). Changing the ontology is a Tier 3 structural change: get the human partner's approval first, edit ONLY the workspace bundle (never `~/.argo/schema`, which is shared by every project), then run `validateSystemArchitecture` and `argo-init`. The full resolution and authoring procedure (two routes, traps, validation) lives in skill `ontology-authoring`.
|
|
181
|
+
</Ontology>
|
|
182
|
+
|
|
183
|
+
<RuleRouting>
|
|
184
|
+
Nearly every task follows the resident sections in this file; load a skill ONLY when the task enters its special scenario. Never bulk-load every skill.
|
|
185
|
+
- Writing the graph / delivering a change: the contract is resident (`<IntentArchitectureFirst>`, `<AcceptanceTestFirst>`, `<ChangeTierGate>`, `<GraphDeduplication>`, `<LosslessWrite>`, `<ContentStoragePolicy>`). Load skill `argo-graph-write` only for the write tool mechanics — element/relationship/view parameters, preview/apply, retry after a semantic conflict, and the tombstone ledger path.
|
|
186
|
+
- Memory: the contract is resident (`<TaskMemoryCapture>`, `<MemoryTriggerTiming>`, `<SessionMemorySummarization>`, `<MemoryRecallGuideline>`, `<MemoryTierConventions>` — recall, T1/T2/T3, the `memory-capture` marker). Load skill `argo-memory-ops` only for operator mechanics — the actor memory view/attribute ids and the archive move steps.
|
|
187
|
+
- Retrieval: the ordering is resident (`<QueryPriorityGuideline>`, `<ExplorationGuideline>`, `<ToolsGuideline>`). Load skill `argo-retrieval` only for structural/type lookups — semantic vs Cypher, read-only queryNeo4jGraph, exploration depth.
|
|
188
|
+
- Delegation — handing work to another Business Actor, launching its agent type, actor isolation, multimodal capability handoff: load skill `argo-delegation` (sections `CoperationGuideline`, `CapabilityDelegationGuideline`).
|
|
189
|
+
- Ontology — resolving the workspace modeling language or authoring/changing a schema bundle: load skill `ontology-authoring`.
|
|
190
|
+
- Untriggered: if no special scenario matches, proceed from this file alone.
|
|
191
|
+
</RuleRouting>
|
|
192
|
+
|
|
193
|
+
<Attention>
|
|
194
|
+
Confirm the ARGO MCP server is serving this repository's graph (design/KG/SystemArchitecture.json), not another graph. If it is not, stop and report to your human partner before doing anything else.
|
|
195
|
+
</Attention>
|