semantic-atlas 0.3.0 → 1.0.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.
Files changed (322) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +134 -166
  2. package/.agents/skills/semantic-atlas/agents/openai.yaml +4 -0
  3. package/.agents/skills/semantic-atlas/references/observations.md +131 -0
  4. package/.agents/skills/semantic-atlas/scripts/query-context.mjs +110 -0
  5. package/.agents/skills/semantic-atlas-maintenance/SKILL.md +93 -0
  6. package/.agents/skills/semantic-atlas-maintenance/agents/openai.yaml +4 -0
  7. package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +56 -0
  8. package/README.md +134 -239
  9. package/dist/application/map-application.d.ts +24 -0
  10. package/dist/application/map-application.d.ts.map +1 -0
  11. package/dist/application/map-application.js +134 -0
  12. package/dist/application/map-application.js.map +1 -0
  13. package/dist/cli/bin.js +6 -35
  14. package/dist/cli/bin.js.map +1 -0
  15. package/dist/cli/observation-commands.d.ts +16 -0
  16. package/dist/cli/observation-commands.d.ts.map +1 -0
  17. package/dist/cli/observation-commands.js +118 -0
  18. package/dist/cli/observation-commands.js.map +1 -0
  19. package/dist/cli/projection-writer.d.ts +2 -0
  20. package/dist/cli/projection-writer.d.ts.map +1 -0
  21. package/dist/cli/projection-writer.js +9 -0
  22. package/dist/cli/projection-writer.js.map +1 -0
  23. package/dist/cli/reconciliation-command.d.ts +7 -0
  24. package/dist/cli/reconciliation-command.d.ts.map +1 -0
  25. package/dist/cli/reconciliation-command.js +33 -0
  26. package/dist/cli/reconciliation-command.js.map +1 -0
  27. package/dist/cli/run-cli.d.ts +21 -0
  28. package/dist/cli/run-cli.d.ts.map +1 -0
  29. package/dist/cli/run-cli.js +299 -0
  30. package/dist/cli/run-cli.js.map +1 -0
  31. package/dist/contracts/cli.d.ts +166 -1211
  32. package/dist/contracts/cli.d.ts.map +1 -1
  33. package/dist/contracts/cli.js +2 -232
  34. package/dist/contracts/cli.js.map +1 -0
  35. package/dist/contracts/insights.d.ts +39 -1
  36. package/dist/contracts/insights.d.ts.map +1 -1
  37. package/dist/contracts/insights.js +2 -1
  38. package/dist/contracts/insights.js.map +1 -0
  39. package/dist/contracts/map.d.ts +154 -0
  40. package/dist/contracts/map.d.ts.map +1 -0
  41. package/dist/contracts/map.js +60 -0
  42. package/dist/contracts/map.js.map +1 -0
  43. package/dist/contracts/observation.d.ts +649 -0
  44. package/dist/contracts/observation.d.ts.map +1 -0
  45. package/dist/contracts/observation.js +140 -0
  46. package/dist/contracts/observation.js.map +1 -0
  47. package/dist/contracts/projection.d.ts +7 -0
  48. package/dist/contracts/projection.d.ts.map +1 -0
  49. package/dist/contracts/projection.js +2 -0
  50. package/dist/contracts/projection.js.map +1 -0
  51. package/dist/contracts/reconciliation.d.ts +40 -0
  52. package/dist/contracts/reconciliation.d.ts.map +1 -0
  53. package/dist/contracts/reconciliation.js +2 -0
  54. package/dist/contracts/reconciliation.js.map +1 -0
  55. package/dist/index.d.ts +7 -17
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +3 -9
  58. package/dist/index.js.map +1 -0
  59. package/dist/insights/insight-service.d.ts +14 -0
  60. package/dist/insights/insight-service.d.ts.map +1 -0
  61. package/dist/insights/insight-service.js +129 -0
  62. package/dist/insights/insight-service.js.map +1 -0
  63. package/dist/map/business-graph.d.ts +32 -0
  64. package/dist/map/business-graph.d.ts.map +1 -0
  65. package/dist/map/business-graph.js +122 -0
  66. package/dist/map/business-graph.js.map +1 -0
  67. package/dist/map/map-document-loader.d.ts +13 -0
  68. package/dist/map/map-document-loader.d.ts.map +1 -0
  69. package/dist/map/map-document-loader.js +86 -0
  70. package/dist/map/map-document-loader.js.map +1 -0
  71. package/dist/map/map-validator.d.ts +12 -0
  72. package/dist/map/map-validator.d.ts.map +1 -0
  73. package/dist/map/map-validator.js +322 -0
  74. package/dist/map/map-validator.js.map +1 -0
  75. package/dist/observations/observation-application.d.ts +23 -0
  76. package/dist/observations/observation-application.d.ts.map +1 -0
  77. package/dist/observations/observation-application.js +62 -0
  78. package/dist/observations/observation-application.js.map +1 -0
  79. package/dist/observations/observation-claim-manager.d.ts +13 -0
  80. package/dist/observations/observation-claim-manager.d.ts.map +1 -0
  81. package/dist/observations/observation-claim-manager.js +247 -0
  82. package/dist/observations/observation-claim-manager.js.map +1 -0
  83. package/dist/observations/observation-store.d.ts +43 -0
  84. package/dist/observations/observation-store.d.ts.map +1 -0
  85. package/dist/observations/observation-store.js +208 -0
  86. package/dist/observations/observation-store.js.map +1 -0
  87. package/dist/observations/repository-identity.d.ts +12 -0
  88. package/dist/observations/repository-identity.d.ts.map +1 -0
  89. package/dist/observations/repository-identity.js +108 -0
  90. package/dist/observations/repository-identity.js.map +1 -0
  91. package/dist/query/context-query-service.d.ts +15 -0
  92. package/dist/query/context-query-service.d.ts.map +1 -0
  93. package/dist/query/context-query-service.js +36 -0
  94. package/dist/query/context-query-service.js.map +1 -0
  95. package/dist/reconciliation/reconciliation-service.d.ts +10 -0
  96. package/dist/reconciliation/reconciliation-service.d.ts.map +1 -0
  97. package/dist/reconciliation/reconciliation-service.js +116 -0
  98. package/dist/reconciliation/reconciliation-service.js.map +1 -0
  99. package/dist/rendering/map-projector.d.ts +8 -0
  100. package/dist/rendering/map-projector.d.ts.map +1 -0
  101. package/dist/rendering/map-projector.js +386 -0
  102. package/dist/rendering/map-projector.js.map +1 -0
  103. package/dist/setup/managed-skill-installer.d.ts +60 -0
  104. package/dist/setup/managed-skill-installer.d.ts.map +1 -0
  105. package/dist/setup/managed-skill-installer.js +307 -0
  106. package/dist/setup/managed-skill-installer.js.map +1 -0
  107. package/dist/setup/package-identity.d.ts +6 -0
  108. package/dist/setup/package-identity.d.ts.map +1 -0
  109. package/dist/setup/package-identity.js +16 -0
  110. package/dist/setup/package-identity.js.map +1 -0
  111. package/dist/setup/package-upgrader.d.ts +10 -22
  112. package/dist/setup/package-upgrader.d.ts.map +1 -1
  113. package/dist/setup/package-upgrader.js +60 -76
  114. package/dist/setup/package-upgrader.js.map +1 -0
  115. package/docs/architecture.md +428 -0
  116. package/docs/evaluation.md +220 -174
  117. package/docs/index.md +27 -40
  118. package/docs/map-format.md +224 -0
  119. package/docs/observations.md +175 -0
  120. package/docs/product-contract.md +295 -137
  121. package/examples/commerce.yaml +204 -0
  122. package/package.json +31 -30
  123. package/.agents/skills/semantic-atlas/references/graph-patch.md +0 -190
  124. package/.agents/skills/semantic-atlas/references/product-feedback.md +0 -34
  125. package/.agents/skills/semantic-atlas/references/result-routing.md +0 -104
  126. package/.agents/skills/semantic-atlas/references/snapshot-bootstrap.md +0 -42
  127. package/.agents/skills/semantic-atlas-insights/SKILL.md +0 -55
  128. package/README.zh-CN.md +0 -273
  129. package/dist/business-flow/business-flow-derivation-service.d.ts +0 -11
  130. package/dist/business-flow/business-flow-derivation-service.d.ts.map +0 -1
  131. package/dist/business-flow/business-flow-derivation-service.js +0 -151
  132. package/dist/business-flow/business-flow-draft.d.ts +0 -16
  133. package/dist/business-flow/business-flow-draft.d.ts.map +0 -1
  134. package/dist/business-flow/business-flow-draft.js +0 -150
  135. package/dist/business-flow/framework-business-strategy.d.ts +0 -7
  136. package/dist/business-flow/framework-business-strategy.d.ts.map +0 -1
  137. package/dist/business-flow/framework-business-strategy.js +0 -1
  138. package/dist/business-flow/strategies/bullmq-business-strategy.d.ts +0 -10
  139. package/dist/business-flow/strategies/bullmq-business-strategy.d.ts.map +0 -1
  140. package/dist/business-flow/strategies/bullmq-business-strategy.js +0 -79
  141. package/dist/business-flow/strategies/called-operation-derivation.d.ts +0 -13
  142. package/dist/business-flow/strategies/called-operation-derivation.d.ts.map +0 -1
  143. package/dist/business-flow/strategies/called-operation-derivation.js +0 -32
  144. package/dist/business-flow/strategies/graphql-business-strategy.d.ts +0 -8
  145. package/dist/business-flow/strategies/graphql-business-strategy.d.ts.map +0 -1
  146. package/dist/business-flow/strategies/graphql-business-strategy.js +0 -65
  147. package/dist/business-flow/strategies/nestjs-business-strategy.d.ts +0 -8
  148. package/dist/business-flow/strategies/nestjs-business-strategy.d.ts.map +0 -1
  149. package/dist/business-flow/strategies/nestjs-business-strategy.js +0 -72
  150. package/dist/business-flow/strategies/strategy-helpers.d.ts +0 -32
  151. package/dist/business-flow/strategies/strategy-helpers.d.ts.map +0 -1
  152. package/dist/business-flow/strategies/strategy-helpers.js +0 -49
  153. package/dist/business-flow/strategies/typeorm-business-strategy.d.ts +0 -10
  154. package/dist/business-flow/strategies/typeorm-business-strategy.d.ts.map +0 -1
  155. package/dist/business-flow/strategies/typeorm-business-strategy.js +0 -136
  156. package/dist/business-flow/strategies/verified-invariant-strategy.d.ts +0 -5
  157. package/dist/business-flow/strategies/verified-invariant-strategy.d.ts.map +0 -1
  158. package/dist/business-flow/strategies/verified-invariant-strategy.js +0 -38
  159. package/dist/business-flow/strategies/verified-test-strategy.d.ts +0 -5
  160. package/dist/business-flow/strategies/verified-test-strategy.d.ts.map +0 -1
  161. package/dist/business-flow/strategies/verified-test-strategy.js +0 -26
  162. package/dist/business-flow/structural-flow-catalog.d.ts +0 -21
  163. package/dist/business-flow/structural-flow-catalog.d.ts.map +0 -1
  164. package/dist/business-flow/structural-flow-catalog.js +0 -125
  165. package/dist/business-flow/types.d.ts +0 -51
  166. package/dist/business-flow/types.d.ts.map +0 -1
  167. package/dist/business-flow/types.js +0 -1
  168. package/dist/cli/argument-parser.d.ts +0 -3
  169. package/dist/cli/argument-parser.d.ts.map +0 -1
  170. package/dist/cli/argument-parser.js +0 -200
  171. package/dist/cli/cli-application.d.ts +0 -39
  172. package/dist/cli/cli-application.d.ts.map +0 -1
  173. package/dist/cli/cli-application.js +0 -571
  174. package/dist/cli/cli-error.d.ts +0 -12
  175. package/dist/cli/cli-error.d.ts.map +0 -1
  176. package/dist/cli/cli-error.js +0 -44
  177. package/dist/cli/cli-presenter.d.ts +0 -14
  178. package/dist/cli/cli-presenter.d.ts.map +0 -1
  179. package/dist/cli/cli-presenter.js +0 -36
  180. package/dist/cli/insights-cli.d.ts +0 -6
  181. package/dist/cli/insights-cli.d.ts.map +0 -1
  182. package/dist/cli/insights-cli.js +0 -236
  183. package/dist/cli/main.d.ts +0 -3
  184. package/dist/cli/main.d.ts.map +0 -1
  185. package/dist/cli/main.js +0 -137
  186. package/dist/cli/standalone-cli.d.ts +0 -3
  187. package/dist/cli/standalone-cli.d.ts.map +0 -1
  188. package/dist/cli/standalone-cli.js +0 -96
  189. package/dist/cli/types.d.ts +0 -49
  190. package/dist/cli/types.d.ts.map +0 -1
  191. package/dist/cli/types.js +0 -1
  192. package/dist/contracts/graph.d.ts +0 -266
  193. package/dist/contracts/graph.d.ts.map +0 -1
  194. package/dist/contracts/graph.js +0 -182
  195. package/dist/contracts/identifiers.d.ts +0 -4
  196. package/dist/contracts/identifiers.d.ts.map +0 -1
  197. package/dist/contracts/identifiers.js +0 -7
  198. package/dist/contracts/public-contracts.d.ts +0 -5
  199. package/dist/contracts/public-contracts.d.ts.map +0 -1
  200. package/dist/contracts/public-contracts.js +0 -4
  201. package/dist/evaluation/comparison.d.ts +0 -30
  202. package/dist/evaluation/comparison.d.ts.map +0 -1
  203. package/dist/evaluation/comparison.js +0 -108
  204. package/dist/evaluation/contracts.d.ts +0 -301
  205. package/dist/evaluation/contracts.d.ts.map +0 -1
  206. package/dist/evaluation/contracts.js +0 -413
  207. package/dist/graph/graph-store.d.ts +0 -55
  208. package/dist/graph/graph-store.d.ts.map +0 -1
  209. package/dist/graph/graph-store.js +0 -912
  210. package/dist/graph/types.d.ts +0 -189
  211. package/dist/graph/types.d.ts.map +0 -1
  212. package/dist/graph/types.js +0 -1
  213. package/dist/insights/contracts.d.ts +0 -266
  214. package/dist/insights/contracts.d.ts.map +0 -1
  215. package/dist/insights/contracts.js +0 -124
  216. package/dist/insights/insights-store.d.ts +0 -73
  217. package/dist/insights/insights-store.d.ts.map +0 -1
  218. package/dist/insights/insights-store.js +0 -246
  219. package/dist/knowledge/business-knowledge-service.d.ts +0 -24
  220. package/dist/knowledge/business-knowledge-service.d.ts.map +0 -1
  221. package/dist/knowledge/business-knowledge-service.js +0 -200
  222. package/dist/knowledge/graph-patch-conflict-error.d.ts +0 -8
  223. package/dist/knowledge/graph-patch-conflict-error.d.ts.map +0 -1
  224. package/dist/knowledge/graph-patch-conflict-error.js +0 -12
  225. package/dist/knowledge/structural-target-binding.d.ts +0 -14
  226. package/dist/knowledge/structural-target-binding.d.ts.map +0 -1
  227. package/dist/knowledge/structural-target-binding.js +0 -11
  228. package/dist/package-metadata.d.ts +0 -2
  229. package/dist/package-metadata.d.ts.map +0 -1
  230. package/dist/package-metadata.js +0 -9
  231. package/dist/repository/git-command.d.ts +0 -3
  232. package/dist/repository/git-command.d.ts.map +0 -1
  233. package/dist/repository/git-command.js +0 -25
  234. package/dist/repository/repository-inspector.d.ts +0 -7
  235. package/dist/repository/repository-inspector.d.ts.map +0 -1
  236. package/dist/repository/repository-inspector.js +0 -84
  237. package/dist/repository/repository-language-support.d.ts +0 -14
  238. package/dist/repository/repository-language-support.d.ts.map +0 -1
  239. package/dist/repository/repository-language-support.js +0 -64
  240. package/dist/repository/types.d.ts +0 -9
  241. package/dist/repository/types.d.ts.map +0 -1
  242. package/dist/repository/types.js +0 -1
  243. package/dist/runtime/sqlite-compatibility-process.d.ts +0 -8
  244. package/dist/runtime/sqlite-compatibility-process.d.ts.map +0 -1
  245. package/dist/runtime/sqlite-compatibility-process.js +0 -20
  246. package/dist/setup/skill-installer.d.ts +0 -20
  247. package/dist/setup/skill-installer.d.ts.map +0 -1
  248. package/dist/setup/skill-installer.js +0 -187
  249. package/dist/snapshots/repository-snapshot.d.ts +0 -4
  250. package/dist/snapshots/repository-snapshot.d.ts.map +0 -1
  251. package/dist/snapshots/repository-snapshot.js +0 -119
  252. package/dist/snapshots/types.d.ts +0 -30
  253. package/dist/snapshots/types.d.ts.map +0 -1
  254. package/dist/snapshots/types.js +0 -1
  255. package/dist/storage/atlas-database.d.ts +0 -19
  256. package/dist/storage/atlas-database.d.ts.map +0 -1
  257. package/dist/storage/atlas-database.js +0 -433
  258. package/dist/storage/snapshot-store.d.ts +0 -19
  259. package/dist/storage/snapshot-store.d.ts.map +0 -1
  260. package/dist/storage/snapshot-store.js +0 -74
  261. package/dist/structural-backend/codegraph-backend.d.ts +0 -57
  262. package/dist/structural-backend/codegraph-backend.d.ts.map +0 -1
  263. package/dist/structural-backend/codegraph-backend.js +0 -1230
  264. package/dist/structural-backend/codegraph-worker-client.d.ts +0 -5
  265. package/dist/structural-backend/codegraph-worker-client.d.ts.map +0 -1
  266. package/dist/structural-backend/codegraph-worker-client.js +0 -118
  267. package/dist/structural-backend/codegraph-worker-protocol.d.ts +0 -35
  268. package/dist/structural-backend/codegraph-worker-protocol.d.ts.map +0 -1
  269. package/dist/structural-backend/codegraph-worker-protocol.js +0 -1
  270. package/dist/structural-backend/codegraph-worker.d.ts +0 -2
  271. package/dist/structural-backend/codegraph-worker.d.ts.map +0 -1
  272. package/dist/structural-backend/codegraph-worker.js +0 -131
  273. package/dist/structural-backend/process-instance.d.ts +0 -18
  274. package/dist/structural-backend/process-instance.d.ts.map +0 -1
  275. package/dist/structural-backend/process-instance.js +0 -207
  276. package/dist/structural-backend/structural-fact-changes.d.ts +0 -7
  277. package/dist/structural-backend/structural-fact-changes.d.ts.map +0 -1
  278. package/dist/structural-backend/structural-fact-changes.js +0 -78
  279. package/dist/structural-backend/structural-projection-bootstrapper.d.ts +0 -10
  280. package/dist/structural-backend/structural-projection-bootstrapper.d.ts.map +0 -1
  281. package/dist/structural-backend/structural-projection-bootstrapper.js +0 -295
  282. package/dist/structural-backend/structural-publication.d.ts +0 -13
  283. package/dist/structural-backend/structural-publication.d.ts.map +0 -1
  284. package/dist/structural-backend/structural-publication.js +0 -255
  285. package/dist/structural-backend/structural-write-lock.d.ts +0 -8
  286. package/dist/structural-backend/structural-write-lock.d.ts.map +0 -1
  287. package/dist/structural-backend/structural-write-lock.js +0 -415
  288. package/dist/structural-backend/types.d.ts +0 -144
  289. package/dist/structural-backend/types.d.ts.map +0 -1
  290. package/dist/structural-backend/types.js +0 -11
  291. package/dist/world/business-map-projector.d.ts +0 -14
  292. package/dist/world/business-map-projector.d.ts.map +0 -1
  293. package/dist/world/business-map-projector.js +0 -178
  294. package/dist/world/types.d.ts +0 -77
  295. package/dist/world/types.d.ts.map +0 -1
  296. package/dist/world/types.js +0 -1
  297. package/dist/world/world-graph-query.d.ts +0 -26
  298. package/dist/world/world-graph-query.d.ts.map +0 -1
  299. package/dist/world/world-graph-query.js +0 -250
  300. package/dist/world/world-model-service.d.ts +0 -21
  301. package/dist/world/world-model-service.d.ts.map +0 -1
  302. package/dist/world/world-model-service.js +0 -219
  303. package/dist/world/world-snapshot-store.d.ts +0 -40
  304. package/dist/world/world-snapshot-store.d.ts.map +0 -1
  305. package/dist/world/world-snapshot-store.js +0 -581
  306. package/docs/README.md +0 -30
  307. package/docs/architecture/codegraph-backend.md +0 -190
  308. package/docs/architecture/continuous-business-learning.md +0 -240
  309. package/docs/contracts/cli-v1.md +0 -164
  310. package/docs/contracts/graph-model.md +0 -106
  311. package/docs/contracts/graph-patch-v1.md +0 -105
  312. package/docs/contracts/insights-v1.md +0 -84
  313. package/docs/log.md +0 -80
  314. package/docs/mindmaps/semantic-atlas-overview.drawio +0 -255
  315. package/docs/mindmaps/semantic-atlas-overview.png +0 -0
  316. package/docs/mindmaps/semantic-atlas-overview.zh-CN.drawio +0 -255
  317. package/docs/mindmaps/semantic-atlas-overview.zh-CN.png +0 -0
  318. package/schemas/cli-envelope-v1.schema.json +0 -1244
  319. package/schemas/evaluation-plan-v1.schema.json +0 -211
  320. package/schemas/evaluation-run-v1.schema.json +0 -659
  321. package/schemas/graph-patch-v1.schema.json +0 -392
  322. package/schemas/insights-envelope-v1.schema.json +0 -428
