archgraph-argo 0.27.0 → 0.28.0

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 CHANGED
@@ -1,106 +1,167 @@
1
1
  # ArchGraph
2
2
 
3
- An architecture-graph driven framework for Agentic Engineering.
3
+ **A knowledge-graph framework with an ontology you define — wired into your coding agent through one MCP interface.**
4
+
5
+ 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.**
6
+
7
+ Ready to try it? Jump to **[Build your own graph](#build-your-own-graph)**.
8
+
9
+ [Install](#install) · [Build your own graph](#build-your-own-graph) · [Why ArchGraph](#why-archgraph) · [Capabilities](#capabilities) · [Docs](#docs) · [Community](#community)
10
+
11
+ ![ArchGraph core model — one graph for the agent's memory and the product's design](docs/diagrams/core-model.svg)
4
12
 
5
13
  ## What is this?
6
14
 
7
- ArchGraph builds a **unified language** that puts harness design and target product design into
8
- **one model** — so you get a single view to work and observe, and real control over your agents.
15
+ 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
16
 
10
- It doubles as a **long-term memory for coding agents**: an ArchiMate 3.2 intent graph exposed through
11
- a single read/write MCP interface. Memory is tiered — a compact working memory restored at session
12
- start, a long-term memory recalled on demand — and writes are deduplicated, so the graph stays clean
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.
17
+ - **Architects / tech leads** — one model of the product, the harness, and the agents.
18
+ - **Agent users** — memory restored at session start, recalled on demand, reused instead of duplicated.
19
+ - **Platform teams** — one interface, deployed into the editor you already use.
17
20
 
18
- ![ArchGraph core model — harness design and product design in one graph](docs/diagrams/core-model.svg)
21
+ → Full onboarding: **[docs/getting-started.html](docs/getting-started.html)**
19
22
 
20
- ## Architecture
23
+ ## Why ArchGraph
21
24
 
22
- The global architecture (Layered Viewpoint) shows how the human, the coding agent, ARGO MCP, the
23
- intent architecture graph, ArchiMate 3.2, and Enterprise Architect relate in graph-driven agentic
24
- engineering:
25
+ 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
26
 
26
- ![Global architecture — Layered Viewpoint](docs/diagrams/global-architecture.svg)
27
+ 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
28
 
28
- Editable source: [`scripts/gen-diagrams.js`](scripts/gen-diagrams.js)
29
+ The honest, cost-included comparison lives in one canonical place — **[docs/capabilities.html#compare](docs/capabilities.html#compare)**.
29
30
 
30
- ## Supported Harnesses
31
+ ## Bring your own ontology
31
32
 
32
- ArchGraph deploys the ARGO toolchain to all major coding-agent environments:
33
+ 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.
33
34
 
34
- | Harness | MCP Server | Skills | Rules / Instructions | Agents | Wakeup Gate |
35
- |--------------------|:----------:|:------:|:--------------------:|:------:|:-----------:|
36
- | GitHub Copilot | ✓ | ✓ | ✓ | ✓ | — |
37
- | Cursor | ✓ | ✓ | ✓ | ✓ | — |
38
- | OpenCode | ✓ | ✓ | ✓ | ✓ | ✓ |
39
- | DeepSeek Harness | ✓ | ✓ | ✓ | ✓ | ✓ |
40
- | OpenClaw | ✓ | ✓ | ✓ | — | ✓ |
35
+ 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.
41
36
 
42
- A single `argo-deploy` registers the `argo` MCP server and installs all artifacts into each harness
43
- automatically.
37
+ → Worked example — define an ontology, then build the graph step by step: **[docs/case-team-graph.html](docs/case-team-graph.html)** · runnable bundle: [`custom-schema/`](custom-schema/README.md)
44
38
 
45
39
  ## Install
46
40
 
47
- ```powershell
41
+ **Prerequisite: Node.js ≥ 18** (the ARGO toolchain and the MCP server both run on Node).
42
+
43
+ ```bash
48
44
  npm install -g archgraph-argo
49
45
  argo-deploy
50
46
  ```
51
47
 
52
- Done &mdash; the ARGO toolchain, skills, and rules are deployed, and the `argo` MCP server is registered automatically in **GitHub Copilot**, **Cursor**, **OpenCode**, **DeepSeek Harness** (dsh), and **OpenClaw**.
48
+ `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
49
 
54
- ### Prerequisites and configuration
50
+ ## Quick start
55
51
 
56
- Everything works out of the box except **semantic (Graph RAG) queries**, which need:
52
+ 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
53
 
58
- - **Neo4j graph database** — stores the structural projection of your architecture graph. During
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)).
54
+ **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
55
 
68
- Where do the values come from? The Neo4j credentials come from the Neo4j instance you own or
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.
56
+ ## Build your own graph
73
57
 
74
- ## How to use
58
+ 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.
59
+
60
+ ### Route A — default ontology (fastest)
61
+
62
+ No schema work: use the built-in **ArchiMate 3.2 + ARGO extensions**.
63
+
64
+ 1. **Install (once).** Requires **Node.js ≥ 18**.
65
+
66
+ ```bash
67
+ npm install -g archgraph-argo
68
+ argo-deploy
69
+ ```
70
+
71
+ Then **restart your editor / host** so it reloads the MCP server.
72
+
73
+ 2. **Initialize.** Ask your coding agent to run `argo init` (the `initializeWorkspace` MCP call). It creates and validates the starter `design/KG/SystemArchitecture.json`, which already contains the project's root view named `SystemArchitecture`.
74
+
75
+ 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.
76
+
77
+ 4. **Verify.** Ask your coding agent to call `validateSystemArchitecture`, then `queryNeo4jGraph` with `{"schema": true}` to confirm the element and relationship types in effect.
78
+
79
+ ### Route B — your own ontology
80
+
81
+ 1. **Install (once).** As in Route A.
82
+
83
+ 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).
84
+
85
+ 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.
75
86
 
