@descryy/core 0.4.0 → 0.5.1
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/dist/budget/reply.d.ts +11 -46
- package/dist/budget/reply.d.ts.map +1 -1
- package/dist/budget/reply.js +10 -39
- package/dist/budget/reply.js.map +1 -1
- package/dist/budget/size.d.ts +2 -21
- package/dist/budget/size.d.ts.map +1 -1
- package/dist/budget/size.js +3 -24
- package/dist/budget/size.js.map +1 -1
- package/dist/capabilities/preconditions.d.ts +7 -68
- package/dist/capabilities/preconditions.d.ts.map +1 -1
- package/dist/capabilities/preconditions.js +6 -57
- package/dist/capabilities/preconditions.js.map +1 -1
- package/dist/contracts/engine.d.ts +23 -11
- package/dist/contracts/engine.d.ts.map +1 -1
- package/dist/contracts/engine.js +23 -11
- package/dist/contracts/engine.js.map +1 -1
- package/dist/contracts/orphans.d.ts +18 -122
- package/dist/contracts/orphans.d.ts.map +1 -1
- package/dist/contracts/orphans.js +36 -134
- package/dist/contracts/orphans.js.map +1 -1
- package/dist/contracts/paths.d.ts +4 -114
- package/dist/contracts/paths.d.ts.map +1 -1
- package/dist/contracts/paths.js +7 -140
- package/dist/contracts/paths.js.map +1 -1
- package/dist/contracts/shapes.d.ts +13 -66
- package/dist/contracts/shapes.d.ts.map +1 -1
- package/dist/contracts/shapes.js +20 -91
- package/dist/contracts/shapes.js.map +1 -1
- package/dist/governance/budget.d.ts +12 -48
- package/dist/governance/budget.d.ts.map +1 -1
- package/dist/governance/budget.js +12 -48
- package/dist/governance/budget.js.map +1 -1
- package/dist/governance/candidate-boundary.d.ts +4 -32
- package/dist/governance/candidate-boundary.d.ts.map +1 -1
- package/dist/governance/candidate-boundary.js +4 -32
- package/dist/governance/candidate-boundary.js.map +1 -1
- package/dist/governance/escalation.d.ts +7 -45
- package/dist/governance/escalation.d.ts.map +1 -1
- package/dist/governance/escalation.js +7 -45
- package/dist/governance/escalation.js.map +1 -1
- package/dist/governance/fact-boundary.d.ts +7 -49
- package/dist/governance/fact-boundary.d.ts.map +1 -1
- package/dist/governance/fact-boundary.js +5 -43
- package/dist/governance/fact-boundary.js.map +1 -1
- package/dist/governance/finding-funnel.d.ts +11 -72
- package/dist/governance/finding-funnel.d.ts.map +1 -1
- package/dist/governance/finding-funnel.js +9 -68
- package/dist/governance/finding-funnel.js.map +1 -1
- package/dist/graph/build.d.ts +9 -90
- package/dist/graph/build.d.ts.map +1 -1
- package/dist/graph/build.js +15 -62
- package/dist/graph/build.js.map +1 -1
- package/dist/graph/cross-language.d.ts +4 -43
- package/dist/graph/cross-language.d.ts.map +1 -1
- package/dist/graph/cross-language.js +9 -77
- package/dist/graph/cross-language.js.map +1 -1
- package/dist/graph/merge.d.ts +8 -88
- package/dist/graph/merge.d.ts.map +1 -1
- package/dist/graph/merge.js +9 -93
- package/dist/graph/merge.js.map +1 -1
- package/dist/graph/observed-tests.d.ts +7 -68
- package/dist/graph/observed-tests.d.ts.map +1 -1
- package/dist/graph/observed-tests.js +5 -60
- package/dist/graph/observed-tests.js.map +1 -1
- package/dist/graph/persist.d.ts +2 -25
- package/dist/graph/persist.d.ts.map +1 -1
- package/dist/graph/persist.js +2 -25
- package/dist/graph/persist.js.map +1 -1
- package/dist/graph/runtime-confirmation.d.ts +14 -91
- package/dist/graph/runtime-confirmation.d.ts.map +1 -1
- package/dist/graph/runtime-confirmation.js +19 -103
- package/dist/graph/runtime-confirmation.js.map +1 -1
- package/dist/ledger/mint.d.ts +9 -43
- package/dist/ledger/mint.d.ts.map +1 -1
- package/dist/ledger/mint.js +15 -65
- package/dist/ledger/mint.js.map +1 -1
- package/dist/ledger/resolve.d.ts +13 -81
- package/dist/ledger/resolve.d.ts.map +1 -1
- package/dist/ledger/resolve.js +13 -76
- package/dist/ledger/resolve.js.map +1 -1
- package/dist/multipr/fingerprint.d.ts +5 -46
- package/dist/multipr/fingerprint.d.ts.map +1 -1
- package/dist/multipr/fingerprint.js +22 -74
- package/dist/multipr/fingerprint.js.map +1 -1
- package/dist/multipr/hidden-dependency.d.ts +13 -73
- package/dist/multipr/hidden-dependency.d.ts.map +1 -1
- package/dist/multipr/hidden-dependency.js +12 -63
- package/dist/multipr/hidden-dependency.js.map +1 -1
- package/dist/multipr/mechanical.d.ts +25 -160
- package/dist/multipr/mechanical.d.ts.map +1 -1
- package/dist/multipr/mechanical.js +21 -137
- package/dist/multipr/mechanical.js.map +1 -1
- package/dist/multipr/migration-heads.d.ts +18 -105
- package/dist/multipr/migration-heads.d.ts.map +1 -1
- package/dist/multipr/migration-heads.js +15 -84
- package/dist/multipr/migration-heads.js.map +1 -1
- package/dist/multipr/overlap.d.ts +16 -94
- package/dist/multipr/overlap.d.ts.map +1 -1
- package/dist/multipr/overlap.js +25 -105
- package/dist/multipr/overlap.js.map +1 -1
- package/dist/multipr/scope-store.d.ts +15 -80
- package/dist/multipr/scope-store.d.ts.map +1 -1
- package/dist/multipr/scope-store.js +17 -87
- package/dist/multipr/scope-store.js.map +1 -1
- package/dist/multipr/superseded.d.ts +10 -95
- package/dist/multipr/superseded.d.ts.map +1 -1
- package/dist/multipr/superseded.js +7 -60
- package/dist/multipr/superseded.js.map +1 -1
- package/dist/query/confirmed-facts.d.ts +12 -58
- package/dist/query/confirmed-facts.d.ts.map +1 -1
- package/dist/query/confirmed-facts.js +8 -47
- package/dist/query/confirmed-facts.js.map +1 -1
- package/dist/query/declared-value-closure.d.ts +13 -104
- package/dist/query/declared-value-closure.d.ts.map +1 -1
- package/dist/query/declared-value-closure.js +15 -104
- package/dist/query/declared-value-closure.js.map +1 -1
- package/dist/query/memory.d.ts +4 -16
- package/dist/query/memory.d.ts.map +1 -1
- package/dist/query/memory.js +9 -22
- package/dist/query/memory.js.map +1 -1
- package/dist/query/prominence.d.ts +6 -55
- package/dist/query/prominence.d.ts.map +1 -1
- package/dist/query/prominence.js +6 -55
- package/dist/query/prominence.js.map +1 -1
- package/dist/query/provider.d.ts +27 -93
- package/dist/query/provider.d.ts.map +1 -1
- package/dist/query/provider.js +8 -29
- package/dist/query/provider.js.map +1 -1
- package/dist/query/queries.d.ts +15 -65
- package/dist/query/queries.d.ts.map +1 -1
- package/dist/query/queries.js +30 -104
- package/dist/query/queries.js.map +1 -1
- package/dist/query/refusal-fetch.d.ts +8 -85
- package/dist/query/refusal-fetch.d.ts.map +1 -1
- package/dist/query/refusal-fetch.js +11 -93
- package/dist/query/refusal-fetch.js.map +1 -1
- package/dist/query/refusal-questions.d.ts +17 -92
- package/dist/query/refusal-questions.d.ts.map +1 -1
- package/dist/query/refusal-questions.js +14 -78
- package/dist/query/refusal-questions.js.map +1 -1
- package/dist/query/resolution-floor.d.ts +3 -23
- package/dist/query/resolution-floor.d.ts.map +1 -1
- package/dist/query/resolution-floor.js +3 -23
- package/dist/query/resolution-floor.js.map +1 -1
- package/dist/query/root-cause-score.d.ts +11 -161
- package/dist/query/root-cause-score.d.ts.map +1 -1
- package/dist/query/root-cause-score.js +6 -137
- package/dist/query/root-cause-score.js.map +1 -1
- package/dist/query/row-closure-picture.d.ts +5 -67
- package/dist/query/row-closure-picture.d.ts.map +1 -1
- package/dist/query/row-closure-picture.js +6 -67
- package/dist/query/row-closure-picture.js.map +1 -1
- package/dist/query/similar-incidents.d.ts +6 -41
- package/dist/query/similar-incidents.d.ts.map +1 -1
- package/dist/query/similar-incidents.js +15 -69
- package/dist/query/similar-incidents.js.map +1 -1
- package/dist/query/sqlite.d.ts +3 -7
- package/dist/query/sqlite.d.ts.map +1 -1
- package/dist/query/sqlite.js +9 -19
- package/dist/query/sqlite.js.map +1 -1
- package/dist/query/test-coverage.d.ts +5 -45
- package/dist/query/test-coverage.d.ts.map +1 -1
- package/dist/query/test-coverage.js +10 -53
- package/dist/query/test-coverage.js.map +1 -1
- package/dist/query/traverse.d.ts +22 -126
- package/dist/query/traverse.d.ts.map +1 -1
- package/dist/query/traverse.js +25 -126
- package/dist/query/traverse.js.map +1 -1
- package/dist/query/unresolved.d.ts +19 -164
- package/dist/query/unresolved.d.ts.map +1 -1
- package/dist/query/unresolved.js +11 -138
- package/dist/query/unresolved.js.map +1 -1
- package/dist/query/verification-status.d.ts +12 -109
- package/dist/query/verification-status.d.ts.map +1 -1
- package/dist/query/verification-status.js +9 -99
- package/dist/query/verification-status.js.map +1 -1
- package/dist/recording/migrate.d.ts +4 -10
- package/dist/recording/migrate.d.ts.map +1 -1
- package/dist/recording/migrate.js +4 -10
- package/dist/recording/migrate.js.map +1 -1
- package/dist/recording/reader.d.ts +2 -7
- package/dist/recording/reader.d.ts.map +1 -1
- package/dist/recording/reader.js +2 -7
- package/dist/recording/reader.js.map +1 -1
- package/dist/recording/redact.d.ts +6 -57
- package/dist/recording/redact.d.ts.map +1 -1
- package/dist/recording/redact.js +8 -64
- package/dist/recording/redact.js.map +1 -1
- package/dist/recording/schema.d.ts +3 -38
- package/dist/recording/schema.d.ts.map +1 -1
- package/dist/recording/schema.js +3 -38
- package/dist/recording/schema.js.map +1 -1
- package/dist/recording/writer.d.ts +11 -74
- package/dist/recording/writer.d.ts.map +1 -1
- package/dist/recording/writer.js +3 -43
- package/dist/recording/writer.js.map +1 -1
- package/dist/scoping/fanout.d.ts +6 -68
- package/dist/scoping/fanout.d.ts.map +1 -1
- package/dist/scoping/fanout.js +6 -68
- package/dist/scoping/fanout.js.map +1 -1
- package/dist/scoping/score.d.ts +20 -70
- package/dist/scoping/score.d.ts.map +1 -1
- package/dist/scoping/score.js +20 -70
- package/dist/scoping/score.js.map +1 -1
- package/dist/scoping/tiers.d.ts +4 -16
- package/dist/scoping/tiers.d.ts.map +1 -1
- package/dist/scoping/tiers.js +4 -16
- package/dist/scoping/tiers.js.map +1 -1
- package/dist/scoping/traverse.d.ts +3 -25
- package/dist/scoping/traverse.d.ts.map +1 -1
- package/dist/scoping/traverse.js +14 -49
- package/dist/scoping/traverse.js.map +1 -1
- package/dist/scoping/weights.d.ts +10 -74
- package/dist/scoping/weights.d.ts.map +1 -1
- package/dist/scoping/weights.js +14 -86
- package/dist/scoping/weights.js.map +1 -1
- package/dist/sources/confirmed/incidents.d.ts +5 -35
- package/dist/sources/confirmed/incidents.d.ts.map +1 -1
- package/dist/sources/confirmed/incidents.js +14 -48
- package/dist/sources/confirmed/incidents.js.map +1 -1
- package/dist/sources/git/diff.d.ts +93 -63
- package/dist/sources/git/diff.d.ts.map +1 -1
- package/dist/sources/git/diff.js +200 -81
- package/dist/sources/git/diff.js.map +1 -1
- package/dist/sources/git/env.d.ts +7 -0
- package/dist/sources/git/env.d.ts.map +1 -1
- package/dist/sources/git/env.js +10 -11
- package/dist/sources/git/env.js.map +1 -1
- package/dist/sources/git/history.d.ts +64 -84
- package/dist/sources/git/history.d.ts.map +1 -1
- package/dist/sources/git/history.js +141 -112
- package/dist/sources/git/history.js.map +1 -1
- package/dist/sources/git/incidents.d.ts +13 -75
- package/dist/sources/git/incidents.d.ts.map +1 -1
- package/dist/sources/git/incidents.js +21 -91
- package/dist/sources/git/incidents.js.map +1 -1
- package/dist/sources/git/index.d.ts +5 -3
- package/dist/sources/git/index.d.ts.map +1 -1
- package/dist/sources/git/index.js +3 -2
- package/dist/sources/git/index.js.map +1 -1
- package/dist/sources/git/source.d.ts +9 -79
- package/dist/sources/git/source.d.ts.map +1 -1
- package/dist/sources/git/source.js +33 -133
- package/dist/sources/git/source.js.map +1 -1
- package/dist/sources/migrations/across-change.d.ts +94 -0
- package/dist/sources/migrations/across-change.d.ts.map +1 -0
- package/dist/sources/migrations/across-change.js +278 -0
- package/dist/sources/migrations/across-change.js.map +1 -0
- package/dist/sources/migrations/dialects.d.ts +20 -36
- package/dist/sources/migrations/dialects.d.ts.map +1 -1
- package/dist/sources/migrations/dialects.js +11 -36
- package/dist/sources/migrations/dialects.js.map +1 -1
- package/dist/sources/migrations/index.d.ts +3 -1
- package/dist/sources/migrations/index.d.ts.map +1 -1
- package/dist/sources/migrations/index.js +2 -1
- package/dist/sources/migrations/index.js.map +1 -1
- package/dist/sources/migrations/read.d.ts +14 -79
- package/dist/sources/migrations/read.d.ts.map +1 -1
- package/dist/sources/migrations/read.js +14 -89
- package/dist/sources/migrations/read.js.map +1 -1
- package/dist/sources/workspace/workspace.d.ts +6 -42
- package/dist/sources/workspace/workspace.d.ts.map +1 -1
- package/dist/sources/workspace/workspace.js +10 -53
- package/dist/sources/workspace/workspace.js.map +1 -1
- package/dist/store/driver/driver.d.ts +9 -38
- package/dist/store/driver/driver.d.ts.map +1 -1
- package/dist/store/driver/driver.js +4 -22
- package/dist/store/driver/driver.js.map +1 -1
- package/dist/store/driver/node-sqlite.d.ts +3 -12
- package/dist/store/driver/node-sqlite.d.ts.map +1 -1
- package/dist/store/driver/node-sqlite.js +4 -18
- package/dist/store/driver/node-sqlite.js.map +1 -1
- package/dist/store/index.d.ts +2 -7
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +4 -10
- package/dist/store/index.js.map +1 -1
- package/dist/store/migrate.d.ts +14 -50
- package/dist/store/migrate.d.ts.map +1 -1
- package/dist/store/migrate.js +15 -52
- package/dist/store/migrate.js.map +1 -1
- package/dist/store/reader.d.ts +19 -84
- package/dist/store/reader.d.ts.map +1 -1
- package/dist/store/reader.js +25 -92
- package/dist/store/reader.js.map +1 -1
- package/dist/store/schema.d.ts +14 -76
- package/dist/store/schema.d.ts.map +1 -1
- package/dist/store/schema.js +14 -76
- package/dist/store/schema.js.map +1 -1
- package/dist/store/writer.d.ts +14 -88
- package/dist/store/writer.d.ts.map +1 -1
- package/dist/store/writer.js +29 -123
- package/dist/store/writer.js.map +1 -1
- package/dist/tiers/certify.d.ts +46 -281
- package/dist/tiers/certify.d.ts.map +1 -1
- package/dist/tiers/certify.js +46 -226
- package/dist/tiers/certify.js.map +1 -1
- package/dist/tiers/ladder.d.ts +7 -51
- package/dist/tiers/ladder.d.ts.map +1 -1
- package/dist/tiers/ladder.js +13 -89
- package/dist/tiers/ladder.js.map +1 -1
- package/dist/validation/attributes.d.ts +6 -55
- package/dist/validation/attributes.d.ts.map +1 -1
- package/dist/validation/attributes.js +6 -55
- package/dist/validation/attributes.js.map +1 -1
- package/dist/validation/config-graph.d.ts +7 -56
- package/dist/validation/config-graph.d.ts.map +1 -1
- package/dist/validation/config-graph.js +15 -61
- package/dist/validation/config-graph.js.map +1 -1
- package/dist/validation/env.d.ts +47 -8
- package/dist/validation/env.d.ts.map +1 -1
- package/dist/validation/env.js +119 -31
- package/dist/validation/env.js.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -0
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/join-substitution.d.ts +22 -120
- package/dist/validation/join-substitution.d.ts.map +1 -1
- package/dist/validation/join-substitution.js +13 -90
- package/dist/validation/join-substitution.js.map +1 -1
- package/dist/validation/migration-integrity.d.ts +11 -72
- package/dist/validation/migration-integrity.d.ts.map +1 -1
- package/dist/validation/migration-integrity.js +16 -79
- package/dist/validation/migration-integrity.js.map +1 -1
- package/dist/validation/migrations.d.ts +22 -101
- package/dist/validation/migrations.d.ts.map +1 -1
- package/dist/validation/migrations.js +19 -83
- package/dist/validation/migrations.js.map +1 -1
- package/dist/validation/nodes.d.ts +3 -1
- package/dist/validation/nodes.d.ts.map +1 -1
- package/dist/validation/nodes.js +3 -1
- package/dist/validation/nodes.js.map +1 -1
- package/dist/validation/orm-registration.d.ts +106 -0
- package/dist/validation/orm-registration.d.ts.map +1 -0
- package/dist/validation/orm-registration.js +191 -0
- package/dist/validation/orm-registration.js.map +1 -0
- package/dist/validation/rollback.d.ts +10 -73
- package/dist/validation/rollback.d.ts.map +1 -1
- package/dist/validation/rollback.js +15 -82
- package/dist/validation/rollback.js.map +1 -1
- package/dist/validation/route-drift.d.ts +9 -62
- package/dist/validation/route-drift.d.ts.map +1 -1
- package/dist/validation/route-drift.js +7 -52
- package/dist/validation/route-drift.js.map +1 -1
- package/dist/validation/sources.d.ts +16 -94
- package/dist/validation/sources.d.ts.map +1 -1
- package/dist/validation/sources.js +51 -147
- package/dist/validation/sources.js.map +1 -1
- package/dist/worker/pool.d.ts +6 -45
- package/dist/worker/pool.d.ts.map +1 -1
- package/dist/worker/pool.js +5 -42
- package/dist/worker/pool.js.map +1 -1
- package/dist/worker/protocol.d.ts +7 -20
- package/dist/worker/protocol.d.ts.map +1 -1
- package/dist/worker/protocol.js +3 -10
- package/dist/worker/protocol.js.map +1 -1
- package/dist/worker/traversal.worker.d.ts +2 -21
- package/dist/worker/traversal.worker.d.ts.map +1 -1
- package/dist/worker/traversal.worker.js +4 -23
- package/dist/worker/traversal.worker.js.map +1 -1
- package/package.json +11 -2
|
@@ -1,57 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runtime confirmation
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* > runtime. This is the one accuracy source that cannot be copied without
|
|
6
|
-
* > also building the testing half, and it should be treated as the core
|
|
7
|
-
* > technical moat rather than the graph itself."* — §11B.3
|
|
8
|
-
*
|
|
9
|
-
* The schema has held `observed_edges` and `edge_corrections` since the store
|
|
10
|
-
* was first written, both on the EARNED side of DEC-017's partition, both
|
|
11
|
-
* carrying a comment explaining why they cannot be recomputed. **Nothing read
|
|
12
|
-
* or wrote either one.** This module is what they were for.
|
|
13
|
-
*
|
|
14
|
-
* ## The three arrows §11B.3 draws, and where each one lands
|
|
15
|
-
*
|
|
16
|
-
* | Observation | What happens |
|
|
17
|
-
* | --- | --- |
|
|
18
|
-
* | confirms an edge the graph already has, below R4 | **promote** to R4, `observed_by_run` set |
|
|
19
|
-
* | confirms an edge the graph does not have | **create** it at R4 — "recall gap closed" |
|
|
20
|
-
* | denies an edge the graph has, below R4 | **correct** it: an `edge_corrections` row, and a {@link GraphDefectRecord} out |
|
|
21
|
-
*
|
|
22
|
-
* ## Why a denial demotes confidence and does not delete the edge
|
|
23
|
-
*
|
|
24
|
-
* `edges` is DERIVED. Deleting a row there is undone by the next index, which
|
|
25
|
-
* regenerates the identical guess from the identical source and has no memory
|
|
26
|
-
* of the run that disproved it — the correction would evaporate exactly when
|
|
27
|
-
* it was needed again. §11B.5 already states the answer: corrections are
|
|
28
|
-
* *"stored as graph overrides keyed by stable node IDs, surviving re-index and
|
|
29
|
-
* adapter upgrades."* So the durable statement is the `edge_corrections` row,
|
|
30
|
-
* and the effect on the derived graph is a confidence demotion that
|
|
31
|
-
* {@link reapplyEarnedOverlays} re-applies after every rebuild.
|
|
32
|
-
*
|
|
33
|
-
* Demotion rather than deletion is also DEC-284's own stated direction — *"it
|
|
34
|
-
* fails toward demote, which is the safe direction"* — and it keeps rule 2
|
|
35
|
-
* intact from the other side: a wrong edge stops being load-bearing without
|
|
36
|
-
* the graph asserting a *new* fact (that the call does not exist) that no
|
|
37
|
-
* single observation actually establishes.
|
|
38
|
-
*
|
|
39
|
-
* ## What this module refuses to do
|
|
40
|
-
*
|
|
41
|
-
* - **Invent a node.** An observation naming a node this graph does not hold
|
|
42
|
-
* is refused with its reason, never created. Rule 2, and the same posture
|
|
43
|
-
* `correlateExecution` takes one layer down for an ambiguous resolution.
|
|
44
|
-
* - **Adjudicate R4 against R4.** A denial against an edge already at R4 is
|
|
45
|
-
* two runtime observations disagreeing across time — a staleness question
|
|
46
|
-
* whose policy is decided (DEC-284 + a 7-day backstop) but whose consumer
|
|
47
|
-
* does not exist yet. `contradiction.ts` excludes the case by construction
|
|
48
|
-
* and this module reports it as {@link RuntimeConfirmationResult.staleR4}
|
|
49
|
-
* rather than laundering it through a path that looks decided.
|
|
50
|
-
* - **Judge a finding.** Resolution has no opinion on confidence (RT-027).
|
|
51
|
-
* Nothing here reads or writes a finding, a hypothesis or a category.
|
|
52
|
-
*
|
|
53
|
-
* @see `packages/ir/src/contradiction.ts` — the pure detection this persists.
|
|
54
|
-
* @see `documents/plans/ai-layer-plan.md` §10 — *"the valuable half."*
|
|
2
|
+
* Runtime confirmation (§11B.3, the R4 moat): what `observed_edges`/`edge_corrections` (EARNED, DEC-017) were for.
|
|
3
|
+
* Confirms → promote/create at R4; denies → demote confidence, never delete (edges are DERIVED; DEC-284 fails toward demote).
|
|
4
|
+
* Refuses to invent nodes (rule 2), adjudicate R4-vs-R4 (`staleR4`), or judge a finding (RT-027).
|
|
55
5
|
*/
|
|
56
6
|
import { type EdgeType, type GraphDefectRecord, type RuntimeEdgeObservation } from "@descryy/ir";
|
|
57
7
|
import type { SqlDriver } from "../store/driver/driver.ts";
|
|
@@ -104,39 +54,18 @@ export interface EdgeCorrectionRow {
|
|
|
104
54
|
readonly reason: string;
|
|
105
55
|
readonly correctedAt: number;
|
|
106
56
|
}
|
|
107
|
-
/**
|
|
108
|
-
* A clock, injected so a test can pin `observed_at`/`corrected_at`. Same shape
|
|
109
|
-
* the store's own tests already use.
|
|
110
|
-
*/
|
|
57
|
+
/** Injected clock so a test can pin `observed_at`/`corrected_at`. */
|
|
111
58
|
export interface Clock {
|
|
112
59
|
now(): number;
|
|
113
60
|
}
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* Pure with respect to its inputs and total over them: every observation lands
|
|
119
|
-
* in exactly one of the six result arrays, so a caller can account for all of
|
|
120
|
-
* them without inspecting the store. Never throws for an observation it cannot
|
|
121
|
-
* act on — that is a refusal, per the five-result-states rule the tool contract
|
|
122
|
-
* applies one layer up.
|
|
123
|
-
*/
|
|
61
|
+
/** Applies a run's edge observations, writing the earned record and projecting
|
|
62
|
+
* it onto derived edges in one transaction. Every observation lands in exactly
|
|
63
|
+
* one result array; never throws — an unactionable one is a refusal. */
|
|
124
64
|
export declare function applyRuntimeObservations(driver: SqlDriver, input: RuntimeConfirmationInput, clock?: Clock): RuntimeConfirmationResult;
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* `edges` and leaves `observed_edges`/`edge_corrections` standing; a re-index
|
|
130
|
-
* then regenerates the same static guesses, at their static resolutions, with
|
|
131
|
-
* no memory of any run. Without this call the moat is silently reset on every
|
|
132
|
-
* rebuild — the edges would be back at R2 and the R4 rows would sit in a table
|
|
133
|
-
* nothing consults, which is indistinguishable from never having observed
|
|
134
|
-
* anything.
|
|
135
|
-
*
|
|
136
|
-
* Observations whose endpoints no longer exist are reported as refusals rather
|
|
137
|
-
* than recreated: the code moved, and re-minting a node from an old run's
|
|
138
|
-
* record would be the same rule-2 violation one rebuild later.
|
|
139
|
-
*/
|
|
65
|
+
/** Re-projects the EARNED ledgers onto a freshly rebuilt derived graph — what
|
|
66
|
+
* makes the DEC-017 partition pay. Without this, a re-index silently resets the
|
|
67
|
+
* moat (edges back at R2, R4 rows unconsulted). Endpoints no longer present
|
|
68
|
+
* are refused, not recreated — re-minting from an old run repeats the rule-2 violation. */
|
|
140
69
|
export declare function reapplyEarnedOverlays(driver: SqlDriver): RuntimeConfirmationResult;
|
|
141
70
|
/** Every row of the EARNED R4 ledger, oldest first, optionally for one run. */
|
|
142
71
|
export declare function observedEdges(driver: SqlDriver, options?: {
|
|
@@ -144,15 +73,9 @@ export declare function observedEdges(driver: SqlDriver, options?: {
|
|
|
144
73
|
}): ObservedEdgeRow[];
|
|
145
74
|
/** Every row of the EARNED correction ledger (§11B.5), oldest first. */
|
|
146
75
|
export declare function edgeCorrections(driver: SqlDriver): EdgeCorrectionRow[];
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* *"On one team's codebase, a few hundred corrections buy more accuracy than a
|
|
151
|
-
* quarter of parser work."* Same table the runtime's own denials land in, on
|
|
152
|
-
* purpose: an edge is wrong or it is not, and who noticed does not change what
|
|
153
|
-
* the graph should do about it. The `reason` is the correction's provenance and
|
|
154
|
-
* is never summarised.
|
|
155
|
-
*/
|
|
76
|
+
/** Records a human's verdict on an edge (§11B.5's other producer) — same table
|
|
77
|
+
* the runtime's own denials land in; who noticed doesn't change what the graph
|
|
78
|
+
* does. `reason` is provenance, never summarised. */
|
|
156
79
|
export declare function recordEdgeCorrection(driver: SqlDriver, input: {
|
|
157
80
|
readonly from: string;
|
|
158
81
|
readonly to: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-confirmation.d.ts","sourceRoot":"","sources":["../../src/graph/runtime-confirmation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runtime-confirmation.d.ts","sourceRoot":"","sources":["../../src/graph/runtime-confirmation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAU,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,oFAAoF;AACpF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,uFAAuF;AACvF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,8GAA8G;IAC9G,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8IAA8I;IAC9I,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAC1D;AAED,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAA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Ae,EAAE,CA0B7G;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,EAAE,CAYtE;AAED;;sDAEsD;AACtD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAChJ,KAAK,GAAE,KAAoB,GAC1B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQ7B;AA8ED,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,gBAAgB,2BAAqD,CAAC"}
|
|
@@ -1,70 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runtime confirmation
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* > runtime. This is the one accuracy source that cannot be copied without
|
|
6
|
-
* > also building the testing half, and it should be treated as the core
|
|
7
|
-
* > technical moat rather than the graph itself."* — §11B.3
|
|
8
|
-
*
|
|
9
|
-
* The schema has held `observed_edges` and `edge_corrections` since the store
|
|
10
|
-
* was first written, both on the EARNED side of DEC-017's partition, both
|
|
11
|
-
* carrying a comment explaining why they cannot be recomputed. **Nothing read
|
|
12
|
-
* or wrote either one.** This module is what they were for.
|
|
13
|
-
*
|
|
14
|
-
* ## The three arrows §11B.3 draws, and where each one lands
|
|
15
|
-
*
|
|
16
|
-
* | Observation | What happens |
|
|
17
|
-
* | --- | --- |
|
|
18
|
-
* | confirms an edge the graph already has, below R4 | **promote** to R4, `observed_by_run` set |
|
|
19
|
-
* | confirms an edge the graph does not have | **create** it at R4 — "recall gap closed" |
|
|
20
|
-
* | denies an edge the graph has, below R4 | **correct** it: an `edge_corrections` row, and a {@link GraphDefectRecord} out |
|
|
21
|
-
*
|
|
22
|
-
* ## Why a denial demotes confidence and does not delete the edge
|
|
23
|
-
*
|
|
24
|
-
* `edges` is DERIVED. Deleting a row there is undone by the next index, which
|
|
25
|
-
* regenerates the identical guess from the identical source and has no memory
|
|
26
|
-
* of the run that disproved it — the correction would evaporate exactly when
|
|
27
|
-
* it was needed again. §11B.5 already states the answer: corrections are
|
|
28
|
-
* *"stored as graph overrides keyed by stable node IDs, surviving re-index and
|
|
29
|
-
* adapter upgrades."* So the durable statement is the `edge_corrections` row,
|
|
30
|
-
* and the effect on the derived graph is a confidence demotion that
|
|
31
|
-
* {@link reapplyEarnedOverlays} re-applies after every rebuild.
|
|
32
|
-
*
|
|
33
|
-
* Demotion rather than deletion is also DEC-284's own stated direction — *"it
|
|
34
|
-
* fails toward demote, which is the safe direction"* — and it keeps rule 2
|
|
35
|
-
* intact from the other side: a wrong edge stops being load-bearing without
|
|
36
|
-
* the graph asserting a *new* fact (that the call does not exist) that no
|
|
37
|
-
* single observation actually establishes.
|
|
38
|
-
*
|
|
39
|
-
* ## What this module refuses to do
|
|
40
|
-
*
|
|
41
|
-
* - **Invent a node.** An observation naming a node this graph does not hold
|
|
42
|
-
* is refused with its reason, never created. Rule 2, and the same posture
|
|
43
|
-
* `correlateExecution` takes one layer down for an ambiguous resolution.
|
|
44
|
-
* - **Adjudicate R4 against R4.** A denial against an edge already at R4 is
|
|
45
|
-
* two runtime observations disagreeing across time — a staleness question
|
|
46
|
-
* whose policy is decided (DEC-284 + a 7-day backstop) but whose consumer
|
|
47
|
-
* does not exist yet. `contradiction.ts` excludes the case by construction
|
|
48
|
-
* and this module reports it as {@link RuntimeConfirmationResult.staleR4}
|
|
49
|
-
* rather than laundering it through a path that looks decided.
|
|
50
|
-
* - **Judge a finding.** Resolution has no opinion on confidence (RT-027).
|
|
51
|
-
* Nothing here reads or writes a finding, a hypothesis or a category.
|
|
52
|
-
*
|
|
53
|
-
* @see `packages/ir/src/contradiction.ts` — the pure detection this persists.
|
|
54
|
-
* @see `documents/plans/ai-layer-plan.md` §10 — *"the valuable half."*
|
|
2
|
+
* Runtime confirmation (§11B.3, the R4 moat): what `observed_edges`/`edge_corrections` (EARNED, DEC-017) were for.
|
|
3
|
+
* Confirms → promote/create at R4; denies → demote confidence, never delete (edges are DERIVED; DEC-284 fails toward demote).
|
|
4
|
+
* Refuses to invent nodes (rule 2), adjudicate R4-vs-R4 (`staleR4`), or judge a finding (RT-027).
|
|
55
5
|
*/
|
|
56
6
|
import { edgeId } from "@descryy/ir";
|
|
57
7
|
const SYSTEM_CLOCK = { now: () => Date.now() };
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Pure with respect to its inputs and total over them: every observation lands
|
|
63
|
-
* in exactly one of the six result arrays, so a caller can account for all of
|
|
64
|
-
* them without inspecting the store. Never throws for an observation it cannot
|
|
65
|
-
* act on — that is a refusal, per the five-result-states rule the tool contract
|
|
66
|
-
* applies one layer up.
|
|
67
|
-
*/
|
|
8
|
+
/** Applies a run's edge observations, writing the earned record and projecting
|
|
9
|
+
* it onto derived edges in one transaction. Every observation lands in exactly
|
|
10
|
+
* one result array; never throws — an unactionable one is a refusal. */
|
|
68
11
|
export function applyRuntimeObservations(driver, input, clock = SYSTEM_CLOCK) {
|
|
69
12
|
const promoted = [];
|
|
70
13
|
const created = [];
|
|
@@ -78,9 +21,8 @@ export function applyRuntimeObservations(driver, input, clock = SYSTEM_CLOCK) {
|
|
|
78
21
|
const id = edgeId(observation.from, observation.to, observation.edgeType);
|
|
79
22
|
const existing = readEdge(driver, id);
|
|
80
23
|
if (observation.held) {
|
|
81
|
-
// Both endpoints must already be nodes
|
|
82
|
-
//
|
|
83
|
-
// shape rule 2 exists to forbid.
|
|
24
|
+
// Both endpoints must already be nodes — else the graph invents a symbol
|
|
25
|
+
// from a runtime string, exactly what rule 2 forbids.
|
|
84
26
|
const missing = missingNode(driver, observation.from, observation.to);
|
|
85
27
|
if (missing !== null) {
|
|
86
28
|
refused.push({
|
|
@@ -135,21 +77,10 @@ export function applyRuntimeObservations(driver, input, clock = SYSTEM_CLOCK) {
|
|
|
135
77
|
});
|
|
136
78
|
return { promoted, created, confirmed, contradictions, staleR4, refused };
|
|
137
79
|
}
|
|
138
|
-
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* `edges` and leaves `observed_edges`/`edge_corrections` standing; a re-index
|
|
143
|
-
* then regenerates the same static guesses, at their static resolutions, with
|
|
144
|
-
* no memory of any run. Without this call the moat is silently reset on every
|
|
145
|
-
* rebuild — the edges would be back at R2 and the R4 rows would sit in a table
|
|
146
|
-
* nothing consults, which is indistinguishable from never having observed
|
|
147
|
-
* anything.
|
|
148
|
-
*
|
|
149
|
-
* Observations whose endpoints no longer exist are reported as refusals rather
|
|
150
|
-
* than recreated: the code moved, and re-minting a node from an old run's
|
|
151
|
-
* record would be the same rule-2 violation one rebuild later.
|
|
152
|
-
*/
|
|
80
|
+
/** Re-projects the EARNED ledgers onto a freshly rebuilt derived graph — what
|
|
81
|
+
* makes the DEC-017 partition pay. Without this, a re-index silently resets the
|
|
82
|
+
* moat (edges back at R2, R4 rows unconsulted). Endpoints no longer present
|
|
83
|
+
* are refused, not recreated — re-minting from an old run repeats the rule-2 violation. */
|
|
153
84
|
export function reapplyEarnedOverlays(driver) {
|
|
154
85
|
const rows = observedEdges(driver);
|
|
155
86
|
const corrections = edgeCorrections(driver).filter((c) => c.verdict === "wrong");
|
|
@@ -183,9 +114,7 @@ export function reapplyEarnedOverlays(driver) {
|
|
|
183
114
|
}
|
|
184
115
|
}
|
|
185
116
|
for (const correction of corrections) {
|
|
186
|
-
// A correction never wins over a later observation
|
|
187
|
-
// firing is a stronger, more recent statement than the denial that
|
|
188
|
-
// demoted it, and `observed_edges` carries the run that saw it.
|
|
117
|
+
// A correction never wins over a later observation firing the edge again.
|
|
189
118
|
const existing = readEdge(driver, correction.edgeId);
|
|
190
119
|
if (existing !== undefined && existing.resolution < 4)
|
|
191
120
|
demoteEdge(driver, correction.edgeId);
|
|
@@ -224,15 +153,9 @@ export function edgeCorrections(driver) {
|
|
|
224
153
|
correctedAt: row.corrected_at,
|
|
225
154
|
}));
|
|
226
155
|
}
|
|
227
|
-
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* *"On one team's codebase, a few hundred corrections buy more accuracy than a
|
|
231
|
-
* quarter of parser work."* Same table the runtime's own denials land in, on
|
|
232
|
-
* purpose: an edge is wrong or it is not, and who noticed does not change what
|
|
233
|
-
* the graph should do about it. The `reason` is the correction's provenance and
|
|
234
|
-
* is never summarised.
|
|
235
|
-
*/
|
|
156
|
+
/** Records a human's verdict on an edge (§11B.5's other producer) — same table
|
|
157
|
+
* the runtime's own denials land in; who noticed doesn't change what the graph
|
|
158
|
+
* does. `reason` is provenance, never summarised. */
|
|
236
159
|
export function recordEdgeCorrection(driver, input, clock = SYSTEM_CLOCK) {
|
|
237
160
|
const id = edgeId(input.from, input.to, input.edgeType);
|
|
238
161
|
driver.transaction(() => {
|
|
@@ -243,9 +166,7 @@ export function recordEdgeCorrection(driver, input, clock = SYSTEM_CLOCK) {
|
|
|
243
166
|
});
|
|
244
167
|
return { edgeId: id };
|
|
245
168
|
}
|
|
246
|
-
// ---------------------------------------------------------------------------
|
|
247
169
|
// Internals.
|
|
248
|
-
// ---------------------------------------------------------------------------
|
|
249
170
|
function readEdge(driver, id) {
|
|
250
171
|
return driver
|
|
251
172
|
.prepare("SELECT id, resolution, observed_by_run FROM edges WHERE id = ?")
|
|
@@ -278,9 +199,7 @@ function recordCorrectionRow(driver, id, verdict, reason, now) {
|
|
|
278
199
|
.run(id, verdict, reason, now);
|
|
279
200
|
}
|
|
280
201
|
function promoteEdge(driver, id, runId) {
|
|
281
|
-
// Confidence
|
|
282
|
-
// (DEC-115), and leaving a witnessed edge at the guess's own confidence
|
|
283
|
-
// would let a downstream ranker treat proof as inference.
|
|
202
|
+
// Confidence to 1 with resolution: R4 is unconditionally class A (DEC-115).
|
|
284
203
|
driver
|
|
285
204
|
.prepare("UPDATE edges SET resolution = 4, observed_by_run = ?, confidence = 1.0 WHERE id = ?")
|
|
286
205
|
.run(runId, id);
|
|
@@ -289,11 +208,8 @@ function demoteEdge(driver, id) {
|
|
|
289
208
|
driver.prepare("UPDATE edges SET confidence = 0.0 WHERE id = ?").run(id);
|
|
290
209
|
}
|
|
291
210
|
function insertEdgeAtR4(driver, id, observation, runId, commitSha) {
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
// owns a run row of its own, created once and reused. Deleting it cascades
|
|
295
|
-
// exactly the edges this module minted and nothing else, which is the
|
|
296
|
-
// correct blast radius for invalidating a runtime producer.
|
|
211
|
+
// run_id needs a real adapter_runs row (FK); this pass owns one, created once
|
|
212
|
+
// and reused, so deleting it cascades exactly this module's own minted edges.
|
|
297
213
|
const producerRunId = ensureRuntimeRun(driver, runId, commitSha);
|
|
298
214
|
driver
|
|
299
215
|
.prepare("INSERT INTO edges (id, source, target, type, resolution, confidence, produced_by, observed_by_run, attrs, run_id)" +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-confirmation.js","sourceRoot":"","sources":["../../src/graph/runtime-confirmation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runtime-confirmation.js","sourceRoot":"","sources":["../../src/graph/runtime-confirmation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAsE,MAAM,aAAa,CAAC;AAsEzG,MAAM,YAAY,GAAU,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AAEtD;;yEAEyE;AACzE,MAAM,UAAU,wBAAwB,CACtC,MAAiB,EACjB,KAA+B,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,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AAC7G,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,kBAAkB,IAAI,uBAAuB,EAAE,CAAC;AAEnF,SAAS,gBAAgB,CAAC,MAAiB,EAAE,KAAa,EAAE,SAAiB;IAC3E,MAAM,EAAE,GAAG,WAAW,KAAK,EAAE,CAAC;IAC9B,MAAM;SACH,OAAO,CACN,sGAAsG;QACpG,4DAA4D;QAC5D,kDAAkD;QAClD,6BAA6B,CAChC;SACA,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjG,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/ledger/mint.d.ts
CHANGED
|
@@ -1,33 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DEC-223's
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* refusal-ledger rows a confirmed fact answers. It deliberately does not
|
|
6
|
-
* mint an edge — it has no target to join against, and said so in its own
|
|
7
|
-
* header. This module owns that join.
|
|
8
|
-
*
|
|
9
|
-
* The confirmed base URL is testimony: it tells us the call is real, not
|
|
10
|
-
* dynamic, and gives a human's word for what the blocked expression
|
|
11
|
-
* evaluates to. It is **not** what identifies the endpoint. DEC-054 makes
|
|
12
|
-
* `API_ENDPOINT` identity `METHOD + normalisedPath`, base-independent by
|
|
13
|
-
* design — the same mechanism that lets a caller in one repository and a
|
|
14
|
-
* route in another join on nothing but a shared path template. What
|
|
15
|
-
* identifies the endpoint here is the row's own `attrs.path`/`attrs.method`
|
|
16
|
-
* — the relative path adapter-typescript already read from the call site,
|
|
17
|
-
* before the base blocked it (DEC-260's `templateSuffixAfterFirstSpan`).
|
|
18
|
-
*
|
|
19
|
-
* No match, no edge. A row whose candidate id is not in the supplied graph
|
|
20
|
-
* is reported as an orphan — never guessed into existence (rule 2) and
|
|
21
|
-
* never silently dropped (rule 5).
|
|
2
|
+
* DEC-223's minting side. `applyConfirmedFacts` decides which refusal rows a confirmed fact answers but mints no edge (no target to join); this module owns that join.
|
|
3
|
+
* Identity is `METHOD + normalisedPath` (DEC-054), base-independent — the confirmed base URL is testimony, not identity; joins on the row's own `attrs.path`/`attrs.method` instead.
|
|
4
|
+
* No match: reported as an orphan, never guessed into existence (rule 2) or silently dropped (rule 5).
|
|
22
5
|
*/
|
|
23
6
|
import type { ConfirmedFact, IdentityScope, IREdge, UnresolvedRef } from "@descryy/ir";
|
|
24
7
|
import type { ConfirmedFactMatch } from "../query/confirmed-facts.ts";
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* (`sources/git/source.ts`) — a core-owned synthetic producer, not a
|
|
28
|
-
* language adapter. A minted edge's invalidation is scoped to this id, never
|
|
29
|
-
* to whichever adapter produced the endpoint or the caller it joins.
|
|
30
|
-
*/
|
|
8
|
+
/** Own `producedBy`, same pattern as `git-history` — a core-owned synthetic
|
|
9
|
+
* producer, not a language adapter. Invalidation scopes to this id alone. */
|
|
31
10
|
export declare const MINT_SOURCE_ID = "ledger-mint";
|
|
32
11
|
export declare const MINT_SOURCE_VERSION = "0.1.0";
|
|
33
12
|
export declare const MINT_PRODUCED_BY = "ledger-mint@0.1.0";
|
|
@@ -60,22 +39,9 @@ export interface EndpointLookup {
|
|
|
60
39
|
readonly id: string;
|
|
61
40
|
} | undefined;
|
|
62
41
|
}
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* `
|
|
67
|
-
* it shares with whichever repository serves the route) — `API_ENDPOINT`
|
|
68
|
-
* being workspace-scoped means the repo half is discarded by `scopeOf`
|
|
69
|
-
* whenever a workspace is set, so passing the caller's own repo here is
|
|
70
|
-
* correct even though the target endpoint may live in a different one.
|
|
71
|
-
*
|
|
72
|
-
* `currentCommit` is the repo's `commitSha` for *this* run (`root.commitSha`
|
|
73
|
-
* at the call site) — compared against each fact's own `confirmedAtCommit`
|
|
74
|
-
* so a minted edge discloses whether the human answer it rests on was given
|
|
75
|
-
* against the code as it stands today. This is the disclosure floor named in
|
|
76
|
-
* the item this closes, not re-verification: nobody re-checks the fact
|
|
77
|
-
* against a live source, the edge just stops reading as unconditionally
|
|
78
|
-
* current when it isn't.
|
|
79
|
-
*/
|
|
42
|
+
/** Joins `applyConfirmedFacts`'s `answered` rows against a real endpoint graph.
|
|
43
|
+
* `scope` is the caller's own identity (`API_ENDPOINT` is workspace-scoped, so
|
|
44
|
+
* the repo half is discarded when a workspace is set). `currentCommit` vs each
|
|
45
|
+
* fact's `confirmedAtCommit` discloses staleness — never re-verifies. */
|
|
80
46
|
export declare function mintEdgesFromConfirmedFacts(matches: readonly ConfirmedFactMatch[], endpoints: EndpointLookup, scope: IdentityScope, producedBy: string, currentCommit?: string): MintResult;
|
|
81
47
|
//# sourceMappingURL=mint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../src/ledger/mint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../src/ledger/mint.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAStE;8EAC8E;AAC9E,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,gBAAgB,sBAA6C,CAAC;AAE3E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC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
-
* mint an edge — it has no target to join against, and said so in its own
|
|
7
|
-
* header. This module owns that join.
|
|
8
|
-
*
|
|
9
|
-
* The confirmed base URL is testimony: it tells us the call is real, not
|
|
10
|
-
* dynamic, and gives a human's word for what the blocked expression
|
|
11
|
-
* evaluates to. It is **not** what identifies the endpoint. DEC-054 makes
|
|
12
|
-
* `API_ENDPOINT` identity `METHOD + normalisedPath`, base-independent by
|
|
13
|
-
* design — the same mechanism that lets a caller in one repository and a
|
|
14
|
-
* route in another join on nothing but a shared path template. What
|
|
15
|
-
* identifies the endpoint here is the row's own `attrs.path`/`attrs.method`
|
|
16
|
-
* — the relative path adapter-typescript already read from the call site,
|
|
17
|
-
* before the base blocked it (DEC-260's `templateSuffixAfterFirstSpan`).
|
|
18
|
-
*
|
|
19
|
-
* No match, no edge. A row whose candidate id is not in the supplied graph
|
|
20
|
-
* is reported as an orphan — never guessed into existence (rule 2) and
|
|
21
|
-
* never silently dropped (rule 5).
|
|
2
|
+
* DEC-223's minting side. `applyConfirmedFacts` decides which refusal rows a confirmed fact answers but mints no edge (no target to join); this module owns that join.
|
|
3
|
+
* Identity is `METHOD + normalisedPath` (DEC-054), base-independent — the confirmed base URL is testimony, not identity; joins on the row's own `attrs.path`/`attrs.method` instead.
|
|
4
|
+
* No match: reported as an orphan, never guessed into existence (rule 2) or silently dropped (rule 5).
|
|
22
5
|
*/
|
|
23
6
|
import { endpointQsp, nodeId, reliabilityCap, reliabilityNote } from "@descryy/ir";
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* adapter carries (`extract.ts` mints those at `resolution: 2` too) — plus
|
|
28
|
-
* `humanAsserted: true` for the base itself, which `reliabilityCap` treats as
|
|
29
|
-
* a second, independent ceiling. At R2 with `nameLevel: true` the structural
|
|
30
|
-
* cap is A; `humanAsserted` pulls that down to B. Not asserted directly —
|
|
31
|
-
* computed below, so the class actually reported is whatever the two
|
|
32
|
-
* arguments produce, not a hardcoded "B".
|
|
33
|
-
*/
|
|
7
|
+
/** Name-level R2 match, same strength as any resolved `USES_API` join. `humanAsserted`
|
|
8
|
+
* is a second, independent ceiling — pulls the R2/nameLevel A down to B — computed
|
|
9
|
+
* below, never hardcoded. */
|
|
34
10
|
const MINT_RESOLUTION = 2;
|
|
35
11
|
const MINT_NAME_LEVEL = true;
|
|
36
12
|
const MINT_CONFIDENCE = 0.9;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* (`sources/git/source.ts`) — a core-owned synthetic producer, not a
|
|
40
|
-
* language adapter. A minted edge's invalidation is scoped to this id, never
|
|
41
|
-
* to whichever adapter produced the endpoint or the caller it joins.
|
|
42
|
-
*/
|
|
13
|
+
/** Own `producedBy`, same pattern as `git-history` — a core-owned synthetic
|
|
14
|
+
* producer, not a language adapter. Invalidation scopes to this id alone. */
|
|
43
15
|
export const MINT_SOURCE_ID = "ledger-mint";
|
|
44
16
|
export const MINT_SOURCE_VERSION = "0.1.0";
|
|
45
17
|
export const MINT_PRODUCED_BY = `${MINT_SOURCE_ID}@${MINT_SOURCE_VERSION}`;
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `
|
|
50
|
-
* it shares with whichever repository serves the route) — `API_ENDPOINT`
|
|
51
|
-
* being workspace-scoped means the repo half is discarded by `scopeOf`
|
|
52
|
-
* whenever a workspace is set, so passing the caller's own repo here is
|
|
53
|
-
* correct even though the target endpoint may live in a different one.
|
|
54
|
-
*
|
|
55
|
-
* `currentCommit` is the repo's `commitSha` for *this* run (`root.commitSha`
|
|
56
|
-
* at the call site) — compared against each fact's own `confirmedAtCommit`
|
|
57
|
-
* so a minted edge discloses whether the human answer it rests on was given
|
|
58
|
-
* against the code as it stands today. This is the disclosure floor named in
|
|
59
|
-
* the item this closes, not re-verification: nobody re-checks the fact
|
|
60
|
-
* against a live source, the edge just stops reading as unconditionally
|
|
61
|
-
* current when it isn't.
|
|
62
|
-
*/
|
|
18
|
+
/** Joins `applyConfirmedFacts`'s `answered` rows against a real endpoint graph.
|
|
19
|
+
* `scope` is the caller's own identity (`API_ENDPOINT` is workspace-scoped, so
|
|
20
|
+
* the repo half is discarded when a workspace is set). `currentCommit` vs each
|
|
21
|
+
* fact's `confirmedAtCommit` discloses staleness — never re-verifies. */
|
|
63
22
|
export function mintEdgesFromConfirmedFacts(matches, endpoints, scope, producedBy, currentCommit) {
|
|
64
23
|
const minted = [];
|
|
65
24
|
const orphaned = [];
|
|
@@ -84,14 +43,8 @@ export function mintEdgesFromConfirmedFacts(matches, endpoints, scope, producedB
|
|
|
84
43
|
}
|
|
85
44
|
const reliabilityClass = reliabilityCap(MINT_RESOLUTION, MINT_NAME_LEVEL, true);
|
|
86
45
|
const note = reliabilityNote(MINT_RESOLUTION, MINT_NAME_LEVEL, true);
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
// "stale" when both are known and differ; "unknown" when either is
|
|
90
|
-
// missing — a fact confirmed before `confirmedAtCommit` existed, or a run
|
|
91
|
-
// with no commit available, is disclosed as unknown rather than assumed
|
|
92
|
-
// fresh. `staleFact` on the edge is `true` the moment any grounding fact
|
|
93
|
-
// is not affirmatively current, so a consumer can filter on one field
|
|
94
|
-
// without re-deriving this per-fact logic.
|
|
46
|
+
// "current" only when both commits are known and equal; "stale" when both
|
|
47
|
+
// known and differ; "unknown" when either is missing — never assumed fresh.
|
|
95
48
|
const factFreshness = facts.map((f) => {
|
|
96
49
|
const staleness = currentCommit === undefined || f.confirmedAtCommit === undefined
|
|
97
50
|
? "unknown"
|
|
@@ -117,10 +70,7 @@ export function mintEdgesFromConfirmedFacts(matches, endpoints, scope, producedB
|
|
|
117
70
|
reliabilityNote: note,
|
|
118
71
|
blockedBy: ref.attrs?.["blockedBy"],
|
|
119
72
|
staleFact,
|
|
120
|
-
// Every fact that answered this row, verbatim — never collapsed to
|
|
121
|
-
// one value. A row genuinely answered by facts scoped to two
|
|
122
|
-
// different environments stays disclosed as two, not silently
|
|
123
|
-
// narrowed to whichever sorted first.
|
|
73
|
+
// Every fact that answered this row, verbatim — never collapsed to one.
|
|
124
74
|
confirmedFacts: factFreshness.map(({ fact: f, staleness }) => ({
|
|
125
75
|
value: f.value,
|
|
126
76
|
...(f.environment === undefined ? {} : { environment: f.environment }),
|
package/dist/ledger/mint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint.js","sourceRoot":"","sources":["../../src/ledger/mint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mint.js","sourceRoot":"","sources":["../../src/ledger/mint.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInF;;8BAE8B;AAC9B,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B;8EAC8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,cAAc,IAAI,mBAAmB,EAAE,CAAC;AAkC3E;;;0EAG0E;AAC1E,MAAM,UAAU,2BAA2B,CACzC,OAAsC,EACtC,SAAyB,EACzB,KAAoB,EACpB,UAAkB,EAClB,aAAsB;IAEtB,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,MAAM,UAAU,GAAuB,EAAE,CAAC;IAE1C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;QAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,GA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