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,415 +0,0 @@
1
- import { randomUUID } from "node:crypto";
2
- import { closeSync, constants as fileSystemConstants, fsyncSync, fstatSync, linkSync, lstatSync, openSync, readFileSync, readdirSync, unlinkSync, writeFileSync, } from "node:fs";
3
- import { basename, dirname, join } from "node:path";
4
- import { currentProcessInstance, inspectProcessInstance, isProcessAlive, processStartedAfter, } from "./process-instance.js";
5
- const OWNERSHIP_FILE_MARKER = ".owner-";
6
- export class StructuralWriteLock {
7
- #path;
8
- #identity;
9
- #ownership;
10
- #ownershipPath;
11
- #ownershipDescriptor;
12
- constructor(path, identity, ownership, ownershipPath, ownershipDescriptor) {
13
- this.#path = path;
14
- this.#identity = identity;
15
- this.#ownership = ownership;
16
- this.#ownershipPath = ownershipPath;
17
- this.#ownershipDescriptor = ownershipDescriptor;
18
- }
19
- static acquire(path) {
20
- if (hasCompetingOwnershipLease(path)) {
21
- return undefined;
22
- }
23
- for (let attempt = 0; attempt < 2; attempt += 1) {
24
- const acquired = StructuralWriteLock.create(path);
25
- if (acquired !== undefined) {
26
- return acquired;
27
- }
28
- const existing = observeLock(path);
29
- if (existing === undefined || isObservedOwnershipActive(path, existing)) {
30
- return undefined;
31
- }
32
- if (!removeObservedLock(path, existing)) {
33
- return undefined;
34
- }
35
- }
36
- return undefined;
37
- }
38
- release() {
39
- try {
40
- removeObservedLock(this.#path, {
41
- identity: this.#identity,
42
- ownership: this.#ownership,
43
- });
44
- }
45
- finally {
46
- try {
47
- removeObservedLock(this.#ownershipPath, {
48
- identity: this.#identity,
49
- ownership: this.#ownership,
50
- });
51
- }
52
- finally {
53
- if (this.#ownershipDescriptor !== undefined) {
54
- closeSync(this.#ownershipDescriptor);
55
- }
56
- }
57
- }
58
- }
59
- static create(path) {
60
- const processInstance = currentProcessInstance();
61
- const ownership = {
62
- pid: process.pid,
63
- token: randomUUID(),
64
- instanceId: processInstance.id,
65
- instanceProof: processInstance.proof,
66
- };
67
- const ownershipPath = ownershipFilePath(path, ownership);
68
- let ownershipFileCreated = false;
69
- let ownershipLeaseRetained = false;
70
- let ownershipDescriptor;
71
- try {
72
- const noFollow = fileSystemConstants.O_NOFOLLOW ?? 0;
73
- ownershipDescriptor = openSync(ownershipPath, fileSystemConstants.O_CREAT |
74
- fileSystemConstants.O_EXCL |
75
- fileSystemConstants.O_RDWR |
76
- noFollow, 0o600);
77
- ownershipFileCreated = true;
78
- writeFileSync(ownershipDescriptor, serializeOwnership(ownership), { encoding: "utf8" });
79
- persistOwnershipFile(ownershipDescriptor);
80
- if (ownership.instanceProof !== "open-file") {
81
- closeSync(ownershipDescriptor);
82
- ownershipDescriptor = undefined;
83
- }
84
- if (hasCompetingOwnershipLease(path, ownershipPath)) {
85
- return undefined;
86
- }
87
- // Publish only a complete owner record at the contested lock path.
88
- try {
89
- linkSync(ownershipPath, path);
90
- }
91
- catch (error) {
92
- if (isFileSystemError(error, "EEXIST")) {
93
- return undefined;
94
- }
95
- throw error;
96
- }
97
- const identity = lstatSync(path);
98
- try {
99
- persistDirectory(dirname(path));
100
- }
101
- catch (error) {
102
- removeObservedLock(path, { identity, ownership });
103
- throw error;
104
- }
105
- if (hasCompetingOwnershipLease(path, ownershipPath) ||
106
- !matchesObservedLock(path, { identity, ownership })) {
107
- removeObservedLock(path, { identity, ownership });
108
- return undefined;
109
- }
110
- ownershipLeaseRetained = true;
111
- return new StructuralWriteLock(path, identity, ownership, ownershipPath, ownershipDescriptor);
112
- }
113
- finally {
114
- if (ownershipFileCreated && !ownershipLeaseRetained) {
115
- try {
116
- removeRegularFile(ownershipPath);
117
- }
118
- finally {
119
- if (ownershipDescriptor !== undefined) {
120
- closeSync(ownershipDescriptor);
121
- }
122
- }
123
- }
124
- }
125
- }
126
- }
127
- function persistOwnershipFile(descriptor) {
128
- fsyncSync(descriptor);
129
- }
130
- function persistDirectory(path) {
131
- if (process.platform === "win32") {
132
- return;
133
- }
134
- const descriptor = openSync(path, fileSystemConstants.O_RDONLY);
135
- try {
136
- fsyncSync(descriptor);
137
- }
138
- finally {
139
- closeSync(descriptor);
140
- }
141
- }
142
- function ownershipFilePath(path, ownership) {
143
- if (ownership.instanceId === undefined) {
144
- throw new Error("The structural lock owner lease requires a process instance identity");
145
- }
146
- if (ownership.instanceProof === undefined) {
147
- throw new Error("The structural lock owner lease requires a process instance proof");
148
- }
149
- return `${path}${OWNERSHIP_FILE_MARKER}${ownership.pid}-${ownership.instanceProof}-${ownership.instanceId}-${ownership.token}`;
150
- }
151
- function hasCompetingOwnershipLease(lockPath, ownOwnershipPath) {
152
- const directory = dirname(lockPath);
153
- const prefix = `${basename(lockPath)}${OWNERSHIP_FILE_MARKER}`;
154
- let entries;
155
- try {
156
- entries = readdirSync(directory);
157
- }
158
- catch {
159
- return true;
160
- }
161
- for (const entry of entries) {
162
- const path = join(directory, entry);
163
- if (path === ownOwnershipPath) {
164
- continue;
165
- }
166
- const ownership = parseOwnershipFileName(entry, prefix);
167
- if (ownership === undefined) {
168
- continue;
169
- }
170
- const observed = observeLock(path);
171
- if (observed === undefined ||
172
- observed.ownership.pid !== ownership.pid ||
173
- observed.ownership.token !== ownership.token ||
174
- observed.ownership.instanceId !== ownership.instanceId ||
175
- observed.ownership.instanceProof !== ownership.instanceProof) {
176
- if (ownership.instanceId === undefined
177
- ? isLegacyLeasePathActive(lockPath, path, ownership.pid)
178
- : isOwnershipActive(ownership, path)) {
179
- return true;
180
- }
181
- }
182
- else if (observed.ownership.instanceId === undefined) {
183
- if (isLegacyLeaseActive(lockPath, observed)) {
184
- return true;
185
- }
186
- if (matchesObservedLock(lockPath, observed) &&
187
- !removeObservedLock(lockPath, observed)) {
188
- return true;
189
- }
190
- }
191
- else if (isOwnershipActive(observed.ownership, path, observed.identity)) {
192
- return true;
193
- }
194
- if (!removeRegularFile(path) && pathExists(path)) {
195
- return true;
196
- }
197
- }
198
- return false;
199
- }
200
- function parseOwnershipFileName(name, prefix) {
201
- if (!name.startsWith(prefix)) {
202
- return undefined;
203
- }
204
- const serializedOwnership = name.slice(prefix.length);
205
- const match = /^(\d+)-(?:(?<instanceProof>process-start|open-file)-)?(?:(?<instanceId>[0-9a-f]{64})-)?(?<token>[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$/iu
206
- .exec(serializedOwnership);
207
- if (match === null) {
208
- return undefined;
209
- }
210
- const serializedPid = match[1] ?? "";
211
- const pid = /^\d+$/u.test(serializedPid)
212
- ? Number.parseInt(serializedPid, 10)
213
- : Number.NaN;
214
- const token = match.groups?.token ?? "";
215
- const instanceId = match.groups?.instanceId;
216
- const instanceProof = match.groups?.instanceProof;
217
- if (!Number.isSafeInteger(pid) ||
218
- pid <= 0 ||
219
- !isUuid(token) ||
220
- (instanceProof !== undefined && instanceId === undefined)) {
221
- return undefined;
222
- }
223
- return {
224
- pid,
225
- token,
226
- ...(instanceId === undefined ? {} : { instanceId }),
227
- ...(instanceProof === undefined ? {} : { instanceProof }),
228
- };
229
- }
230
- function isUuid(value) {
231
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu.test(value);
232
- }
233
- function removeRegularFile(path) {
234
- let identity;
235
- try {
236
- identity = lstatSync(path);
237
- }
238
- catch {
239
- return false;
240
- }
241
- if (!identity.isFile() || identity.isSymbolicLink()) {
242
- return false;
243
- }
244
- try {
245
- const current = lstatSync(path);
246
- if (current.dev !== identity.dev || current.ino !== identity.ino) {
247
- return false;
248
- }
249
- unlinkSync(path);
250
- return true;
251
- }
252
- catch {
253
- return false;
254
- }
255
- }
256
- function pathExists(path) {
257
- try {
258
- lstatSync(path);
259
- return true;
260
- }
261
- catch (error) {
262
- return !isFileSystemError(error, "ENOENT");
263
- }
264
- }
265
- function observeLock(path) {
266
- let descriptor;
267
- try {
268
- const identity = lstatSync(path);
269
- if (!identity.isFile() || identity.isSymbolicLink()) {
270
- return undefined;
271
- }
272
- descriptor = openSync(path, fileSystemConstants.O_RDONLY | (fileSystemConstants.O_NOFOLLOW ?? 0));
273
- const openedIdentity = fstatSync(descriptor);
274
- if (openedIdentity.dev !== identity.dev ||
275
- openedIdentity.ino !== identity.ino) {
276
- return undefined;
277
- }
278
- const ownership = parseOwnership(readFileSync(descriptor, "utf8"));
279
- return ownership === undefined ? undefined : { identity: openedIdentity, ownership };
280
- }
281
- catch {
282
- return undefined;
283
- }
284
- finally {
285
- if (descriptor !== undefined) {
286
- closeSync(descriptor);
287
- }
288
- }
289
- }
290
- function removeObservedLock(path, expected) {
291
- if (!matchesObservedLock(path, expected)) {
292
- return false;
293
- }
294
- try {
295
- unlinkSync(path);
296
- return true;
297
- }
298
- catch {
299
- return false;
300
- }
301
- }
302
- function matchesObservedLock(path, expected) {
303
- const current = observeLock(path);
304
- return current !== undefined &&
305
- current.identity.dev === expected.identity.dev &&
306
- current.identity.ino === expected.identity.ino &&
307
- current.ownership.pid === expected.ownership.pid &&
308
- current.ownership.token === expected.ownership.token &&
309
- current.ownership.instanceId === expected.ownership.instanceId &&
310
- current.ownership.instanceProof === expected.ownership.instanceProof;
311
- }
312
- function serializeOwnership(ownership) {
313
- return `${JSON.stringify(ownership)}\n`;
314
- }
315
- function parseOwnership(value) {
316
- try {
317
- const parsed = JSON.parse(value);
318
- const pid = typeof parsed === "object" && parsed !== null && "pid" in parsed
319
- ? parsed.pid
320
- : undefined;
321
- const token = typeof parsed === "object" && parsed !== null && "token" in parsed
322
- ? parsed.token
323
- : undefined;
324
- const instanceId = typeof parsed === "object" && parsed !== null && "instanceId" in parsed
325
- ? parsed.instanceId
326
- : undefined;
327
- const instanceProof = typeof parsed === "object" && parsed !== null && "instanceProof" in parsed
328
- ? parsed.instanceProof
329
- : undefined;
330
- if (typeof pid !== "number" ||
331
- !Number.isSafeInteger(pid) ||
332
- pid <= 0 ||
333
- typeof token !== "string" ||
334
- token.length === 0 ||
335
- (instanceId !== undefined && !isProcessInstanceId(instanceId)) ||
336
- (instanceProof !== undefined && !isProcessInstanceProof(instanceProof)) ||
337
- (instanceProof !== undefined && instanceId === undefined)) {
338
- return undefined;
339
- }
340
- return {
341
- pid,
342
- token,
343
- ...(instanceId === undefined ? {} : { instanceId }),
344
- ...(instanceProof === undefined ? {} : { instanceProof }),
345
- };
346
- }
347
- catch {
348
- return undefined;
349
- }
350
- }
351
- function isOwnershipActive(ownership, leasePath, leaseIdentity) {
352
- if (ownership.instanceId === undefined) {
353
- return isProcessAlive(ownership.pid);
354
- }
355
- let identity;
356
- try {
357
- identity = leaseIdentity ?? lstatSync(leasePath);
358
- }
359
- catch {
360
- return false;
361
- }
362
- const status = inspectProcessInstance(ownership.pid, ownership.instanceId, ownership.instanceProof ?? "process-start", {
363
- path: leasePath,
364
- device: identity.dev,
365
- inode: identity.ino,
366
- writtenAtMs: Math.max(identity.birthtimeMs, identity.ctimeMs),
367
- });
368
- return status === "matching" || status === "unknown";
369
- }
370
- function isObservedOwnershipActive(lockPath, lock) {
371
- return lock.ownership.instanceId === undefined
372
- ? isLegacyLeaseActive(lockPath, lock)
373
- : isOwnershipActive(lock.ownership, lockPath, lock.identity);
374
- }
375
- function isLegacyLeaseActive(lockPath, lease) {
376
- return isLegacyLeasePathActive(lockPath, lease.identity, lease.ownership.pid);
377
- }
378
- function isLegacyLeasePathActive(lockPath, leasePathOrIdentity, pid) {
379
- if (!isProcessAlive(pid)) {
380
- return false;
381
- }
382
- let leaseIdentity;
383
- try {
384
- leaseIdentity = typeof leasePathOrIdentity === "string"
385
- ? lstatSync(leasePathOrIdentity)
386
- : leasePathOrIdentity;
387
- }
388
- catch {
389
- return false;
390
- }
391
- try {
392
- const fixedIdentity = lstatSync(lockPath);
393
- const sameLease = fixedIdentity.isFile() &&
394
- !fixedIdentity.isSymbolicLink() &&
395
- fixedIdentity.dev === leaseIdentity.dev &&
396
- fixedIdentity.ino === leaseIdentity.ino;
397
- if (!sameLease) {
398
- return false;
399
- }
400
- const leaseWrittenAtMs = Math.max(leaseIdentity.birthtimeMs, leaseIdentity.ctimeMs);
401
- return processStartedAfter(pid, leaseWrittenAtMs) !== true;
402
- }
403
- catch {
404
- return false;
405
- }
406
- }
407
- function isProcessInstanceId(value) {
408
- return typeof value === "string" && /^[0-9a-f]{64}$/u.test(value);
409
- }
410
- function isProcessInstanceProof(value) {
411
- return value === "process-start" || value === "open-file";
412
- }
413
- function isFileSystemError(error, code) {
414
- return error instanceof Error && "code" in error && error.code === code;
415
- }
@@ -1,144 +0,0 @@
1
- import type { z } from "zod";
2
- import type { structuralProvenanceSchema, structuralSupportSchema, structuralSupportStatusSchema } from "../contracts/graph.js";
3
- export declare const STRUCTURAL_BACKEND_VERSION = "1.5.0";
4
- export type StructuralProjectionCompleteness = "missing" | "complete" | "incomplete";
5
- export type StructuralSupportStatus = z.infer<typeof structuralSupportStatusSchema>;
6
- export type StructuralProvenance = z.infer<typeof structuralProvenanceSchema>;
7
- export type BackendStructuralNodeKind = "Module" | "File" | "Symbol" | "Test";
8
- export type BackendDeclarationKind = "file" | "module" | "class" | "struct" | "interface" | "trait" | "protocol" | "function" | "method" | "property" | "field" | "variable" | "constant" | "enum" | "enum_member" | "type_alias" | "namespace" | "parameter" | "import" | "export" | "route" | "component" | "test" | "virtual_module";
9
- export type BackendStructuralRelationType = "contains" | "declares" | "imports" | "exports" | "references" | "calls" | "extends" | "implements" | "instantiates" | "decorated_by";
10
- export type StructuralSupport = z.infer<typeof structuralSupportSchema>;
11
- export interface StructuralReference {
12
- readonly id: string;
13
- }
14
- export interface StructuralSourcePosition {
15
- readonly line: number;
16
- readonly column: number;
17
- }
18
- export interface StructuralSourceRange {
19
- readonly start: StructuralSourcePosition;
20
- readonly end: StructuralSourcePosition;
21
- }
22
- export interface StructuralNode {
23
- readonly reference: StructuralReference;
24
- readonly kind: BackendStructuralNodeKind;
25
- readonly declarationKind: BackendDeclarationKind;
26
- readonly decorators: readonly string[];
27
- readonly name: string;
28
- readonly qualifiedName: string;
29
- readonly path: string;
30
- readonly language: string;
31
- readonly range: StructuralSourceRange;
32
- readonly support: StructuralSupport;
33
- readonly virtual?: boolean;
34
- }
35
- export interface StructuralRelation {
36
- readonly from: StructuralReference;
37
- readonly type: BackendStructuralRelationType;
38
- readonly to: StructuralReference;
39
- readonly support: StructuralSupport;
40
- readonly location?: {
41
- readonly path: string;
42
- readonly position: StructuralSourcePosition;
43
- };
44
- }
45
- export interface StructuralUnknownBoundary {
46
- readonly reference: StructuralReference;
47
- readonly kind: "UnknownBoundary";
48
- readonly owner: StructuralReference;
49
- readonly operation: string;
50
- readonly target?: string;
51
- readonly reason: string;
52
- readonly path?: string;
53
- readonly position?: StructuralSourcePosition;
54
- readonly candidates: readonly string[];
55
- readonly support: StructuralSupport;
56
- }
57
- export interface StructuralDiagnostic {
58
- readonly code: "STRUCTURAL_BACKEND_FAILURE" | "STRUCTURAL_INDEX_INCOMPLETE";
59
- readonly message: string;
60
- }
61
- export interface StructuralIndexState {
62
- readonly completeness: StructuralProjectionCompleteness;
63
- readonly databasePath: string;
64
- readonly backendVersion: string;
65
- readonly extractionVersion: number | null;
66
- readonly indexedAt: string | null;
67
- readonly diagnostics: readonly StructuralDiagnostic[];
68
- }
69
- export interface StructuralBuildCounts {
70
- readonly filesDiscovered: number;
71
- readonly filesIndexed: number;
72
- readonly filesSkipped: number;
73
- readonly filesErrored: number;
74
- readonly nodes: number;
75
- readonly relations: number;
76
- }
77
- export interface StructuralFileChanges {
78
- readonly added: readonly string[];
79
- readonly modified: readonly string[];
80
- readonly removed: readonly string[];
81
- }
82
- export interface StructuralFactChanges {
83
- readonly added: number;
84
- readonly changed: number;
85
- readonly reused: number;
86
- readonly removed: number;
87
- }
88
- export interface StructuralBuildResult extends StructuralIndexState {
89
- readonly mode: "initial" | "full" | "incremental";
90
- readonly counts: StructuralBuildCounts;
91
- readonly changes: StructuralFileChanges;
92
- readonly factChanges: StructuralFactChanges;
93
- readonly boundaries: readonly StructuralUnknownBoundary[];
94
- }
95
- export interface StructuralSearchQuery {
96
- readonly query: string;
97
- readonly limit?: number;
98
- }
99
- export interface StructuralSearchResult {
100
- readonly score: number;
101
- readonly node: StructuralNode;
102
- }
103
- export interface StructuralProjectGraphQuery {
104
- readonly declarationKinds: readonly BackendDeclarationKind[];
105
- }
106
- export interface StructuralTraversalQuery {
107
- readonly reference: StructuralReference;
108
- readonly maxDepth?: number;
109
- readonly direction?: "incoming" | "outgoing" | "both";
110
- readonly relationTypes?: readonly BackendStructuralRelationType[];
111
- }
112
- export interface StructuralTraversalResult {
113
- readonly roots: readonly StructuralReference[];
114
- readonly nodes: readonly StructuralNode[];
115
- readonly relations: readonly StructuralRelation[];
116
- readonly boundaries: readonly StructuralUnknownBoundary[];
117
- }
118
- export interface StructuralCallRelation {
119
- readonly node: StructuralNode;
120
- readonly relation: StructuralRelation;
121
- }
122
- export interface StructuralFileDependency {
123
- readonly path: string;
124
- readonly support: StructuralSupport;
125
- }
126
- export interface StructuralIndexBackend {
127
- inspect(): Promise<StructuralIndexState>;
128
- build(): Promise<StructuralBuildResult>;
129
- sync(): Promise<StructuralBuildResult>;
130
- listRoots(): Promise<readonly StructuralNode[]>;
131
- readProjectGraph(query: StructuralProjectGraphQuery): Promise<StructuralTraversalResult>;
132
- search(query: StructuralSearchQuery): Promise<readonly StructuralSearchResult[]>;
133
- getNode(reference: StructuralReference): Promise<StructuralNode | undefined>;
134
- traverse(query: StructuralTraversalQuery): Promise<StructuralTraversalResult>;
135
- getCallers(reference: StructuralReference): Promise<readonly StructuralCallRelation[]>;
136
- getCallees(reference: StructuralReference): Promise<readonly StructuralCallRelation[]>;
137
- getFileDependencies(path: string): Promise<readonly StructuralFileDependency[]>;
138
- }
139
- export declare class StructuralBackendError extends Error {
140
- readonly code: "STRUCTURAL_INDEX_MISSING" | "STRUCTURAL_INDEX_INCOMPLETE" | "STRUCTURAL_QUERY_FAILED";
141
- readonly cause: unknown;
142
- constructor(code: StructuralBackendError["code"], message: string, cause?: unknown);
143
- }
144
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/structural-backend/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK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AK;IAC/C,QAAQ,CAAC,IAAI,EAAE,0BAA0B,GAAG,6BAA6B,GAAG,yBAAyB,CAAC;IACtG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;gBAGtB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,EACpC,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO;CAOlB"}
@@ -1,11 +0,0 @@
1
- export const STRUCTURAL_BACKEND_VERSION = "1.5.0";
2
- export class StructuralBackendError extends Error {
3
- code;
4
- cause;
5
- constructor(code, message, cause) {
6
- super(message);
7
- this.name = "StructuralBackendError";
8
- this.code = code;
9
- this.cause = cause;
10
- }
11
- }
@@ -1,14 +0,0 @@
1
- import type { BusinessGraphNode, BusinessGraphRelation, BusinessMapView } from "../graph/types.js";
2
- export declare class BusinessMapProjector {
3
- #private;
4
- constructor(nodes: readonly BusinessGraphNode[], relations: readonly BusinessGraphRelation[]);
5
- project(focusKey?: string): BusinessMapView | undefined;
6
- private rootKeys;
7
- private pathFromRoot;
8
- private touchesSubtree;
9
- private isDescendantOrSelf;
10
- private projectEndpoint;
11
- private addContextRegion;
12
- private addRegion;
13
- }
14
- //# sourceMappingURL=business-map-projector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"business-map-projector.d.ts","sourceRoot":"","sources":["../../src/world/business-map-projector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EAKrB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAuB3B,qBAAa,oBAAoB;;gBAO7B,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,SAAS,EAAE,SAAS,qBAAqB,EAAE;IAY7C,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IA2CvD,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,SAAS;CAYlB"}