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.
- package/.agents/skills/semantic-atlas/SKILL.md +134 -166
- package/.agents/skills/semantic-atlas/agents/openai.yaml +4 -0
- package/.agents/skills/semantic-atlas/references/observations.md +131 -0
- package/.agents/skills/semantic-atlas/scripts/query-context.mjs +110 -0
- package/.agents/skills/semantic-atlas-maintenance/SKILL.md +93 -0
- package/.agents/skills/semantic-atlas-maintenance/agents/openai.yaml +4 -0
- package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +56 -0
- package/README.md +134 -239
- package/dist/application/map-application.d.ts +24 -0
- package/dist/application/map-application.d.ts.map +1 -0
- package/dist/application/map-application.js +134 -0
- package/dist/application/map-application.js.map +1 -0
- package/dist/cli/bin.js +6 -35
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/observation-commands.d.ts +16 -0
- package/dist/cli/observation-commands.d.ts.map +1 -0
- package/dist/cli/observation-commands.js +118 -0
- package/dist/cli/observation-commands.js.map +1 -0
- package/dist/cli/projection-writer.d.ts +2 -0
- package/dist/cli/projection-writer.d.ts.map +1 -0
- package/dist/cli/projection-writer.js +9 -0
- package/dist/cli/projection-writer.js.map +1 -0
- package/dist/cli/reconciliation-command.d.ts +7 -0
- package/dist/cli/reconciliation-command.d.ts.map +1 -0
- package/dist/cli/reconciliation-command.js +33 -0
- package/dist/cli/reconciliation-command.js.map +1 -0
- package/dist/cli/run-cli.d.ts +21 -0
- package/dist/cli/run-cli.d.ts.map +1 -0
- package/dist/cli/run-cli.js +299 -0
- package/dist/cli/run-cli.js.map +1 -0
- package/dist/contracts/cli.d.ts +166 -1211
- package/dist/contracts/cli.d.ts.map +1 -1
- package/dist/contracts/cli.js +2 -232
- package/dist/contracts/cli.js.map +1 -0
- package/dist/contracts/insights.d.ts +39 -1
- package/dist/contracts/insights.d.ts.map +1 -1
- package/dist/contracts/insights.js +2 -1
- package/dist/contracts/insights.js.map +1 -0
- package/dist/contracts/map.d.ts +154 -0
- package/dist/contracts/map.d.ts.map +1 -0
- package/dist/contracts/map.js +60 -0
- package/dist/contracts/map.js.map +1 -0
- package/dist/contracts/observation.d.ts +649 -0
- package/dist/contracts/observation.d.ts.map +1 -0
- package/dist/contracts/observation.js +140 -0
- package/dist/contracts/observation.js.map +1 -0
- package/dist/contracts/projection.d.ts +7 -0
- package/dist/contracts/projection.d.ts.map +1 -0
- package/dist/contracts/projection.js +2 -0
- package/dist/contracts/projection.js.map +1 -0
- package/dist/contracts/reconciliation.d.ts +40 -0
- package/dist/contracts/reconciliation.d.ts.map +1 -0
- package/dist/contracts/reconciliation.js +2 -0
- package/dist/contracts/reconciliation.js.map +1 -0
- package/dist/index.d.ts +7 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -0
- package/dist/insights/insight-service.d.ts +14 -0
- package/dist/insights/insight-service.d.ts.map +1 -0
- package/dist/insights/insight-service.js +129 -0
- package/dist/insights/insight-service.js.map +1 -0
- package/dist/map/business-graph.d.ts +32 -0
- package/dist/map/business-graph.d.ts.map +1 -0
- package/dist/map/business-graph.js +122 -0
- package/dist/map/business-graph.js.map +1 -0
- package/dist/map/map-document-loader.d.ts +13 -0
- package/dist/map/map-document-loader.d.ts.map +1 -0
- package/dist/map/map-document-loader.js +86 -0
- package/dist/map/map-document-loader.js.map +1 -0
- package/dist/map/map-validator.d.ts +12 -0
- package/dist/map/map-validator.d.ts.map +1 -0
- package/dist/map/map-validator.js +322 -0
- package/dist/map/map-validator.js.map +1 -0
- package/dist/observations/observation-application.d.ts +23 -0
- package/dist/observations/observation-application.d.ts.map +1 -0
- package/dist/observations/observation-application.js +62 -0
- package/dist/observations/observation-application.js.map +1 -0
- package/dist/observations/observation-claim-manager.d.ts +13 -0
- package/dist/observations/observation-claim-manager.d.ts.map +1 -0
- package/dist/observations/observation-claim-manager.js +247 -0
- package/dist/observations/observation-claim-manager.js.map +1 -0
- package/dist/observations/observation-store.d.ts +43 -0
- package/dist/observations/observation-store.d.ts.map +1 -0
- package/dist/observations/observation-store.js +208 -0
- package/dist/observations/observation-store.js.map +1 -0
- package/dist/observations/repository-identity.d.ts +12 -0
- package/dist/observations/repository-identity.d.ts.map +1 -0
- package/dist/observations/repository-identity.js +108 -0
- package/dist/observations/repository-identity.js.map +1 -0
- package/dist/query/context-query-service.d.ts +15 -0
- package/dist/query/context-query-service.d.ts.map +1 -0
- package/dist/query/context-query-service.js +36 -0
- package/dist/query/context-query-service.js.map +1 -0
- package/dist/reconciliation/reconciliation-service.d.ts +10 -0
- package/dist/reconciliation/reconciliation-service.d.ts.map +1 -0
- package/dist/reconciliation/reconciliation-service.js +116 -0
- package/dist/reconciliation/reconciliation-service.js.map +1 -0
- package/dist/rendering/map-projector.d.ts +8 -0
- package/dist/rendering/map-projector.d.ts.map +1 -0
- package/dist/rendering/map-projector.js +386 -0
- package/dist/rendering/map-projector.js.map +1 -0
- package/dist/setup/managed-skill-installer.d.ts +60 -0
- package/dist/setup/managed-skill-installer.d.ts.map +1 -0
- package/dist/setup/managed-skill-installer.js +307 -0
- package/dist/setup/managed-skill-installer.js.map +1 -0
- package/dist/setup/package-identity.d.ts +6 -0
- package/dist/setup/package-identity.d.ts.map +1 -0
- package/dist/setup/package-identity.js +16 -0
- package/dist/setup/package-identity.js.map +1 -0
- package/dist/setup/package-upgrader.d.ts +10 -22
- package/dist/setup/package-upgrader.d.ts.map +1 -1
- package/dist/setup/package-upgrader.js +60 -76
- package/dist/setup/package-upgrader.js.map +1 -0
- package/docs/architecture.md +428 -0
- package/docs/evaluation.md +220 -174
- package/docs/index.md +27 -40
- package/docs/map-format.md +224 -0
- package/docs/observations.md +175 -0
- package/docs/product-contract.md +295 -137
- package/examples/commerce.yaml +204 -0
- package/package.json +31 -30
- package/.agents/skills/semantic-atlas/references/graph-patch.md +0 -190
- package/.agents/skills/semantic-atlas/references/product-feedback.md +0 -34
- package/.agents/skills/semantic-atlas/references/result-routing.md +0 -104
- package/.agents/skills/semantic-atlas/references/snapshot-bootstrap.md +0 -42
- package/.agents/skills/semantic-atlas-insights/SKILL.md +0 -55
- package/README.zh-CN.md +0 -273
- package/dist/business-flow/business-flow-derivation-service.d.ts +0 -11
- package/dist/business-flow/business-flow-derivation-service.d.ts.map +0 -1
- package/dist/business-flow/business-flow-derivation-service.js +0 -151
- package/dist/business-flow/business-flow-draft.d.ts +0 -16
- package/dist/business-flow/business-flow-draft.d.ts.map +0 -1
- package/dist/business-flow/business-flow-draft.js +0 -150
- package/dist/business-flow/framework-business-strategy.d.ts +0 -7
- package/dist/business-flow/framework-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/framework-business-strategy.js +0 -1
- package/dist/business-flow/strategies/bullmq-business-strategy.d.ts +0 -10
- package/dist/business-flow/strategies/bullmq-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/bullmq-business-strategy.js +0 -79
- package/dist/business-flow/strategies/called-operation-derivation.d.ts +0 -13
- package/dist/business-flow/strategies/called-operation-derivation.d.ts.map +0 -1
- package/dist/business-flow/strategies/called-operation-derivation.js +0 -32
- package/dist/business-flow/strategies/graphql-business-strategy.d.ts +0 -8
- package/dist/business-flow/strategies/graphql-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/graphql-business-strategy.js +0 -65
- package/dist/business-flow/strategies/nestjs-business-strategy.d.ts +0 -8
- package/dist/business-flow/strategies/nestjs-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/nestjs-business-strategy.js +0 -72
- package/dist/business-flow/strategies/strategy-helpers.d.ts +0 -32
- package/dist/business-flow/strategies/strategy-helpers.d.ts.map +0 -1
- package/dist/business-flow/strategies/strategy-helpers.js +0 -49
- package/dist/business-flow/strategies/typeorm-business-strategy.d.ts +0 -10
- package/dist/business-flow/strategies/typeorm-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/typeorm-business-strategy.js +0 -136
- package/dist/business-flow/strategies/verified-invariant-strategy.d.ts +0 -5
- package/dist/business-flow/strategies/verified-invariant-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/verified-invariant-strategy.js +0 -38
- package/dist/business-flow/strategies/verified-test-strategy.d.ts +0 -5
- package/dist/business-flow/strategies/verified-test-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/verified-test-strategy.js +0 -26
- package/dist/business-flow/structural-flow-catalog.d.ts +0 -21
- package/dist/business-flow/structural-flow-catalog.d.ts.map +0 -1
- package/dist/business-flow/structural-flow-catalog.js +0 -125
- package/dist/business-flow/types.d.ts +0 -51
- package/dist/business-flow/types.d.ts.map +0 -1
- package/dist/business-flow/types.js +0 -1
- package/dist/cli/argument-parser.d.ts +0 -3
- package/dist/cli/argument-parser.d.ts.map +0 -1
- package/dist/cli/argument-parser.js +0 -200
- package/dist/cli/cli-application.d.ts +0 -39
- package/dist/cli/cli-application.d.ts.map +0 -1
- package/dist/cli/cli-application.js +0 -571
- package/dist/cli/cli-error.d.ts +0 -12
- package/dist/cli/cli-error.d.ts.map +0 -1
- package/dist/cli/cli-error.js +0 -44
- package/dist/cli/cli-presenter.d.ts +0 -14
- package/dist/cli/cli-presenter.d.ts.map +0 -1
- package/dist/cli/cli-presenter.js +0 -36
- package/dist/cli/insights-cli.d.ts +0 -6
- package/dist/cli/insights-cli.d.ts.map +0 -1
- package/dist/cli/insights-cli.js +0 -236
- package/dist/cli/main.d.ts +0 -3
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -137
- package/dist/cli/standalone-cli.d.ts +0 -3
- package/dist/cli/standalone-cli.d.ts.map +0 -1
- package/dist/cli/standalone-cli.js +0 -96
- package/dist/cli/types.d.ts +0 -49
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/types.js +0 -1
- package/dist/contracts/graph.d.ts +0 -266
- package/dist/contracts/graph.d.ts.map +0 -1
- package/dist/contracts/graph.js +0 -182
- package/dist/contracts/identifiers.d.ts +0 -4
- package/dist/contracts/identifiers.d.ts.map +0 -1
- package/dist/contracts/identifiers.js +0 -7
- package/dist/contracts/public-contracts.d.ts +0 -5
- package/dist/contracts/public-contracts.d.ts.map +0 -1
- package/dist/contracts/public-contracts.js +0 -4
- package/dist/evaluation/comparison.d.ts +0 -30
- package/dist/evaluation/comparison.d.ts.map +0 -1
- package/dist/evaluation/comparison.js +0 -108
- package/dist/evaluation/contracts.d.ts +0 -301
- package/dist/evaluation/contracts.d.ts.map +0 -1
- package/dist/evaluation/contracts.js +0 -413
- package/dist/graph/graph-store.d.ts +0 -55
- package/dist/graph/graph-store.d.ts.map +0 -1
- package/dist/graph/graph-store.js +0 -912
- package/dist/graph/types.d.ts +0 -189
- package/dist/graph/types.d.ts.map +0 -1
- package/dist/graph/types.js +0 -1
- package/dist/insights/contracts.d.ts +0 -266
- package/dist/insights/contracts.d.ts.map +0 -1
- package/dist/insights/contracts.js +0 -124
- package/dist/insights/insights-store.d.ts +0 -73
- package/dist/insights/insights-store.d.ts.map +0 -1
- package/dist/insights/insights-store.js +0 -246
- package/dist/knowledge/business-knowledge-service.d.ts +0 -24
- package/dist/knowledge/business-knowledge-service.d.ts.map +0 -1
- package/dist/knowledge/business-knowledge-service.js +0 -200
- package/dist/knowledge/graph-patch-conflict-error.d.ts +0 -8
- package/dist/knowledge/graph-patch-conflict-error.d.ts.map +0 -1
- package/dist/knowledge/graph-patch-conflict-error.js +0 -12
- package/dist/knowledge/structural-target-binding.d.ts +0 -14
- package/dist/knowledge/structural-target-binding.d.ts.map +0 -1
- package/dist/knowledge/structural-target-binding.js +0 -11
- package/dist/package-metadata.d.ts +0 -2
- package/dist/package-metadata.d.ts.map +0 -1
- package/dist/package-metadata.js +0 -9
- package/dist/repository/git-command.d.ts +0 -3
- package/dist/repository/git-command.d.ts.map +0 -1
- package/dist/repository/git-command.js +0 -25
- package/dist/repository/repository-inspector.d.ts +0 -7
- package/dist/repository/repository-inspector.d.ts.map +0 -1
- package/dist/repository/repository-inspector.js +0 -84
- package/dist/repository/repository-language-support.d.ts +0 -14
- package/dist/repository/repository-language-support.d.ts.map +0 -1
- package/dist/repository/repository-language-support.js +0 -64
- package/dist/repository/types.d.ts +0 -9
- package/dist/repository/types.d.ts.map +0 -1
- package/dist/repository/types.js +0 -1
- package/dist/runtime/sqlite-compatibility-process.d.ts +0 -8
- package/dist/runtime/sqlite-compatibility-process.d.ts.map +0 -1
- package/dist/runtime/sqlite-compatibility-process.js +0 -20
- package/dist/setup/skill-installer.d.ts +0 -20
- package/dist/setup/skill-installer.d.ts.map +0 -1
- package/dist/setup/skill-installer.js +0 -187
- package/dist/snapshots/repository-snapshot.d.ts +0 -4
- package/dist/snapshots/repository-snapshot.d.ts.map +0 -1
- package/dist/snapshots/repository-snapshot.js +0 -119
- package/dist/snapshots/types.d.ts +0 -30
- package/dist/snapshots/types.d.ts.map +0 -1
- package/dist/snapshots/types.js +0 -1
- package/dist/storage/atlas-database.d.ts +0 -19
- package/dist/storage/atlas-database.d.ts.map +0 -1
- package/dist/storage/atlas-database.js +0 -433
- package/dist/storage/snapshot-store.d.ts +0 -19
- package/dist/storage/snapshot-store.d.ts.map +0 -1
- package/dist/storage/snapshot-store.js +0 -74
- package/dist/structural-backend/codegraph-backend.d.ts +0 -57
- package/dist/structural-backend/codegraph-backend.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-backend.js +0 -1230
- package/dist/structural-backend/codegraph-worker-client.d.ts +0 -5
- package/dist/structural-backend/codegraph-worker-client.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-worker-client.js +0 -118
- package/dist/structural-backend/codegraph-worker-protocol.d.ts +0 -35
- package/dist/structural-backend/codegraph-worker-protocol.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-worker-protocol.js +0 -1
- package/dist/structural-backend/codegraph-worker.d.ts +0 -2
- package/dist/structural-backend/codegraph-worker.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-worker.js +0 -131
- package/dist/structural-backend/process-instance.d.ts +0 -18
- package/dist/structural-backend/process-instance.d.ts.map +0 -1
- package/dist/structural-backend/process-instance.js +0 -207
- package/dist/structural-backend/structural-fact-changes.d.ts +0 -7
- package/dist/structural-backend/structural-fact-changes.d.ts.map +0 -1
- package/dist/structural-backend/structural-fact-changes.js +0 -78
- package/dist/structural-backend/structural-projection-bootstrapper.d.ts +0 -10
- package/dist/structural-backend/structural-projection-bootstrapper.d.ts.map +0 -1
- package/dist/structural-backend/structural-projection-bootstrapper.js +0 -295
- package/dist/structural-backend/structural-publication.d.ts +0 -13
- package/dist/structural-backend/structural-publication.d.ts.map +0 -1
- package/dist/structural-backend/structural-publication.js +0 -255
- package/dist/structural-backend/structural-write-lock.d.ts +0 -8
- package/dist/structural-backend/structural-write-lock.d.ts.map +0 -1
- package/dist/structural-backend/structural-write-lock.js +0 -415
- package/dist/structural-backend/types.d.ts +0 -144
- package/dist/structural-backend/types.d.ts.map +0 -1
- package/dist/structural-backend/types.js +0 -11
- package/dist/world/business-map-projector.d.ts +0 -14
- package/dist/world/business-map-projector.d.ts.map +0 -1
- package/dist/world/business-map-projector.js +0 -178
- package/dist/world/types.d.ts +0 -77
- package/dist/world/types.d.ts.map +0 -1
- package/dist/world/types.js +0 -1
- package/dist/world/world-graph-query.d.ts +0 -26
- package/dist/world/world-graph-query.d.ts.map +0 -1
- package/dist/world/world-graph-query.js +0 -250
- package/dist/world/world-model-service.d.ts +0 -21
- package/dist/world/world-model-service.d.ts.map +0 -1
- package/dist/world/world-model-service.js +0 -219
- package/dist/world/world-snapshot-store.d.ts +0 -40
- package/dist/world/world-snapshot-store.d.ts.map +0 -1
- package/dist/world/world-snapshot-store.js +0 -581
- package/docs/README.md +0 -30
- package/docs/architecture/codegraph-backend.md +0 -190
- package/docs/architecture/continuous-business-learning.md +0 -240
- package/docs/contracts/cli-v1.md +0 -164
- package/docs/contracts/graph-model.md +0 -106
- package/docs/contracts/graph-patch-v1.md +0 -105
- package/docs/contracts/insights-v1.md +0 -84
- package/docs/log.md +0 -80
- package/docs/mindmaps/semantic-atlas-overview.drawio +0 -255
- package/docs/mindmaps/semantic-atlas-overview.png +0 -0
- package/docs/mindmaps/semantic-atlas-overview.zh-CN.drawio +0 -255
- package/docs/mindmaps/semantic-atlas-overview.zh-CN.png +0 -0
- package/schemas/cli-envelope-v1.schema.json +0 -1244
- package/schemas/evaluation-plan-v1.schema.json +0 -211
- package/schemas/evaluation-run-v1.schema.json +0 -659
- package/schemas/graph-patch-v1.schema.json +0 -392
- package/schemas/insights-envelope-v1.schema.json +0 -428
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
|
-
import { createRepositorySnapshot } from "../snapshots/repository-snapshot.js";
|
|
54
|
-
import { isSupportedSource } from "../repository/repository-inspector.js";
|
|
55
|
-
import { CodeGraphStructuralBackend, } from "../structural-backend/codegraph-backend.js";
|
|
56
|
-
import { StructuralProjectionBootstrapper } from "../structural-backend/structural-projection-bootstrapper.js";
|
|
57
|
-
import { requiresBundledCodeGraphRuntime, runCodeGraphWorker, } from "../structural-backend/codegraph-worker-client.js";
|
|
58
|
-
import { WorldSnapshotStore } from "./world-snapshot-store.js";
|
|
59
|
-
export class WorldModelService {
|
|
60
|
-
repository;
|
|
61
|
-
#backend;
|
|
62
|
-
constructor(repository) {
|
|
63
|
-
this.repository = repository;
|
|
64
|
-
this.#backend = new CodeGraphStructuralBackend(repository);
|
|
65
|
-
}
|
|
66
|
-
async build() {
|
|
67
|
-
return this.publish("full");
|
|
68
|
-
}
|
|
69
|
-
async sync() {
|
|
70
|
-
return this.publish("incremental");
|
|
71
|
-
}
|
|
72
|
-
state() {
|
|
73
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
74
|
-
try {
|
|
75
|
-
const store = __addDisposableResource(env_1, new WorldSnapshotStore(this.repository), false);
|
|
76
|
-
return store.readState();
|
|
77
|
-
}
|
|
78
|
-
catch (e_1) {
|
|
79
|
-
env_1.error = e_1;
|
|
80
|
-
env_1.hasError = true;
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
__disposeResources(env_1);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
currentSnapshotId() {
|
|
87
|
-
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
88
|
-
try {
|
|
89
|
-
const store = __addDisposableResource(env_2, new WorldSnapshotStore(this.repository), false);
|
|
90
|
-
return store.requireCurrentSnapshot().snapshotId;
|
|
91
|
-
}
|
|
92
|
-
catch (e_2) {
|
|
93
|
-
env_2.error = e_2;
|
|
94
|
-
env_2.hasError = true;
|
|
95
|
-
}
|
|
96
|
-
finally {
|
|
97
|
-
__disposeResources(env_2);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
async publish(mode) {
|
|
101
|
-
if (requiresBundledCodeGraphRuntime()) {
|
|
102
|
-
return runCodeGraphWorker({
|
|
103
|
-
operation: mode === "full" ? "worldBuild" : "worldSync",
|
|
104
|
-
repository: this.repository,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
let snapshot;
|
|
108
|
-
let staleAssertions = [];
|
|
109
|
-
let previousSnapshotId = null;
|
|
110
|
-
const hooks = {
|
|
111
|
-
onBuilding: async () => {
|
|
112
|
-
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
113
|
-
try {
|
|
114
|
-
snapshot = await createRepositorySnapshot(this.repository);
|
|
115
|
-
const store = __addDisposableResource(env_3, new WorldSnapshotStore(this.repository), false);
|
|
116
|
-
previousSnapshotId = store.readState().currentSnapshotId;
|
|
117
|
-
store.begin(snapshot.snapshotId);
|
|
118
|
-
}
|
|
119
|
-
catch (e_3) {
|
|
120
|
-
env_3.error = e_3;
|
|
121
|
-
env_3.hasError = true;
|
|
122
|
-
}
|
|
123
|
-
finally {
|
|
124
|
-
__disposeResources(env_3);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
prepareProjection: async () => {
|
|
128
|
-
await new StructuralProjectionBootstrapper(this.repository)
|
|
129
|
-
.bootstrap(requireBuildSnapshot(snapshot));
|
|
130
|
-
},
|
|
131
|
-
validate: async (_structural, indexedSources) => {
|
|
132
|
-
const indexedSnapshot = requireBuildSnapshot(snapshot);
|
|
133
|
-
const publishableSnapshot = await createRepositorySnapshot(this.repository);
|
|
134
|
-
const mismatch = worldPublicationMismatch(indexedSnapshot, publishableSnapshot, indexedSources);
|
|
135
|
-
if (mismatch !== null) {
|
|
136
|
-
throw new Error(`Repository changed during world publication: ${mismatch}`);
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
publish: async (structural, resolver) => {
|
|
140
|
-
const env_4 = { stack: [], error: void 0, hasError: false };
|
|
141
|
-
try {
|
|
142
|
-
const indexedSnapshot = requireBuildSnapshot(snapshot);
|
|
143
|
-
const store = __addDisposableResource(env_4, new WorldSnapshotStore(this.repository), false);
|
|
144
|
-
staleAssertions = store.publish(indexedSnapshot, structural.backendVersion, structural.extractionVersion, resolver, {
|
|
145
|
-
fromSnapshotId: previousSnapshotId,
|
|
146
|
-
toSnapshotId: indexedSnapshot.snapshotId,
|
|
147
|
-
structural: structural.changes,
|
|
148
|
-
}).staleAssertions;
|
|
149
|
-
}
|
|
150
|
-
catch (e_4) {
|
|
151
|
-
env_4.error = e_4;
|
|
152
|
-
env_4.hasError = true;
|
|
153
|
-
}
|
|
154
|
-
finally {
|
|
155
|
-
__disposeResources(env_4);
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
fail: (error) => {
|
|
159
|
-
const env_5 = { stack: [], error: void 0, hasError: false };
|
|
160
|
-
try {
|
|
161
|
-
if (snapshot === undefined) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const store = __addDisposableResource(env_5, new WorldSnapshotStore(this.repository), false);
|
|
165
|
-
store.fail(snapshot.snapshotId, error);
|
|
166
|
-
}
|
|
167
|
-
catch (e_5) {
|
|
168
|
-
env_5.error = e_5;
|
|
169
|
-
env_5.hasError = true;
|
|
170
|
-
}
|
|
171
|
-
finally {
|
|
172
|
-
__disposeResources(env_5);
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
const structural = await this.#backend.publishWorld(mode, hooks);
|
|
177
|
-
if (structural.completeness !== "complete") {
|
|
178
|
-
throw new Error(structural.diagnostics[0]?.message ?? "The structural index did not complete");
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
snapshotId: requireBuildSnapshot(snapshot).snapshotId,
|
|
182
|
-
structural,
|
|
183
|
-
staleAssertions,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
function requireBuildSnapshot(snapshot) {
|
|
188
|
-
if (snapshot === undefined) {
|
|
189
|
-
throw new Error("World publication did not capture a repository snapshot");
|
|
190
|
-
}
|
|
191
|
-
return snapshot;
|
|
192
|
-
}
|
|
193
|
-
export function worldPublicationMismatch(indexedSnapshot, publishableSnapshot, indexedSources) {
|
|
194
|
-
if (publishableSnapshot.snapshotId !== indexedSnapshot.snapshotId) {
|
|
195
|
-
return `indexed ${indexedSnapshot.snapshotId}, current ${publishableSnapshot.snapshotId}`;
|
|
196
|
-
}
|
|
197
|
-
const indexedHashes = new Map(indexedSources.map((file) => [file.path, file.contentHash]));
|
|
198
|
-
for (const file of indexedSnapshot.files) {
|
|
199
|
-
if (!isSupportedSource(file.path) || file.worktree === null) {
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
const indexedHash = indexedHashes.get(file.path);
|
|
203
|
-
if (indexedHash === undefined) {
|
|
204
|
-
return `snapshot source ${file.path} is missing from the structural index`;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
const snapshotHashes = new Map(indexedSnapshot.files.map((file) => [file.path, file.worktree?.contentHash]));
|
|
208
|
-
for (const file of indexedSources) {
|
|
209
|
-
if (!isSupportedSource(file.path)) {
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
const snapshotHash = snapshotHashes.get(file.path);
|
|
213
|
-
if (snapshotHash !== file.contentHash) {
|
|
214
|
-
return `indexed source ${file.path} has ${file.contentHash}, ` +
|
|
215
|
-
`snapshot has ${snapshotHash ?? "no content"}`;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { GitRepository } from "../repository/types.js";
|
|
2
|
-
import type { RepositorySnapshot } from "../snapshots/types.js";
|
|
3
|
-
import type { CurrentWorldSnapshot, SemanticGraphChangeOptions, SemanticGraphChanges, StructuralEvidenceResolver, WorldPublicationMetadata, WorldSnapshotState } from "./types.js";
|
|
4
|
-
interface ReconciliationResult {
|
|
5
|
-
readonly staleAssertions: readonly string[];
|
|
6
|
-
}
|
|
7
|
-
export declare class WorldSnapshotStore implements Disposable {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(repository: GitRepository);
|
|
10
|
-
readState(): WorldSnapshotState;
|
|
11
|
-
begin(targetSnapshotId: string): void;
|
|
12
|
-
publish(snapshot: RepositorySnapshot, backendVersion: string, extractionVersion: number | null, resolver: StructuralEvidenceResolver, changes: Omit<WorldPublicationMetadata, "staleAssertions">): ReconciliationResult;
|
|
13
|
-
fail(targetSnapshotId: string, error: unknown): void;
|
|
14
|
-
requireCurrentSnapshot(): RepositorySnapshot;
|
|
15
|
-
requireCurrentWorld(): CurrentWorldSnapshot;
|
|
16
|
-
readSemanticChanges(options?: SemanticGraphChangeOptions): SemanticGraphChanges | undefined;
|
|
17
|
-
private readCurrentPublication;
|
|
18
|
-
private readPublication;
|
|
19
|
-
private requirePublication;
|
|
20
|
-
private readPreviousPublication;
|
|
21
|
-
private findPublication;
|
|
22
|
-
private readSnapshot;
|
|
23
|
-
close(): void;
|
|
24
|
-
[Symbol.dispose](): void;
|
|
25
|
-
private get connection();
|
|
26
|
-
private transaction;
|
|
27
|
-
private requireBuildingSnapshot;
|
|
28
|
-
private saveSnapshot;
|
|
29
|
-
private rebindEvidence;
|
|
30
|
-
private assertionIdentity;
|
|
31
|
-
private rebindEvidenceTable;
|
|
32
|
-
private rebindStructuralRelationTargets;
|
|
33
|
-
private resolveEvidence;
|
|
34
|
-
private resolveStructuralLocator;
|
|
35
|
-
private refreshValidity;
|
|
36
|
-
private refreshValidityTable;
|
|
37
|
-
private saveWorldPublication;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=world-snapshot-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"world-snapshot-store.d.ts","sourceRoot":"","sources":["../../src/world/world-snapshot-store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EACV,oBAAoB,EAEpB,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAE1B,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAmBpB,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAwBD,qBAAa,kBAAmB,YAAW,UAAU;;gBAKvC,UAAU,EAAE,aAAa;IAMrC,SAAS,IAAI,kBAAkB;IAsC/B,KAAK,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAmBrC,OAAO,CACL,QAAQ,EAAE,kBAAkB,EAC5B,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,QAAQ,EAAE,0BAA0B,EACpC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,GACzD,oBAAoB;IAiEvB,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAoBpD,sBAAsB,IAAI,kBAAkB;IAI5C,mBAAmB,IAAI,oBAAoB;IAuB3C,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,oBAAoB,GAAG,SAAS;IAgD/F,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,YAAY;IAYpB,KAAK,IAAI,IAAI;IAIb,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAIxB,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,cAAc;IA8BtB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,mBAAmB;IA+E3B,OAAO,CAAC,+BAA+B;IAmFvC,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,wBAAwB;IAehC,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,oBAAoB;IAuD5B,OAAO,CAAC,oBAAoB;CA8B7B"}
|