@@ -1,163 +1,321 @@
1
1
  # Semantic Atlas Product Contract
2
2
 
3
- ## Purpose and authority
3
+ This page defines the accepted initial product. It answers what Semantic Atlas
4
+ must improve, how agents and people use it, and which results establish
5
+ that the product works.
4
6
 
5
- Semantic Atlas is a local project world model used by AI coding agents. It connects code structure to durable business concepts, flows, data, rules, and interfaces so an agent can understand a project through business meaning instead of repeatedly reconstructing that meaning from source search.
7
+ **Status: the initial local product is accepted and integrated; the v1
8
+ real-repository rollout is approved.**
6
9
 
7
- Source code remains authoritative. Atlas is a revision-aware projection with explicit evidence and validity. A stale, unsupported, unresolved, or insufficient result sends the calling agent back to source inspection.
10
+ ## Purpose
8
11
 
9
- This document defines the current product boundary. The versioned machine contracts live in `schemas/`; the storage and integration design is defined in [CodeGraph backend architecture](architecture/codegraph-backend.md).
12
+ Semantic Atlas helps coding agents make more accurate engineering changes.
13
+ It supplies a shared map of stable business boundaries, meaningful concepts,
14
+ relationships, data, rules, interfaces, and likely source entry points before
15
+ an agent confirms current behavior in authoritative evidence.
10
16
 