76
- **Step 0 — initialize the workspace.** In a fresh project, ask your coding agent to run `argo init`
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.
87
+ 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).
80
88
 
81
- After installing, open your project and start a coding agent. It will:
89
+ 5. **Verify.** Ask your coding agent to call `validateSystemArchitecture`, then `queryNeo4jGraph` with `{"schema": true}`.
90
+
91
+ The fully-illustrated, step-by-step walkthrough is **[docs/case-team-graph.html](docs/case-team-graph.html)** (Chinese), and the runnable example bundle is [`custom-schema/`](custom-schema/README.md). The result looks like this:
92
+
93
+ ![Team Graph example — Agent 001 assigned to Team A, Team A depends on Service A, Service A depends on Service B](docs/diagrams/team-graph-elements-relations.svg)
94
+
95
+ ## Capabilities
96
+
97
+ Each line links to a short page — this is the map, not the manual.
98
+
99
+ - **[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.
100
+ - **[Pluggable ontology](docs/capabilities.html#ontology)** — ship your own schema bundle; the default (ArchiMate 3.2 + ARGO extensions) is data, not code.
101
+ - **[Semantic + structural retrieval](docs/capabilities.html#retrieval)** — Graph RAG recall plus read-only Cypher for exact structure.
102
+ - **[Deduplicated writes](docs/capabilities.html#quality)** — reuse an existing element, relationship, or view instead of copying it; near-duplicates are blocked as candidates.
103
+ - **[Acceptance-test-first + traceability](docs/capabilities.html#quality)** — every change is testable, and the commit id is registered back onto the element.
104
+ - **[Enterprise Architect interop](docs/capabilities.html#interop)** — the graph projects to `.qea`; human EA edits return as a semantic diff.
105
+ - **[Federated graph sharing](docs/capabilities.html#federation)** — sovereign graphs joined by a registry–broker; reads authorized and returned by reference.
106
+ - **[One MCP interface, six hosts](docs/capabilities.html#harness)** — install once, run in Copilot, Cursor, OpenCode, DeepSeek Harness, OpenClaw, and Codex.
107
+
108
+ ## How to use
109
+
110
+ **Initialize once** (`argo init`), then open your project and let your coding agent work. It will:
82
111
 
83
112
  1. locate the architecture element behind the task before changing anything,
84
113
  2. arm itself with that element's Skills and Rules,
85
- 3. work test-first (GIVEN-WHEN-THEN), and trace every commit back to the graph,
86
- 4. reuse an existing element, relationship, or view instead of creating a duplicate — the write path
87
- deduplicates by identity and flags a semantically near element of the same type.
114
+ 3. work test-first (GIVEN-WHEN-THEN) and trace every commit back to the graph,
115
+ 4. reuse an existing element by default — a near-duplicate needs an explicit override.
88
116
 
89
- The intent architecture graph — modelled in **ArchiMate 3.2** — is the single source of truth.
117
+ The intent architecture graph is the single source of truth.
118
+
119
+ ## Supported Harnesses
120
+
121
+ | Harness | MCP | Skills | Rules | Agents |
122
+ |---------|:---:|:------:|:-----:|:------:|
123
+ | GitHub Copilot | ✓ | ✓ | ✓ | ✓ |
124
+ | Cursor | ✓ | ✓ | ✓ | ✓ |
125
+ | OpenCode | ✓ | ✓ | ✓ | ✓ |
126
+ | DeepSeek Harness | ✓ | ✓ | ✓ | ✓ |
127
+ | OpenClaw | ✓ | ✓ | ✓ | — |
128
+ | Codex | ✓ | ✓ | ✓ | — |
129
+
130
+ A single `argo-deploy` registers the `argo` MCP server and installs all artifacts into each harness automatically.
131
+
132
+ ## Cross-project read/write
133
+
134
+ Cross-project access runs over **two separate channels** — they must not be conflated:
135
+
136
+ 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`.
137
+ 2. **Federated** — a per-call `projectId` is routed through the **federation center**, authorized there (denied by default), and returned by reference.
138
+
139
+ Whether the local channel works depends on the harness, because a harness may bridge the MCP server and pin the workspace per call:
140
+
141
+ | Harness | Local read (`workspaceRoot`) | Local write | Federated read (`projectId`) |
142
+ |---------|:----------------------------:|:-----------:|:----------------------------:|
143
+ | OpenCode | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
144
+ | Codex | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
145
+ | DeepSeek Harness | ✗ | ✗ | ✓ |
146
+ | GitHub Copilot | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
147
+ | Cursor | 待测 | 待测 | ✓ |
148
+ | OpenClaw | 不涉及 | 不涉及 | ✓ |
149
+
150
+ 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.
90
151
 
91
152
  ## Community
92
153
 
93
- ArchGraph runs on open co-building. Join the community hub to share, browse and reuse **architecture
94
- subgraphs** across projects, and follow the governance & contribution guides:
154
+ 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.
155
+
156
+ - **Community site** — https://argo.derekworkspacev5.com/archgraph/
157
+ - **graph-wiki** (graph-asset home) — https://github.com/derekhu0002/graph-wiki
158
+ - **GitHub** — https://github.com/derekhu0002/archgraph
95
159
 
96
- - **Community site** — https://argo.derekworkspacev5.com/archgraph/ (subgraph library, docs, blog)
97
- - **graph-wiki repository** — https://github.com/derekhu0002/graph-wiki (graph-asset home: contribute
98
- a subgraph from your project, or pull one back to reuse)
160
+ ## Docs
99
161
 
100
- Sharing is **federated**: each project keeps its own graph sovereign and publishes subgraphs to a
101
- registry, where other members register, discover, and read opened content **by reference** —
102
- register, discover, authorize, read. Access is **denied by default**, and nothing is copied or merged.
103
- Browse the [federation members](https://argo.derekworkspacev5.com/archgraph/federation).
162
+ - [Getting started](docs/getting-started.html) · [Capabilities](docs/capabilities.html) · [Worked case: Team Graph](docs/case-team-graph.html)
163
+ - [Schema bundles / ontology decoupling](docs/schema-bundle-decoupling.md) · [Self-hosted embeddings](docs/self-hosted-embedding-deployment.md) · [MCP acceptance](docs/mcp-acceptance.md)
164
+ - [Insights](docs/insights.html) — GraphRAG, agent memory, and portable skills.
104
165
 
105
166
  ## License
106
167
 
package/argo/.env.example CHANGED
@@ -142,7 +142,7 @@ ARGO_W31_LIVE_MUTATION_VECTOR_E2E=
142
142
  # Pin the workspace/repository root the MCP server serves.
143
143
  # ARGO_REPO_ROOT=
144
144
  # Explicit schema-bundle directory (highest precedence): overrides both the
145
- # repository's own <workspace>/.argo/schema bundle and the default ArgoBument
145
+ # repository's own <workspace>/.argo/schema bundle and the default ArchiMate 3.2
146
146
  # bundle. Must contain SystemArchitecture.schema.json.
147
147
  # ARGO_SCHEMA_DIR=
148
148
  # Actor element type the wakeup gate looks up when a workspace schema renames
@@ -168,3 +168,14 @@ ARGO_W31_LIVE_MUTATION_VECTOR_E2E=
168
168
  # ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD=
169
169
  # Alias of ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD (takes precedence when set).
170
170
  # ARGO_SEMANTIC_DEDUP_THRESHOLD=
171
+ # Cross-project WRITE guard. Default ON: a write tool may only target the
172
+ # server's own (home) workspace, so a foreign per-call workspaceRoot is
173
+ # rejected fail-closed while cross-project READS stay open. "0" disables it
174
+ # (all-or-nothing) for a trusted multi-workspace host that legitimately writes
175
+ # several workspaces through one server.
176
+ # ARGO_WORKSPACE_WRITE_GUARD=
177
+ # Set to "1" by a trusted host broker (e.g. the DSH workspace bridge) to assert
178
+ # it controls the per-call `sessionWorkspaceRoot` field; the argo server then
179
+ # allows WRITES to that host-designated session workspace as well as its home
180
+ # workspace. A model cannot set a process env var, so the trust is unforgeable.
181
+ # ARGO_WORKSPACE_ROOT_TRUSTED=
@@ -30,7 +30,7 @@ Non-negotiable red lines (MUST). Never skip, simplify, or silently violate them;
30
30
 
31
31
  <Ontology>
32
32
  Resolve the workspace modeling language before acting; do not assume ArchiMate. `queryNeo4jGraph` with `{schema:true}` returns `schemaKind`, `schemaLanguage`, the element/relationship type enums, `actorElementType`, `bundleValidation` and `guidePath`.
33
- 1. `schemaKind` `default`: the built-in ArgoBument language (ArchiMate 3.2 + ARGO). Reference files under ~/.argo: structure `~/.argo/schema/SystemArchitecture.schema.json`; types `~/.argo/schema/archimate3.2.md`.
33
+ 1. `schemaKind` `default`: the built-in ArchiMate 3.2 modeling language (with ARGO extensions). Reference files under ~/.argo: structure `~/.argo/schema/SystemArchitecture.schema.json`; types `~/.argo/schema/archimate3.2.md`.
34
34
  2. `schemaKind` `workspace`/`override`: the repository's own schema bundle. Its element/relationship types, endpoint rules, root-view name, per-view element limit and guide govern every read and write — never assume ArchiMate types here.
35
35
  3. `actorElementType` is the element type whose members are Actors (default `Business Actor`; `null` = no actor concept → skip Actor identification). Host override: ARGO_ACTOR_ELEMENT_TYPE.
36
36
  4. If `bundleValidation.status` is `failed`, the workspace schema is misconfigured: report it to the human partner and do not write until it is fixed.
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "ArgoBument default schema bundle descriptor",
4
- "description": "Descriptor for the default ARGO schema bundle (ArchiMate 3.2 + ARGO extensions). A repository may override this bundle by placing its own SystemArchitecture.schema.json (plus an optional argob.config.json / argob-rules.json) under <workspace>/.argo/schema.",
3
+ "title": "ArchiMate 3.2 default schema bundle descriptor",
4
+ "description": "Descriptor for the default ARGO schema bundle (ArchiMate 3.2 + ARGO extensions). A repository may override this bundle by placing its own SystemArchitecture.schema.json (plus an optional schema-bundle.config.json / schema-bundle.rules.json) under <workspace>/.argo/schema.",
5
+ "id": "default",
6
+ "aliases": ["archimate3.2", "archimate", "base"],
5
7
  "language": "ArchiMate 3.2",
6
8
  "elementTypeEnumKey": "archimateElementType",
7
9
  "relationshipTypeEnumKey": "archimateRelationshipType",