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,172 +1,140 @@
1
1
  ---
2
2
  name: semantic-atlas
3
- description: "Use Semantic Atlas as the required first business-understanding loop in supported TypeScript or JavaScript repositories before feature implementation, bug fixing, debugging, refactoring, behavior-changing review, business-flow tracing, invariant and test discovery, or dependency or impact analysis. Git-only release work, mechanical formatting, unrelated documentation, and unsupported repositories stay in normal workflows."
4
- compatibility: "Requires Node.js 22.12 through 24 and the semantic-atlas CLI."
3
+ description: Query a repository's advisory business map before broad source discovery for business-changing feature, bug, refactor, and impact-analysis tasks. Use in repositories with docs/business-map files to find likely owners, collaborators, data, invariants, interfaces, and source anchors, then confirm every change-controlling claim in current evidence.
4
+ compatibility: Requires Node.js 24+, a bundled or PATH-compatible semantic-atlas CLI, and repository source access.
5
5
  ---
6
6
 
7
7
  # Semantic Atlas
8
8
 
9
- Use the local, deterministic Atlas world map as the first business-understanding
10
- surface for every supported task. Source code remains authoritative; Atlas is a
11
- revision-aware projection that supplies bounded evidence, business context,
12
- certainty, validity, and explicit structural limits.
13
-
14
- The calling Agent owns task interpretation, source changes, tests, Git, and
15
- review. The CLI accepts business vocabulary, stable business keys, structural
16
- search terms, snapshot identifiers, and structured GraphPatch input; it does
17
- not interpret natural-language tasks.
18
-
19
- Business knowledge grows during real engineering tasks. Indexing publishes
20
- structural evidence and refreshes existing assertions; it does not invent an
21
- upfront business map. A root is any currently parentless business node, and a
22
- later verified task may place that root beneath a newly discovered parent.
23
-
24
- ## Required business-understanding loop
25
-
26
- 1. Identify the exact target Git worktree before any Atlas command. Run from
27
- that worktree or pass its absolute path with `--repo <path>`, and confirm the
28
- response `repository.root` is the intended worktree.
29
- 2. Run one Atlas CLI command at a time and wait for its complete response. The
30
- current worktree publication and repository-wide knowledge transaction form
31
- a serialized evidence boundary.
32
- 3. Start with `semantic-atlas status` before broad source discovery. Read the
33
- versioned envelope, `data.freshness`, snapshot, warnings, and
34
- `data.backend.completeness` by stable fields and codes.
35
- 4. Complete the matching snapshot-bootstrap procedure as soon as status reports
36
- missing, stale, failed, or incomplete publication state.
37
- 5. Query the business world before broad source search: inspect the world
38
- `map view`, search compact business vocabulary, then zoom into and show the
39
- most relevant business region.
40
- 6. Classify the business response and complete every triggered reference before
41
- source confirmation. `BUSINESS_KNOWLEDGE_EMPTY`, weak, partial, stale,
42
- unsupported, or otherwise insufficient business results trigger result
43
- routing and explicit task-scoped `code search` fallback.
44
- 7. Open cited ranges and confirm decisive behavior in authoritative source.
45
- Follow only the dependencies, interfaces, data, invariants, or tests needed
46
- to answer or change the behavior.
47
- 8. Perform implementation, debugging, testing, and review through the normal
48
- engineering workflow.
49
- 9. Reconcile relevant source changes with Atlas, then make the mandatory
50
- knowledge-capture decision before completing the task.
51
-
52
- ## Query before broad source discovery
53
-
54
- Extract two to four compact concepts from the task: business vocabulary,
55
- likely symbols, interfaces or data, and dependency or impact terms. Query them
56
- in this order:
57
-
58
- 1. Run `semantic-atlas map view` to see the current world regions and
59
- cross-region business connections.
60
- 2. Use `semantic-atlas map search <business-term> [--limit <n>]` for distinct
61
- business concepts that are not obvious from the world view.
62
- 3. Use `semantic-atlas map view <business-key>` to zoom one level at a time.
63
- Follow `breadcrumbs`, `child` regions, `context` regions, and connection
64
- summaries until the task's owning business area is visible.
65
- 4. Use `semantic-atlas map show <business-key>` to inspect the selected
66
- assertion, its direct business relationships, and direct structural evidence.
67
- 5. When the map is empty or insufficient, use
68
- `semantic-atlas code search <structural-term> [--limit <n>]` for likely
69
- symbols, interfaces, data, or framework entry points. Open the returned
70
- source locations directly.
71
-
72
- An empty business world is a normal continuous-learning state. Structural
73
- results provide a bounded evidence path for the active task and never become a
74
- second map or substitute business regions.
75
-
76
- Treat search score as ranking rather than certainty. Stop semantic zoom when it
77
- identifies the necessary symbols, files, relationships, evidence, and explicit
78
- uncertainty. If the map remains weak, use its best seeds for bounded source
79
- inspection and route the observed weak state through the conditional reference.
80
-
81
- ## Source authority
82
-
83
- Confirm every answer-controlling or change-controlling claim in source even
84
- when Atlas reports `valid` plus `exact`. Keep structural support, business
85
- certainty, and evidence validity separate:
86
-
87
- - `exact` identifies uniquely supported structure or business evidence;
88
- - `inferred` is supported Agent synthesis that remains distinguishable from an
89
- exact fact;
90
- - `hypothesis` remains an exploration lead;
91
- - `stale`, `unknown`, `unsupported`, `partial`, and `insufficient` results bound
92
- source fallback rather than authorizing a decisive claim.
93
-
94
- When index warnings or source reveal dynamic ambiguity, preserve the unresolved
95
- boundary in the task conclusion. Source inspection may resolve the current task
96
- without turning the structural ambiguity into an exact Atlas claim.
97
-
98
- ## After source changes
99
-
100
- 1. Preserve the pre-change current snapshot ID when impact or semantic change
101
- matters.
102
- 2. Complete source changes and relevant tests through the normal workflow.
103
- 3. Run `semantic-atlas index` after relevant source changes and require a
104
- current, complete publication before trusting the refreshed map.
105
- 4. Run `semantic-atlas changes`; use `--from <snapshot-id>` and
106
- `--to <snapshot-id>` for an explicit persisted range.
107
- 5. Inspect node and relation additions, changes, removals, and
108
- `staleAssertions`. Re-query affected concepts and confirm the result against
109
- source and tests.
110
-
111
- Treat a failed or incomplete publication as unavailable map state and retain
112
- source as authority.
113
-
114
- ## Knowledge-capture decision
115
-
116
- Before completing every supported task, classify the business meaning learned
117
- during source confirmation:
118
-
119
- - `reuse`: current knowledge already expresses the verified business meaning;
120
- - `extend`: add a durable, verified `Capability`, `Scenario`, `Operation`,
121
- `Invariant`, `Interface`, or `Data` concept or supported relationship;
122
- - `introduce`: create a verified concept as a provisional root when no credible
123
- parent is known yet;
124
- - `reparent`: attach an existing node or subtree to a newly verified parent while
125
- preserving its key, evidence, and non-hierarchy relationships;
126
- - `refine`: update an existing kind, label, summary, aliases, certainty, or
127
- evidence when source proves a better assertion;
128
- - `transient`: keep transient or unverified observations only in task context,
129
- including symptoms, one-off notes, tentative runtime paths, Git facts, and
130
- hypotheses without durable evidence.
131
-
132
- Persist every new durable, verified concept and supported relationship that
133
- will help a later task. Reuse current knowledge without a duplicate patch when
134
- it already captures the result.
135
-
136
- When durable knowledge exists, read GraphPatch authoring, recheck status, submit
137
- one atomic patch with `semantic-atlas learn --stdin`, then run
138
- `semantic-atlas map show <learned-key>` to verify current validity, certainty,
139
- evidence, and relationships. The verified node must be reusable by a later
140
- fresh task through world view, business search, semantic zoom, and direct show.
141
-
142
- ## Conditional references
143
-
144
- Load detailed procedures only after their matching observable state:
145
-
146
- - Read [snapshot bootstrap](references/snapshot-bootstrap.md) only when status
147
- reports `missing`, `stale`, failed, or incomplete state.
148
- - Read [result routing](references/result-routing.md) only when a command returns
149
- an error, warning, `hypothesis`, `unknown`, `unsupported`, `partial`, empty,
150
- competing, or otherwise `insufficient` result.
151
- - Read [GraphPatch authoring](references/graph-patch.md) only when the
152
- knowledge-capture decision identifies durable verified knowledge to persist.
153
- - Read [product feedback](references/product-feedback.md) only when source
154
- confirmation shows that Atlas materially blocked or slowed the completed
155
- task, or produced a confirmed misleading result.
156
-
157
- ## Answer contract
158
-
159
- Use Atlas internally as context rather than dumping raw envelopes. State the
160
- relevant business concepts, files, symbols, and relationships; distinguish
161
- exact evidence from inference; identify unresolved boundaries and their source
162
- fallback; cite authoritative source and verification; and mention reindexing,
163
- semantic changes, or learned knowledge when they materially affect the result.
164
-
165
- ## Responsibility boundary
166
-
167
- Semantic Atlas owns deterministic indexing, revision-aware map queries,
168
- semantic change records, and evidence-bound business knowledge in local Atlas data.
169
- The calling Agent owns concept extraction, natural-language reasoning,
170
- source editing, tests, Git operations, and review. Keep repository-specific
171
- facts in Atlas or authoritative source and keep this Skill reusable across
172
- repositories.
9
+ Use the tracked business map as a compact navigation prior. Treat all returned
10
+ nodes, relations, summaries, and anchors as investigation leads; current
11
+ source, tests, tracked product documents, and required runtime evidence decide
12
+ what an engineering change may claim and do.
13
+
14
+ ## Choose The Workflow
15
+
16
+ Use this workflow when a task can change business behavior, ownership, shared
17
+ data, an invariant, or an interface. Begin ordinary repository work directly
18
+ when the task is purely mechanical and its exact source boundary is already
19
+ established, such as formatting, a local rename, or generated-file refresh.
20
+
21
+ ## Query The Smallest Useful Neighborhood
22
+
23
+ 1. Read the task contract and repository instructions. Resolve the repository
24
+ root and keep all commands in the task's assigned worktree.
25
+ 2. Choose one distinctive business term from the user-visible behavior. Prefer
26
+ an exact business name or stable task vocabulary over a framework, folder,
27
+ class, or method name.
28
+ 3. Before broad source discovery, run the Skill's identity- and
29
+ contract-checking adapter:
30
+
31
+ ```bash
32
+ node "<skill-directory>/scripts/query-context.mjs" \
33
+ "<business-term>" --repo "<absolute-repository-root>"
34
+ ```
35
+
36
+ A package-bundled adapter invokes that package's CLI directly. A managed
37
+ user Skill first requires the PATH CLI version recorded by `setup`, then
38
+ verifies the v1 `context` envelope. This keeps an older command with the
39
+ same executable name from being interpreted as the current product.
40
+
41
+ 4. Read the selected concept, ancestors, direct children, incoming and outgoing
42
+ relations, endpoint summaries, and anchors. Record them as hypotheses.
43
+ 5. Query a returned stable ID only when a direct owner, upstream action,
44
+ downstream consumer, shared data concept, invariant, or interface could
45
+ change the implementation scope. Stop expanding when the current task has a
46
+ source-confirmable boundary; a complete graph traversal is not required.
47
+
48
+ ## Route Map Outcomes
49
+
50
+ - A successful context result supplies likely business scope and source entry
51
+ points. Open the most decisive anchors first, then follow current imports,
52
+ callers, consumers, tests, and product documents as the behavior requires.
53
+ - `CONCEPT_AMBIGUOUS` supplies explicit candidates. Compare their stable IDs,
54
+ names, kinds, and task meaning, then query the matching ID. When current
55
+ behavior is needed to choose, search only the task term and candidate
56
+ vocabulary before selecting.
57
+ - `CONCEPT_NOT_FOUND` and `MAP_NOT_FOUND` are bounded map outcomes. Continue
58
+ with ordinary source discovery using user vocabulary, likely product docs,
59
+ and progressively narrower source searches.
60
+ - `MAP_DOCUMENT_INVALID`, an unavailable CLI, or an infrastructure failure
61
+ makes the map unavailable for this task. Preserve the error as context and
62
+ continue through the repository's normal discovery workflow.
63
+ - A node with no anchors still provides business vocabulary and relations.
64
+ Search its stable name, aliases, neighboring concepts, and interface terms,
65
+ then follow current code structure.
66
+ - A missing or stale file, directory, document, symbol, or search anchor weakens
67
+ that navigation hint. Use the node meaning and direct relations for a bounded
68
+ search, and confirm the replacement location in current evidence.
69
+
70
+ ## Build A Current-Evidence Model
71
+
72
+ For every map statement that could control the change:
73
+
74
+ 1. Open current source or tests that implement or exercise the behavior.
75
+ 2. Open the tracked product document when it owns the durable rule or outcome.
76
+ 3. Confirm both endpoints of an invocation, shared-data, invariant, publish, or
77
+ consume relation when that relation expands the required scope.
78
+ 4. Use runtime evidence when the conclusion depends on deployed state rather
79
+ than repository behavior.
80
+ 5. Classify each relevant hypothesis as confirmed, contradicted, or unresolved.
81
+ Let confirmed current evidence control the implementation. Replace a
82
+ contradicted relation with the source-supported collaborator in the
83
+ task-specific model. Keep unresolved statements out of decisive conclusions.
84
+
85
+ Trace a downstream symptom toward its confirmed upstream cause before editing.
86
+ For shared data or interfaces, inspect every confirmed producer and consumer
87
+ needed to preserve the contract. Keep unrelated neighbors outside the change.
88
+
89
+ ## Implement And Verify
90
+
91
+ Continue through the repository's normal engineering workflow after the
92
+ current-evidence model is clear. Implement the confirmed cause and affected
93
+ collaborators, add regression coverage at the public behavior boundary, run
94
+ the repository's required checks, and review the final diff against the task
95
+ scope.
96
+
97
+ Final conclusions identify the business boundary, the decisive current
98
+ evidence, the implemented or proposed scope, and relevant verification. Phrase
99
+ map-only statements as leads or uncertainty rather than current behavior.
100
+
101
+ ## Record The Task Observation
102
+
103
+ For business-changing work, read [references/observations.md](references/observations.md)
104
+ and record one task observation after the engineering result and verification
105
+ are known. Use a stable observation ID for the run and reuse the same complete
106
+ document when retrying an interrupted submission.
107
+
108
+ The task observation records the map-query outcome, selected concepts,
109
+ current-evidence dispositions, map-update candidates, and any explicit human
110
+ correction. Independent review owns accuracy judgments, so the task document
111
+ contains investigation evidence rather than a correctness verdict.
112
+
113
+ Submit the complete JSON document through the installed CLI:
114
+
115
+ ```text
116
+ semantic-atlas observe task --stdin [--repo <repository-root>]
117
+ ```
118
+
119
+ Report the recorded or idempotent outcome with the engineering result. When
120
+ the observation command fails, the engineering result remains unchanged;
121
+ report the observation failure separately so review can distinguish delivery
122
+ evidence from missing accuracy evidence.
123
+
124
+ ## Report Durable Map Observations Separately
125
+
126
+ Ordinary task completion does not require editing `docs/business-map`. When
127
+ current evidence reveals a stable missing concept, stale anchor, or
128
+ contradicted relation, add a separate map-update candidate to the task report:
129
+
130
+ ```text
131
+ Map-update candidate: <node, relation, or anchor>
132
+ Business domain: <stable domain ID>
133
+ Disposition: <confirmed, contradicted, or unresolved>
134
+ Current evidence: <repository-relative source, test, or product document>
135
+ Durable correction: <concise proposed business meaning>
136
+ ```
137
+
138
+ Keep the candidate separate from the engineering conclusion so later periodic
139
+ reconciliation can accept, refine, or discard it through the repository's
140
+ normal Git review workflow.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Semantic Atlas"
3
+ short_description: "Guide engineering work from business context to current evidence"
4
+ default_prompt: "Use $semantic-atlas to map this business-changing task to current repository evidence before implementing it."
@@ -0,0 +1,131 @@
1
+ # Accuracy Observation Contract
2
+
3
+ Create one immutable task observation after business-changing engineering work
4
+ has reached its current result. Generate `id` once, keep `recordedAt` stable,
5
+ and replay the same document when a submission result is uncertain.
6
+
7
+ ## Task Observation
8
+
9
+ The task Agent records investigation evidence. It does not add review verdicts,
10
+ correctness fields, rework judgments, or map-regression judgments. Current task
11
+ observations use schema version 2.
12
+
13
+ ```json
14
+ {
15
+ "schemaVersion": 2,
16
+ "id": "task-observation-unique-id",
17
+ "recordedAt": "2026-08-27T03:00:00.000Z",
18
+ "task": {
19
+ "taskId": "engineering-task-id",
20
+ "runId": "engineering-run-id"
21
+ },
22
+ "map": {
23
+ "queries": [
24
+ {
25
+ "selector": "Place order",
26
+ "outcome": "context",
27
+ "selectedConceptIds": ["commerce.orders.place-order"]
28
+ }
29
+ ],
30
+ "dispositions": [
31
+ {
32
+ "status": "stale",
33
+ "summary": "Current source moved while the mapped business meaning stayed stable.",
34
+ "evidence": [
35
+ {
36
+ "kind": "source",
37
+ "reference": "src/orders/place-order.ts"
38
+ }
39
+ ]
40
+ }
41
+ ]
42
+ },
43
+ "mapUpdateCandidates": [
44
+ {
45
+ "businessDomainId": "commerce",
46
+ "kind": "anchor",
47
+ "disposition": "confirmed",
48
+ "summary": "Replace the stale source anchor during reconciliation.",
49
+ "evidence": [
50
+ {
51
+ "kind": "source",
52
+ "reference": "src/orders/place-order.ts"
53
+ }
54
+ ]
55
+ }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ Query outcomes are `context`, `concept_not_found`, `concept_ambiguous`,
61
+ `map_not_found`, or `unavailable`. Only `context` includes one or more
62
+ `selectedConceptIds`. Current-evidence dispositions are `confirmed`, `missing`,
63
+ `stale`, `contradicted`, or `unresolved`. Evidence kinds are `source`, `test`,
64
+ `document`, or `runtime`.
65
+
66
+ Every map-update candidate names its stable `businessDomainId`. Its disposition
67
+ is `confirmed` when current evidence supports the proposed correction,
68
+ `contradicted` when it replaces a mapped statement contradicted by current
69
+ evidence, or `unresolved` when it remains a maintenance lead. Periodic
70
+ maintenance preserves these task-time judgments and linked independent reviews,
71
+ then confirms durable business meaning again before editing canonical YAML.
72
+ Immutable task v1 observations remain readable after package upgrades, but
73
+ their candidates predate these ownership fields and therefore stay outside
74
+ domain reconciliation.
75
+
76
+ When a person explicitly corrects the task, add:
77
+
78
+ ```json
79
+ {
80
+ "humanCorrection": {
81
+ "summary": "The user corrected the business boundary.",
82
+ "dimensions": ["business_boundary"]
83
+ }
84
+ }
85
+ ```
86
+
87
+ Correction dimensions are `business_boundary`, `upstream_cause`, `impact`, and
88
+ `map_use`.
89
+
90
+ Submit the document on standard input from the repository or provide `--repo`:
91
+
92
+ ```text
93
+ semantic-atlas observe task --stdin --repo <repository-root>
94
+ ```
95
+
96
+ The first submission returns `recorded`. An exact replay returns `idempotent`.
97
+ The same ID with changed content returns `OBSERVATION_CONFLICT`.
98
+
99
+ ## Independent Review Observation
100
+
101
+ An independent reviewer references the retained task observation and owns the
102
+ accuracy assessment:
103
+
104
+ ```json
105
+ {
106
+ "schemaVersion": 1,
107
+ "id": "review-observation-unique-id",
108
+ "recordedAt": "2026-08-27T03:30:00.000Z",
109
+ "taskObservationId": "task-observation-unique-id",
110
+ "review": {
111
+ "taskId": "review-task-id",
112
+ "runId": "review-run-id",
113
+ "verdict": "approved",
114
+ "businessBoundary": "correct",
115
+ "upstreamCause": "correct",
116
+ "impactCompleteness": "complete",
117
+ "requiredRework": false,
118
+ "mapCausedRegression": false
119
+ }
120
+ }
121
+ ```
122
+
123
+ Submit it with:
124
+
125
+ ```text
126
+ semantic-atlas observe review --stdin --repo <repository-root>
127
+ ```
128
+
129
+ An approved review cannot contain an incorrect assessed dimension, required
130
+ rework, or a map-caused regression. A `changes_requested` review sets
131
+ `requiredRework` to `true` and can record the failed accuracy dimensions.
@@ -0,0 +1,110 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { fileURLToPath } from "node:url";
3
+ import { spawnSync } from "node:child_process";
4
+
5
+ const arguments_ = process.argv.slice(2);
6
+ if (arguments_.length === 0) {
7
+ fail("Usage: query-context.mjs <business-term> --repo <repository-root>");
8
+ }
9
+
10
+ const bundledCli = fileURLToPath(
11
+ new URL("../../../../dist/cli/bin.js", import.meta.url),
12
+ );
13
+ const command = await resolveCliCommand();
14
+ const result = spawnSync(command.executable, command.arguments, {
15
+ encoding: "utf8",
16
+ });
17
+
18
+ if (result.error) {
19
+ fail(`Could not run the semantic-atlas CLI: ${result.error.message}`);
20
+ }
21
+
22
+ let envelope;
23
+ try {
24
+ envelope = JSON.parse(result.stdout);
25
+ } catch {
26
+ fail(
27
+ "The available semantic-atlas command does not implement the v1 context contract.",
28
+ );
29
+ }
30
+
31
+ if (envelope?.schemaVersion !== 1 || envelope?.command !== "context") {
32
+ fail(
33
+ "The available semantic-atlas command returned an incompatible context envelope.",
34
+ );
35
+ }
36
+
37
+ process.stdout.write(result.stdout);
38
+ process.stderr.write(result.stderr);
39
+ process.exitCode = result.status ?? 2;
40
+
41
+ async function resolveCliCommand() {
42
+ const managedIdentity = await readManagedIdentity();
43
+ if (managedIdentity) {
44
+ const versionResult = spawnSync("semantic-atlas", ["--version"], {
45
+ encoding: "utf8",
46
+ });
47
+ if (versionResult.error) {
48
+ fail(`Could not verify the managed semantic-atlas CLI: ${versionResult.error.message}`);
49
+ }
50
+ const installedVersion = versionResult.stdout.trim();
51
+ if (versionResult.status !== 0 || installedVersion !== managedIdentity.packageVersion) {
52
+ fail(
53
+ `The managed Semantic Atlas Skill requires CLI ${managedIdentity.packageVersion}, but ${installedVersion || "no compatible CLI"} is available.`,
54
+ );
55
+ }
56
+ return {
57
+ executable: "semantic-atlas",
58
+ arguments: ["context", ...arguments_],
59
+ };
60
+ }
61
+
62
+ if (await fileExists(bundledCli)) {
63
+ return {
64
+ executable: process.execPath,
65
+ arguments: [bundledCli, "context", ...arguments_],
66
+ };
67
+ }
68
+
69
+ return {
70
+ executable: "semantic-atlas",
71
+ arguments: ["context", ...arguments_],
72
+ };
73
+ }
74
+
75
+ async function readManagedIdentity() {
76
+ try {
77
+ const marker = JSON.parse(
78
+ await readFile(
79
+ new URL("../.semantic-atlas-managed.json", import.meta.url),
80
+ "utf8",
81
+ ),
82
+ );
83
+ if (
84
+ marker?.schemaVersion === 1
85
+ && marker?.managedBy === "semantic-atlas"
86
+ && marker?.skillName === "semantic-atlas"
87
+ && typeof marker?.packageVersion === "string"
88
+ ) {
89
+ return { packageVersion: marker.packageVersion };
90
+ }
91
+ fail("The managed Semantic Atlas Skill has an invalid package identity.");
92
+ } catch (error) {
93
+ if (error?.code === "ENOENT") return undefined;
94
+ fail("The managed Semantic Atlas Skill package identity could not be read.");
95
+ }
96
+ }
97
+
98
+ async function fileExists(filePath) {
99
+ try {
100
+ await access(filePath);
101
+ return true;
102
+ } catch {
103
+ return false;
104
+ }
105
+ }
106
+
107
+ function fail(message) {
108
+ process.stderr.write(`${message}\n`);
109
+ process.exit(2);
110
+ }