11
- ## One-product boundary
17
+ The map is a durable navigation prior rather than a synchronized copy of the
18
+ codebase. Product structure normally changes more slowly than implementation,
19
+ so a partially stale map can still lead an agent toward the right owners,
20
+ collaborators, invariants, and upstream causes. The agent corrects that prior
21
+ with current source, tests, tracked product documentation, Git, and runtime
22
+ evidence before changing behavior.
12
23
 
13
- Users and calling agents interact with one product:
24
+ ## Product Outcome
14
25
 
15
- - the `semantic-atlas` CLI supplies deterministic, machine-readable operations;
16
- - the `semantic-atlas` Skill teaches the calling agent when and how to use those operations;
17
- - the separate `semantic-atlas-insights` Skill supports deliberate product review and feedback triage;
18
- - `@colbymchenry/codegraph` is an internal structural-index dependency behind an Atlas-owned adapter;
19
- - CodeGraph's CLI, MCP server, storage model, and public types are not exposed as Semantic Atlas workflows.
26
+ The product succeeds when map-assisted agents more reliably:
20
27
 
21
- Atlas interprets CodeGraph results through its own world-graph contract. Replacing or upgrading the structural backend does not change the public product identity.
28
+ - enter a task through the correct business boundary;
29
+ - distinguish a downstream symptom from its upstream cause;
30
+ - inspect the business collaborators, data, rules, and interfaces needed for a
31
+ complete change;
32
+ - choose an implementation scope that fixes the cause without unrelated work;
33
+ - preserve readable responsibilities and maintainable code;
34
+ - identify when the map is incomplete or contradicted by current evidence;
35
+ - correct their investigation without requiring a person to supervise routine
36
+ discovery and implementation.
22
37
 
