semantic-atlas 0.4.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 (346) 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 -265
  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 -42
  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 -45
  118. package/docs/map-format.md +224 -0
  119. package/docs/observations.md +175 -0
  120. package/docs/product-contract.md +295 -165
  121. package/examples/commerce.yaml +204 -0
  122. package/package.json +32 -32
  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 -296
  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 -104
  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/cli/web-cli.d.ts +0 -9
  193. package/dist/cli/web-cli.d.ts.map +0 -1
  194. package/dist/cli/web-cli.js +0 -134
  195. package/dist/contracts/graph.d.ts +0 -266
  196. package/dist/contracts/graph.d.ts.map +0 -1
  197. package/dist/contracts/graph.js +0 -182
  198. package/dist/contracts/identifiers.d.ts +0 -4
  199. package/dist/contracts/identifiers.d.ts.map +0 -1
  200. package/dist/contracts/identifiers.js +0 -7
  201. package/dist/contracts/public-contracts.d.ts +0 -5
  202. package/dist/contracts/public-contracts.d.ts.map +0 -1
  203. package/dist/contracts/public-contracts.js +0 -4
  204. package/dist/evaluation/comparison.d.ts +0 -30
  205. package/dist/evaluation/comparison.d.ts.map +0 -1
  206. package/dist/evaluation/comparison.js +0 -108
  207. package/dist/evaluation/contracts.d.ts +0 -301
  208. package/dist/evaluation/contracts.d.ts.map +0 -1
  209. package/dist/evaluation/contracts.js +0 -413
  210. package/dist/graph/graph-store.d.ts +0 -55
  211. package/dist/graph/graph-store.d.ts.map +0 -1
  212. package/dist/graph/graph-store.js +0 -912
  213. package/dist/graph/types.d.ts +0 -189
  214. package/dist/graph/types.d.ts.map +0 -1
  215. package/dist/graph/types.js +0 -1
  216. package/dist/insights/contracts.d.ts +0 -266
  217. package/dist/insights/contracts.d.ts.map +0 -1
  218. package/dist/insights/contracts.js +0 -124
  219. package/dist/insights/insights-store.d.ts +0 -73
  220. package/dist/insights/insights-store.d.ts.map +0 -1
  221. package/dist/insights/insights-store.js +0 -246
  222. package/dist/knowledge/business-knowledge-service.d.ts +0 -24
  223. package/dist/knowledge/business-knowledge-service.d.ts.map +0 -1
  224. package/dist/knowledge/business-knowledge-service.js +0 -200
  225. package/dist/knowledge/graph-patch-conflict-error.d.ts +0 -8
  226. package/dist/knowledge/graph-patch-conflict-error.d.ts.map +0 -1
  227. package/dist/knowledge/graph-patch-conflict-error.js +0 -12
  228. package/dist/knowledge/structural-target-binding.d.ts +0 -14
  229. package/dist/knowledge/structural-target-binding.d.ts.map +0 -1
  230. package/dist/knowledge/structural-target-binding.js +0 -11
  231. package/dist/package-metadata.d.ts +0 -2
  232. package/dist/package-metadata.d.ts.map +0 -1
  233. package/dist/package-metadata.js +0 -9
  234. package/dist/repository/git-command.d.ts +0 -3
  235. package/dist/repository/git-command.d.ts.map +0 -1
  236. package/dist/repository/git-command.js +0 -25
  237. package/dist/repository/repository-inspector.d.ts +0 -8
  238. package/dist/repository/repository-inspector.d.ts.map +0 -1
  239. package/dist/repository/repository-inspector.js +0 -97
  240. package/dist/repository/repository-language-support.d.ts +0 -14
  241. package/dist/repository/repository-language-support.d.ts.map +0 -1
  242. package/dist/repository/repository-language-support.js +0 -64
  243. package/dist/repository/types.d.ts +0 -9
  244. package/dist/repository/types.d.ts.map +0 -1
  245. package/dist/repository/types.js +0 -1
  246. package/dist/runtime/sqlite-compatibility-process.d.ts +0 -8
  247. package/dist/runtime/sqlite-compatibility-process.d.ts.map +0 -1
  248. package/dist/runtime/sqlite-compatibility-process.js +0 -20
  249. package/dist/setup/skill-installer.d.ts +0 -20
  250. package/dist/setup/skill-installer.d.ts.map +0 -1
  251. package/dist/setup/skill-installer.js +0 -187
  252. package/dist/snapshots/repository-snapshot.d.ts +0 -4
  253. package/dist/snapshots/repository-snapshot.d.ts.map +0 -1
  254. package/dist/snapshots/repository-snapshot.js +0 -119
  255. package/dist/snapshots/types.d.ts +0 -30
  256. package/dist/snapshots/types.d.ts.map +0 -1
  257. package/dist/snapshots/types.js +0 -1
  258. package/dist/storage/atlas-database.d.ts +0 -25
  259. package/dist/storage/atlas-database.d.ts.map +0 -1
  260. package/dist/storage/atlas-database.js +0 -483
  261. package/dist/storage/snapshot-store.d.ts +0 -19
  262. package/dist/storage/snapshot-store.d.ts.map +0 -1
  263. package/dist/storage/snapshot-store.js +0 -74
  264. package/dist/structural-backend/codegraph-backend.d.ts +0 -57
  265. package/dist/structural-backend/codegraph-backend.d.ts.map +0 -1
  266. package/dist/structural-backend/codegraph-backend.js +0 -1230
  267. package/dist/structural-backend/codegraph-worker-client.d.ts +0 -5
  268. package/dist/structural-backend/codegraph-worker-client.d.ts.map +0 -1
  269. package/dist/structural-backend/codegraph-worker-client.js +0 -118
  270. package/dist/structural-backend/codegraph-worker-protocol.d.ts +0 -35
  271. package/dist/structural-backend/codegraph-worker-protocol.d.ts.map +0 -1
  272. package/dist/structural-backend/codegraph-worker-protocol.js +0 -1
  273. package/dist/structural-backend/codegraph-worker.d.ts +0 -2
  274. package/dist/structural-backend/codegraph-worker.d.ts.map +0 -1
  275. package/dist/structural-backend/codegraph-worker.js +0 -131
  276. package/dist/structural-backend/process-instance.d.ts +0 -18
  277. package/dist/structural-backend/process-instance.d.ts.map +0 -1
  278. package/dist/structural-backend/process-instance.js +0 -207
  279. package/dist/structural-backend/structural-fact-changes.d.ts +0 -7
  280. package/dist/structural-backend/structural-fact-changes.d.ts.map +0 -1
  281. package/dist/structural-backend/structural-fact-changes.js +0 -78
  282. package/dist/structural-backend/structural-projection-bootstrapper.d.ts +0 -10
  283. package/dist/structural-backend/structural-projection-bootstrapper.d.ts.map +0 -1
  284. package/dist/structural-backend/structural-projection-bootstrapper.js +0 -295
  285. package/dist/structural-backend/structural-publication.d.ts +0 -13
  286. package/dist/structural-backend/structural-publication.d.ts.map +0 -1
  287. package/dist/structural-backend/structural-publication.js +0 -255
  288. package/dist/structural-backend/structural-write-lock.d.ts +0 -8
  289. package/dist/structural-backend/structural-write-lock.d.ts.map +0 -1
  290. package/dist/structural-backend/structural-write-lock.js +0 -415
  291. package/dist/structural-backend/types.d.ts +0 -144
  292. package/dist/structural-backend/types.d.ts.map +0 -1
  293. package/dist/structural-backend/types.js +0 -11
  294. package/dist/web/application/atlas-read-service.d.ts +0 -27
  295. package/dist/web/application/atlas-read-service.d.ts.map +0 -1
  296. package/dist/web/application/atlas-read-service.js +0 -216
  297. package/dist/web/application/primary-repository-catalog.d.ts +0 -15
  298. package/dist/web/application/primary-repository-catalog.d.ts.map +0 -1
  299. package/dist/web/application/primary-repository-catalog.js +0 -202
  300. package/dist/web/application/types.d.ts +0 -41
  301. package/dist/web/application/types.d.ts.map +0 -1
  302. package/dist/web/application/types.js +0 -1
  303. package/dist/web/server/api-router.d.ts +0 -4
  304. package/dist/web/server/api-router.d.ts.map +0 -1
  305. package/dist/web/server/api-router.js +0 -151
  306. package/dist/web/server/local-web-server.d.ts +0 -12
  307. package/dist/web/server/local-web-server.d.ts.map +0 -1
  308. package/dist/web/server/local-web-server.js +0 -100
  309. package/dist/web-client/assets/index-DneaErDj.css +0 -1
  310. package/dist/web-client/assets/index-cze_4vtt.js +0 -2
  311. package/dist/web-client/assets/index-cze_4vtt.js.map +0 -1
  312. package/dist/web-client/index.html +0 -61
  313. package/dist/world/business-map-projector.d.ts +0 -14
  314. package/dist/world/business-map-projector.d.ts.map +0 -1
  315. package/dist/world/business-map-projector.js +0 -178
  316. package/dist/world/types.d.ts +0 -77
  317. package/dist/world/types.d.ts.map +0 -1
  318. package/dist/world/types.js +0 -1
  319. package/dist/world/world-graph-query.d.ts +0 -30
  320. package/dist/world/world-graph-query.d.ts.map +0 -1
  321. package/dist/world/world-graph-query.js +0 -252
  322. package/dist/world/world-model-service.d.ts +0 -21
  323. package/dist/world/world-model-service.d.ts.map +0 -1
  324. package/dist/world/world-model-service.js +0 -219
  325. package/dist/world/world-snapshot-store.d.ts +0 -41
  326. package/dist/world/world-snapshot-store.d.ts.map +0 -1
  327. package/dist/world/world-snapshot-store.js +0 -581
  328. package/docs/README.md +0 -30
  329. package/docs/architecture/codegraph-backend.md +0 -190
  330. package/docs/architecture/continuous-business-learning.md +0 -240
  331. package/docs/architecture/web-viewer.md +0 -225
  332. package/docs/contracts/cli-v1.md +0 -179
  333. package/docs/contracts/graph-model.md +0 -106
  334. package/docs/contracts/graph-patch-v1.md +0 -105
  335. package/docs/contracts/http-api-v1.md +0 -155
  336. package/docs/contracts/insights-v1.md +0 -84
  337. package/docs/log.md +0 -159
  338. package/docs/mindmaps/semantic-atlas-overview.drawio +0 -255
  339. package/docs/mindmaps/semantic-atlas-overview.png +0 -0
  340. package/docs/mindmaps/semantic-atlas-overview.zh-CN.drawio +0 -255
  341. package/docs/mindmaps/semantic-atlas-overview.zh-CN.png +0 -0
  342. package/schemas/cli-envelope-v1.schema.json +0 -1244
  343. package/schemas/evaluation-plan-v1.schema.json +0 -211
  344. package/schemas/evaluation-run-v1.schema.json +0 -659
  345. package/schemas/graph-patch-v1.schema.json +0 -392
  346. package/schemas/insights-envelope-v1.schema.json +0 -428
