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
package/README.md
CHANGED
|
@@ -1,123 +1,204 @@
|
|
|
1
1
|
# ArchGraph
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A knowledge-graph framework with an ontology you define — wired into your coding agent through one MCP interface.**
|
|
4
|
+
|
|
5
|
+
**English** · [简体中文](README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
For teams running coding agents on a real codebase, ArchGraph gives the agent durable, tiered long-term memory on an **intent graph** — a versioned architecture graph that records *why* the system is built the way it is, not just how. You and the agent read and write it through a single **MCP** server (**MCP** = **Model Context Protocol**, the open standard that lets an AI tool call external servers as tools). The graph's shape is set by an **ontology** — its vocabulary of element and relationship types — and that ontology is yours to define. The built-in default is **ArchiMate 3.2 + ARGO extensions**, where **ArchiMate** is a standard enterprise-architecture modeling language and **ARGO** is the toolchain and agent-workflow layer behind the `argo-deploy` and `argo-init` commands. A repository can plug in its own ontology — and this one does. **One install, one interface to learn.**
|
|
8
|
+
|
|
9
|
+
Ready to try it? Jump to **[Build your own graph](#build-your-own-graph)**.
|
|
10
|
+
|
|
11
|
+
[Install](#install) · [Build your own graph](#build-your-own-graph) · [Why ArchGraph](#why-archgraph) · [Capabilities](#capabilities) · [Docs](#docs) · [Community](#community)
|
|
12
|
+
|
|
13
|
+

|
|
4
14
|
|
|
5
15
|
## What is this?
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
**one model** — so you get a single view to work and observe, and real control over your agents.
|
|
17
|
+
If you run coding agents on a real codebase, every session starts cold and the "why" behind the system lives nowhere. ArchGraph makes **one architecture graph** the single source of truth — the agent's memory and the product's design in one model. It is *one MCP interface* to install and learn: the agent restores context at session start, recalls detail on demand, and reuses what it already knows instead of duplicating it (a duplicate needs an explicit override).
|
|
9
18
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
and semantic recall stays precise. Reusable subgraphs can also be shared across projects through a
|
|
14
|
-
federated registry, and any read tool can take an optional <code>projectId</code> to query
|
|
15
|
-
**another project's graph** through the federation center — authorized, read-only, and by
|
|
16
|
-
reference (denied by default). See the [home page](https://archgraph.org/) for the full capability set.
|
|
19
|
+
- **Architects / tech leads** — one model of the product, the harness, and the agents.
|
|
20
|
+
- **Agent users** — memory restored at session start, recalled on demand, reused instead of duplicated.
|
|
21
|
+
- **Platform teams** — one interface, deployed into the editor you already use.
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
→ Full onboarding: **[docs/getting-started.html](docs/getting-started.html)**
|
|
19
24
|
|
|
20
|
-
##
|
|
25
|
+
## Why ArchGraph
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
intent architecture graph, ArchiMate 3.2, and Enterprise Architect relate in graph-driven agentic
|
|
24
|
-
engineering:
|
|
27
|
+
Every team running coding agents hits the same wall: the code is in the repo, but the *reasoning* behind it lives nowhere. Four common fixes exist, and each works until it doesn't.
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
The real differentiator is **not** "custom vs. locked". Protégé/OWL, Neo4j, TerminusDB, and Archi/EA all let you extend a model or bring your own vocabulary. It is that ArchGraph makes the ontology a **first-class, validated, runtime-resolved schema bundle** — and puts it behind **one MCP interface** the agent reads *and* writes, with typed dedup and commit traceability built in.
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
The honest, cost-included comparison lives in one canonical place — **[docs/capabilities.html#compare](docs/capabilities.html#compare)**.
|
|
29
32
|
|
|
30
|
-
##
|
|
33
|
+
## Bring your own ontology
|
|
34
|
+
|
|
35
|
+
A knowledge-graph framework that speaks only one language is not a framework. ArchGraph separates the **core** from the **ontology**: a repository drops a *schema bundle* under `.argo/schema/` (element/relationship types, endpoint rules, an actor contract, an optional guide), and validation, MCP guidance, and the `.qea` projection follow it. A bundle can `extends: "default"` — inheriting the built-in **ArchiMate 3.2 + ARGO extensions** — and add its own types; no framework change required.
|
|
36
|
+
|
|
37
|
+
This repository is the proof: its own bundle uses `extends: "default"` and layers a **UML 2 state-machine profile** on top, resolved at runtime from `.argo/schema/` rather than hardcoded in the framework.
|
|
38
|
+
|
|
39
|
+
→ Worked example — define an ontology, then build the graph step by step: **[docs/case-team-graph.html](docs/case-team-graph.html)** · prebuilt ontology catalog: [`custom-schema/`](custom-schema/README.md) (Team Graph · Finance CDM · Industry 4.0 AAS · STIX Threat Intelligence · UML 2 · SysML · IPD · Mathematics) · full authoring reference (types, relationship structure, axioms/constraints): **[docs/ontology-authoring.md](docs/ontology-authoring.md)**
|
|
40
|
+
|
|
41
|
+
## Ontology validation (optional)
|
|
42
|
+
|
|
43
|
+
Your schema bundle already enforces endpoint rules. ArchGraph can go further and run a **real ontology / reasoning engine** at the same validation timings the framework already uses — **on write** (the change's delta subgraph) and **at init** (the whole graph) — to catch what a schema alone cannot:
|
|
44
|
+
|
|
45
|
+
- **logical contradictions** (OWL inconsistency — e.g. an element that is two disjoint types, or a single-valued slot with two values), and
|
|
46
|
+
- **constraint violations** (SHACL, compiled from your endpoint matrix).
|
|
47
|
+
|
|
48
|
+
It is **opt-in and off by default**; when enabled it is **fail-close** — a configured-but-unavailable engine is a **blocking error**, not a silent pass (an advisory validator can opt out per entry with `onError: "warn"`).
|
|
31
49
|
|
|
32
|
-
|
|
50
|
+
**Enable it.**
|
|
33
51
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
```bash
|
|
53
|
+
argo-deploy -EnableOntologyValidation
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
That writes two keys into `~/.argo/.env` (the same file the deployer configures) — you don't hand-edit them:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
ARGO_ONTOLOGY_PYTHON=python
|
|
60
|
+
ARGO_VALIDATION_EXTENSIONS=[{"name":"ontology","timings":["write","init"],"command":["node","<argo>/scripts/ontology-projection/cli.js","--workspace","{workspaceRoot}","--graph","{graphPath}","--mode","{mode}"]}]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Then **restart your editor / host** so the MCP server reloads `~/.argo/.env`. Turn it off by clearing the `ARGO_VALIDATION_EXTENSIONS` line (or deploying without the flag) and restarting.
|
|
64
|
+
|
|
65
|
+
**Dependencies.** The engine is **pySHACL** + **owlready2/HermiT**. The deployer installs the Python packages (`pyshacl`, `owlready2`) for you; **Python 3 and a JRE** are prerequisites — if either is missing the deploy **stops with an alert** (it never installs a system runtime), so install them and re-run `argo-deploy`. Pass `-SkipOntologyEngine` to skip the engine step entirely.
|
|
41
66
|
|
|
42
|
-
|
|
43
|
-
|
|
67
|
+
**Verify.**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
Get-Content "$env:USERPROFILE\.argo\.env" | Select-String ARGO_VALIDATION_EXTENSIONS # ~/.argo/.env on macOS/Linux
|
|
71
|
+
python -c "import pyshacl, owlready2; print('ok')"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The extension point is **open-closed**: any external validator that speaks the small contract (argv tokens `{workspaceRoot}` / `{graphPath}` / `{mode}`; reads the post-mutation document and touched ids from the environment; prints `{errors, warnings}`) is added as **one entry** in `ARGO_VALIDATION_EXTENSIONS` — no framework change. Spec: [`argo/scripts/ontology-projection/EXTENSION_PROTOCOL.md`](argo/scripts/ontology-projection/EXTENSION_PROTOCOL.md).
|
|
44
75
|
|
|
45
76
|
## Install
|
|
46
77
|
|
|
47
|
-
|
|
78
|
+
**Prerequisite: Node.js ≥ 18** (the ARGO toolchain and the MCP server both run on Node).
|
|
79
|
+
|
|
80
|
+
```bash
|
|
48
81
|
npm install -g archgraph-argo
|
|
49
82
|
argo-deploy
|
|
50
83
|
```
|
|
51
84
|
|
|
52
|
-
|
|
85
|
+
`argo-deploy` registers the `argo` MCP server and installs the skills and rules into **GitHub Copilot, Cursor, OpenCode, DeepSeek Harness, OpenClaw, and Codex** (agents are installed where the host supports them). It then prompts for the few settings in `~/.argo/.env`. **After deploying, restart your editor / host** so it reloads the MCP server. Semantic queries additionally need **Neo4j** and an **embedding** endpoint — see [Build your own graph](#build-your-own-graph).
|
|
53
86
|
|
|
54
|
-
|
|
87
|
+
## Quick start
|
|
55
88
|
|
|
56
|
-
|
|
89
|
+
There is **one** canonical start: **[Build your own graph](#build-your-own-graph)** — install once, then pick Route A (the default ontology) or Route B (your own). That section carries every step and MCP call; this one deliberately keeps no second copy, so there is only one path to follow.
|
|
57
90
|
|
|
58
|
-
|
|
59
|
-
`argo-deploy` you configure `ARGO_NEO4J_DATABASE_URL`, `ARGO_NEO4J_DATABASE_USERNAME`, and
|
|
60
|
-
`ARGO_NEO4J_DATABASE_PASSWORD` in `~/.argo/.env`.
|
|
61
|
-
- **Embedding / vector engine** — powers semantic Graph RAG retrieval. Configure
|
|
62
|
-
`ARGO_EMBEDDING_BASE_URL`, `ARGO_EMBEDDING_MODEL`, `ARGO_EMBEDDING_PROVIDER`,
|
|
63
|
-
`ARGO_EMBEDDING_MODEL_VERSION`, `ARGO_EMBEDDING_DIMENSIONS`, plus the API key `QWEN_KEY`.
|
|
64
|
-
It points at **any OpenAI-compatible embedding endpoint** — a cloud provider, or a self-hosted
|
|
65
|
-
server for offline / intranet / private deployments via `ARGO_EMBEDDING_PROFILE=openai-compatible`
|
|
66
|
-
(see the [self-hosted embedding guide](docs/self-hosted-embedding-deployment.md)).
|
|
91
|
+
**The one prerequisite that is not out of the box:** semantic (Graph RAG) retrieval needs a **Neo4j** instance and an OpenAI-compatible **embedding** endpoint. Context reads, writes, and Enterprise Architect interop work without them; the **Cypher** (Neo4j's graph query language) structural projection and all semantic retrieval need Neo4j.
|
|
67
92
|
|
|
68
|
-
|
|
69
|
-
provision (URI, username, password). The embedding configuration and `QWEN_KEY` come from your
|
|
70
|
-
embedding provider's dashboard — for example Alibaba DashScope — or from a self-hosted
|
|
71
|
-
OpenAI-compatible server. `argo-deploy` walks you through the prompt (existing non-empty values in
|
|
72
|
-
`~/.argo/.env` are kept); you can also edit the file afterwards and re-run.
|
|
93
|
+
## Build your own graph
|
|
73
94
|
|
|
74
|
-
|
|
95
|
+
Pick **one** of two routes. Everything happens through your coding agent and the ARGO MCP server; the only commands you run yourself are the install. Once initialized, the intent graph is the single source of truth.
|
|
96
|
+
|
|
97
|
+
### Route A — default ontology (fastest)
|
|
75
98
|
|
|
76
|
-
|
|
77
|
-
(the `initializeWorkspace` MCP call). It creates a starter `design/KG/SystemArchitecture.json` when
|
|
78
|
-
missing, performs the first JSON → Neo4j sync, initializes the semantic (Graph RAG) lifecycle, and
|
|
79
|
-
verifies the architecture. From then on, the intent graph is the source of truth for the project.
|
|
99
|
+
No schema work: use the built-in **ArchiMate 3.2 + ARGO extensions**.
|
|
80
100
|
|
|
81
|
-
|
|
101
|
+
1. **Install (once).** Requires **Node.js ≥ 18**.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install -g archgraph-argo
|
|
105
|
+
argo-deploy
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Then **restart your editor / host** so it reloads the MCP server.
|
|
109
|
+
|
|
110
|
+
2. **Initialize.** Ask your coding agent to run `argo-init` (the workspace-init CLI). It creates and validates the starter `design/KG/SystemArchitecture.json`, which already contains the project's root view named `SystemArchitecture`.
|
|
111
|
+
|
|
112
|
+
3. **Add elements and relationships.** Ask your coding agent to call `applySystemArchitectureMutation` and attach every new element and relationship to the project's **existing root view** — tell it to resolve that view's real `view_id` first (`queryNeo4jGraph` / `getArchitectureViewContext`). Do **not** pre-create a view: a new view called `SystemArchitecture` would collide with the one `argo-init` made, and any `view_ids` pointing at a different id would then fail.
|
|
113
|
+
|
|
114
|
+
4. **Verify.** Ask your coding agent to call `validateSystemArchitecture`, then `queryNeo4jGraph` with `{"schema": true}` to confirm the element and relationship types in effect.
|
|
115
|
+
|
|
116
|
+
### Route B — your own ontology
|
|
117
|
+
|
|
118
|
+
1. **Install (once).** As in Route A.
|
|
119
|
+
|
|
120
|
+
2. **Author your schema.** Put your modeling language under `.argo/schema/`. A **standalone** bundle — a full `SystemArchitecture.schema.json`, editing its two `$defs` enum arrays, `archimateElementType` and `archimateRelationshipType` — **must also declare `actorElementType` in `schema-bundle.config.json`**, set to one of your element types (or to `null` if your schema genuinely has no actor concept), or loading fails closed (`bundleValidation.status: "failed"`) and validation/writes are blocked. A bundle that only `extends: "default"` needs just the config. `schema-bundle.rules.json` stays optional (without it, endpoint checks are permissive). An agent does not need to be told the mechanism: its startup `queryNeo4jGraph {schema:true}` returns an `ontologyAuthoring` contract, and the shipped `ontology-authoring` skill carries the full procedure. Treat it as a Tier 3 structural change — approve first, edit only the workspace `.argo/schema` (never `~/.argo/schema`), then run `validateSystemArchitecture` and `argo-init`.
|
|
121
|
+
|
|
122
|
+
3. **Author the graph yourself.** With a custom schema, `argo-init` does **not** create the graph — the packaged default would not match your vocabulary — and it **fails closed** with `NO_DEFAULT_GRAPH`. Before any MCP write, create `design/KG/SystemArchitecture.json` by hand, using your own element and relationship types and your own root view. Then ask your coding agent to run `argo-init` to validate it.
|
|
123
|
+
|
|
124
|
+
4. **Add into YOUR root view.** Ask your coding agent to call `applySystemArchitectureMutation`, attaching each element and relationship to the root view **you authored** (not the default one).
|
|
125
|
+
|
|
126
|
+
5. **Verify.** Ask your coding agent to call `validateSystemArchitecture`, then `queryNeo4jGraph` with `{"schema": true}`.
|
|
127
|
+
|
|
128
|
+
The fully-illustrated, step-by-step walkthrough is **[docs/case-team-graph.html](docs/case-team-graph.html)** (Chinese), and the prebuilt example bundles are catalogued in [`custom-schema/`](custom-schema/README.md). The result looks like this:
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+
## Capabilities
|
|
133
|
+
|
|
134
|
+
Each line links to a short page — this is the map, not the manual.
|
|
135
|
+
|
|
136
|
+
- **[Tiered long-term memory](docs/capabilities.html#memory)** — a compact working memory at session start, a long-term memory recalled on demand, and an archive.
|
|
137
|
+
- **[Pluggable ontology](docs/capabilities.html#ontology)** — ship your own schema bundle; the default (ArchiMate 3.2 + ARGO extensions) is data, not code.
|
|
138
|
+
- **[Semantic + structural retrieval](docs/capabilities.html#retrieval)** — Graph RAG recall plus read-only Cypher for exact structure.
|
|
139
|
+
- **[Deduplicated writes](docs/capabilities.html#quality)** — reuse an existing element, relationship, or view instead of copying it; near-duplicates are blocked as candidates.
|
|
140
|
+
- **[Acceptance-test-first + traceability](docs/capabilities.html#quality)** — every change is testable, and the commit id is registered back onto the element.
|
|
141
|
+
- **[Enterprise Architect interop](docs/capabilities.html#interop)** — the graph projects to `.qea`; human EA edits return as a semantic diff.
|
|
142
|
+
- **[Federated graph sharing](docs/capabilities.html#federation)** — sovereign graphs joined by a registry–broker; reads authorized and returned by reference.
|
|
143
|
+
- **[One MCP interface, six hosts](docs/capabilities.html#harness)** — install once, run in Copilot, Cursor, OpenCode, DeepSeek Harness, OpenClaw, and Codex.
|
|
144
|
+
|
|
145
|
+
## How to use
|
|
146
|
+
|
|
147
|
+
**Initialize once** (`argo-init`), then open your project and let your coding agent work. It will:
|
|
82
148
|
|
|
83
149
|
1. locate the architecture element behind the task before changing anything,
|
|
84
150
|
2. arm itself with that element's Skills and Rules,
|
|
85
|
-
3. work test-first (GIVEN-WHEN-THEN)
|
|
86
|
-
4. reuse an existing element
|
|
87
|
-
deduplicates by identity and flags a semantically near element of the same type.
|
|
151
|
+
3. work test-first (GIVEN-WHEN-THEN) and trace every commit back to the graph,
|
|
152
|
+
4. reuse an existing element by default — a near-duplicate needs an explicit override.
|
|
88
153
|
|
|
89
|
-
The intent architecture graph
|
|
154
|
+
The intent architecture graph is the single source of truth.
|
|
90
155
|
|
|
91
|
-
##
|
|
156
|
+
## Supported Harnesses
|
|
92
157
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
158
|
+
| Harness | MCP | Skills | Rules | Agents |
|
|
159
|
+
|---------|:---:|:------:|:-----:|:------:|
|
|
160
|
+
| GitHub Copilot | ✓ | ✓ | ✓ | ✓ |
|
|
161
|
+
| Cursor | ✓ | ✓ | ✓ | ✓ |
|
|
162
|
+
| OpenCode | ✓ | ✓ | ✓ | ✓ |
|
|
163
|
+
| DeepSeek Harness | ✓ | ✓ | ✓ | ✓ |
|
|
164
|
+
| OpenClaw | ✓ | ✓ | ✓ | — |
|
|
165
|
+
| Codex | ✓ | ✓ | ✓ | — |
|
|
96
166
|
|
|
97
|
-
|
|
98
|
-
**discover** it, reads are **explicitly authorized and denied by default**, and a cross-project read
|
|
99
|
-
returns a **reference, not a copy**. The center holds only federation metadata — membership,
|
|
100
|
-
capabilities, interfaces, grants — plus a read-only mirror: it is a **registry + broker**, never the
|
|
101
|
-
content.
|
|
167
|
+
A single `argo-deploy` registers the `argo` MCP server and installs all artifacts into each harness automatically.
|
|
102
168
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
169
|
+
## Cross-project read/write
|
|
170
|
+
|
|
171
|
+
Cross-project access runs over **two separate channels** — they must not be conflated:
|
|
172
|
+
|
|
173
|
+
1. **Local path** — a per-call `workspaceRoot` reads a peer project's graph on the same machine. Writes are **read-only by design**: a foreign write is refused with `WORKSPACE_WRITE_DENIED`.
|
|
174
|
+
2. **Federated** — a per-call `projectId` is routed through the **federation center**, authorized there (denied by default), and returned by reference.
|
|
175
|
+
|
|
176
|
+
Whether the local channel works depends on the harness, because a harness may bridge the MCP server and pin the workspace per call:
|
|
177
|
+
|
|
178
|
+
| Harness | Local read (`workspaceRoot`) | Local write | Federated read (`projectId`) |
|
|
179
|
+
|---------|:----------------------------:|:-----------:|:----------------------------:|
|
|
180
|
+
| OpenCode | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
|
|
181
|
+
| Codex | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
|
|
182
|
+
| DeepSeek Harness | ✗ | ✗ | ✓ |
|
|
183
|
+
| GitHub Copilot | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
|
|
184
|
+
| Cursor | 待测 | 待测 | ✓ |
|
|
185
|
+
| OpenClaw | 不涉及 | 不涉及 | ✓ |
|
|
186
|
+
|
|
187
|
+
DeepSeek Harness **cannot** do local cross-project access: its bridge pins the session workspace, so the request never reaches the server as written and only the federated channel works.
|
|
107
188
|
|
|
108
189
|
## Community
|
|
109
190
|
|
|
110
|
-
ArchGraph runs on open co-building.
|
|
111
|
-
|
|
191
|
+
ArchGraph runs on open co-building: share and reuse **architecture subgraphs** across projects. Sharing is **federated** — each project keeps its graph sovereign, and members register, discover, authorize, and read opened content **by reference** (denied by default; nothing copied or merged). The center is a **registry–broker** that holds federation metadata, never content.
|
|
192
|
+
|
|
193
|
+
- **Community site** — https://argo.derekworkspacev5.com/archgraph/
|
|
194
|
+
- **graph-wiki** (graph-asset home) — https://github.com/derekhu0002/graph-wiki
|
|
195
|
+
- **GitHub** — https://github.com/derekhu0002/archgraph
|
|
112
196
|
|
|
113
|
-
|
|
114
|
-
- **graph-wiki repository** — https://github.com/derekhu0002/graph-wiki (graph-asset home: contribute
|
|
115
|
-
a subgraph from your project, or pull one back to reuse)
|
|
197
|
+
## Docs
|
|
116
198
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Browse the [federation members](https://argo.derekworkspacev5.com/archgraph/federation).
|
|
199
|
+
- [Getting started](docs/getting-started.html) · [Capabilities](docs/capabilities.html) · [Worked case: Team Graph](docs/case-team-graph.html)
|
|
200
|
+
- [Schema bundles / ontology decoupling](docs/schema-bundle-decoupling.md) · [Self-hosted embeddings](docs/self-hosted-embedding-deployment.md) · [MCP acceptance](docs/mcp-acceptance.md)
|
|
201
|
+
- [Insights](docs/insights.html) — GraphRAG, agent memory, and portable skills.
|
|
121
202
|
|
|
122
203
|
## License
|
|
123
204
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# ArchGraph
|
|
2
|
+
|
|
3
|
+
**一个由你定义本体的知识图谱框架 —— 通过一个统一的 MCP 接口接入你的编码 Agent。**
|
|
4
|
+
|
|
5
|
+
[English](README.md) · **简体中文**
|
|
6
|
+
|
|
7
|
+
面向在真实代码库上运行编码 Agent 的团队,ArchGraph 让 Agent 在一张**意图图谱(intent graph)**上拥有持久、分层的长期记忆 —— 这是一张带版本的架构图,记录系统*为什么*长成这样,而不只是*长什么样*。你和 Agent 通过一个 **MCP** 服务端(**MCP** = **Model Context Protocol**,让 AI 工具把外部服务当作工具调用的开放标准)来读写它。图谱的形态由**本体(ontology)**决定 —— 也就是元素与关系类型的词汇表 —— 而这套本体由你定义。内置默认是 **ArchiMate 3.2 + ARGO 扩展**,其中 **ArchiMate** 是一套标准的企业架构建模语言,**ARGO** 是 `argo-deploy` 与 `argo-init` 命令背后的工具链与 Agent 工作流层。一个仓库可以接入自己的本体 —— 本仓库就是这么做的。**一次安装,一个接口,学一次。**
|
|
8
|
+
|
|
9
|
+
准备好试一试了吗?直接跳到 **[构建你自己的图谱](#构建你自己的图谱)**。
|
|
10
|
+
|
|
11
|
+
[安装](#安装) · [构建你自己的图谱](#构建你自己的图谱) · [为什么选择 ArchGraph](#为什么选择-archgraph) · [能力总览](#能力总览) · [文档](#文档) · [社区](#社区)
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## 这是什么?
|
|
16
|
+
|
|
17
|
+
如果你在真实代码库上运行编码 Agent,那么每个会话都是「冷启动」,而系统背后的「为什么」无处安放。ArchGraph 让**一张架构图**成为唯一的事实来源 —— Agent 的记忆与产品的设计合于同一个模型。你只需安装并学习*一个 MCP 接口*:Agent 在会话开始时恢复上下文,在需要时召回细节,并复用已知内容而不是重复创建(若确实要建重复项,必须显式确认)。
|
|
18
|
+
|
|
19
|
+
- **架构师 / 技术负责人** —— 用一张模型同时描述产品、工具链与 Agent。
|
|
20
|
+
- **Agent 使用者** —— 会话开始时记忆已恢复,需要时按需召回,复用而非重复。
|
|
21
|
+
- **平台团队** —— 一个接口,部署进你已在使用的编辑器。
|
|
22
|
+
|
|
23
|
+
→ 完整上手:**[docs/getting-started.html](docs/getting-started.html)**
|
|
24
|
+
|
|
25
|
+
## 为什么选择 ArchGraph
|
|
26
|
+
|
|
27
|
+
每个运行编码 Agent 的团队都会撞上同一堵墙:代码在仓库里,但代码背后的*推理*无处安放。常见的四种做法各有用武之地,但都撑不了多久。
|
|
28
|
+
|
|
29
|
+
真正的差异**不在于**「自定义 vs. 锁定」。Protégé/OWL、Neo4j、TerminusDB、Archi/EA 都允许你扩展模型或自带词汇。而在于 ArchGraph 把本体做成一个**一等公民、受校验、运行时解析的 schema bundle**,并把它放在**一个** Agent 既能读*又能*写的 **MCP 接口**之后,且内建类型化去重与提交可追溯。
|
|
30
|
+
|
|
31
|
+
包含成本的诚实对比只放在一个权威位置 —— **[docs/capabilities.html#compare](docs/capabilities.html#compare)**。
|
|
32
|
+
|
|
33
|
+
## 自带本体
|
|
34
|
+
|
|
35
|
+
只会说一种语言的知识图谱框架,称不上框架。ArchGraph 把**内核**与**本体**分离:仓库在 `.argo/schema/` 下放一份 *schema bundle*(元素/关系类型、端点规则、actor 契约、可选 guide),校验、MCP 指引与 `.qea` 投影都会随之改变。一份 bundle 可以 `extends: "default"` —— 继承内置的 **ArchiMate 3.2 + ARGO 扩展** —— 再追加自己的类型;无需改动框架。
|
|
36
|
+
|
|
37
|
+
本仓库就是证明:它自己的 bundle 用 `extends: "default"` 并叠加了一份 **UML 2 状态机 profile**,在运行时从 `.argo/schema/` 解析,而不是硬编码在框架里。
|
|
38
|
+
|
|
39
|
+
→ 一个完整示例 —— 定义本体后一步步建图:**[docs/case-team-graph.html](docs/case-team-graph.html)** · 预置本体目录:[`custom-schema/`](custom-schema/README.md)(Team Graph · Finance CDM · Industry 4.0 AAS · STIX Threat Intelligence · UML 2 · SysML · IPD · Mathematics)· 完整编写参考(类型、关系结构、公理/约束):**[docs/ontology-authoring.md](docs/ontology-authoring.md)**
|
|
40
|
+
|
|
41
|
+
## 本体校验(可选)
|
|
42
|
+
|
|
43
|
+
你的 schema bundle 已经能约束端点规则。ArchGraph 还能更进一步,在框架既有的校验时机上运行一个**真正的本体 / 推理引擎** —— **写入时**(本次变更的增量子图)与**初始化时**(整张图)—— 以捕捉仅靠 schema 无法发现的问题:
|
|
44
|
+
|
|
45
|
+
- **逻辑矛盾**(OWL 不一致 —— 例如一个元素同时属于两个互斥类型,或单值槽位被赋了两个值),以及
|
|
46
|
+
- **约束违规**(SHACL,由你的端点矩阵编译而来)。
|
|
47
|
+
|
|
48
|
+
它是**可选的、默认关闭**;一旦启用则是**失败即阻断(fail-close)** —— 已配置但不可用的引擎会被视为**阻断性错误**,而不是默默通过(咨询类校验器可以按条目用 `onError: "warn"` 选择退出)。
|
|
49
|
+
|
|
50
|
+
**启用它。**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
argo-deploy -EnableOntologyValidation
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
这会把两个键写进 `~/.argo/.env`(也就是部署器配置的同一个文件)—— 你不用手动编辑:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
ARGO_ONTOLOGY_PYTHON=python
|
|
60
|
+
ARGO_VALIDATION_EXTENSIONS=[{"name":"ontology","timings":["write","init"],"command":["node","<argo>/scripts/ontology-projection/cli.js","--workspace","{workspaceRoot}","--graph","{graphPath}","--mode","{mode}"]}]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
然后**重启你的编辑器 / 宿主**,让 MCP 服务端重新加载 `~/.argo/.env`。要关闭它,清空 `ARGO_VALIDATION_EXTENSIONS` 这一行(或部署时不带该标志)并重启即可。
|
|
64
|
+
|
|
65
|
+
**依赖。** 引擎是 **pySHACL** + **owlready2/HermiT**。部署器会替你安装这些 Python 包(`pyshacl`、`owlready2`);**Python 3 与一个 JRE** 是前置条件 —— 若缺任一,部署会**带告警停止**(它绝不会擅自安装系统运行时),请先装上再重跑 `argo-deploy`。传 `-SkipOntologyEngine` 可完全跳过引擎步骤。
|
|
66
|
+
|
|
67
|
+
**验证。**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
Get-Content "$env:USERPROFILE\.argo\.env" | Select-String ARGO_VALIDATION_EXTENSIONS # macOS/Linux 上是 ~/.argo/.env
|
|
71
|
+
python -c "import pyshacl, owlready2; print('ok')"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
这个扩展点是**开闭的**:任何遵守这份小契约的外部校验器(argv 令牌 `{workspaceRoot}` / `{graphPath}` / `{mode}`;从环境读取变更后的文档与被触碰的 id;打印 `{errors, warnings}`)都可以作为**一条条目**加入 `ARGO_VALIDATION_EXTENSIONS` —— 无需改动框架。规范:[`argo/scripts/ontology-projection/EXTENSION_PROTOCOL.md`](argo/scripts/ontology-projection/EXTENSION_PROTOCOL.md)。
|
|
75
|
+
|
|
76
|
+
## 安装
|
|
77
|
+
|
|
78
|
+
**前置条件:Node.js ≥ 18**(ARGO 工具链与 MCP 服务端都跑在 Node 上)。
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install -g archgraph-argo
|
|
82
|
+
argo-deploy
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`argo-deploy` 会注册 `argo` MCP 服务端,并把 skills 与 rules 安装进 **GitHub Copilot、Cursor、OpenCode、DeepSeek Harness、OpenClaw 和 Codex**(agents 只在支持它的宿主上安装)。随后它会提示你填写 `~/.argo/.env` 里的少量设置。**部署完成后,重启你的编辑器 / 宿主**,让它重新加载 MCP 服务端。语义查询还需要 **Neo4j** 与一个 **embedding** 端点 —— 见 [构建你自己的图谱](#构建你自己的图谱)。
|
|
86
|
+
|
|
87
|
+
## 快速开始
|
|
88
|
+
|
|
89
|
+
只有**一条**权威起点:**[构建你自己的图谱](#构建你自己的图谱)** —— 装一次,然后选路线 A(默认本体)或路线 B(你自己的本体)。那一节包含每一步与每个 MCP 调用;这里刻意不再放第二份副本,所以只有一条路可走。
|
|
90
|
+
|
|
91
|
+
**唯一开箱即用之外的前置条件:**语义(Graph RAG)检索需要一台 **Neo4j** 实例与一个 OpenAI 兼容的 **embedding** 端点。上下文读取、写入与 Enterprise Architect 互操作无需它们;**Cypher**(Neo4j 的图查询语言)结构投影与全部语义检索则需要 Neo4j。
|
|
92
|
+
|
|
93
|
+
## 构建你自己的图谱
|
|
94
|
+
|
|
95
|
+
二选一。一切都在你的编码 Agent 与 ARGO MCP 服务端之间完成;你唯一需要亲自运行的命令就是安装。初始化之后,意图图谱就是唯一的事实来源。
|
|
96
|
+
|
|
97
|
+
### 路线 A —— 默认本体(最快)
|
|
98
|
+
|
|
99
|
+
无需本体工作:使用内置的 **ArchiMate 3.2 + ARGO 扩展**。
|
|
100
|
+
|
|
101
|
+
1. **安装(一次)。** 需要 **Node.js ≥ 18**。
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install -g archgraph-argo
|
|
105
|
+
argo-deploy
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
然后**重启你的编辑器 / 宿主**,让它重新加载 MCP 服务端。
|
|
109
|
+
|
|
110
|
+
2. **初始化。** 让你的编码 Agent 运行 `argo-init`(工作区初始化 CLI)。它会创建并校验起始的 `design/KG/SystemArchitecture.json`,其中已经包含名为 `SystemArchitecture` 的项目根视图。
|
|
111
|
+
|
|
112
|
+
3. **添加元素与关系。** 让你的编码 Agent 调用 `applySystemArchitectureMutation`,把每个新元素与关系挂到项目的**既有根视图**上 —— 先让它解析该视图真实的 `view_id`(`queryNeo4jGraph` / `getArchitectureViewContext`)。**不要**预建视图:一个名为 `SystemArchitecture` 的新视图会与 `argo-init` 创建的那个冲突,此后任何指向别的 id 的 `view_ids` 都会失败。
|
|
113
|
+
|
|
114
|
+
4. **验证。** 让你的编码 Agent 调用 `validateSystemArchitecture`,再用 `{"schema": true}` 调用 `queryNeo4jGraph` 确认生效的元素与关系类型。
|
|
115
|
+
|
|
116
|
+
### 路线 B —— 你自己的本体
|
|
117
|
+
|
|
118
|
+
1. **安装(一次)。** 同路线 A。
|
|
119
|
+
|
|
120
|
+
2. **编写你的 schema。** 把你的建模语言放到 `.argo/schema/` 下。一份**独立** bundle —— 一个完整的 `SystemArchitecture.schema.json`,编辑其两个 `$defs` 枚举数组 `archimateElementType` 与 `archimateRelationshipType` —— **还必须**在 `schema-bundle.config.json` 中声明 `actorElementType`,设为你某个元素类型(若你的 schema 确实没有 actor 概念则设为 `null`),否则会加载失败即阻断(`bundleValidation.status: "failed"`),校验/写入都会被阻塞。仅 `extends: "default"` 的 bundle 只需那份 config。`schema-bundle.rules.json` 保持可选(没有它时端点检查较为宽松)。Agent 不必被额外告知这套机制:它启动时的 `queryNeo4jGraph {schema:true}` 会返回 `ontologyAuthoring` 契约,随包部署的 `ontology-authoring` skill 给出完整步骤。这是 Tier 3 结构性变更——先经你批准,只改仓内 `.argo/schema`(绝不改 `~/.argo/schema`),改后跑 `validateSystemArchitecture` 与 `argo-init`。
|
|
121
|
+
|
|
122
|
+
3. **自己编写图谱。** 使用自定义 schema 时,`argo-init` **不会**创建图谱 —— 打包的默认图与你的词汇不匹配 —— 它会**失败即阻断**并报 `NO_DEFAULT_GRAPH`。在任何 MCP 写入之前,手工创建 `design/KG/SystemArchitecture.json`,使用你自己的元素与关系类型以及你自己的根视图。然后让你的编码 Agent 运行 `argo-init` 来校验它。
|
|
123
|
+
|
|
124
|
+
4. **加入你自己的根视图。** 让你的编码 Agent 调用 `applySystemArchitectureMutation`,把每个元素与关系挂到**你编写的**根视图上(而不是默认那个)。
|
|
125
|
+
|
|
126
|
+
5. **验证。** 让你的编码 Agent 调用 `validateSystemArchitecture`,再用 `{"schema": true}` 调用 `queryNeo4jGraph`。
|
|
127
|
+
|
|
128
|
+
完整图文、分步的走查见 **[docs/case-team-graph.html](docs/case-team-graph.html)**(中文),预置示例 bundle 收录于 [`custom-schema/`](custom-schema/README.md)。结果看起来是这样:
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+
## 能力总览
|
|
133
|
+
|
|
134
|
+
每一行都链接到一个简短的页面 —— 这是地图,不是手册。
|
|
135
|
+
|
|
136
|
+
- **[分层长期记忆](docs/capabilities.html#memory)** —— 会话开始时一份紧凑的工作记忆,按需召回一份长期记忆,以及一个归档。
|
|
137
|
+
- **[可插拔本体](docs/capabilities.html#ontology)** —— 交付你自己的 schema bundle;默认(ArchiMate 3.2 + ARGO 扩展)是数据,不是代码。
|
|
138
|
+
- **[语义 + 结构检索](docs/capabilities.html#retrieval)** —— Graph RAG 召回,加上只读 Cypher 精确查询结构。
|
|
139
|
+
- **[去重写入](docs/capabilities.html#quality)** —— 复用既有的元素、关系或视图,而不是复制它;近似重复会作为候选被拦下。
|
|
140
|
+
- **[验收测试先行 + 可追溯](docs/capabilities.html#quality)** —— 每次改动都可测试,且 commit id 会登记回元素。
|
|
141
|
+
- **[Enterprise Architect 互操作](docs/capabilities.html#interop)** —— 图谱投影为 `.qea`;人类在 EA 里的编辑以语义 diff 返回。
|
|
142
|
+
- **[联邦图谱共享](docs/capabilities.html#federation)** —— 主权图谱通过注册中心–代理(registry–broker)互联;读取经授权并按引用返回。
|
|
143
|
+
- **[一个 MCP 接口,六个宿主](docs/capabilities.html#harness)** —— 装一次,在 Copilot、Cursor、OpenCode、DeepSeek Harness、OpenClaw 与 Codex 中运行。
|
|
144
|
+
|
|
145
|
+
## 如何使用
|
|
146
|
+
|
|
147
|
+
**初始化一次**(`argo-init`),然后打开你的项目,让你的编码 Agent 干活。它会:
|
|
148
|
+
|
|
149
|
+
1. 在改动任何东西之前,先定位任务背后的架构元素,
|
|
150
|
+
2. 用该元素的 Skills 与 Rules 武装自己,
|
|
151
|
+
3. 测试先行(GIVEN-WHEN-THEN),并把每个 commit 追溯到图谱,
|
|
152
|
+
4. 默认复用既有元素 —— 近似重复需要显式确认。
|
|
153
|
+
|
|
154
|
+
意图架构图就是唯一的事实来源。
|
|
155
|
+
|
|
156
|
+
## 支持的宿主
|
|
157
|
+
|
|
158
|
+
| 宿主 | MCP | Skills | Rules | Agents |
|
|
159
|
+
|---------|:---:|:------:|:-----:|:------:|
|
|
160
|
+
| GitHub Copilot | ✓ | ✓ | ✓ | ✓ |
|
|
161
|
+
| Cursor | ✓ | ✓ | ✓ | ✓ |
|
|
162
|
+
| OpenCode | ✓ | ✓ | ✓ | ✓ |
|
|
163
|
+
| DeepSeek Harness | ✓ | ✓ | ✓ | ✓ |
|
|
164
|
+
| OpenClaw | ✓ | ✓ | ✓ | — |
|
|
165
|
+
| Codex | ✓ | ✓ | ✓ | — |
|
|
166
|
+
|
|
167
|
+
一次 `argo-deploy` 即可注册 `argo` MCP 服务端,并把全部产物自动安装进每个宿主。
|
|
168
|
+
|
|
169
|
+
## 跨项目读写
|
|
170
|
+
|
|
171
|
+
跨项目访问走**两条独立通道** —— 不能混为一谈:
|
|
172
|
+
|
|
173
|
+
1. **本地路径** —— 每次调用传 `workspaceRoot`,读取同机上一个对等项目的图谱。写入**按设计只读**:外部写入会被拒绝并返回 `WORKSPACE_WRITE_DENIED`。
|
|
174
|
+
2. **联邦** —— 每次调用传 `projectId`,经**联邦中心**路由,在其处授权(默认拒绝),并按引用返回。
|
|
175
|
+
|
|
176
|
+
本地通道是否可用取决于宿主,因为宿主可能桥接 MCP 服务端并按调用固定工作区:
|
|
177
|
+
|
|
178
|
+
| 宿主 | 本地读(`workspaceRoot`) | 本地写 | 联邦读(`projectId`) |
|
|
179
|
+
|---------|:----------------------------:|:-----------:|:----------------------------:|
|
|
180
|
+
| OpenCode | ✓ | blocked(`WORKSPACE_WRITE_DENIED`) | ✓ |
|
|
181
|
+
| Codex | ✓ | blocked(`WORKSPACE_WRITE_DENIED`) | ✓ |
|
|
182
|
+
| DeepSeek Harness | ✗ | ✗ | ✓ |
|
|
183
|
+
| GitHub Copilot | ✓ | blocked(`WORKSPACE_WRITE_DENIED`) | ✓ |
|
|
184
|
+
| Cursor | 待测 | 待测 | ✓ |
|
|
185
|
+
| OpenClaw | 不涉及 | 不涉及 | ✓ |
|
|
186
|
+
|
|
187
|
+
DeepSeek Harness **无法**做本地跨项目访问:它的桥接固定了会话工作区,请求不会按原样到达服务端,只有联邦通道可用。
|
|
188
|
+
|
|
189
|
+
## 社区
|
|
190
|
+
|
|
191
|
+
ArchGraph 建立在开放共建之上:在项目间分享与复用**架构子图**。分享是**联邦式**的 —— 每个项目保持图谱主权,成员通过**引用**进行注册、发现、授权与读取已开放内容(默认拒绝;不复制、不合并)。中心是一个**注册中心–代理**,只保存联邦元数据,从不保存内容。
|
|
192
|
+
|
|
193
|
+
- **社区站点** —— https://argo.derekworkspacev5.com/archgraph/
|
|
194
|
+
- **graph-wiki**(图谱资产之家)—— https://github.com/derekhu0002/graph-wiki
|
|
195
|
+
- **GitHub** —— https://github.com/derekhu0002/archgraph
|
|
196
|
+
|
|
197
|
+
## 文档
|
|
198
|
+
|
|
199
|
+
- [使用介绍](docs/getting-started.html) · [能力总览](docs/capabilities.html) · [完整案例:Team Graph](docs/case-team-graph.html)
|
|
200
|
+
- [Schema bundles / 本体解耦](docs/schema-bundle-decoupling.md) · [自建 embedding 部署](docs/self-hosted-embedding-deployment.md) · [MCP 验收](docs/mcp-acceptance.md)
|
|
201
|
+
- [洞察](docs/insights.html) —— GraphRAG、Agent 记忆与可移植技能。
|
|
202
|
+
|
|
203
|
+
## 许可证
|
|
204
|
+
|
|
205
|
+
[Apache License 2.0](LICENSE)
|
package/argo/.env.example
CHANGED
|
@@ -60,6 +60,16 @@ ARGO_NEO4J_DATABASE=
|
|
|
60
60
|
# the reranker when ARGO_RERANK_API_KEY is not set. Never commit it.
|
|
61
61
|
QWEN_KEY=
|
|
62
62
|
|
|
63
|
+
# --- Online MCP (thin writer -> cloud) --------------------------------------
|
|
64
|
+
# Execution mode: "offline" (local engine) or "online" (thin writer forwards
|
|
65
|
+
# reads to the cloud). Default offline. A project's .argo/workspace.json mode
|
|
66
|
+
# overrides this global default.
|
|
67
|
+
ARGO_MODE=
|
|
68
|
+
# Cloud online-MCP base URL (the thin writer forwards reads/validate here).
|
|
69
|
+
ARGO_CLOUD_URL=
|
|
70
|
+
# Cloud bearer token. SECRET: user-level, never commit it.
|
|
71
|
+
ARGO_CLOUD_TOKEN=
|
|
72
|
+
|
|
63
73
|
# --- Semantic retrieval tuning (optional; safe defaults shown) --------------
|
|
64
74
|
# Similarity threshold, memory purposes (recall-oriented). Default 0.55.
|
|
65
75
|
ARGO_SEMANTIC_MEMORY_THRESHOLD=
|
|
@@ -104,9 +114,16 @@ ARGO_SEMANTIC_RERANK_POOL=
|
|
|
104
114
|
ARGO_SEMANTIC_RERANK_RETURN=
|
|
105
115
|
# Per-request rerank timeout in ms (AbortController). Default 3500.
|
|
106
116
|
ARGO_SEMANTIC_RERANK_TIMEOUT_MS=
|
|
117
|
+
# Rerank wire contract: "chat" (default) = listwise LLM over /chat/completions;
|
|
118
|
+
# "native" = a real cross-encoder rerank service (DashScope text-rerank API,
|
|
119
|
+
# e.g. model qwen3.7-text-rerank; base URL may be the origin
|
|
120
|
+
# https://dashscope.aliyuncs.com or the full /api/v1/services/rerank/... URL).
|
|
121
|
+
# Unset/unknown = chat (backward compatible).
|
|
122
|
+
ARGO_RERANK_TRANSPORT=
|
|
107
123
|
# Dedicated rerank provider (optional). When unset, rerank falls back to the
|
|
108
124
|
# embedding provider above. Use these to point rerank at another provider/model
|
|
109
|
-
# (e.g.
|
|
125
|
+
# that actually exists (e.g. native DashScope: base https://dashscope.aliyuncs.com,
|
|
126
|
+
# model qwen3.7-text-rerank, key = QWEN_KEY).
|
|
110
127
|
ARGO_RERANK_BASE_URL=
|
|
111
128
|
# Dedicated rerank API key. SECRET. Falls back to QWEN_KEY when unset.
|
|
112
129
|
ARGO_RERANK_API_KEY=
|
|
@@ -125,6 +142,26 @@ ARGO_RERANK_DISABLE_THINKING=
|
|
|
125
142
|
# {"enable_thinking":false}.
|
|
126
143
|
ARGO_RERANK_THINKING_PARAM=
|
|
127
144
|
|
|
145
|
+
# --- Ontology / axiom validation extension (optional; OFF by default) --------
|
|
146
|
+
# JSON list of external validators run at the framework's validation timings
|
|
147
|
+
# (write = per-mutation delta subgraph; init = whole graph). Empty or absent =
|
|
148
|
+
# disabled (default: no behaviour change). The bundled ontology engine entry is:
|
|
149
|
+
# [{"name":"ontology","timings":["write","init"],
|
|
150
|
+
# "command":["node","<argo>/scripts/ontology-projection/cli.js",
|
|
151
|
+
# "--workspace","{workspaceRoot}","--graph","{graphPath}","--mode","{mode}"]}]
|
|
152
|
+
# Requires Python 3 (+ `pyshacl` + `owlready2`) and a JRE (owlready2 runs HermiT);
|
|
153
|
+
# a configured-but-unavailable engine is a BLOCKING error (fail-close), not a
|
|
154
|
+
# silent pass. Add "onError":"warn" to an entry to make it advisory instead.
|
|
155
|
+
# The deployer's `argo-deploy -EnableOntologyValidation` writes this key for you.
|
|
156
|
+
# Verify its value: Get-Content $env:USERPROFILE\.argo\.env (or read this file).
|
|
157
|
+
ARGO_VALIDATION_EXTENSIONS=
|
|
158
|
+
# Interpreter for the ontology engine CLI. Default: python3 (set "python" on
|
|
159
|
+
# Windows when python3 is not on PATH).
|
|
160
|
+
ARGO_ONTOLOGY_PYTHON=
|
|
161
|
+
# Write-time engine: "real" (default; pySHACL + owlready2/HermiT) or
|
|
162
|
+
# "deterministic" (dependency-free in-process subset).
|
|
163
|
+
ARGO_ONTOLOGY_ENGINE=
|
|
164
|
+
|
|
128
165
|
# --- Live end-to-end opt-ins (optional; normally unset) ---------------------
|
|
129
166
|
# "1" allows the live embedding-provider E2E to hit the real network.
|
|
130
167
|
ARGO_LIVE_PROVIDER_E2E=
|
|
@@ -168,3 +205,14 @@ ARGO_W31_LIVE_MUTATION_VECTOR_E2E=
|
|
|
168
205
|
# ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD=
|
|
169
206
|
# Alias of ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD (takes precedence when set).
|
|
170
207
|
# ARGO_SEMANTIC_DEDUP_THRESHOLD=
|
|
208
|
+
# Cross-project WRITE guard. Default ON: a write tool may only target the
|
|
209
|
+
# server's own (home) workspace, so a foreign per-call workspaceRoot is
|
|
210
|
+
# rejected fail-closed while cross-project READS stay open. "0" disables it
|
|
211
|
+
# (all-or-nothing) for a trusted multi-workspace host that legitimately writes
|
|
212
|
+
# several workspaces through one server.
|
|
213
|
+
# ARGO_WORKSPACE_WRITE_GUARD=
|
|
214
|
+
# Set to "1" by a trusted host broker (e.g. the DSH workspace bridge) to assert
|
|
215
|
+
# it controls the per-call `sessionWorkspaceRoot` field; the argo server then
|
|
216
|
+
# allows WRITES to that host-designated session workspace as well as its home
|
|
217
|
+
# workspace. A model cannot set a process env var, so the trust is unforgeable.
|
|
218
|
+
# ARGO_WORKSPACE_ROOT_TRUSTED=
|
|
@@ -28,7 +28,10 @@ export default async function argoCostCollector(input) {
|
|
|
28
28
|
const workspaceRoot = (input && (input.directory || input.worktree)) || process.cwd();
|
|
29
29
|
const hooks = log.createHostCollectorHooks(workspaceRoot);
|
|
30
30
|
return {
|
|
31
|
-
|
|
31
|
+
// OpenCode delivers tool arguments as the SECOND argument of
|
|
32
|
+
// tool.execute.before ({ args }); passing it through is what makes the
|
|
33
|
+
// logged args.keys usable (e.g. telling a schema read from a graph query).
|
|
34
|
+
"tool.execute.before": async (i, o) => { try { hooks.before(i, o); } catch { /* best-effort */ } },
|
|
32
35
|
"tool.execute.after": async (i, o) => { try { hooks.after(i, o); } catch { /* best-effort */ } },
|
|
33
36
|
event: async (payload) => { try { hooks.event(payload); } catch { /* best-effort */ } },
|
|
34
37
|
};
|
|
@@ -13,7 +13,10 @@ const WAKEUP_GATE = [
|
|
|
13
13
|
"WAKEUP GATE (unconditional; applies to the very first message of every session, including greetings, casual chat, and questions; never skip or defer).",
|
|
14
14
|
`1. Your very FIRST tool call must be an ARGO MCP query listing all Actor elements (getSystemArchitecture, purpose "audit", subject "${ACTOR_ELEMENT_TYPE}"). Resolve the workspace's own schema first: queryNeo4jGraph with {schema:true} reports actorElementType (a .argo/schema bundle may rename it; null means no Actor concept, then skip), bundleValidation, and the type enums.`,
|
|
15
15
|
"2. Restore that Actor's long-term memory (the SUBVIEW hierarchy mounted under it) before responding.",
|
|
16
|
-
"3.
|
|
16
|
+
"3. Load the principles index (base capability; queryNeo4jGraph {schema:true} -> principleIndex, which a bundle may override or disable with null): read the element named by its indexElementId in the same startup step — the index only, never every principle body. If its status is 'declared-missing', or the read returns zero rows, no catalog exists yet: say so in one line and offer to create it; never invent entries and never continue silently. Principle bodies are fetched on demand when a declared load trigger matches a checkpoint.",
|
|
17
|
+
"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 with no preceding graph read is a violation.",
|
|
18
|
+
"5. Recall before acting: a task or goal is a recall trigger, not only a question. Before the FIRST side-effecting action (file write/edit, command execution, graph mutation, delegation), if you have not yet retrieved for this task, run ONE retrieval on the task intent (memory_search for prior experience/decisions/lessons, getSystemArchitecture for 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.",
|
|
19
|
+
"6. If the ARGO MCP is unavailable or errors, say so explicitly first. Only after this gate may you respond or act.",
|
|
17
20
|
].join("\n");
|
|
18
21
|
|
|
19
22
|
export default async function argoWakeupPlugin() {
|