23
- ## Agent workflow
38
+ The map itself may be incomplete or stale. The final engineering conclusion
39
+ uses current evidence and is held to a higher accuracy standard than the map.
24
40
 
25
- ### Required business-understanding loop
41
+ ## Users And Core Scenarios
42
+
43
+ ### Coding agent orientation
44
+
45
+ An agent receives a feature, bug, refactor, or impact question. It queries a
46
+ compact business neighborhood, follows likely owners and collaborators, opens
47
+ the decisive current source, and builds the task-specific system model before
48
+ editing.
26
49
 
27
- 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.
28
- 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.
29
- 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.
30
- 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.
31
- 5. After relevant source changes, the agent reindexes, inspects `changes`, re-queries affected concepts, and confirms the refreshed projection against source and tests.
32
- 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.
50
+ ### Root-cause and impact discovery
33
51
 
34
- Detailed bootstrap, abnormal-result routing, and GraphPatch procedures are state-conditioned Skill references rather than permanently loaded first-use instructions.
52
+ An agent uses typed business relations to ask what invokes an action, what data
53
+ it reads or writes, which invariant constrains it, and which interfaces cross
54
+ its boundary. These relations guide source investigation when user wording and
55
+ implementation vocabulary differ.
35
56
 
36
- ### Task-driven continuous learning
37
-
38
- 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.
39
-
40
- 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.
41
-
42
- ## Responsibility boundary
43
-
44
- | Concern | Semantic Atlas | Calling agent |
45
- | --- | --- | --- |
46
- | Product interface | Exposes the `semantic-atlas` CLI and two focused Skills | Chooses the repository, task scope, and maintenance cadence |
47
- | Installation lifecycle | Ships version-matched primary and insights Skills, synchronizes them through `semantic-atlas setup`, and upgrades the global package plus Skills through `semantic-atlas upgrade` | Performs the initial global npm installation and can invoke setup or upgrade from any directory |
48
- | 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 |
49
- | 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 |
50
- | Unified graph | Connects business assertions to structural evidence and returns one Atlas graph contract | Uses graph results as bounded context |
51
- | Evidence lifecycle | Records source locators and hashes, then derives `valid` or `stale` after indexing | Revalidates or replaces stale assertions |
52
- | Generated state | Writes durable knowledge under the user Atlas home and disposable structure under ignored `.atlas/` | Edits source and project configuration |
53
- | Product observability | Best-effort records objective command events and explicit feedback in the installation-level insights store | Reviews signals, validates reports, and chooses product follow-up work |
54
- | Verification | Reports evidence, freshness, support, and unresolved boundaries | Runs tests, reviews diffs, and judges correctness |
55
- | Git workflow | Reads Git state for snapshots without changing tracked state | Commits, merges, rebases, reviews, and releases |
56
-
57
- ## Storage and zero-intrusion contract
58
-
59
- Atlas separates repository knowledge from worktree structure:
57
+ ### Human inspection
58
+
59
+ A person views deterministic projections of the same tracked map to discuss
60
+ business boundaries and relationships. The visual surface does not become a
61
+ second authoring format.
62
+
63
+ ### Periodic reconciliation
64
+
65
+ Agents accumulate candidate observations from real work. A later maintenance
66
+ task reviews current code and stable product meaning by business domain, then
67
+ updates tracked map files through ordinary Git changes. The map evolves at the
68
+ pace of durable business understanding rather than every source edit.
69
+
70
+ ## Shared Business Model
71
+
72
+ The map uses these concept kinds:
73
+
74
+ - `domain`: a stable top-level business area;
75
+ - `capability`: a durable ability owned by a domain or broader capability;
76
+ - `scenario`: a bounded business collaboration that users or operators can
77
+ name;
78
+ - `operation`: an independently meaningful action with one business outcome or
79
+ state effect;
80
+ - `data`: a durable business record or concept;
81
+ - `invariant`: a rule that constrains business behavior;
82
+ - `interface`: an API, event, queue, webhook, or external integration boundary.
83
+
84
+ `part_of` supplies primary semantic containment. Directed horizontal relations
85
+ describe collaboration:
86
+
87
+ - `invokes`
88
+ - `reads`
89
+ - `writes`
90
+ - `publishes`
91
+ - `consumes`
92
+ - `constrained_by`
93
+
94
+ A concept is worth retaining when future tasks can independently name,
95
+ navigate to, depend on, constrain, read, write, publish, consume, or change it.
96
+ Methods, helpers, SQL statements, folders, and framework components remain
97
+ source details until they express durable business meaning.
98
+
99
+ ## Authority And Accuracy
100
+
101
+ Tracked map documents are authoritative for the shared map. They are not
102
+ authoritative for current application behavior.
103
+
104
+ Every map-assisted engineering task follows this evidence order:
105
+
106
+ 1. The map proposes likely business scope and relations.
107
+ 2. Current source and tests confirm implementation behavior.
108
+ 3. Tracked product documents confirm durable intent when they own that intent.
109
+ 4. Runtime, database, queue, or environment evidence confirms state-dependent
110
+ behavior when the task requires it.
111
+ 5. The agent reports uncertainty when available evidence cannot support a
112
+ decisive conclusion.
113
+
114
+ An outdated path or symbol anchor weakens that navigation hint without
115
+ invalidating unrelated business meaning. A contradiction changes the current
116
+ task conclusion immediately and becomes a candidate for later map
117
+ reconciliation.
118
+
119
+ ## Collaboration And Concurrency
120
+
121
+ Business-map files live in the repository and travel with its branches. Files
122
+ are divided by stable business domain so agents can read concurrently and most
123
+ durable updates touch only one owning map.
124
+
125
+ Ordinary development tasks read the map and proceed independently. A task may
126
+ record a candidate map observation, but successful engineering delivery does
127
+ not depend on synchronizing the shared map. Reconciliation uses normal Git
128
+ diff, review, and merge semantics instead of a second transaction or locking
129
+ protocol.
130
+
131
+ ## Initial Product Scope
132
+
133
+ The initial product delivers one coherent path:
134
+
135
+ 1. Load tracked map documents from a repository.
136
+ 2. Validate document shape and graph integrity.
137
+ 3. Normalize the complete map in memory.
138
+ 4. Find a business concept by stable ID, name, or alias.
139
+ 5. Return its containment, direct business relations, related concepts, and
140
+ navigation anchors as structured JSON.
141
+ 6. Render deterministic human-readable projections from the same graph.
142
+ 7. Package an Agent Skill that routes map context into current-source
143
+ confirmation.
144
+ 8. Exercise the workflow against real engineering tasks, including stale and
145
+ incomplete map cases.
146
+
147
+ The runtime is stateless between commands. Derived render artifacts and future
148
+ performance caches are reproducible from tracked files.
149
+
150
+ ## Current Non-Goals
151
+
152
+ The initial product does not provide:
153
+
154
+ - a synchronized structural copy of the codebase;
155
+ - a persistent business-knowledge database;
156
+ - content hashes, source snapshots, knowledge revisions, or transactional graph
157
+ patches;
158
+ - automatic inference of business meaning from folders or call graphs;
159
+ - mandatory map updates after every engineering task;
160
+ - source editing, test execution, Git mutation, code review, or release
161
+ orchestration;
162
+ - branch conditions, retries, loops, timing, or executable workflow state;
163
+ - real-time multi-user map editing;
164
+ - a second visual authoring representation.
165
+
166
+ These boundaries keep the first product centered on better engineering
167
+ judgment. Later capabilities require observed evidence that they improve that
168
+ outcome.
169
+
170
+ ## Completion Standard
171
+
172
+ The first product is complete when one candidate revision demonstrates all of
173
+ the following:
174
+
175
+ - tracked example and real-project map files load and validate through the
176
+ public CLI;
177
+ - context queries return the expected business owner, containment, incoming and
178
+ outgoing relationships, and navigation anchors;
179
+ - the renderer produces readable projections from the same normalized graph;
180
+ - a repository-discovered Agent Skill uses map context before broad source
181
+ discovery and confirms every change-controlling claim in current evidence;
182
+ - real task cases cover upstream root cause, cross-capability impact, missing
183
+ map knowledge, stale anchors, and a contradicted relationship;
184
+ - map-assisted agents reach correct source-supported conclusions without
185
+ introducing unsupported business claims;
186
+ - independent review finds the implementation responsibilities readable and
187
+ the public workflow consistent with this contract;
188
+ - delivery remains local: publication, external installation, and migration are
189
+ separately authorized stages.
190
+
191
+ Token usage, opened files, wall time, compute cost, and map-maintenance effort
192
+ are recorded to explain product behavior. They do not replace accuracy and
193
+ human-intervention evidence as acceptance conditions.
194
+
195
+ ## Current Delivery State
196
+
197
+ The documentation baseline and initial product are integrated. Managed setup,
198
+ versioned observations, and read-only reconciliation are included in the v1
199
+ candidate. The clean repository now carries the `semantic-atlas@1.0.0` package
200
+ identity, public documentation, CI, privacy and transition checks, and a
201
+ GitHub-Release-driven npm provenance workflow for independent release review.
202
+ The existing `lzj960515/semantic-atlas` repository remains the public product
203
+ identity and carries the protected npm environment used by the approved direct
204
+ v1 cutover. Review, branch cutover, publication, target-repository changes, and
205
+ longitudinal use remain separate verified stages.
206
+
207
+ ## V1 Real-Repository Rollout
208
+
209
+ The next product stage turns the accepted local candidate into the one installed
210
+ Semantic Atlas product used by real engineering repositories.
211
+
212
+ ### Product identity and direct cutover
213
+
214
+ - The new implementation takes over the npm package name `semantic-atlas` as a
215
+ breaking `v1.0.0` release.
216
+ - The existing `lzj960515/semantic-atlas` GitHub repository remains the active
217
+ repository and keeps its configured release environment and public identity.
218
+ - Its `main` branch changes directly from the published v0 line to the clean v1
219
+ history through one explicitly authorized, lease-checked history replacement.
220
+ This discontinuity is the intended breaking repository upgrade.
221
+ - Existing v0 Git tags, GitHub Releases, and npm versions remain available while
222
+ the new clean `main`, annotated `v1.0.0` tag, and immutable Release become the
223
+ current source identity.
224
+ - Local legacy history and recovery bundles are optional operator artifacts,
225
+ not cutover prerequisites or release authority.
226
+ - The old CLI's supported upgrade path must install v1 and invoke the v1
227
+ `setup` successfully.
228
+
229
+ ### Installed CLI and managed Skills
230
+
231
+ The published CLI owns installation of its bundled user Skills:
60
232
 
