semantic-atlas 0.1.3 → 0.2.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/.agents/skills/semantic-atlas/SKILL.md +59 -43
- package/.agents/skills/semantic-atlas/references/graph-patch.md +22 -5
- package/.agents/skills/semantic-atlas/references/result-routing.md +32 -19
- package/.agents/skills/semantic-atlas/references/snapshot-bootstrap.md +17 -32
- package/README.md +34 -20
- package/README.zh-CN.md +30 -20
- package/dist/cli/argument-parser.js +41 -23
- package/dist/cli/bin.js +12 -15
- package/dist/cli/cli-application.d.ts +2 -2
- package/dist/cli/cli-application.d.ts.map +1 -1
- package/dist/cli/cli-application.js +40 -36
- package/dist/cli/standalone-cli.d.ts +3 -0
- package/dist/cli/standalone-cli.d.ts.map +1 -0
- package/dist/cli/standalone-cli.js +65 -0
- package/dist/cli/types.d.ts +7 -6
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/contracts/cli.d.ts +370 -1360
- package/dist/contracts/cli.d.ts.map +1 -1
- package/dist/contracts/cli.js +58 -65
- package/dist/contracts/graph.d.ts +4 -0
- package/dist/contracts/graph.d.ts.map +1 -1
- package/dist/contracts/graph.js +2 -2
- package/dist/evaluation/contracts.d.ts +11 -2
- package/dist/evaluation/contracts.d.ts.map +1 -1
- package/dist/evaluation/contracts.js +7 -2
- package/dist/graph/graph-store.d.ts +3 -1
- package/dist/graph/graph-store.d.ts.map +1 -1
- package/dist/graph/graph-store.js +48 -2
- package/dist/graph/types.d.ts +30 -9
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/package-metadata.d.ts +2 -0
- package/dist/package-metadata.d.ts.map +1 -0
- package/dist/package-metadata.js +9 -0
- package/dist/runtime/sqlite-compatibility-process.d.ts +8 -0
- package/dist/runtime/sqlite-compatibility-process.d.ts.map +1 -0
- package/dist/runtime/sqlite-compatibility-process.js +20 -0
- package/dist/setup/skill-installer.d.ts +19 -0
- package/dist/setup/skill-installer.d.ts.map +1 -0
- package/dist/setup/skill-installer.js +156 -0
- package/dist/world/business-map-projector.d.ts +14 -0
- package/dist/world/business-map-projector.d.ts.map +1 -0
- package/dist/world/business-map-projector.js +178 -0
- package/dist/world/world-graph-query.d.ts +8 -13
- package/dist/world/world-graph-query.d.ts.map +1 -1
- package/dist/world/world-graph-query.js +26 -229
- package/docs/README.md +30 -0
- package/docs/architecture/codegraph-backend.md +2 -2
- package/docs/architecture/continuous-business-learning.md +240 -0
- package/docs/contracts/cli-v1.md +40 -17
- package/docs/contracts/graph-model.md +11 -7
- package/docs/contracts/graph-patch-v1.md +8 -1
- package/docs/evaluation.md +20 -15
- package/docs/index.md +41 -0
- package/docs/log.md +56 -0
- package/docs/product-contract.md +10 -5
- package/package.json +1 -1
- package/schemas/cli-envelope-v1.schema.json +365 -564
- package/schemas/evaluation-run-v1.schema.json +4 -1
package/docs/contracts/cli-v1.md
CHANGED
|
@@ -4,29 +4,44 @@
|
|
|
4
4
|
|
|
5
5
|
The npm package and executable are both named `semantic-atlas`. Development uses Node.js 24; the published CLI supports Node.js 22.12 through 24.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Repository-independent commands run before Git, Atlas storage, or SQLite is
|
|
8
|
+
opened:
|
|
9
|
+
|
|
10
|
+
| Command | Contract |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| `setup` | Atomically install or update the exact bundled Skill at `~/.agents/skills/semantic-atlas`. A recognized legacy `~/.codex/skills/semantic-atlas` copy is removed after the shared installation succeeds. |
|
|
13
|
+
| `-h`, `--help` | Print top-level usage and command help. |
|
|
14
|
+
| `--version` | Print the installed package version. |
|
|
15
|
+
|
|
16
|
+
These commands write conventional text to standard output and diagnostics to
|
|
17
|
+
standard error. `setup` records the package version and a content fingerprint;
|
|
18
|
+
repeated execution verifies the installed files and restores a changed managed
|
|
19
|
+
copy. A directory that does not identify itself as the Semantic Atlas Skill is
|
|
20
|
+
reported as a conflict and left unchanged.
|
|
21
|
+
|
|
22
|
+
Global project options:
|
|
8
23
|
|
|
9
24
|
- `--repo <path>` selects a directory within the target repository; the default is the current directory.
|
|
10
25
|
- `--pretty` indents JSON without changing fields or values.
|
|
11
26
|
|
|
12
|
-
|
|
27
|
+
Project commands:
|
|
13
28
|
|
|
14
29
|
| Command | Contract |
|
|
15
30
|
| --- | --- |
|
|
16
31
|
| `status` | Report worktree identity, current revision, latest world snapshot, freshness, local store location, language support, and additive structural-backend metadata. |
|
|
17
32
|
| `index` | Build or synchronize the embedded structural index, reconcile Atlas evidence, publish the completed world snapshot, and report changed facts and unknowns. |
|
|
18
|
-
| `map
|
|
19
|
-
| `map
|
|
20
|
-
| `map
|
|
21
|
-
| `
|
|
33
|
+
| `map view [business-key]` | Return the world business frontier, or zoom one level into a selected business region with breadcrumbs, child/context regions, and projected cross-boundary connections. An empty world returns `regions: []` with `BUSINESS_KNOWLEDGE_EMPTY`. |
|
|
34
|
+
| `map search <business-term> [--limit <n>]` | Lexically rank business labels, aliases, summaries, and attached evidence vocabulary; every result is a business node and the default limit is 20. |
|
|
35
|
+
| `map show <business-key>` | Return one business assertion plus its direct business relations and direct structural evidence links. The command does not recursively traverse CodeGraph. |
|
|
36
|
+
| `code search <structural-term> [--limit <n>]` | Return bounded structural symbols and source locations when business knowledge is absent or insufficient; the default limit is 20. |
|
|
22
37
|
| `learn --stdin` | Read one complete GraphPatch v1 JSON value from standard input and apply it atomically. |
|
|
23
38
|
| `changes [--from <snapshot-id>] [--to <snapshot-id>]` | Report net semantic graph changes between persisted Atlas snapshot endpoints, not a raw Git diff. The source must be an ancestor of the target in the publication chain; defaults compare the previous and current snapshots. |
|
|
24
39
|
|
|
25
|
-
`map` commands
|
|
40
|
+
`map` commands expose business navigation. `code search` is the explicit structural fallback. The calling agent extracts concepts, reformulates searches, opens returned source locations, and judges impact.
|
|
26
41
|
|
|
27
42
|
## Response envelope
|
|
28
43
|
|
|
29
|
-
Every command writes one JSON envelope to standard output. The normative discriminated schema is `schemas/cli-envelope-v1.schema.json`.
|
|
44
|
+
Every project command writes one JSON envelope to standard output. The normative discriminated schema is `schemas/cli-envelope-v1.schema.json`.
|
|
30
45
|
|
|
31
46
|
```json
|
|
32
47
|
{
|
|
@@ -56,8 +71,8 @@ Every command writes one JSON envelope to standard output. The normative discrim
|
|
|
56
71
|
|
|
57
72
|
- Successful responses have `status: "ok" | "partial"`, a non-null repository, and command data selected by `data.command`.
|
|
58
73
|
- `snapshot` is `null` before the first successful index. Otherwise it includes the snapshot ID, Git HEAD, creation time, and `current` or `stale` freshness.
|
|
59
|
-
- `partial` means usable data
|
|
60
|
-
- Business map nodes and relations always include `certainty`, derived `validity`, and evidence.
|
|
74
|
+
- `partial` means usable data is accompanied by a warning or contains stale or otherwise bounded knowledge. An empty business map and an index with unresolved structural counts are usable `partial` results, not indexing failures.
|
|
75
|
+
- Business map nodes and direct relations always include `certainty`, derived `validity`, and evidence. Projected connections report contributor counts and certainty/validity distributions without becoming stored assertions. Structural code-search nodes preserve normalized backend provenance and support. Unsupported languages include a reason instead of an approximate analysis.
|
|
61
76
|
- `warnings` contains stable codes and descriptions for non-fatal conditions. Consumers use codes rather than parsing messages.
|
|
62
77
|
- `storeLocation` identifies the repository-wide Atlas knowledge database. The current worktree's `.atlas/codegraph.db` path remains an internal structural-backend detail.
|
|
63
78
|
|
|
@@ -69,10 +84,10 @@ The schema requires these fields while allowing additive fields inside command d
|
|
|
69
84
|
| --- | --- |
|
|
70
85
|
| `status` | `currentRevision`, `freshness`, `storeLocation`, `languages` |
|
|
71
86
|
| `index` | `snapshotId`, fact counts, unknown-boundary counts; backend version and evidence-rebinding counts are additive metadata until promoted by a later schema version |
|
|
72
|
-
| `map.
|
|
73
|
-
| `map.
|
|
74
|
-
| `map.
|
|
75
|
-
| `
|
|
87
|
+
| `map.view` | nullable `focus`, root-to-focus `breadcrumbs`, `regions`, and projected `connections` |
|
|
88
|
+
| `map.search` | `query`, `limit`, scored business-only `results` |
|
|
89
|
+
| `map.show` | business `node` and direct evidence-aware `relations` |
|
|
90
|
+
| `code.search` | `query`, `limit`, scored structural-only `results` with source locations and support |
|
|
76
91
|
| `learn` | `baseSnapshotId`, `snapshotId`, applied operation counts |
|
|
77
92
|
| `changes` | source and target snapshot IDs, node/relation change sets, stale assertions |
|
|
78
93
|
|
|
@@ -82,7 +97,13 @@ published graph; `removed` counts facts present only in the previous publication
|
|
|
82
97
|
is changed when its stable node identity or relation endpoints remain while its structural
|
|
83
98
|
content, location, or support changes.
|
|
84
99
|
|
|
85
|
-
Map node and relation objects preserve their evidence lifecycle. When evidence cannot uniquely rebind after indexing, a business node can remain addressable by key while its `summary` is returned with `validity: "stale"`; callers therefore cannot confuse vocabulary identity with a current fact.
|
|
100
|
+
Map node and direct relation objects preserve their evidence lifecycle. When evidence cannot uniquely rebind after indexing, a business node can remain addressable by key while its `summary` is returned with `validity: "stale"`; callers therefore cannot confuse vocabulary identity with a current fact.
|
|
101
|
+
|
|
102
|
+
In a world view, `focus` is null, `breadcrumbs` is empty, and every region has role `root`. In a focused view, `focus` is the selected business node, breadcrumbs run from its current root to the focus, direct children have role `child`, and related external branches have role `context`. Every region reports `childCount` and `expandable`.
|
|
103
|
+
|
|
104
|
+
Each connection identifies visible business endpoints and groups summaries by relation type. `directCount` counts stored relations whose endpoints are already visible at this level; `aggregatedCount` counts stored deeper relations lifted to the visible frontier. Certainty and validity objects count the underlying contributors. A relation projected to the same visible region is hidden until the agent zooms further in.
|
|
105
|
+
|
|
106
|
+
`BUSINESS_KNOWLEDGE_EMPTY` is the stable warning code for a current indexed world with no learned business nodes. World `map.view` returns an empty `regions` array in this state. Structural modules and symbols remain discoverable through `code.search`; they are never emitted as business regions.
|
|
86
107
|
|
|
87
108
|
Change ranges follow the current publication history and fold the requested endpoints into one content comparison. When a content-addressed snapshot was published more than once, `--to` selects its latest occurrence in that history and `--from` selects the latest matching occurrence at or before the target; equal IDs compare the selected occurrence with itself. Paths that have the same presence and content at both endpoints are omitted even if they changed in between, while `staleAssertions` reports the selected target occurrence's final validity state. An unknown target has no change result.
|
|
88
109
|
|
|
@@ -115,6 +136,8 @@ Handled failures have `status: "error"` and structured data:
|
|
|
115
136
|
|
|
116
137
|
Handled nonzero failures still emit a versioned error envelope when a response can be formed. Diagnostics never replace the machine-readable response.
|
|
117
138
|
|
|
118
|
-
##
|
|
139
|
+
## Contract stability
|
|
140
|
+
|
|
141
|
+
This pre-adoption revision directly replaces the earlier roots/children/mixed-search/depth-traversal command set. It exposes no aliases or dual response shapes. The generated schema is the current v1 authority.
|
|
119
142
|
|
|
120
|
-
|
|
143
|
+
After adoption, top-level envelope fields, command discriminants, and required command fields are closed within version 1. Additive fields may appear inside command data and result objects; callers ignore fields they do not understand. A future removed field, changed meaning, enum incompatibility, or operation change requires a new `schemaVersion`. GraphPatch and other input objects remain strict and reject unknown fields.
|
|
@@ -29,7 +29,7 @@ The domains are physically separated by lifecycle: CodeGraph structure lives in
|
|
|
29
29
|
|
|
30
30
|
Repository and snapshot IDs are content identifiers produced by Atlas repository inspection. Public structural IDs are deterministic Atlas references derived from normalized backend identity, path, kind, and qualified name. Backend row IDs remain internal locators and may change after a CodeGraph upgrade or rebuild.
|
|
31
31
|
|
|
32
|
-
Business keys are stable slash-separated keys such as `commerce/orders/place-order`. Labels and aliases form stable vocabulary while evidence-bound summaries can evolve without changing the key.
|
|
32
|
+
Business keys are stable slash-separated keys such as `commerce/orders/place-order`. The slash-separated text is a readable namespace, not hierarchy authority. Labels and aliases form stable vocabulary while evidence-bound summaries and `part_of` placement can evolve without changing the key.
|
|
33
33
|
|
|
34
34
|
## Relation kinds
|
|
35
35
|
|
|
@@ -55,7 +55,7 @@ Business keys are stable slash-separated keys such as `commerce/orders/place-ord
|
|
|
55
55
|
| Business | `constrained_by` | A business node is governed by an invariant |
|
|
56
56
|
| Business | `verified_by` | A business node is checked by an agent-verified structural declaration |
|
|
57
57
|
|
|
58
|
-
All learned relations originate at a business node. `realized_by` and `verified_by` target structural nodes; the other business relations target business nodes. A test directory or filename is structural context only.
|
|
58
|
+
All learned relations originate at a business node. `realized_by` and `verified_by` target structural nodes; the other business relations target business nodes. A test directory or filename is structural context only. `map show` exposes an agent-verified declaration as a direct `verified_by` relation; the declaration remains a `Symbol` when the structural backend cannot identify a test case independently.
|
|
59
59
|
|
|
60
60
|
## Structural support
|
|
61
61
|
|
|
@@ -89,14 +89,18 @@ Validity is derived state and is never accepted as GraphPatch input. Stable busi
|
|
|
89
89
|
|
|
90
90
|
## Unknown boundaries
|
|
91
91
|
|
|
92
|
-
An `UnknownBoundary` records the unresolved operation, backend reason, location, and any finite candidates.
|
|
92
|
+
An `UnknownBoundary` records the unresolved operation, backend reason, location, and any finite candidates. Index results report unresolved-boundary counts and warnings; Atlas never converts a boundary into an exact edge. When a task reaches warned dynamic behavior, the Agent uses bounded `code search` results and authoritative source rather than assuming a missing relationship. Examples include unresolved references, reflection, runtime dependency lookup, dynamic imports, and non-unique string tokens.
|
|
93
93
|
|
|
94
|
-
##
|
|
94
|
+
## Business navigation and structural fallback
|
|
95
95
|
|
|
96
|
-
`map
|
|
96
|
+
`map view` projects one canonical business graph into a visible frontier. Without a focus it exposes all current business nodes with no outgoing `part_of` relation as root regions. With a focus it exposes the focus's direct children, its root-to-focus breadcrumb, and the nearest visible external branches connected to its subtree. Any business kind may be a provisional root; an empty business graph returns no regions rather than structural directories.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
`part_of` is the current business navigation hierarchy. Each business node has at most one outgoing `part_of` parent, and the hierarchy is acyclic. A later GraphPatch can atomically remove an old parent and add a broader parent while preserving the moved node's key, evidence, descendants, and non-hierarchy relationships. Structural nodes remain a separate evidence and source-navigation domain.
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
Non-hierarchy relations are stored only at the endpoints the Agent verified. A view lifts deeper endpoints to the visible frontier, hides relations that collapse inside one region, and groups the rest by visible endpoints and relation type. Every summary separates direct and aggregated contributor counts and preserves certainty and validity distributions. These connections are query projections and are never accepted as GraphPatch facts.
|
|
101
|
+
|
|
102
|
+
`map show` accepts one business key and returns only its direct learned relations, including direct `realized_by` and `verified_by` structural evidence. It has no depth option and does not recursively expand the CodeGraph projection.
|
|
103
|
+
|
|
104
|
+
Lexical search has two explicit domains. `map search` ranks Atlas business vocabulary and always returns business nodes. `code search` ranks CodeGraph symbols and paths and always returns structural nodes with current source locations and support. The calling AI uses structural search only when business knowledge is absent or insufficient, then opens source directly. The CLI does not add a language model or pretend lexical scores are business inference.
|
|
101
105
|
|
|
102
106
|
Structural nodes and relations include normalized `support.status` and `support.provenance`. Business assertions use `certainty`, `validity`, and evidence instead. Unknown boundaries keep their structural owner, unresolved operation, support, reason, source location, and finite candidates.
|
|
@@ -65,7 +65,7 @@ GraphPatch is the only public write contract for agent-learned knowledge. It can
|
|
|
65
65
|
|
|
66
66
|
## Operations
|
|
67
67
|
|
|
68
|
-
Business node upserts contain a stable
|
|
68
|
+
Business node upserts contain a stable slash-separated `key`, one of `Capability`, `Scenario`, `Operation`, `Invariant`, `Interface`, or `Data`, plus a label, summary, aliases, certainty, and at least one evidence record. The key is stable vocabulary identity and does not encode authoritative hierarchy; the summary is an assertion governed by certainty and evidence. A node-only patch without assertion evidence is invalid. Removing a node uses `{ "op": "remove", "key": "..." }`.
|
|
69
69
|
|
|
70
70
|
Business relation upserts contain a source reference, relation type, target reference, certainty, and at least one evidence record. Removing a relation supplies its source, type, and target selector. The stable relation identity is that `(from, type, to)` tuple; repeated upserts replace the assertion and its evidence idempotently.
|
|
71
71
|
|
|
@@ -76,6 +76,12 @@ Reference domains make ownership explicit:
|
|
|
76
76
|
|
|
77
77
|
All learned relations originate at a business node. `realized_by` and `verified_by` target structural nodes; `part_of`, `invokes`, `reads`, `writes`, `publishes`, `consumes`, and `constrained_by` target business nodes.
|
|
78
78
|
|
|
79
|
+
### Business hierarchy
|
|
80
|
+
|
|
81
|
+
`part_of` alone defines current parent placement. Every business node may have at most one outgoing `part_of` parent, and the complete `part_of` graph must remain acyclic. A parentless node of any business kind is a current root.
|
|
82
|
+
|
|
83
|
+
Reparent an existing node or subtree in one patch: optionally upsert the new parent, remove the old `part_of` selector, and upsert the new `part_of` relation. Preserve the moved node key. Atlas applies relation removals before validating the final candidate hierarchy, so a valid reparent succeeds atomically while a second parent or cycle rejects the complete patch.
|
|
84
|
+
|
|
79
85
|
## Evidence and certainty
|
|
80
86
|
|
|
81
87
|
Each node or relation evidence item binds an Atlas structural symbol or test reference, normalized repository-relative file, one-based source range, and lowercase SHA-256 content hash. Atlas also records the backend locator and version needed for later rebinding. Evidence must resolve inside the same worktree and match the current completed snapshot exactly.
|
|
@@ -92,6 +98,7 @@ Each node or relation evidence item binds an Atlas structural symbol or test ref
|
|
|
92
98
|
4. Relation endpoints and kinds satisfy the graph contract.
|
|
93
99
|
5. Every node and relation evidence symbol, path, range, and hash belongs to the current repository snapshot.
|
|
94
100
|
6. Removes do not leave dangling business relations.
|
|
101
|
+
7. The final `part_of` hierarchy has at most one parent per node and contains no cycle.
|
|
95
102
|
|
|
96
103
|
The patch is one transaction. Any failure rejects every operation with exit code 5 and a machine-readable error; retries start from a freshly read snapshot. No partial success is exposed.
|
|
97
104
|
|
package/docs/evaluation.md
CHANGED
|
@@ -39,18 +39,22 @@ A run is invalid when it lacks exact source-token accounting, is not a fresh con
|
|
|
39
39
|
The published `fresh-agent-v1` run uses the repository-owned source observer and
|
|
40
40
|
`tiktoken-o200k_base-v1`. Every observer invocation appends one JSONL record per
|
|
41
41
|
returned file. The runner normalizes those atomically appended records to a
|
|
42
|
-
strict event sequence.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
strict event sequence. Each run records its command-policy version. The retained
|
|
43
|
+
`fresh-agent-shell-allowlist-v4` policy replays the original roots, children, and
|
|
44
|
+
structural show grammar, while the current `fresh-agent-shell-allowlist-v5`
|
|
45
|
+
policy accepts the business-first map view/search/show and explicit code search
|
|
46
|
+
grammar. Both policies accept only observer reads/searches, read-only Semantic
|
|
47
|
+
Atlas commands, bounded file-name listings, and content-free availability
|
|
48
|
+
probes. Atlas commands must satisfy the complete grammar for their recorded
|
|
49
|
+
policy, and `--repo` is prohibited because each process already runs from its
|
|
50
|
+
measured fixture. The policies reject alternative readers, arbitrary executables
|
|
51
|
+
and wrappers, external instruction paths, command substitution, redirection,
|
|
52
|
+
unsupported command composition, and unquoted shell word generation such as
|
|
53
|
+
brace, parameter, tilde, or filename expansion. The fixed
|
|
54
|
+
`$EVALUATION_OBSERVER` parameter is the only permitted shell expansion. The
|
|
55
|
+
runner rejects failed audits before adjudication, and published-result validation
|
|
56
|
+
re-audits every recorded command sequence and its derived Atlas calls without
|
|
57
|
+
rewriting immutable historical records.
|
|
54
58
|
|
|
55
59
|
Runner v5 adds repository-native Skill discovery evidence. It copies the
|
|
56
60
|
candidate Skill into only the Atlas fixture through a Git-local ignore rule,
|
|
@@ -67,8 +71,9 @@ decision so a missing or unnecessary GraphPatch load fails validation. Independe
|
|
|
67
71
|
adjudication separately evaluates the decision's business meaning from bounded
|
|
68
72
|
retained evidence rather than trusting the Agent's label. The public run contract
|
|
69
73
|
binds the adjudicated outcome to the answer; a negative decision verdict must make
|
|
70
|
-
the run incorrect and carry `protocol-violation`. The
|
|
71
|
-
|
|
74
|
+
the run incorrect and carry `protocol-violation`. The observer and shell-safety
|
|
75
|
+
rules remain stable while the Atlas command grammar advances through an explicit
|
|
76
|
+
policy version.
|
|
72
77
|
|
|
73
78
|
## Metrics
|
|
74
79
|
|
|
@@ -94,7 +99,7 @@ Semantic Atlas Skill, CLI, and current worktree-local index. The retained 22
|
|
|
94
99
|
`fresh-agent-runner-v1` records were re-audited from preserved raw command logs;
|
|
95
100
|
the affected NestJS provider-contract pair was replaced under
|
|
96
101
|
`fresh-agent-runner-v2` with host capabilities explicitly disabled. All 24
|
|
97
|
-
published command sequences were subsequently re-audited under the
|
|
102
|
+
published command sequences were subsequently re-audited under the v4
|
|
98
103
|
fixture-local Atlas grammar.
|
|
99
104
|
|
|
100
105
|
All 12 pairs retained 100 percent required-file recall, required-symbol recall,
|
package/docs/index.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Semantic Atlas Documentation Index
|
|
2
|
+
|
|
3
|
+
This index routes product, architecture, contract, and evaluation questions to
|
|
4
|
+
their authoritative pages. Current implementation details remain verifiable in
|
|
5
|
+
source and tests.
|
|
6
|
+
|
|
7
|
+
## Product and learning model
|
|
8
|
+
|
|
9
|
+
- [Product contract](product-contract.md): product boundary, responsibility
|
|
10
|
+
split, lifecycle, storage, and release gates.
|
|
11
|
+
- [Continuous business learning](architecture/continuous-business-learning.md):
|
|
12
|
+
how business knowledge grows during real work, how provisional roots evolve,
|
|
13
|
+
how hierarchy reparenting remains safe, and how one graph projects into
|
|
14
|
+
semantically zoomable world and focused views.
|
|
15
|
+
|
|
16
|
+
## Architecture
|
|
17
|
+
|
|
18
|
+
- [CodeGraph backend](architecture/codegraph-backend.md): ownership and
|
|
19
|
+
consistency boundaries between durable Atlas knowledge and disposable
|
|
20
|
+
structural projections.
|
|
21
|
+
- [Semantic Atlas overview mind map](mindmaps/semantic-atlas-overview.png):
|
|
22
|
+
visual overview; editable sources are available in the same directory.
|
|
23
|
+
|
|
24
|
+
## Public contracts
|
|
25
|
+
|
|
26
|
+
- [Graph model](contracts/graph-model.md): node, relation, evidence, certainty,
|
|
27
|
+
validity, hierarchy, and traversal semantics.
|
|
28
|
+
- [GraphPatch v1](contracts/graph-patch-v1.md): atomic business-knowledge write
|
|
29
|
+
contract.
|
|
30
|
+
- [CLI v1](contracts/cli-v1.md): deterministic commands, envelopes, warnings,
|
|
31
|
+
and exit codes.
|
|
32
|
+
|
|
33
|
+
## Evaluation
|
|
34
|
+
|
|
35
|
+
- [Evaluation protocol](evaluation.md): fixed Fresh Agent comparison and
|
|
36
|
+
evidence requirements.
|
|
37
|
+
|
|
38
|
+
## Maintenance
|
|
39
|
+
|
|
40
|
+
- [Knowledge-base scope and rules](README.md)
|
|
41
|
+
- [Knowledge maintenance log](log.md)
|
package/docs/log.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Semantic Atlas Knowledge Maintenance Log
|
|
2
|
+
|
|
3
|
+
This log records material documentation ingestion and revisions. Current
|
|
4
|
+
conclusions live on their owning pages rather than in this chronology.
|
|
5
|
+
|
|
6
|
+
## [2026-08-20] revise | Versioned evaluation command replay
|
|
7
|
+
|
|
8
|
+
- Bound each Fresh Agent run to the command-policy version that produced it.
|
|
9
|
+
- Preserved v4 replay for immutable structural-map records and introduced v5
|
|
10
|
+
for the business-first map and explicit code-search grammar.
|
|
11
|
+
- Kept current runs fail-closed against removed commands while allowing release
|
|
12
|
+
validation to re-audit historical evidence without rewriting it.
|
|
13
|
+
- Affected page: `evaluation.md`.
|
|
14
|
+
|
|
15
|
+
## [2026-08-20] revise | Managed Skill setup and CLI discovery
|
|
16
|
+
|
|
17
|
+
- Added repository-independent `setup`, help, and version commands before the
|
|
18
|
+
Git/SQLite lifecycle.
|
|
19
|
+
- Defined `~/.agents/skills/semantic-atlas` as the shared managed target with
|
|
20
|
+
atomic updates, package-version/content markers, and recognized legacy
|
|
21
|
+
`~/.codex/skills/semantic-atlas` migration.
|
|
22
|
+
- Replaced the separate repository Skill-installer journey with the bundled
|
|
23
|
+
npm package workflow and added installed-tarball setup/update verification.
|
|
24
|
+
- Affected pages: `README.md`, `README.zh-CN.md`, `product-contract.md`, and
|
|
25
|
+
`contracts/cli-v1.md`.
|
|
26
|
+
|
|
27
|
+
## [2026-08-20] revise | Semantic zoom and AI-first query contract
|
|
28
|
+
|
|
29
|
+
- Defined one canonical business graph with world/focused visible frontiers,
|
|
30
|
+
breadcrumbs, child/context regions, and evidence-preserving aggregate
|
|
31
|
+
connections.
|
|
32
|
+
- Replaced roots, children, mixed search, structural show, and depth traversal
|
|
33
|
+
with `map view`, business-only search/show, and explicit `code search`.
|
|
34
|
+
- Reframed the public API around the calling Agent's actual self-dogfood path:
|
|
35
|
+
business navigation, bounded code fallback, source confirmation, engineering
|
|
36
|
+
work, and task-driven knowledge capture.
|
|
37
|
+
- Synchronized the product contract, graph model, CLI contract, READMEs, and
|
|
38
|
+
Semantic Atlas Skill without compatibility aliases.
|
|
39
|
+
- Affected pages: `architecture/continuous-business-learning.md`,
|
|
40
|
+
`product-contract.md`, `contracts/graph-model.md`, and `contracts/cli-v1.md`.
|
|
41
|
+
|
|
42
|
+
## [2026-08-20] revise | Continuous business learning and evolving roots
|
|
43
|
+
|
|
44
|
+
- Added the continuous-learning architecture as the owning design for business
|
|
45
|
+
knowledge acquired during real engineering tasks.
|
|
46
|
+
- Defined roots as the current parentless business frontier rather than fixed
|
|
47
|
+
Capability roots or structural-module fallbacks.
|
|
48
|
+
- Defined stable keys, single-parent hierarchy, acyclic placement, and atomic
|
|
49
|
+
reparenting as the first implementation slice.
|
|
50
|
+
- Synchronized the product, graph, GraphPatch, CLI, README, and Agent Skill
|
|
51
|
+
contracts around task-driven learning and the `BUSINESS_KNOWLEDGE_EMPTY`
|
|
52
|
+
fallback.
|
|
53
|
+
- Established the documentation index and knowledge-base maintenance boundary.
|
|
54
|
+
- Affected pages: `architecture/continuous-business-learning.md`,
|
|
55
|
+
`product-contract.md`, `contracts/graph-model.md`, `contracts/graph-patch-v1.md`,
|
|
56
|
+
and `contracts/cli-v1.md`.
|
package/docs/product-contract.md
CHANGED
|
@@ -25,24 +25,25 @@ Atlas interprets CodeGraph results through its own world-graph contract. Replaci
|
|
|
25
25
|
|
|
26
26
|
1. For every supported task that implements, fixes, debugs, refactors, reviews, traces, or assesses business behavior, the agent identifies the exact target worktree and invokes `semantic-atlas status` before broad source discovery.
|
|
27
27
|
2. Atlas commands run serially. A missing, stale, failed, or incomplete snapshot loads the bootstrap procedure and invokes `semantic-atlas index`; a current complete snapshot proceeds directly to map queries.
|
|
28
|
-
3. The agent
|
|
28
|
+
3. The agent starts from `map view`, searches business vocabulary with `map search`, zooms into relevant regions with `map view <business-key>`, and inspects direct evidence with `map show`. When business knowledge is absent or insufficient, `code search` returns a bounded structural source seed set instead of mixing code symbols into the business map.
|
|
29
29
|
4. The agent confirms answer-controlling and change-controlling behavior in authoritative source. Source edits, tests, Git operations, review, and natural-language reasoning remain normal engineering work outside Atlas.
|
|
30
30
|
5. After relevant source changes, the agent reindexes, inspects `changes`, re-queries affected concepts, and confirms the refreshed projection against source and tests.
|
|
31
31
|
6. Before completing the task, the agent makes a knowledge-capture decision. Every newly discovered durable, verified business concept and supported relationship caused by missing or insufficient map knowledge is submitted with `learn --stdin` and verified through `map show`; transient and unverified observations remain task context.
|
|
32
32
|
|
|
33
33
|
Detailed bootstrap, abnormal-result routing, and GraphPatch procedures are state-conditioned Skill references rather than permanently loaded first-use instructions.
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### Task-driven continuous learning
|
|
36
36
|
|
|
37
|
-
A normal task adds only the
|
|
37
|
+
A normal task adds only the durable business knowledge it verifies while doing the requested engineering work. This makes ordinary work incrementally improve later map queries without requiring a separate repository-wide business-learning phase.
|
|
38
38
|
|
|
39
|
-
An
|
|
39
|
+
An indexed repository may legitimately have no business nodes. In that state, the world `map view` returns `regions: []` with `BUSINESS_KNOWLEDGE_EMPTY`; the agent uses `code search` and source as a bounded fallback for the current task. After source and tests establish durable meaning, the agent records only that reusable knowledge. Later tasks may add a broader parent and place an existing root beneath it without changing the existing node identity.
|
|
40
40
|
|
|
41
41
|
## Responsibility boundary
|
|
42
42
|
|
|
43
43
|
| Concern | Semantic Atlas | Calling agent |
|
|
44
44
|
| --- | --- | --- |
|
|
45
45
|
| Product interface | Exposes the `semantic-atlas` CLI and Skill | Chooses the repository and task scope |
|
|
46
|
+
| Skill installation | Ships one version-matched Skill and synchronizes it into the shared user Skill directory through `semantic-atlas setup` | Installs or upgrades the npm package and invokes setup |
|
|
46
47
|
| Structural code model | Uses the embedded CodeGraph SDK for extraction, cross-file resolution, incremental sync, and structural queries | Reads source when the structural map is insufficient |
|
|
47
48
|
| Business world model | Stores and queries capabilities, scenarios, operations, invariants, interfaces, data, and their relationships | Understands natural language and decides which business assertions are justified |
|
|
48
49
|
| Unified graph | Connects business assertions to structural evidence and returns one Atlas graph contract | Uses graph results as bounded context |
|
|
@@ -101,6 +102,10 @@ The public graph has two ownership domains and one query surface:
|
|
|
101
102
|
|
|
102
103
|
Evidence stores a backend locator together with normalized path, symbol identity, source range, and content hash. A structural rebuild may replace backend rows, so Atlas rebinds evidence after indexing. Failed rebinding produces `stale`; it never silently deletes or upgrades a business assertion.
|
|
103
104
|
|
|
105
|
+
`map view` projects one canonical business graph into the frontier needed by the current task. The world view exposes every current parentless business node as a root region. A focused view exposes direct child regions, breadcrumb context, and cross-boundary business connections aggregated from deeper asserted relations. Projection counts preserve direct versus aggregated contributors plus certainty and validity distributions; projected connections are never persisted as new facts.
|
|
106
|
+
|
|
107
|
+
Root placement is provisional. Business keys remain stable vocabulary identifiers while `part_of` is the hierarchy authority; every node has at most one `part_of` parent and the hierarchy is acyclic. Structural modules and symbols remain available only through explicit `code search` fallback and never substitute for an empty business map.
|
|
108
|
+
|
|
104
109
|
## Supported scope
|
|
105
110
|
|
|
106
111
|
v0.1 supports business understanding for TypeScript and JavaScript projects, with initial evaluation coverage for NestJS, GraphQL, TypeORM, and BullMQ flows. CodeGraph supplies the structural coverage available from the pinned dependency version. Atlas reports unsupported or unresolved structure instead of promising complete JavaScript runtime semantics.
|
|
@@ -134,7 +139,7 @@ The v0.1.0 release requires all of the following on the release commit:
|
|
|
134
139
|
3. The user Atlas database contains `atlas_*` objects while every worktree CodeGraph database contains none.
|
|
135
140
|
4. Initial index, sibling bootstrap, incremental sync, interrupted index recovery, and worktree deletion preserve Atlas-owned business knowledge.
|
|
136
141
|
5. Business evidence rebinds after stable structural changes and becomes visibly stale after changed or missing evidence.
|
|
137
|
-
6.
|
|
142
|
+
6. Business map views zoom deterministically through one hierarchy, preserve evidence summaries on aggregated connections, and keep business search separate from structural code fallback.
|
|
138
143
|
7. Packaged CLI smoke flows pass on supported Node.js versions and operating systems.
|
|
139
144
|
8. Static and Fresh Agent verification of the packaged Semantic Atlas Skill passes.
|
|
140
145
|
9. At least 12 paired Fresh Agent business-location and dependency/impact cases preserve necessary-file recall, necessary-symbol recall, and answer correctness while reducing either median unique opened source files or median source input tokens by at least 30 percent.
|