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,266 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const structuralNodeKindSchema: z.ZodEnum<{
|
|
3
|
-
Repository: "Repository";
|
|
4
|
-
Module: "Module";
|
|
5
|
-
File: "File";
|
|
6
|
-
Symbol: "Symbol";
|
|
7
|
-
Test: "Test";
|
|
8
|
-
UnknownBoundary: "UnknownBoundary";
|
|
9
|
-
}>;
|
|
10
|
-
export declare const businessNodeKindSchema: z.ZodEnum<{
|
|
11
|
-
Capability: "Capability";
|
|
12
|
-
Scenario: "Scenario";
|
|
13
|
-
Operation: "Operation";
|
|
14
|
-
Invariant: "Invariant";
|
|
15
|
-
Interface: "Interface";
|
|
16
|
-
Data: "Data";
|
|
17
|
-
}>;
|
|
18
|
-
export declare const structuralRelationTypeSchema: z.ZodEnum<{
|
|
19
|
-
contains: "contains";
|
|
20
|
-
declares: "declares";
|
|
21
|
-
imports: "imports";
|
|
22
|
-
exports: "exports";
|
|
23
|
-
references: "references";
|
|
24
|
-
calls: "calls";
|
|
25
|
-
extends: "extends";
|
|
26
|
-
implements: "implements";
|
|
27
|
-
instantiates: "instantiates";
|
|
28
|
-
decorated_by: "decorated_by";
|
|
29
|
-
}>;
|
|
30
|
-
export declare const businessRelationTypeSchema: z.ZodEnum<{
|
|
31
|
-
part_of: "part_of";
|
|
32
|
-
invokes: "invokes";
|
|
33
|
-
realized_by: "realized_by";
|
|
34
|
-
reads: "reads";
|
|
35
|
-
writes: "writes";
|
|
36
|
-
publishes: "publishes";
|
|
37
|
-
consumes: "consumes";
|
|
38
|
-
constrained_by: "constrained_by";
|
|
39
|
-
verified_by: "verified_by";
|
|
40
|
-
}>;
|
|
41
|
-
export declare const businessKeySchema: z.ZodString;
|
|
42
|
-
export declare const structuralNodeIdSchema: z.ZodString;
|
|
43
|
-
export declare const relativeSourcePathSchema: z.ZodString;
|
|
44
|
-
export declare const businessNodeReferenceSchema: z.ZodObject<{
|
|
45
|
-
domain: z.ZodLiteral<"business">;
|
|
46
|
-
key: z.ZodString;
|
|
47
|
-
}, z.core.$strict>;
|
|
48
|
-
export declare const sourcePositionSchema: z.ZodObject<{
|
|
49
|
-
line: z.ZodNumber;
|
|
50
|
-
column: z.ZodNumber;
|
|
51
|
-
}, z.core.$strict>;
|
|
52
|
-
export declare const sourceRangeSchema: z.ZodObject<{
|
|
53
|
-
start: z.ZodObject<{
|
|
54
|
-
line: z.ZodNumber;
|
|
55
|
-
column: z.ZodNumber;
|
|
56
|
-
}, z.core.$strict>;
|
|
57
|
-
end: z.ZodObject<{
|
|
58
|
-
line: z.ZodNumber;
|
|
59
|
-
column: z.ZodNumber;
|
|
60
|
-
}, z.core.$strict>;
|
|
61
|
-
}, z.core.$strict>;
|
|
62
|
-
export declare const evidenceSchema: z.ZodObject<{
|
|
63
|
-
symbolId: z.ZodString;
|
|
64
|
-
file: z.ZodString;
|
|
65
|
-
range: z.ZodObject<{
|
|
66
|
-
start: z.ZodObject<{
|
|
67
|
-
line: z.ZodNumber;
|
|
68
|
-
column: z.ZodNumber;
|
|
69
|
-
}, z.core.$strict>;
|
|
70
|
-
end: z.ZodObject<{
|
|
71
|
-
line: z.ZodNumber;
|
|
72
|
-
column: z.ZodNumber;
|
|
73
|
-
}, z.core.$strict>;
|
|
74
|
-
}, z.core.$strict>;
|
|
75
|
-
contentHash: z.ZodString;
|
|
76
|
-
}, z.core.$strict>;
|
|
77
|
-
export declare const assertionCertaintySchema: z.ZodEnum<{
|
|
78
|
-
exact: "exact";
|
|
79
|
-
inferred: "inferred";
|
|
80
|
-
hypothesis: "hypothesis";
|
|
81
|
-
}>;
|
|
82
|
-
export declare const knowledgeValiditySchema: z.ZodEnum<{
|
|
83
|
-
valid: "valid";
|
|
84
|
-
stale: "stale";
|
|
85
|
-
}>;
|
|
86
|
-
export declare const structuralSupportStatusSchema: z.ZodEnum<{
|
|
87
|
-
exact: "exact";
|
|
88
|
-
inferred: "inferred";
|
|
89
|
-
unresolved: "unresolved";
|
|
90
|
-
unsupported: "unsupported";
|
|
91
|
-
}>;
|
|
92
|
-
export declare const structuralProvenanceSchema: z.ZodEnum<{
|
|
93
|
-
"tree-sitter": "tree-sitter";
|
|
94
|
-
scip: "scip";
|
|
95
|
-
heuristic: "heuristic";
|
|
96
|
-
backend: "backend";
|
|
97
|
-
}>;
|
|
98
|
-
export declare const structuralSupportSchema: z.ZodObject<{
|
|
99
|
-
status: z.ZodEnum<{
|
|
100
|
-
exact: "exact";
|
|
101
|
-
inferred: "inferred";
|
|
102
|
-
unresolved: "unresolved";
|
|
103
|
-
unsupported: "unsupported";
|
|
104
|
-
}>;
|
|
105
|
-
provenance: z.ZodEnum<{
|
|
106
|
-
"tree-sitter": "tree-sitter";
|
|
107
|
-
scip: "scip";
|
|
108
|
-
heuristic: "heuristic";
|
|
109
|
-
backend: "backend";
|
|
110
|
-
}>;
|
|
111
|
-
}, z.core.$strict>;
|
|
112
|
-
export declare const graphPatchV1Schema: z.ZodObject<{
|
|
113
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
114
|
-
baseSnapshotId: z.ZodString;
|
|
115
|
-
nodeOperations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
116
|
-
op: z.ZodLiteral<"upsert">;
|
|
117
|
-
node: z.ZodObject<{
|
|
118
|
-
key: z.ZodString;
|
|
119
|
-
kind: z.ZodEnum<{
|
|
120
|
-
Capability: "Capability";
|
|
121
|
-
Scenario: "Scenario";
|
|
122
|
-
Operation: "Operation";
|
|
123
|
-
Invariant: "Invariant";
|
|
124
|
-
Interface: "Interface";
|
|
125
|
-
Data: "Data";
|
|
126
|
-
}>;
|
|
127
|
-
label: z.ZodString;
|
|
128
|
-
summary: z.ZodString;
|
|
129
|
-
aliases: z.ZodArray<z.ZodString>;
|
|
130
|
-
certainty: z.ZodEnum<{
|
|
131
|
-
exact: "exact";
|
|
132
|
-
inferred: "inferred";
|
|
133
|
-
hypothesis: "hypothesis";
|
|
134
|
-
}>;
|
|
135
|
-
evidence: z.ZodArray<z.ZodObject<{
|
|
136
|
-
symbolId: z.ZodString;
|
|
137
|
-
file: z.ZodString;
|
|
138
|
-
range: z.ZodObject<{
|
|
139
|
-
start: z.ZodObject<{
|
|
140
|
-
line: z.ZodNumber;
|
|
141
|
-
column: z.ZodNumber;
|
|
142
|
-
}, z.core.$strict>;
|
|
143
|
-
end: z.ZodObject<{
|
|
144
|
-
line: z.ZodNumber;
|
|
145
|
-
column: z.ZodNumber;
|
|
146
|
-
}, z.core.$strict>;
|
|
147
|
-
}, z.core.$strict>;
|
|
148
|
-
contentHash: z.ZodString;
|
|
149
|
-
}, z.core.$strict>>;
|
|
150
|
-
}, z.core.$strict>;
|
|
151
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
152
|
-
op: z.ZodLiteral<"remove">;
|
|
153
|
-
key: z.ZodString;
|
|
154
|
-
}, z.core.$strict>], "op">>;
|
|
155
|
-
relationOperations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
156
|
-
op: z.ZodLiteral<"upsert">;
|
|
157
|
-
relation: z.ZodUnion<readonly [z.ZodObject<{
|
|
158
|
-
from: z.ZodObject<{
|
|
159
|
-
domain: z.ZodLiteral<"business">;
|
|
160
|
-
key: z.ZodString;
|
|
161
|
-
}, z.core.$strict>;
|
|
162
|
-
type: z.ZodEnum<{
|
|
163
|
-
part_of: "part_of";
|
|
164
|
-
invokes: "invokes";
|
|
165
|
-
reads: "reads";
|
|
166
|
-
writes: "writes";
|
|
167
|
-
publishes: "publishes";
|
|
168
|
-
consumes: "consumes";
|
|
169
|
-
constrained_by: "constrained_by";
|
|
170
|
-
}>;
|
|
171
|
-
to: z.ZodObject<{
|
|
172
|
-
domain: z.ZodLiteral<"business">;
|
|
173
|
-
key: z.ZodString;
|
|
174
|
-
}, z.core.$strict>;
|
|
175
|
-
certainty: z.ZodEnum<{
|
|
176
|
-
exact: "exact";
|
|
177
|
-
inferred: "inferred";
|
|
178
|
-
hypothesis: "hypothesis";
|
|
179
|
-
}>;
|
|
180
|
-
evidence: z.ZodArray<z.ZodObject<{
|
|
181
|
-
symbolId: z.ZodString;
|
|
182
|
-
file: z.ZodString;
|
|
183
|
-
range: z.ZodObject<{
|
|
184
|
-
start: z.ZodObject<{
|
|
185
|
-
line: z.ZodNumber;
|
|
186
|
-
column: z.ZodNumber;
|
|
187
|
-
}, z.core.$strict>;
|
|
188
|
-
end: z.ZodObject<{
|
|
189
|
-
line: z.ZodNumber;
|
|
190
|
-
column: z.ZodNumber;
|
|
191
|
-
}, z.core.$strict>;
|
|
192
|
-
}, z.core.$strict>;
|
|
193
|
-
contentHash: z.ZodString;
|
|
194
|
-
}, z.core.$strict>>;
|
|
195
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
196
|
-
from: z.ZodObject<{
|
|
197
|
-
domain: z.ZodLiteral<"business">;
|
|
198
|
-
key: z.ZodString;
|
|
199
|
-
}, z.core.$strict>;
|
|
200
|
-
type: z.ZodEnum<{
|
|
201
|
-
realized_by: "realized_by";
|
|
202
|
-
verified_by: "verified_by";
|
|
203
|
-
}>;
|
|
204
|
-
to: z.ZodObject<{
|
|
205
|
-
domain: z.ZodLiteral<"structural">;
|
|
206
|
-
id: z.ZodString;
|
|
207
|
-
}, z.core.$strict>;
|
|
208
|
-
certainty: z.ZodEnum<{
|
|
209
|
-
exact: "exact";
|
|
210
|
-
inferred: "inferred";
|
|
211
|
-
hypothesis: "hypothesis";
|
|
212
|
-
}>;
|
|
213
|
-
evidence: z.ZodArray<z.ZodObject<{
|
|
214
|
-
symbolId: z.ZodString;
|
|
215
|
-
file: z.ZodString;
|
|
216
|
-
range: z.ZodObject<{
|
|
217
|
-
start: z.ZodObject<{
|
|
218
|
-
line: z.ZodNumber;
|
|
219
|
-
column: z.ZodNumber;
|
|
220
|
-
}, z.core.$strict>;
|
|
221
|
-
end: z.ZodObject<{
|
|
222
|
-
line: z.ZodNumber;
|
|
223
|
-
column: z.ZodNumber;
|
|
224
|
-
}, z.core.$strict>;
|
|
225
|
-
}, z.core.$strict>;
|
|
226
|
-
contentHash: z.ZodString;
|
|
227
|
-
}, z.core.$strict>>;
|
|
228
|
-
}, z.core.$strict>]>;
|
|
229
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
230
|
-
op: z.ZodLiteral<"remove">;
|
|
231
|
-
relation: z.ZodUnion<readonly [z.ZodObject<{
|
|
232
|
-
from: z.ZodObject<{
|
|
233
|
-
domain: z.ZodLiteral<"business">;
|
|
234
|
-
key: z.ZodString;
|
|
235
|
-
}, z.core.$strict>;
|
|
236
|
-
type: z.ZodEnum<{
|
|
237
|
-
part_of: "part_of";
|
|
238
|
-
invokes: "invokes";
|
|
239
|
-
reads: "reads";
|
|
240
|
-
writes: "writes";
|
|
241
|
-
publishes: "publishes";
|
|
242
|
-
consumes: "consumes";
|
|
243
|
-
constrained_by: "constrained_by";
|
|
244
|
-
}>;
|
|
245
|
-
to: z.ZodObject<{
|
|
246
|
-
domain: z.ZodLiteral<"business">;
|
|
247
|
-
key: z.ZodString;
|
|
248
|
-
}, z.core.$strict>;
|
|
249
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
250
|
-
from: z.ZodObject<{
|
|
251
|
-
domain: z.ZodLiteral<"business">;
|
|
252
|
-
key: z.ZodString;
|
|
253
|
-
}, z.core.$strict>;
|
|
254
|
-
type: z.ZodEnum<{
|
|
255
|
-
realized_by: "realized_by";
|
|
256
|
-
verified_by: "verified_by";
|
|
257
|
-
}>;
|
|
258
|
-
to: z.ZodObject<{
|
|
259
|
-
domain: z.ZodLiteral<"structural">;
|
|
260
|
-
id: z.ZodString;
|
|
261
|
-
}, z.core.$strict>;
|
|
262
|
-
}, z.core.$strict>]>;
|
|
263
|
-
}, z.core.$strict>], "op">>;
|
|
264
|
-
}, z.core.$strict>;
|
|
265
|
-
export type GraphPatchV1 = z.infer<typeof graphPatchV1Schema>;
|
|
266
|
-
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/contracts/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB;;;;;;;EAOnC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;EAOjC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;EAWvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAUrC,CAAC;AAEH,eAAO,MAAM,iBAAiB,aAK3B,CAAC;AAEJ,eAAO,MAAM,sBAAsB,aAKhC,CAAC;AAMJ,eAAO,MAAM,wBAAwB,aAMlC,CAAC;AAEJ,eAAO,MAAM,2BAA2B;;;kBAGtC,CAAC;AAOH,eAAO,MAAM,oBAAoB;;;kBAG/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;kBAkB1B,CAAC;AAEL,eAAO,MAAM,cAAc;;;;;;;;;;;;;;kBAMvB,CAAC;AAEL,eAAO,MAAM,wBAAwB;;;;EAInC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;EAA6B,CAAC;AAElE,eAAO,MAAM,6BAA6B;;;;;EAKxC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;EAKrC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;kBAGlC,CAAC;AA4EH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/contracts/graph.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { contentIdentifierSchema } from "./identifiers.js";
|
|
3
|
-
export const structuralNodeKindSchema = z.enum([
|
|
4
|
-
"Repository",
|
|
5
|
-
"Module",
|
|
6
|
-
"File",
|
|
7
|
-
"Symbol",
|
|
8
|
-
"Test",
|
|
9
|
-
"UnknownBoundary",
|
|
10
|
-
]);
|
|
11
|
-
export const businessNodeKindSchema = z.enum([
|
|
12
|
-
"Capability",
|
|
13
|
-
"Scenario",
|
|
14
|
-
"Operation",
|
|
15
|
-
"Invariant",
|
|
16
|
-
"Interface",
|
|
17
|
-
"Data",
|
|
18
|
-
]);
|
|
19
|
-
export const structuralRelationTypeSchema = z.enum([
|
|
20
|
-
"contains",
|
|
21
|
-
"declares",
|
|
22
|
-
"imports",
|
|
23
|
-
"exports",
|
|
24
|
-
"references",
|
|
25
|
-
"calls",
|
|
26
|
-
"extends",
|
|
27
|
-
"implements",
|
|
28
|
-
"instantiates",
|
|
29
|
-
"decorated_by",
|
|
30
|
-
]);
|
|
31
|
-
export const businessRelationTypeSchema = z.enum([
|
|
32
|
-
"part_of",
|
|
33
|
-
"invokes",
|
|
34
|
-
"realized_by",
|
|
35
|
-
"reads",
|
|
36
|
-
"writes",
|
|
37
|
-
"publishes",
|
|
38
|
-
"consumes",
|
|
39
|
-
"constrained_by",
|
|
40
|
-
"verified_by",
|
|
41
|
-
]);
|
|
42
|
-
export const businessKeySchema = z
|
|
43
|
-
.string()
|
|
44
|
-
.regex(/^[a-z0-9]+(?:[._-][a-z0-9]+)*(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/, "Expected a stable slash-separated business key");
|
|
45
|
-
export const structuralNodeIdSchema = z
|
|
46
|
-
.string()
|
|
47
|
-
.regex(/^(?:repository|module|file|symbol|test|unknown):.+$/, "Expected a namespaced structural node ID");
|
|
48
|
-
const evidenceNodeIdSchema = z
|
|
49
|
-
.string()
|
|
50
|
-
.regex(/^(?:symbol|test):.+$/, "Expected an evidence-bearing structural symbol or test ID");
|
|
51
|
-
export const relativeSourcePathSchema = z
|
|
52
|
-
.string()
|
|
53
|
-
.min(1)
|
|
54
|
-
.regex(/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.?(?:\/|$))(?!.*\/\/).+$/, "Expected a normalized repository-relative path");
|
|
55
|
-
export const businessNodeReferenceSchema = z.strictObject({
|
|
56
|
-
domain: z.literal("business"),
|
|
57
|
-
key: businessKeySchema,
|
|
58
|
-
});
|
|
59
|
-
const structuralNodeReferenceSchema = z.strictObject({
|
|
60
|
-
domain: z.literal("structural"),
|
|
61
|
-
id: structuralNodeIdSchema,
|
|
62
|
-
});
|
|
63
|
-
export const sourcePositionSchema = z.strictObject({
|
|
64
|
-
line: z.number().int().positive(),
|
|
65
|
-
column: z.number().int().positive(),
|
|
66
|
-
});
|
|
67
|
-
export const sourceRangeSchema = z
|
|
68
|
-
.strictObject({
|
|
69
|
-
start: sourcePositionSchema,
|
|
70
|
-
end: sourcePositionSchema,
|
|
71
|
-
})
|
|
72
|
-
.superRefine((range, context) => {
|
|
73
|
-
const endsBeforeStart = range.end.line < range.start.line ||
|
|
74
|
-
(range.end.line === range.start.line &&
|
|
75
|
-
range.end.column < range.start.column);
|
|
76
|
-
if (endsBeforeStart) {
|
|
77
|
-
context.addIssue({
|
|
78
|
-
code: "custom",
|
|
79
|
-
message: "Source range end must not precede its start",
|
|
80
|
-
path: ["end"],
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
export const evidenceSchema = z
|
|
85
|
-
.strictObject({
|
|
86
|
-
symbolId: evidenceNodeIdSchema,
|
|
87
|
-
file: relativeSourcePathSchema,
|
|
88
|
-
range: sourceRangeSchema,
|
|
89
|
-
contentHash: contentIdentifierSchema,
|
|
90
|
-
});
|
|
91
|
-
export const assertionCertaintySchema = z.enum([
|
|
92
|
-
"exact",
|
|
93
|
-
"inferred",
|
|
94
|
-
"hypothesis",
|
|
95
|
-
]);
|
|
96
|
-
export const knowledgeValiditySchema = z.enum(["valid", "stale"]);
|
|
97
|
-
export const structuralSupportStatusSchema = z.enum([
|
|
98
|
-
"exact",
|
|
99
|
-
"inferred",
|
|
100
|
-
"unresolved",
|
|
101
|
-
"unsupported",
|
|
102
|
-
]);
|
|
103
|
-
export const structuralProvenanceSchema = z.enum([
|
|
104
|
-
"tree-sitter",
|
|
105
|
-
"scip",
|
|
106
|
-
"heuristic",
|
|
107
|
-
"backend",
|
|
108
|
-
]);
|
|
109
|
-
export const structuralSupportSchema = z.strictObject({
|
|
110
|
-
status: structuralSupportStatusSchema,
|
|
111
|
-
provenance: structuralProvenanceSchema,
|
|
112
|
-
});
|
|
113
|
-
const businessNodeSchema = z.strictObject({
|
|
114
|
-
key: businessKeySchema,
|
|
115
|
-
kind: businessNodeKindSchema,
|
|
116
|
-
label: z.string().min(1),
|
|
117
|
-
summary: z.string().min(1),
|
|
118
|
-
aliases: z.array(z.string().min(1)),
|
|
119
|
-
certainty: assertionCertaintySchema,
|
|
120
|
-
evidence: z.array(evidenceSchema).min(1),
|
|
121
|
-
});
|
|
122
|
-
const businessTargetRelationTypeSchema = z.enum([
|
|
123
|
-
"part_of",
|
|
124
|
-
"invokes",
|
|
125
|
-
"reads",
|
|
126
|
-
"writes",
|
|
127
|
-
"publishes",
|
|
128
|
-
"consumes",
|
|
129
|
-
"constrained_by",
|
|
130
|
-
]);
|
|
131
|
-
const structuralTargetRelationTypeSchema = z.enum([
|
|
132
|
-
"realized_by",
|
|
133
|
-
"verified_by",
|
|
134
|
-
]);
|
|
135
|
-
const businessTargetRelationSelectorSchema = z.strictObject({
|
|
136
|
-
from: businessNodeReferenceSchema,
|
|
137
|
-
type: businessTargetRelationTypeSchema,
|
|
138
|
-
to: businessNodeReferenceSchema,
|
|
139
|
-
});
|
|
140
|
-
const structuralTargetRelationSelectorSchema = z.strictObject({
|
|
141
|
-
from: businessNodeReferenceSchema,
|
|
142
|
-
type: structuralTargetRelationTypeSchema,
|
|
143
|
-
to: structuralNodeReferenceSchema,
|
|
144
|
-
});
|
|
145
|
-
const relationSelectorSchema = z.union([
|
|
146
|
-
businessTargetRelationSelectorSchema,
|
|
147
|
-
structuralTargetRelationSelectorSchema,
|
|
148
|
-
]);
|
|
149
|
-
const assertionShape = {
|
|
150
|
-
certainty: assertionCertaintySchema,
|
|
151
|
-
evidence: z.array(evidenceSchema).min(1),
|
|
152
|
-
};
|
|
153
|
-
const learnedRelationSchema = z.union([
|
|
154
|
-
businessTargetRelationSelectorSchema.extend(assertionShape),
|
|
155
|
-
structuralTargetRelationSelectorSchema.extend(assertionShape),
|
|
156
|
-
]);
|
|
157
|
-
const nodeOperationSchema = z.discriminatedUnion("op", [
|
|
158
|
-
z.strictObject({
|
|
159
|
-
op: z.literal("upsert"),
|
|
160
|
-
node: businessNodeSchema,
|
|
161
|
-
}),
|
|
162
|
-
z.strictObject({
|
|
163
|
-
op: z.literal("remove"),
|
|
164
|
-
key: businessKeySchema,
|
|
165
|
-
}),
|
|
166
|
-
]);
|
|
167
|
-
const relationOperationSchema = z.discriminatedUnion("op", [
|
|
168
|
-
z.strictObject({
|
|
169
|
-
op: z.literal("upsert"),
|
|
170
|
-
relation: learnedRelationSchema,
|
|
171
|
-
}),
|
|
172
|
-
z.strictObject({
|
|
173
|
-
op: z.literal("remove"),
|
|
174
|
-
relation: relationSelectorSchema,
|
|
175
|
-
}),
|
|
176
|
-
]);
|
|
177
|
-
export const graphPatchV1Schema = z.strictObject({
|
|
178
|
-
schemaVersion: z.literal(1),
|
|
179
|
-
baseSnapshotId: contentIdentifierSchema,
|
|
180
|
-
nodeOperations: z.array(nodeOperationSchema),
|
|
181
|
-
relationOperations: z.array(relationOperationSchema),
|
|
182
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../../src/contracts/identifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,aAEuB,CAAC;AAE5D,eAAO,MAAM,iBAAiB,aAEyC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-contracts.d.ts","sourceRoot":"","sources":["../../src/contracts/public-contracts.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type EvaluationRunSummary } from "./contracts.js";
|
|
2
|
-
export interface EvaluationPairSummary {
|
|
3
|
-
readonly caseId: string;
|
|
4
|
-
readonly noAtlas: EvaluationRunSummary;
|
|
5
|
-
readonly atlas: EvaluationRunSummary;
|
|
6
|
-
readonly noRegression: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface EvaluationComparison {
|
|
9
|
-
readonly pairs: readonly EvaluationPairSummary[];
|
|
10
|
-
readonly medians: {
|
|
11
|
-
readonly noAtlas: EvaluationUsageMedian;
|
|
12
|
-
readonly atlas: EvaluationUsageMedian;
|
|
13
|
-
};
|
|
14
|
-
readonly reductions: {
|
|
15
|
-
readonly openedFilePercent: number;
|
|
16
|
-
readonly sourceTokenPercent: number;
|
|
17
|
-
};
|
|
18
|
-
readonly gate: {
|
|
19
|
-
readonly noRegression: boolean;
|
|
20
|
-
readonly uncertaintyHandled: boolean;
|
|
21
|
-
readonly reductionThresholdMet: boolean;
|
|
22
|
-
readonly passed: boolean;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export interface EvaluationUsageMedian {
|
|
26
|
-
readonly openedFileCount: number;
|
|
27
|
-
readonly sourceTokens: number;
|
|
28
|
-
}
|
|
29
|
-
export declare function summarizeEvaluationComparison(rawPlan: unknown, rawRuns: readonly unknown[]): EvaluationComparison;
|
|
30
|
-
//# sourceMappingURL=comparison.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../src/evaluation/comparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAUxB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;QACxC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;KACvC,CAAC;IACF,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;QACnC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;KACrC,CAAC;IACF,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;QACrC,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;QACxC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,OAAO,EAAE,GAC1B,oBAAoB,CA2DtB"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { evaluationPlanSchema, evaluationRunSchema, summarizeEvaluationRun, } from "./contracts.js";
|
|
2
|
-
const REDUCTION_GATE_PERCENT = 30;
|
|
3
|
-
const UNCERTAINTY_FAILURES = new Set([
|
|
4
|
-
"stale-knowledge",
|
|
5
|
-
"hypothesis-mishandled",
|
|
6
|
-
"unknown-boundary-mishandled",
|
|
7
|
-
"unsupported-source",
|
|
8
|
-
]);
|
|
9
|
-
export function summarizeEvaluationComparison(rawPlan, rawRuns) {
|
|
10
|
-
const plan = evaluationPlanSchema.parse(rawPlan);
|
|
11
|
-
const runs = rawRuns.map((run) => evaluationRunSchema.parse(run));
|
|
12
|
-
requireUniqueRunIds(runs);
|
|
13
|
-
const pairs = plan.cases.map((evaluationCase) => {
|
|
14
|
-
const caseRuns = runs.filter((run) => run.caseId === evaluationCase.id);
|
|
15
|
-
const noAtlas = requireModeRun(evaluationCase.id, caseRuns, "no-atlas");
|
|
16
|
-
const atlas = requireModeRun(evaluationCase.id, caseRuns, "atlas");
|
|
17
|
-
requireProtocolParity(noAtlas, atlas);
|
|
18
|
-
const noAtlasSummary = summarizeEvaluationRun(evaluationCase, noAtlas);
|
|
19
|
-
const atlasSummary = summarizeEvaluationRun(evaluationCase, atlas);
|
|
20
|
-
return {
|
|
21
|
-
caseId: evaluationCase.id,
|
|
22
|
-
noAtlas: noAtlasSummary,
|
|
23
|
-
atlas: atlasSummary,
|
|
24
|
-
noRegression: preservesOutcome(noAtlasSummary, atlasSummary),
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
const plannedCases = new Set(plan.cases.map((evaluationCase) => evaluationCase.id));
|
|
28
|
-
const unexpectedRun = runs.find((run) => !plannedCases.has(run.caseId));
|
|
29
|
-
if (unexpectedRun !== undefined) {
|
|
30
|
-
throw new Error(`Run ${unexpectedRun.runId} references unknown case ${unexpectedRun.caseId}`);
|
|
31
|
-
}
|
|
32
|
-
const medians = {
|
|
33
|
-
noAtlas: usageMedian(pairs.map((pair) => pair.noAtlas)),
|
|
34
|
-
atlas: usageMedian(pairs.map((pair) => pair.atlas)),
|
|
35
|
-
};
|
|
36
|
-
const reductions = {
|
|
37
|
-
openedFilePercent: reductionPercent(medians.noAtlas.openedFileCount, medians.atlas.openedFileCount),
|
|
38
|
-
sourceTokenPercent: reductionPercent(medians.noAtlas.sourceTokens, medians.atlas.sourceTokens),
|
|
39
|
-
};
|
|
40
|
-
const noRegression = pairs.every((pair) => pair.noRegression);
|
|
41
|
-
const uncertaintyHandled = pairs.every((pair) => (pair.atlas.failureClassifications.every((failure) => !UNCERTAINTY_FAILURES.has(failure))));
|
|
42
|
-
const reductionThresholdMet = reductions.openedFilePercent >= REDUCTION_GATE_PERCENT
|
|
43
|
-
|| reductions.sourceTokenPercent >= REDUCTION_GATE_PERCENT;
|
|
44
|
-
return {
|
|
45
|
-
pairs,
|
|
46
|
-
medians,
|
|
47
|
-
reductions,
|
|
48
|
-
gate: {
|
|
49
|
-
noRegression,
|
|
50
|
-
uncertaintyHandled,
|
|
51
|
-
reductionThresholdMet,
|
|
52
|
-
passed: noRegression && uncertaintyHandled && reductionThresholdMet,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function requireUniqueRunIds(runs) {
|
|
57
|
-
const runIds = new Set();
|
|
58
|
-
for (const run of runs) {
|
|
59
|
-
if (runIds.has(run.runId)) {
|
|
60
|
-
throw new Error(`Evaluation run ID ${run.runId} is duplicated`);
|
|
61
|
-
}
|
|
62
|
-
runIds.add(run.runId);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function requireModeRun(caseId, runs, mode) {
|
|
66
|
-
const matches = runs.filter((run) => run.mode === mode);
|
|
67
|
-
if (matches.length !== 1 || runs.length !== 2) {
|
|
68
|
-
throw new Error(`Evaluation case ${caseId} requires exactly one no-atlas and one atlas run`);
|
|
69
|
-
}
|
|
70
|
-
return matches[0];
|
|
71
|
-
}
|
|
72
|
-
function requireProtocolParity(noAtlas, atlas) {
|
|
73
|
-
const comparable = [
|
|
74
|
-
noAtlas.agent.product === atlas.agent.product,
|
|
75
|
-
noAtlas.agent.model === atlas.agent.model,
|
|
76
|
-
noAtlas.protocol.fixtureCommit === atlas.protocol.fixtureCommit,
|
|
77
|
-
noAtlas.protocol.instructionsHash === atlas.protocol.instructionsHash,
|
|
78
|
-
noAtlas.protocol.toolPolicyHash === atlas.protocol.toolPolicyHash,
|
|
79
|
-
noAtlas.observations.sourceTokenMethod === atlas.observations.sourceTokenMethod,
|
|
80
|
-
];
|
|
81
|
-
if (comparable.some((matches) => !matches)) {
|
|
82
|
-
throw new Error("Paired runs require the same agent product, model, fixture commit, instructions, "
|
|
83
|
-
+ "tool policy, and source-token method");
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function preservesOutcome(noAtlas, atlas) {
|
|
87
|
-
return Number(atlas.correct) >= Number(noAtlas.correct)
|
|
88
|
-
&& atlas.requiredFileRecall >= noAtlas.requiredFileRecall
|
|
89
|
-
&& atlas.requiredSymbolRecall >= noAtlas.requiredSymbolRecall;
|
|
90
|
-
}
|
|
91
|
-
function usageMedian(runs) {
|
|
92
|
-
return {
|
|
93
|
-
openedFileCount: median(runs.map((run) => run.openedFileCount)),
|
|
94
|
-
sourceTokens: median(runs.map((run) => run.sourceTokens)),
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function median(values) {
|
|
98
|
-
const sorted = [...values].sort((left, right) => left - right);
|
|
99
|
-
const middle = Math.floor(sorted.length / 2);
|
|
100
|
-
return sorted.length % 2 === 0
|
|
101
|
-
? (sorted[middle - 1] + sorted[middle]) / 2
|
|
102
|
-
: sorted[middle];
|
|
103
|
-
}
|
|
104
|
-
function reductionPercent(baseline, candidate) {
|
|
105
|
-
if (baseline === 0)
|
|
106
|
-
return candidate === 0 ? 0 : -100;
|
|
107
|
-
return Math.round(((baseline - candidate) / baseline) * 10_000) / 100;
|
|
108
|
-
}
|