61
233
  ```text
62
- ~/.semantic-atlas/repositories/<repository-id>/
63
- └── atlas.db repository-wide durable knowledge
64
-
65
- ~/.semantic-atlas/
66
- └── insights.db installation-level product observations and feedback
67
-
68
- <worktree>/
69
- └── .atlas/
70
- ├── .gitignore
71
- ├── codegraph.db worktree-local disposable CodeGraph projection
72
- └── transient lock and SQLite sidecar files
234
+ npm install --global semantic-atlas
235
+ semantic-atlas setup
73
236
  ```
74
237
 
75
- - The user-level `atlas.db` stores business knowledge, repository snapshots, snapshot-specific evidence bindings and validity, plus one publication chain for each Git directory.
76
- - The separate user-level `insights.db` stores product command metadata and explicit feedback. It contains no business assertions, structural projection data, command arguments, prompts, source text, or command output.
77
- - `SEMANTIC_ATLAS_HOME` is the only storage override. It must be absolute; the default is `~/.semantic-atlas`.
78
- - Atlas prepares `.atlas/.gitignore` so generated state does not change normal Git status. No tracked source file or project configuration is created or modified.
79
- - Every worktree has an independent CodeGraph index because its checked-out and dirty source state can differ. A missing index is copied from the best compatible sibling through SQLite backup and always incrementally synchronized before publication; full indexing is the fallback.
80
- - `.atlas/codegraph.db` contains only CodeGraph-owned structural schema. Deleting a worktree discards this projection without deleting repository knowledge.
81
- - Atlas never copies CodeGraph structural nodes and edges into parallel Atlas structural tables. The Atlas query layer composes both ownership domains into one logical world graph.
82
-
83
- ## Index and consistency lifecycle
84
-
85
- `semantic-atlas index` is the only public owner of the combined lifecycle:
86
-
87
- 1. acquire the Atlas worktree lock and mark that Git directory's central state as `building`;
88
- 2. bootstrap a missing CodeGraph projection from a compatible sibling when possible, then initialize or open CodeGraph with `CODEGRAPH_DIR=.atlas`;
89
- 3. run CodeGraph indexing or incremental sync and verify the repository snapshot against its indexed source manifest;
90
- 4. commit the local structural publication so the CodeGraph projection is durable;
91
- 5. atomically record the snapshot-specific bindings, validity, and worktree publication in the user-level Atlas database;
92
- 6. move that worktree state to `current` and release the lock.
93
-
94
- An interrupted or failed build remains explicit. Map commands do not present a partial structural graph as current.
95
-
96
- Structural failure restores the previous worktree projection. If the local projection commits but the central Atlas transaction fails, the worktree stays fail closed; the next `index` performs an incremental no-op or sync and republishes central state. No Atlas business data needs to be restored into CodeGraph.
97
-
98
- `learn` is an optimistic-concurrency transaction. It validates all evidence against the current completed snapshot and commits all operations together or none of them.
99
-
100
- ## World-model contract
238
+ `setup` installs the exact bundled Semantic Atlas engineering and maintenance
239
+ Skills under `~/.agents/skills/semantic-atlas` and
240
+ `~/.agents/skills/semantic-atlas-maintenance`. Each uses the same package
241
+ version, content fingerprint, ownership marker, and atomic replacement
242
+ protocol. Setup is idempotent, repairs a modified managed copy, preserves the
243
+ previous copy on failure, and refuses to replace an unrelated same-named
244
+ directory.
101
245
 