@@ -1,179 +0,0 @@
1
- # CLI Contract v1
2
-
3
- ## Invocation
4
-
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
-
7
- Repository-independent lifecycle commands run before Git, Atlas storage, or
8
- SQLite is opened:
9
-
10
- | Command | Contract |
11
- | --- | --- |
12
- | `setup` | Atomically install or update the exact bundled `semantic-atlas` and `semantic-atlas-insights` Skills at `~/.agents/skills/`. A recognized legacy `~/.codex/skills/semantic-atlas` copy is removed after the shared installation succeeds. |
13
- | `upgrade` | Resolve npm's `latest` tag, install that exact release globally, verify the new executable, and invoke the new package's `setup`. An already-current package still verifies and repairs its bundled Skills. |
14
- | `web` | Start the loopback, desktop-only, read-only Web viewer and HTTP API. The project catalog contains only primary working trees on `main` or `master` and excludes linked worktrees. |
15
- | `-h`, `--help` | Print top-level usage and command help. |
16
- | `--version` | Print the installed package version. |
17
-
18
- These commands write conventional text to standard output and diagnostics to
19
- standard error. `setup` records the package version and a content fingerprint;
20
- repeated execution verifies the installed files and restores a changed managed
21
- copy. A directory that does not identify itself as the Semantic Atlas Skill is
22
- reported as a conflict and left unchanged.
23
-
24
- `upgrade` resolves a version before mutation and installs
25
- `semantic-atlas@<resolved-version>` rather than leaving the install step bound to
26
- a moving tag. It locates the new package through npm's global root and starts its
27
- CLI through the current Node executable, so Skill synchronization is owned by
28
- the package that was actually installed. Registry lookup, package installation,
29
- new-version verification, and Skill synchronization are one fail-closed command:
30
- any failed step returns exit code `1` and does not report the upgrade as ready.
31
- `setup` and `upgrade` do not discover a Git repository or open Atlas storage.
32
- `web` discovers existing Atlas repository stores, validates their primary Git
33
- working trees, starts on `127.0.0.1`, and remains active until interrupted. It
34
- does not write a project JSON envelope because its output is the local server
35
- address and lifecycle diagnostics. The browser uses [HTTP API v1](http-api-v1.md),
36
- not CLI subprocesses.
37
- Installation-scoped `insights` commands also avoid Git and repository Atlas
38
- storage, while opening the separate local insights store described in
39
- [Insights v1](insights-v1.md).
40
-
41
- Global project options:
42
-
43
- - `--repo <path>` selects a directory within the target repository; the default is the current directory.
44
- - `--pretty` indents a project or insights JSON envelope without changing fields or values.
45
-
46
- Web options:
47
-
48
- - `--port <n>` selects a TCP port from `1` through `65535`; the default is
49
- `4310`.
50
- - `--no-open` starts the server without opening the default browser.
51
- - `--repo <path>` selects the initial project only when the path resolves to an
52
- eligible primary working tree on `main` or `master`. It does not add or expose
53
- a linked worktree.
54
-
55
- Project commands:
56
-
57
- | Command | Contract |
58
- | --- | --- |
59
- | `status` | Report worktree identity, current revision, latest world snapshot, freshness, local store location, language support, and additive structural-backend metadata. |
60
- | `index` | Build or synchronize the embedded structural index, reconcile Atlas evidence, publish the completed world snapshot, and report changed facts and unknowns. |
61
- | `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`. |
62
- | `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. |
63
- | `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. |
64
- | `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. |
65
- | `learn --stdin` | Read one complete GraphPatch v1 JSON value from standard input and apply it atomically. |
66
- | `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. |
67
- | `feedback report --stdin` | Store an explicit, evidence-contextual product problem or suggestion after source confirmation. The report links nearby local command-event IDs without storing arguments or output. |
68
-
69
- `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.
70
-
71
- ## Response envelope
72
-
73
- Every project command writes one JSON envelope to standard output. The normative discriminated schema is `schemas/cli-envelope-v1.schema.json`.
74
-
75
- ```json
76
- {
77
- "schemaVersion": 1,
78
- "repository": {
79
- "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
80
- "root": "/workspace/example",
81
- "headCommit": "0123456789abcdef0123456789abcdef01234567"
82
- },
83
- "snapshot": null,
84
- "status": "ok",
85
- "data": {
86
- "command": "status",
87
- "currentRevision": {
88
- "headCommit": "0123456789abcdef0123456789abcdef01234567",
89
- "changes": { "staged": 0, "unstaged": 0, "untracked": 0 }
90
- },
91
- "freshness": "missing",
92
- "storeLocation": "/home/agent/.semantic-atlas/repositories/0123456789abcdef/atlas.db",
93
- "languages": [
94
- { "language": "typescript", "support": "supported" }
95
- ]
96
- },
97
- "warnings": []
98
- }
99
- ```
100
-
101
- - Successful responses have `status: "ok" | "partial"`, a non-null repository, and command data selected by `data.command`.
102
- - `snapshot` is `null` before the first successful index. Otherwise it includes the snapshot ID, Git HEAD, creation time, and `current` or `stale` freshness.
103
- - `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.
104
- - 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.
105
- - `warnings` contains stable codes and descriptions for non-fatal conditions. Consumers use codes rather than parsing messages.
106
- - `storeLocation` identifies the repository-wide Atlas knowledge database. The current worktree's `.atlas/codegraph.db` path remains an internal structural-backend detail.
107
-
108
- ## Command data
109
-
110
- The schema requires these fields while allowing additive fields inside command data:
111
-
112
- | `data.command` | Required result fields |
113
- | --- | --- |
114
- | `status` | `currentRevision`, `freshness`, `storeLocation`, `languages` |
115
- | `index` | `snapshotId`, fact counts, unknown-boundary counts; backend version and evidence-rebinding counts are additive metadata until promoted by a later schema version |
116
- | `map.view` | nullable `focus`, root-to-focus `breadcrumbs`, `regions`, and projected `connections` |
117
- | `map.search` | `query`, `limit`, scored business-only `results` |
118
- | `map.show` | business `node` and direct evidence-aware `relations` |
119
- | `code.search` | `query`, `limit`, scored structural-only `results` with source locations and support |
120
- | `learn` | `baseSnapshotId`, `snapshotId`, applied operation counts |
121
- | `changes` | source and target snapshot IDs, node/relation change sets, stale assertions |
122
- | `feedback.report` | created report ID, classification, source-confirmed flag, status, and linked-event count |
123
-
124
- `index.facts` uses one structural-fact unit across every publication: one backend node or
125
- relation is one fact. `added`, `changed`, and `reused` partition the facts in the newly
126
- published graph; `removed` counts facts present only in the previous publication. A fact
127
- is changed when its stable node identity or relation endpoints remain while its structural
128
- content, location, or support changes.
129
-
130
- 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.
131
-
132
- 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`.
133
-
134
- 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.
135
-
136
- `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.
137
-
138
- `feedback report --stdin` accepts one strict JSON object with `kind`, `category`,
139
- `impact`, `observed`, `expected`, optional `suggestion`, and `sourceConfirmed`.
140
- The report itself is explicit feedback; the surrounding passive command event
141
- contains only objective metadata. It is operational product data and never a
142
- GraphPatch or business-world assertion.
143
-
144
- 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.
145
-
146
- ## Errors
147
-
148
- Handled failures have `status: "error"` and structured data:
149
-
150
- ```json
151
- {
152
- "command": null,
153
- "error": {
154
- "code": "INVALID_INPUT",
155
- "message": "The command arguments are invalid."
156
- }
157
- }
158
- ```
159
-
160
- `command` is null when parsing fails before a public command is identified. Scalar or command-success data is invalid in an error envelope. Standard output contains only the envelope; human diagnostics and unexpected stack information go to standard error. Pretty formatting never changes the schema.
161
-
162
- ## Exit codes
163
-
164
- | Code | Meaning |
165
- | --- | --- |
166
- | `0` | Command completed with `ok` or `partial` data |
167
- | `1` | Unexpected internal failure |
168
- | `2` | Invalid command, option, stdin, or schema version |
169
- | `3` | Repository discovery or unsupported-repository failure |
170
- | `4` | Required Atlas state is missing or stale for the requested operation |
171
- | `5` | GraphPatch concurrency, evidence, or repository-boundary rejection |
172
-
173
- Handled nonzero failures still emit a versioned error envelope when a response can be formed. Diagnostics never replace the machine-readable response.
174
-
175
- ## Contract stability
176
-
177
- 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.
178
-
179
- 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.
@@ -1,106 +0,0 @@
1
- # Graph Model
2
-
3
- ## One graph, two ownership domains
4
-
5
- Semantic Atlas exposes one world graph. Its two domains have different authorities and write lifecycles:
6
-
7
- - structural nodes and relations are normalized from the embedded CodeGraph backend and are replaced or synchronized by indexing;
8
- - business nodes and relations are evidence-bound Atlas assertions changed only through GraphPatch;
9
- - evidence relations connect the domains and are rebound after indexing.
10
-
11
- The domains are physically separated by lifecycle: CodeGraph structure lives in the current worktree's disposable `.atlas/codegraph.db`, while repository-wide Atlas knowledge and snapshot bindings live in `~/.semantic-atlas/repositories/<repository-id>/atlas.db`. Atlas does not copy CodeGraph nodes and edges into parallel structural tables. The world-graph query layer composes both stores in memory and returns one versioned Atlas contract.
12
-
13
- ## Node kinds
14
-
15
- | Domain | Kind | Meaning |
16
- | --- | --- | --- |
17
- | Structural | `Repository` | The indexed worktree |
18
- | Structural | `Module` | A code or framework composition unit |
19
- | Structural | `File` | A normalized repository-relative source file |
20
- | Structural | `Symbol` | A normalized CodeGraph declaration such as a class, function, method, field, interface, route, or component |
21
- | Structural | `Test` | A backend-statically identified test declaration when such identity is available |
22
- | Structural | `UnknownBoundary` | An unresolved or unsupported structural relationship |
23
- | Business | `Capability` | A durable business ability |
24
- | Business | `Scenario` | A user or system scenario within a capability |
25
- | Business | `Operation` | A business action or use-case step |
26
- | Business | `Invariant` | A rule that constrains behavior or data |
27
- | Business | `Interface` | A business-facing API, event, queue, or integration contract |
28
- | Business | `Data` | A business data concept or persisted record |
29
-
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
-
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
-
34
- ## Relation kinds
35
-
36
- | Domain | Relation | Meaning |
37
- | --- | --- | --- |
38
- | Structural | `contains` | A structural container owns a child |
39
- | Structural | `declares` | A file or module declares a symbol |
40
- | Structural | `imports` | A file or module imports another unit |
41
- | Structural | `exports` | A file or module exports a symbol |
42
- | Structural | `references` | A symbol or file references another symbol |
43
- | Structural | `calls` | A symbol invokes another symbol |
44
- | Structural | `extends` | A declaration extends another declaration |
45
- | Structural | `implements` | A declaration implements a contract |
46
- | Structural | `instantiates` | A symbol creates an instance |
47
- | Structural | `decorated_by` | A declaration has a resolved decorator |
48
- | Business | `part_of` | A business node belongs to another business node |
49
- | Business | `invokes` | A scenario or operation invokes another operation |
50
- | Business | `realized_by` | A business node is implemented by a structural node |
51
- | Business | `reads` | A business action reads business data |
52
- | Business | `writes` | A business action writes business data |
53
- | Business | `publishes` | A business action publishes an interface or data contract |
54
- | Business | `consumes` | A business action consumes an interface or data contract |
55
- | Business | `constrained_by` | A business node is governed by an invariant |
56
- | Business | `verified_by` | A business node is checked by an agent-verified structural declaration |
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. `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
-
60
- ## Structural support
61
-
62
- Structural results preserve backend provenance. Direct syntax and uniquely resolved relations can be reported as exact structural support. CodeGraph relations with heuristic provenance remain visibly inferred. Unresolved references become `UnknownBoundary` results rather than exact edges.
63
-
64
- Structural support and business certainty are separate concepts. A structurally exact call edge does not by itself prove a business assertion, and an agent may create an inferred business relation from several exact structural facts.
65
-
66
- ## Evidence, certainty, and validity
67
-
68
- Every learned business node summary and learned relation has a certainty and one or more evidence records containing:
69
-
70
- - a public Atlas structural reference and optional internal backend locator;
71
- - a normalized repository-relative source path;
72
- - a qualified symbol identity and structural kind when available;
73
- - a one-based source range;
74
- - the SHA-256 content hash observed at learning time;
75
- - the Atlas snapshot and structural-backend version observed at learning time.
76
-
77
- Evidence does not have a cascading foreign key to CodeGraph rows. Its original locator is repository-wide; every successful worktree publication records a separate snapshot binding. Indexing one branch therefore cannot overwrite another branch's resolved reference or validity.
78
-
79
- Certainty and validity are independent:
80
-
81
- - `exact` means the evidence uniquely proves the business assertion;
82
- - `inferred` means the evidence supports the assertion and includes agent inference;
83
- - `hypothesis` is exploratory and is never a verified fact;
84
- - `valid` means every evidence record uniquely rebinds and its source hash still matches;
85
- - `stale` means at least one evidence record changed, disappeared, or became ambiguous;
86
- - `unknown` describes an explicit structural boundary rather than a business assertion.
87
-
88
- Validity is derived state and is never accepted as GraphPatch input. Stable business identity remains navigable while stale summaries and relations stay visibly stale. Certainty never upgrades automatically.
89
-
90
- ## Unknown boundaries
91
-
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
-
94
- ## Business navigation and structural fallback
95
-
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
-
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
-
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.
105
-
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.
@@ -1,105 +0,0 @@
1
- # GraphPatch v1
2
-
3
- GraphPatch is the only public write contract for agent-learned knowledge. It cannot create, change, or delete CodeGraph-backed structural nodes or relations. The normative input schema is `schemas/graph-patch-v1.schema.json`.
4
-
5
- ## Shape
6
-
7
- ```json
8
- {
9
- "schemaVersion": 1,
10
- "baseSnapshotId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
11
- "nodeOperations": [
12
- {
13
- "op": "upsert",
14
- "node": {
15
- "key": "commerce/orders/place-order",
16
- "kind": "Operation",
17
- "label": "Place order",
18
- "summary": "Validates and creates a customer order.",
19
- "aliases": ["checkout"],
20
- "certainty": "exact",
21
- "evidence": [
22
- {
23
- "symbolId": "symbol:src/orders/order.service.ts#OrderService.placeOrder",
24
- "file": "src/orders/order.service.ts",
25
- "range": {
26
- "start": { "line": 18, "column": 3 },
27
- "end": { "line": 24, "column": 4 }
28
- },
29
- "contentHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
30
- }
31
- ]
32
- }
33
- }
34
- ],
35
- "relationOperations": [
36
- {
37
- "op": "upsert",
38
- "relation": {
39
- "from": {
40
- "domain": "business",
41
- "key": "commerce/orders/place-order"
42
- },
43
- "type": "realized_by",
44
- "to": {
45
- "domain": "structural",
46
- "id": "symbol:src/orders/order.service.ts#OrderService.placeOrder"
47
- },
48
- "certainty": "exact",
49
- "evidence": [
50
- {
51
- "symbolId": "symbol:src/orders/order.service.ts#OrderService.placeOrder",
52
- "file": "src/orders/order.service.ts",
53
- "range": {
54
- "start": { "line": 18, "column": 3 },
55
- "end": { "line": 24, "column": 4 }
56
- },
57
- "contentHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
58
- }
59
- ]
60
- }
61
- }
62
- ]
63
- }
64
- ```
65
-
66
- ## Operations
67
-
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
-
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
-
72
- Reference domains make ownership explicit:
73
-
74
- - `{ "domain": "business", "key": "..." }` addresses an existing or same-patch business node.
75
- - `{ "domain": "structural", "id": "symbol:..." }` addresses an Atlas-normalized CodeGraph node in the base snapshot.
76
-
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
-
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
-
85
- ## Evidence and certainty
86
-
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.
88
-
89
- `exact` means the node summary or relation is uniquely established by evidence. `inferred` means the agent made a supported inference. `hypothesis` records exploration and remains visibly non-factual even while its evidence is current. Certainty never upgrades automatically.
90
-
91
- ## Atomic validation
92
-
93
- `learn --stdin` performs these checks before writing:
94
-
95
- 1. The schema version and complete JSON value are valid.
96
- 2. `baseSnapshotId` equals the current working-tree snapshot.
97
- 3. Every referenced node exists either in the current snapshot or in the patch.
98
- 4. Relation endpoints and kinds satisfy the graph contract.
99
- 5. Every node and relation evidence symbol, path, range, and hash belongs to the current repository snapshot.
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.
102
-
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.
104
-
105
- Validity is derived rather than accepted from GraphPatch. After later indexing, only node summaries and relations with changed evidence become `stale`. Stable node identity and unaffected assertions remain available, and hypotheses remain hypotheses.
@@ -1,155 +0,0 @@
1
- # HTTP API Contract v1
2
-
3
- This page defines the loopback, read-only HTTP interface served by
4
- `semantic-atlas web`. It applies to the bundled desktop Web application and
5
- local API consumers. Status: implemented in the current package.
6
-
7
- ## Transport and lifecycle
8
-
9
- - The server binds to `127.0.0.1` and serves HTTP only for the local machine.
10
- - The default port is `4310`; `--port` selects another available TCP port.
11
- - Every API route is under `/api/v1`.
12
- - API responses use UTF-8 JSON and `Cache-Control: no-store`.
13
- - Static browser assets are outside `/api/v1` and use GET or HEAD.
14
- - v1 defines no mutation method or remote-host mode.
15
-
16
- Every successful API response has this envelope:
17
-
18
- ```json
19
- {
20
- "schemaVersion": 1,
21
- "data": {}
22
- }
23
- ```
24
-
25
- Every handled error has this envelope:
26
-
27
- ```json
28
- {
29
- "schemaVersion": 1,
30
- "error": {
31
- "code": "PROJECT_NOT_FOUND",
32
- "message": "The requested project is not available."
33
- }
34
- }
35
- ```
36
-
37
- Error codes are stable within v1. Messages are display text and may improve
38
- without changing the code.
39
-
40
- ## Project identity
41
-
42
- The API accepts only opaque Atlas repository IDs returned by the project
43
- catalog. It never accepts a filesystem path from an HTTP request.
44
-
45
- `GET /api/v1/projects` returns at most one item per repository. Each item is the
46
- primary working tree currently attached to `main` or `master`; linked worktrees
47
- are excluded before presentation.
48
-
49
- ```json
50
- {
51
- "schemaVersion": 1,
52
- "data": {
53
- "projects": [
54
- {
55
- "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
56
- "name": "semantic-atlas",
57
- "root": "/workspace/semantic-atlas",
58
- "branch": "main",
59
- "headCommit": "0123456789abcdef0123456789abcdef01234567",
60
- "snapshotId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
61
- "freshness": "current",
62
- "status": "current"
63
- }
64
- ]
65
- }
66
- }
67
- ```
68
-
69
- The local root is intentionally visible because the viewer is a local
70
- developer product and direct source evidence may use that root. It is never
71
- sent to a remote service by Semantic Atlas.
72
-
73
- ## Operations
74
-
75
- ### List projects
76
-
77
- ```http
78
- GET /api/v1/projects
79
- ```
80
-
81
- Returns eligible primary-branch repositories sorted by display name and then
82
- root. Missing, stale, building, and failed publication state remains visible in
83
- the project summary; only branch and primary-working-tree eligibility filters
84
- the catalog. A `stale` freshness means source has changed since the last
85
- successful primary-branch publication; it does not prevent map, search, or
86
- node reads from serving that latest published map.
87
-
88
- ### Read project status
89
-
90
- ```http
91
- GET /api/v1/projects/{repositoryId}/status
92
- ```
93
-
94
- Returns repository identity, primary branch, current revision, publication
95
- freshness, languages, backend completeness, and warnings. It does not expose
96
- the Atlas database path.
97
-
98
- ### Read a map view
99
-
100
- ```http
101
- GET /api/v1/projects/{repositoryId}/map
102
- GET /api/v1/projects/{repositoryId}/map?focus={businessKey}
103
- ```
104
-
105
- Returns the existing `BusinessMapView`: focus, breadcrumbs, root/child/context
106
- regions, child counts, expandability, and projected business connections. The
107
- API does not add layout coordinates or persist a projection.
108
-
109
- ### Search business knowledge
110
-
111
- ```http
112
- GET /api/v1/projects/{repositoryId}/search?q={query}&limit={limit}
113
- ```
114
-
115
- `q` is required and trimmed. `limit` defaults to `20` and must be an integer
116
- from `1` through `100`. Results contain only business nodes and lexical ranking
117
- scores. v1 exposes no structural search route.
118
-
119
- ### Read one business node
120
-
121
- ```http
122
- GET /api/v1/projects/{repositoryId}/node?key={businessKey}
123
- ```
124
-
125
- Returns the existing business assertion and its direct relationships, including
126
- direct structural evidence already exposed by `map show`. It does not traverse
127
- the structural graph or accept a depth.
128
-
129
- ## Errors
130
-
131
- | HTTP status | Code | Meaning |
132
- | --- | --- | --- |
133
- | `400` | `INVALID_REQUEST` | Query or path input is missing, malformed, or outside a declared bound. |
134
- | `404` | `PROJECT_NOT_FOUND` | The ID is not in the eligible primary-branch catalog. |
135
- | `404` | `BUSINESS_NODE_NOT_FOUND` | The requested business key is absent. |
136
- | `409` | `ATLAS_STATE_UNAVAILABLE` | The primary publication is missing, building, failed, or structurally incomplete. |
137
- | `409` | `PUBLICATION_CHANGED` | The repository publication changed during a read. |
138
- | `405` | `METHOD_NOT_ALLOWED` | The resource does not support the requested method. |
139
- | `500` | `INTERNAL_ERROR` | An unexpected local failure occurred. |
140
-
141
- Responses do not include stack traces, backend database paths, linked-worktree
142
- paths, or candidate repository paths.
143
-
144
- ## Compatibility
145
-
146
- Additive fields may appear inside successful data objects within v1. Clients
147
- ignore fields they do not understand. Removing a field, changing field meaning,
148
- adding a mutation, widening project eligibility, or changing an enum
149
- incompatibly requires a new API version.
150
-
151
- ## Related pages
152
-
153
- - [Desktop Web viewer](../architecture/web-viewer.md)
154
- - [CLI v1](cli-v1.md)
155
- - [Graph model](graph-model.md)
@@ -1,84 +0,0 @@
1
- # Insights Contract v1
2
-
3
- ## Question and scope
4
-
5
- This page defines the local product-observability interface for Semantic Atlas.
6
- It answers how a maintainer can evaluate adoption and confirmed friction without
7
- adding work to a normal engineering task. The current contract is implemented
8
- by `semantic-atlas insights` and `semantic-atlas feedback report`.
9
-
10
- Insights are installation-scoped under `~/.semantic-atlas/insights.db`, or the
11
- absolute `SEMANTIC_ATLAS_HOME` override. They are separate from each
12
- repository's `atlas.db` knowledge and every worktree's `.atlas` projection.
13
-
14
- ## Data boundary
15
-
16
- Every completed project command best-effort records one event containing:
17
-
18
- - repository identity and the current snapshot identity when available;
19
- - command name, outcome, exit code, stable warning codes, and rounded duration;
20
- - a generated event ID and timestamp.
21
-
22
- Events never contain command arguments, prompts, query text, source text, or
23
- command output. A failure to write an event never changes the project command's
24
- exit code, JSON response, or standard output.
25
-
26
- `feedback report --stdin` stores explicit Agent input only when source
27
- confirmation establishes meaningful product friction or a concrete improvement.
28
- Each report includes a product classification, observed and expected behavior,
29
- an optional suggestion, and up to five recent event IDs from the same
30
- repository. The maintainer must keep this text concise and free of credentials,
31
- source contents, prompts, command output, and unrelated task detail.
32
-
33
- ## Commands
34
-
35
- | Command | Result |
36
- | --- | --- |
37
- | `semantic-atlas insights summary [--period <period>]` | Aggregates command outcomes, command names, warning codes, and feedback categories. |
38
- | `semantic-atlas insights feedback [--period <period>] [--status <status>]` | Lists explicit feedback reports for review. |
39
- | `semantic-atlas insights feedback update --stdin` | Writes one triage decision: `triaged`, `resolved`, or `dismissed`, with a required explanatory note. |
40
- | `semantic-atlas feedback report --stdin` | Project-scoped write of one evidence-contextual product report. |
41
-
42
- The default period is `today`; accepted period values are `today`, `yesterday`,
43
- `7d`, `30d`, and `all`. Day boundaries use the executing machine's local time,
44
- and stored timestamps are ISO-8601 UTC. `--pretty` indents insights responses.
45
-
46
- ## Envelope
47
-
48
- `insights` commands write the strict, repository-independent schema in
49
- `schemas/insights-envelope-v1.schema.json`:
50
-
51
- ```json
52
- {
53
- "schemaVersion": 1,
54
- "status": "ok",
55
- "data": {
56
- "command": "insights.summary",
57
- "range": {
58
- "from": "2026-08-20T16:00:00.000Z",
59
- "to": "2026-08-21T16:00:00.000Z"
60
- },
61
- "summary": {
62
- "commands": { "total": 12, "outcomes": { "ok": 10, "partial": 2, "error": 0 }, "byCommand": [], "warningCodes": [] },
63
- "feedback": { "total": 1, "byCategory": [] }
64
- }
65
- }
66
- }
67
- ```
68
-
69
- The envelope intentionally omits repository and snapshot fields because one
70
- installation-level query can aggregate many repositories. Individual feedback
71
- reports retain their hashed repository and nullable snapshot identity.
72
-
73
- Invalid input returns the same envelope with `status: "error"`,
74
- `data.error.code: "INVALID_INPUT"`, and exit code `2`. An internal local-store
75
- failure returns `INTERNAL_ERROR` and exit code `1`. Successful data, including
76
- an empty range, returns exit code `0`.
77
-
78
- ## Interpretation
79
-
80
- Command volume and warnings show usage shape; they are not a retrieval-recall
81
- or task-quality score. Evaluate a product change by connecting trends to
82
- source-confirmed feedback, reproducible investigations, tests, and fresh-agent
83
- task evaluation. The `semantic-atlas-insights` Skill provides the daily review
84
- and triage workflow while the primary Skill stays focused on development work.