102
- The public graph has two ownership domains and one query surface:
246
+ Business repositories share only `docs/business-map/*.yaml` through Git. They do
247
+ not duplicate the managed user Skills. The package, installed CLI, and installed
248
+ Skills must have one verifiable version identity.
103
249
 
104
- - structural nodes and relations come from CodeGraph and describe where code lives and how statically discoverable code connects;
105
- - business nodes and relations come from evidence-bound Atlas learning and describe why the system exists and how its business behavior flows;
106
- - evidence links connect business assertions to structural nodes without foreign-key ownership of CodeGraph rows;
107
- - map and change results expose Atlas identifiers, certainty, validity, support, and evidence without leaking backend table layouts.
250
+ ### Accuracy observations
108
251
 
109
- 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.
252
+ Real-use evidence is separate from the Git business map and from business-map
253
+ authority. The product records two immutable, versioned local artifacts:
110
254
 
111
- `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.
255
+ - `TaskObservation`: map query and selected concepts, current-evidence
256
+ classification, explicitly domain-owned map-update candidates with a
257
+ candidate disposition, and any explicit human correction known to the task
258
+ Agent. Current writes use task artifact v2; immutable task v1 evidence remains
259
+ readable after upgrade without promoting its unowned candidates;
260
+ - `ReviewObservation`: the independent review verdict, correctness of the
261
+ business boundary and upstream cause, impact completeness, required rework,
262
+ and whether the map caused a wrong conclusion.
112
263
 
113
- 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.
264
+ The task Agent never grades its own engineering accuracy. Review or explicit
265
+ human correction owns correctness. Each observation uses an independent ID and
266
+ atomic file write under a user-local repository partition. The implementation
267
+ does not use SQLite, a remote API, or a shared append-only JSONL file. Summaries
268
+ are reproducible from immutable observations.
114
269
 
115
- ## Supported scope
270
+ The deterministic CLI exposes the observation boundary:
116
271
 
117
- The current release 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.
118
-
119
- Framework knowledge is implemented as Atlas-owned business interpretation over structural queries. It focuses on capabilities, operations, interfaces, data flow, rules, tests, and their evidence. Language parsing, cross-file symbol resolution, callers, callees, and file dependencies remain the structural backend's responsibility.
120
-
121
- ## Non-goals
122
-
123
- Semantic Atlas does not provide:
124
-
125
- - a second CodeGraph-facing product, CLI, MCP server, or user workflow;
126
- - a new compiler, language server, or general-purpose JavaScript runtime analyzer;
127
- - a duplicate copy of CodeGraph's structural graph in Atlas-owned tables;
128
- - a language model, embeddings, vector search, or natural-language inference inside the CLI;
129
- - source editing, test execution, Git mutation, code review, or release automation;
130
- - exact claims for runtime-only behavior that the structural backend cannot establish;
131
- - a human-facing IDE, documentation site, or graph explorer.
132
-
133
- ## Dependency policy
134
-
135
- The first implementation directly depends on pinned `@colbymchenry/codegraph` 1.5.0 and uses its existing public SDK. No upstream change or source copy is required. An upgrade must pass adapter contract tests for directory placement, index/sync behavior, sibling bootstrap compatibility, structural query normalization, evidence rebinding, and Node.js compatibility before the pin changes.
136
-
137
- The fallback order is direct dependency, a small upstream extension, a thin maintained fork, then selective vendoring. Vendoring retains the upstream MIT notice and is used only when a required product boundary cannot be maintained through the SDK.
138
-
139
- ## Release gate
140
-
141
- Every public release requires all of the following on the release commit:
142
-
143
- 1. A packaged install uses the pinned CodeGraph SDK through an Atlas-owned adapter and exposes no CodeGraph CLI or MCP workflow.
144
- 2. `semantic-atlas index` creates only ignored `.atlas/` state in the target worktree and leaves tracked files and normal Git status unchanged.
145
- 3. The user Atlas database contains `atlas_*` objects while every worktree CodeGraph database contains none.
146
- 4. Initial index, sibling bootstrap, incremental sync, interrupted index recovery, and worktree deletion preserve Atlas-owned business knowledge.
147
- 5. Business evidence rebinds after stable structural changes and becomes visibly stale after changed or missing evidence.
148
- 6. Business map views zoom deterministically through one hierarchy, preserve evidence summaries on aggregated connections, and keep business search separate from structural code fallback.
149
- 7. Packaged CLI smoke flows pass on supported Node.js versions and operating systems.
150
- 8. Static and Fresh Agent verification of the packaged Semantic Atlas Skill passes.
151
- 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.
152
- 10. No evaluated answer presents stale, hypothesis, unresolved, or unsupported knowledge as exact.
153
-
154
- The gate is fixed before comparative results are collected. A failed gate creates follow-up work; it does not broaden the current task until it passes.
155
-
156
- ## Related contracts
272
+ ```text
273
+ semantic-atlas observe task --stdin
274
+ semantic-atlas observe review --stdin
275
+ semantic-atlas insights summary [--repo <path>] [--period <duration>]
276
+ semantic-atlas reconcile candidates --repo <path>
277
+ ```
157
278
 
158
- - [CodeGraph backend architecture](architecture/codegraph-backend.md)
159
- - [Graph model](contracts/graph-model.md)
160
- - [CLI v1](contracts/cli-v1.md)
161
- - [Insights v1](contracts/insights-v1.md)
162
- - [GraphPatch v1](contracts/graph-patch-v1.md)
163
- - [Evaluation protocol](evaluation.md)
279
+ Observation failures are reported and never turn a successful engineering task
280
+ into a successful accuracy claim. The main accuracy measures are correct
281
+ business boundary, correct upstream cause, complete required impact, map-caused
282
+ regression, independent-review rework, human correction, and safe recovery from
283
+ missing, stale, or contradicted map knowledge. Tokens, files, time, compute, and
284
+ map-maintenance effort remain explanatory measures.
285
+
286
+ ### Reconciliation
287
+
288
+ Normal engineering work records durable map-update candidates without editing
289
+ the shared map. `reconcile candidates` is read-only and preserves every task
290
+ origin, candidate disposition, duplicate provenance, and linked independent
291
+ review. A periodic maintenance task selects one business domain, checks current
292
+ source and durable product meaning, updates one owning YAML map through normal
293
+ Git review, and leaves unresolved or implementation-local observations out of
294
+ the canonical map.
295
+
296
+ ### Real-use acceptance
297
+
298
+ The first pilot starts with one stable business domain in a private target
299
+ repository rather than mapping the whole repository. Its initial map is
300
+ independently reviewed before merge. Normal Codrive development keeps its
301
+ existing develop, independent review, rework, and fast-forward integration
302
+ lifecycle; Semantic Atlas supplies advisory context and observation evidence
303
+ only.
304
+
305
+ Longitudinal acceptance requires at least 20 natural business-changing tasks
306
+ with independent review, at least one period of real code drift, and two
307
+ domain-scoped reconciliations. Every fifth suitable task adds an ordinary
308
+ analysis-only shadow for bounded comparison without duplicating production
309
+ writes. Natural use is not replaced with manufactured jobs or provider activity.
310
+
311
+ Any map-caused wrong conclusion, Store/authorization/data-boundary regression,
312
+ or installed CLI/Skill version mismatch blocks acceptance. The final stage also
313
+ tests multiple Agents in independent worktrees reading one map revision and
314
+ writing independent observations, with canonical map changes deferred to a
315
+ separate reconciliation task.
316
+
317
+ ## V1 Delivery Boundary
318
+
319
+ The [delivery plan](delivery-plan.md) owns the ordered v1 gates. An earlier gate
320
+ never implies that a later remote, publication, target-repository, or real-use
321
+ gate has completed.