@descryy/core 0.3.0 → 0.5.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/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 +26 -12
- package/dist/contracts/engine.d.ts.map +1 -1
- package/dist/contracts/engine.js +28 -11
- package/dist/contracts/engine.js.map +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/orphans.d.ts +28 -77
- package/dist/contracts/orphans.d.ts.map +1 -1
- package/dist/contracts/orphans.js +124 -94
- 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 +13 -75
- package/dist/graph/build.d.ts.map +1 -1
- package/dist/graph/build.js +0 -0
- 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/index.d.ts +1 -1
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/merge.d.ts +8 -76
- package/dist/graph/merge.d.ts.map +1 -1
- package/dist/graph/merge.js +27 -77
- 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 +5 -9
- package/dist/query/memory.d.ts.map +1 -1
- package/dist/query/memory.js +31 -15
- 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 +28 -81
- 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 +43 -100
- 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 +13 -16
- 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 +0 -0
- 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 +71 -65
- package/dist/sources/git/diff.d.ts.map +1 -1
- package/dist/sources/git/diff.js +136 -83
- 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 +0 -0
- 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 +47 -0
- package/dist/validation/attributes.d.ts.map +1 -0
- package/dist/validation/attributes.js +130 -0
- package/dist/validation/attributes.js.map +1 -0
- 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 +53 -2
- package/dist/validation/env.d.ts.map +1 -1
- package/dist/validation/env.js +99 -4
- package/dist/validation/env.js.map +1 -1
- package/dist/validation/index.d.ts +5 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +3 -1
- 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 +72 -0
- package/dist/validation/migration-integrity.d.ts.map +1 -0
- package/dist/validation/migration-integrity.js +238 -0
- package/dist/validation/migration-integrity.js.map +1 -0
- package/dist/validation/migrations.d.ts +23 -88
- package/dist/validation/migrations.d.ts.map +1 -1
- package/dist/validation/migrations.js +20 -79
- 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/rollback.d.ts +10 -73
- package/dist/validation/rollback.d.ts.map +1 -1
- package/dist/validation/rollback.js +23 -81
- 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,75 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DEC-244
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* The grouper (DEC-243) turns rows into questions. `resolveAgainstDeclared`
|
|
6
|
-
* (`../ledger/resolve.ts`) turns a question into a per-environment answer
|
|
7
|
-
* from what the repository's own `.env*` files already state. Until this
|
|
8
|
-
* file, nothing joined the two — DEC-244's own measurement is 0 of 122 rows
|
|
9
|
-
* closed, not because either half is broken, but because neither called the
|
|
10
|
-
* other.
|
|
11
|
-
*
|
|
12
|
-
* ## What "closing" a row means here, and does not mean
|
|
13
|
-
*
|
|
14
|
-
* This produces a **classification**, never a graph edge — the same
|
|
15
|
-
* discipline `confirmed-facts.ts`'s header states for its own output and for
|
|
16
|
-
* the identical reason: minting `USES_API`/etc. needs a target to join
|
|
17
|
-
* against (an endpoint, a route) that this module has no way to resolve, and
|
|
18
|
-
* DEC-223 §6 already named that as separate, unbuilt work. A caller minting
|
|
19
|
-
* an edge from `closed`/`partiallyClosed` is the one obligated to attach the
|
|
20
|
-
* reliability this module already computed (`DECLARED_VALUE_RELIABILITY`,
|
|
21
|
-
* class A — see DEC-244 Row 1) rather than inventing its own.
|
|
22
|
-
*
|
|
23
|
-
* ## Why this is not a `ConfirmedFact`, and does not reuse its shape
|
|
24
|
-
*
|
|
25
|
-
* `ConfirmedFact` (DEC-223 §3) is testimony: one person's typed string,
|
|
26
|
-
* corroborated by nothing, capped at reliability class B by construction
|
|
27
|
-
* (`humanAsserted: true`). A value read from a repository's own `.env` file
|
|
28
|
-
* is the opposite kind of evidence — nobody asserted it, anyone can re-read
|
|
29
|
-
* the same file and get the same answer, and DEC-244 Row 1 rules it reaches
|
|
30
|
-
* class A on exactly the precedent `validation/env.ts` already established
|
|
31
|
-
* for `.env` reads generally (a direct, uninferred read of a declarative
|
|
32
|
-
* document, the same class of evidence that lets `adapter-openapi`/
|
|
33
|
-
* `adapter-sql` reach R3 with no language adapter at all). Constructing a
|
|
34
|
-
* `ConfirmedFact` here — with a synthetic `confirmedBy: "config:..."` and
|
|
35
|
-
* `humanAsserted` forced `false` at the call site — would make the *type*
|
|
36
|
-
* claim testimony while the *call site* claims otherwise, a distinction that
|
|
37
|
-
* survives exactly as long as every future caller remembers to look past the
|
|
38
|
-
* type to the call site. `DeclaredValueClosure` is the type-level guarantee
|
|
39
|
-
* instead: nothing shaped this way can ever be mistaken for testimony,
|
|
40
|
-
* because nothing about it says `confirmedBy`.
|
|
41
|
-
*
|
|
42
|
-
* ## The hard part: partial closure has to stay visibly partial
|
|
43
|
-
*
|
|
44
|
-
* `resolveAgainstDeclared`'s own `knownEnvironments` is deliberately narrow —
|
|
45
|
-
* it is *only* what this repository's `.env*` **filenames** assert exist,
|
|
46
|
-
* never invented. That narrowness is correct for `resolve.ts` (DEC-223's own
|
|
47
|
-
* "never guessed, always refused" rule) and creates a real trap one layer up:
|
|
48
|
-
* a repository can resolve **every environment its filenames mention** and
|
|
49
|
-
* still have a production deployment this reader has no way to see, because
|
|
50
|
-
* production's value never lived in a checked-in `.env*` file at all.
|
|
51
|
-
*
|
|
52
|
-
* Measured, not hypothetical: `sherpa-frontend` has exactly
|
|
53
|
-
* `.env.development` and `.env.development.local`, nothing named
|
|
54
|
-
* `production` anywhere in its `.env*` surface — `VITE_BACKEND_API_URL`
|
|
55
|
-
* resolves fully for `"development"` (`knownEnvironments.length === 1`), and
|
|
56
|
-
* a consumer that read that as "closed" would silently bind a `localhost`
|
|
57
|
-
* dev value to every production call site in the ledger. **That is the exact
|
|
58
|
-
* silent-failure shape this product exists to catch, reproduced inside the
|
|
59
|
-
* product**, which is why `MIN_KNOWN_ENVIRONMENTS_FOR_CLOSED` exists: a
|
|
60
|
-
* repository's own naming convention has to demonstrate it actually
|
|
61
|
-
* distinguishes more than one environment before this module will call
|
|
62
|
-
* anything fully closed. Below that bar, a fully-resolved result is reported
|
|
63
|
-
* as `"partially-closed"` — under-claiming is the safe direction (rule 2 —
|
|
64
|
-
* when in doubt, omit), and `resolution.knownEnvironments` stays attached to
|
|
65
|
-
* every closure record so a reader can see exactly what evidence there was.
|
|
66
|
-
*
|
|
67
|
-
* `sherpa-cf-worker` is the other real shape: it has **no** `.env*` files at
|
|
68
|
-
* all (its runtime config lives in `wrangler.toml`, `[vars]`/`[env.*.vars]`,
|
|
69
|
-
* a format `resolve.ts` deliberately does not read —
|
|
70
|
-
* `REQUEST-D-wrangler-vars-format.md`, not built). Every one of its rows
|
|
71
|
-
* therefore has `knownEnvironments.length === 0` and lands in `stillOpen`,
|
|
72
|
-
* which is correct and current, not a defect this module can fix.
|
|
2
|
+
* DEC-244 Row 2: wires resolveAgainstDeclared into ledger closure (0/122 rows
|
|
3
|
+
* closed before this — nothing joined the two). Produces a classification,
|
|
4
|
+
* never a graph edge (like confirmed-facts.ts), reaching class A (Row 1) unlike ConfirmedFact's testimony-capped class B (DEC-223 §3). Under-claims below 2 known environments (rule 2).
|
|
73
5
|
*/
|
|
74
6
|
import type { UnresolvedRef } from "@descryy/ir";
|
|
75
7
|
import { reliabilityCap } from "@descryy/ir";
|
|
@@ -81,46 +13,23 @@ export interface DeclaredValueClosure {
|
|
|
81
13
|
readonly blockedBy: string;
|
|
82
14
|
readonly resolution: LedgerAccessorResolution;
|
|
83
15
|
readonly state: ClosureState;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* Carried per-closure rather than computed again by every caller, so a
|
|
87
|
-
* caller cannot accidentally pass `humanAsserted: true` and mislabel a
|
|
88
|
-
* direct read as testimony.
|
|
89
|
-
*/
|
|
16
|
+
/** Always "A" (DEC-244 Row 1). Carried per-closure so no caller can pass
|
|
17
|
+
* `humanAsserted: true` and mislabel a direct read as testimony. */
|
|
90
18
|
readonly reliability: ReturnType<typeof reliabilityCap>;
|
|
91
19
|
}
|
|
92
20
|
export interface DeclaredValueApplication {
|
|
93
21
|
readonly closed: readonly DeclaredValueClosure[];
|
|
94
22
|
readonly partiallyClosed: readonly DeclaredValueClosure[];
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* `askableHandle` returned `null`), an unparseable `blockedBy`, zero
|
|
98
|
-
* `.env*` evidence for this repository, or a recognised name this
|
|
99
|
-
* repository's `.env*` files never set in any environment.
|
|
100
|
-
*/
|
|
23
|
+
/** Everything else: not askable, unparseable `blockedBy`, no `.env*`
|
|
24
|
+
* evidence, or a name never set in any environment. */
|
|
101
25
|
readonly stillOpen: readonly UnresolvedRef[];
|
|
102
26
|
}
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* outcome (`reliabilityCap`'s R3/R4 branch returns `"A"` regardless of
|
|
107
|
-
* `nameLevel`), but a future caller reusing this constant at a lower
|
|
108
|
-
* resolution should not inherit a `nameLevel` value chosen for the wrong
|
|
109
|
-
* reason, so it is stated correctly here rather than left as an accident of
|
|
110
|
-
* R3 not needing it.
|
|
111
|
-
*/
|
|
27
|
+
/** A resolved value claims content, not mere existence — `nameLevel: false`.
|
|
28
|
+
* No effect at R3 (both give "A"), but stated correctly for any future
|
|
29
|
+
* caller reusing this constant at a lower resolution. */
|
|
112
30
|
export declare const DECLARED_VALUE_RELIABILITY: import("@descryy/ir").ReliabilityClass;
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* The reconciliation this makes checkable, same law as the grouper and the
|
|
117
|
-
* Normaliser one level down each: every row in `refs` lands in exactly one
|
|
118
|
-
* of `closed`, `partiallyClosed` or `stillOpen` —
|
|
119
|
-
* `refs.length === closed.length + partiallyClosed.length + stillOpen.length`,
|
|
120
|
-
* always. `resolveAgainstDeclared` is called at most once per distinct
|
|
121
|
-
* `blockedBy` (cached), not once per row, matching `resolve.ts`'s own stated
|
|
122
|
-
* performance contract — "read once per repository ... runs many times
|
|
123
|
-
* against the result rather than rescanning per ledger row."
|
|
124
|
-
*/
|
|
31
|
+
/** Apply declared `.env*` values against the refusal ledger. Every ref lands
|
|
32
|
+
* in exactly one of closed/partiallyClosed/stillOpen. resolveAgainstDeclared
|
|
33
|
+
* is cached per `blockedBy`, not called once per row. */
|
|
125
34
|
export declare function applyDeclaredValues(refs: readonly UnresolvedRef[], declared: readonly DeclaredEnvValue[]): DeclaredValueApplication;
|
|
126
35
|
//# sourceMappingURL=declared-value-closure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-value-closure.d.ts","sourceRoot":"","sources":["../../src/query/declared-value-closure.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"declared-value-closure.d.ts","sourceRoot":"","sources":["../../src/query/declared-value-closure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AAEzD,gGAAgG;AAChG,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B;yEACqE;IACrE,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACjD,QAAQ,CAAC,eAAe,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC1D;4DACwD;IACxD,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;CAC9C;AAKD;;0DAE0D;AAC1D,eAAO,MAAM,0BAA0B,wCAA0D,CAAC;AAgBlG;;0DAE0D;AAC1D,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,aAAa,EAAE,EAC9B,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GACpC,wBAAwB,CAoC1B"}
|
|
@@ -1,126 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DEC-244
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* The grouper (DEC-243) turns rows into questions. `resolveAgainstDeclared`
|
|
6
|
-
* (`../ledger/resolve.ts`) turns a question into a per-environment answer
|
|
7
|
-
* from what the repository's own `.env*` files already state. Until this
|
|
8
|
-
* file, nothing joined the two — DEC-244's own measurement is 0 of 122 rows
|
|
9
|
-
* closed, not because either half is broken, but because neither called the
|
|
10
|
-
* other.
|
|
11
|
-
*
|
|
12
|
-
* ## What "closing" a row means here, and does not mean
|
|
13
|
-
*
|
|
14
|
-
* This produces a **classification**, never a graph edge — the same
|
|
15
|
-
* discipline `confirmed-facts.ts`'s header states for its own output and for
|
|
16
|
-
* the identical reason: minting `USES_API`/etc. needs a target to join
|
|
17
|
-
* against (an endpoint, a route) that this module has no way to resolve, and
|
|
18
|
-
* DEC-223 §6 already named that as separate, unbuilt work. A caller minting
|
|
19
|
-
* an edge from `closed`/`partiallyClosed` is the one obligated to attach the
|
|
20
|
-
* reliability this module already computed (`DECLARED_VALUE_RELIABILITY`,
|
|
21
|
-
* class A — see DEC-244 Row 1) rather than inventing its own.
|
|
22
|
-
*
|
|
23
|
-
* ## Why this is not a `ConfirmedFact`, and does not reuse its shape
|
|
24
|
-
*
|
|
25
|
-
* `ConfirmedFact` (DEC-223 §3) is testimony: one person's typed string,
|
|
26
|
-
* corroborated by nothing, capped at reliability class B by construction
|
|
27
|
-
* (`humanAsserted: true`). A value read from a repository's own `.env` file
|
|
28
|
-
* is the opposite kind of evidence — nobody asserted it, anyone can re-read
|
|
29
|
-
* the same file and get the same answer, and DEC-244 Row 1 rules it reaches
|
|
30
|
-
* class A on exactly the precedent `validation/env.ts` already established
|
|
31
|
-
* for `.env` reads generally (a direct, uninferred read of a declarative
|
|
32
|
-
* document, the same class of evidence that lets `adapter-openapi`/
|
|
33
|
-
* `adapter-sql` reach R3 with no language adapter at all). Constructing a
|
|
34
|
-
* `ConfirmedFact` here — with a synthetic `confirmedBy: "config:..."` and
|
|
35
|
-
* `humanAsserted` forced `false` at the call site — would make the *type*
|
|
36
|
-
* claim testimony while the *call site* claims otherwise, a distinction that
|
|
37
|
-
* survives exactly as long as every future caller remembers to look past the
|
|
38
|
-
* type to the call site. `DeclaredValueClosure` is the type-level guarantee
|
|
39
|
-
* instead: nothing shaped this way can ever be mistaken for testimony,
|
|
40
|
-
* because nothing about it says `confirmedBy`.
|
|
41
|
-
*
|
|
42
|
-
* ## The hard part: partial closure has to stay visibly partial
|
|
43
|
-
*
|
|
44
|
-
* `resolveAgainstDeclared`'s own `knownEnvironments` is deliberately narrow —
|
|
45
|
-
* it is *only* what this repository's `.env*` **filenames** assert exist,
|
|
46
|
-
* never invented. That narrowness is correct for `resolve.ts` (DEC-223's own
|
|
47
|
-
* "never guessed, always refused" rule) and creates a real trap one layer up:
|
|
48
|
-
* a repository can resolve **every environment its filenames mention** and
|
|
49
|
-
* still have a production deployment this reader has no way to see, because
|
|
50
|
-
* production's value never lived in a checked-in `.env*` file at all.
|
|
51
|
-
*
|
|
52
|
-
* Measured, not hypothetical: `sherpa-frontend` has exactly
|
|
53
|
-
* `.env.development` and `.env.development.local`, nothing named
|
|
54
|
-
* `production` anywhere in its `.env*` surface — `VITE_BACKEND_API_URL`
|
|
55
|
-
* resolves fully for `"development"` (`knownEnvironments.length === 1`), and
|
|
56
|
-
* a consumer that read that as "closed" would silently bind a `localhost`
|
|
57
|
-
* dev value to every production call site in the ledger. **That is the exact
|
|
58
|
-
* silent-failure shape this product exists to catch, reproduced inside the
|
|
59
|
-
* product**, which is why `MIN_KNOWN_ENVIRONMENTS_FOR_CLOSED` exists: a
|
|
60
|
-
* repository's own naming convention has to demonstrate it actually
|
|
61
|
-
* distinguishes more than one environment before this module will call
|
|
62
|
-
* anything fully closed. Below that bar, a fully-resolved result is reported
|
|
63
|
-
* as `"partially-closed"` — under-claiming is the safe direction (rule 2 —
|
|
64
|
-
* when in doubt, omit), and `resolution.knownEnvironments` stays attached to
|
|
65
|
-
* every closure record so a reader can see exactly what evidence there was.
|
|
66
|
-
*
|
|
67
|
-
* `sherpa-cf-worker` is the other real shape: it has **no** `.env*` files at
|
|
68
|
-
* all (its runtime config lives in `wrangler.toml`, `[vars]`/`[env.*.vars]`,
|
|
69
|
-
* a format `resolve.ts` deliberately does not read —
|
|
70
|
-
* `REQUEST-D-wrangler-vars-format.md`, not built). Every one of its rows
|
|
71
|
-
* therefore has `knownEnvironments.length === 0` and lands in `stillOpen`,
|
|
72
|
-
* which is correct and current, not a defect this module can fix.
|
|
2
|
+
* DEC-244 Row 2: wires resolveAgainstDeclared into ledger closure (0/122 rows
|
|
3
|
+
* closed before this — nothing joined the two). Produces a classification,
|
|
4
|
+
* never a graph edge (like confirmed-facts.ts), reaching class A (Row 1) unlike ConfirmedFact's testimony-capped class B (DEC-223 §3). Under-claims below 2 known environments (rule 2).
|
|
73
5
|
*/
|
|
74
6
|
import { reliabilityCap } from "@descryy/ir";
|
|
75
7
|
import { askableHandle } from "./refusal-questions.js";
|
|
76
8
|
import { resolveAgainstDeclared } from "../ledger/resolve.js";
|
|
77
9
|
/** Direct reads of `.env*` need no resolution — same precedent `validation/env.ts` already uses (DEC-244 Row 1). */
|
|
78
10
|
const DECLARED_VALUE_RESOLUTION = 3;
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* outcome (`reliabilityCap`'s R3/R4 branch returns `"A"` regardless of
|
|
83
|
-
* `nameLevel`), but a future caller reusing this constant at a lower
|
|
84
|
-
* resolution should not inherit a `nameLevel` value chosen for the wrong
|
|
85
|
-
* reason, so it is stated correctly here rather than left as an accident of
|
|
86
|
-
* R3 not needing it.
|
|
87
|
-
*/
|
|
11
|
+
/** A resolved value claims content, not mere existence — `nameLevel: false`.
|
|
12
|
+
* No effect at R3 (both give "A"), but stated correctly for any future
|
|
13
|
+
* caller reusing this constant at a lower resolution. */
|
|
88
14
|
export const DECLARED_VALUE_RELIABILITY = reliabilityCap(DECLARED_VALUE_RESOLUTION, false, false);
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* rather than `"partially-closed"` — see the module header's `sherpa-frontend`
|
|
93
|
-
* case. Not tuned; picked as the smallest number that is structurally
|
|
94
|
-
* meaningful (one named environment proves nothing about whether a second,
|
|
95
|
-
* unnamed one exists; two or more is the repository's own convention
|
|
96
|
-
* demonstrating it actually distinguishes environments).
|
|
97
|
-
*/
|
|
15
|
+
/** Minimum distinct environments a repo's `.env*` naming must name before a
|
|
16
|
+
* fully-resolved result counts as "closed", not "partially-closed" — one
|
|
17
|
+
* named environment proves nothing about an unnamed second one. */
|
|
98
18
|
const MIN_KNOWN_ENVIRONMENTS_FOR_CLOSED = 2;
|
|
99
19
|
function classify(resolution) {
|
|
100
20
|
if (resolution.resolution === null)
|
|
101
21
|
return "open"; // blockedBy shape not recognised
|
|
102
22
|
if (resolution.knownEnvironments.length === 0)
|
|
103
|
-
return "open";
|
|
23
|
+
return "open";
|
|
104
24
|
if (resolution.resolved.length === 0)
|
|
105
|
-
return "open"; //
|
|
25
|
+
return "open"; // resolved in none of the known environments
|
|
106
26
|
if (resolution.unresolvedEnvironments.length > 0)
|
|
107
|
-
return "partially-closed";
|
|
27
|
+
return "partially-closed";
|
|
108
28
|
if (resolution.knownEnvironments.length < MIN_KNOWN_ENVIRONMENTS_FOR_CLOSED)
|
|
109
29
|
return "partially-closed"; // thin evidence
|
|
110
30
|
return "closed";
|
|
111
31
|
}
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* The reconciliation this makes checkable, same law as the grouper and the
|
|
116
|
-
* Normaliser one level down each: every row in `refs` lands in exactly one
|
|
117
|
-
* of `closed`, `partiallyClosed` or `stillOpen` —
|
|
118
|
-
* `refs.length === closed.length + partiallyClosed.length + stillOpen.length`,
|
|
119
|
-
* always. `resolveAgainstDeclared` is called at most once per distinct
|
|
120
|
-
* `blockedBy` (cached), not once per row, matching `resolve.ts`'s own stated
|
|
121
|
-
* performance contract — "read once per repository ... runs many times
|
|
122
|
-
* against the result rather than rescanning per ledger row."
|
|
123
|
-
*/
|
|
32
|
+
/** Apply declared `.env*` values against the refusal ledger. Every ref lands
|
|
33
|
+
* in exactly one of closed/partiallyClosed/stillOpen. resolveAgainstDeclared
|
|
34
|
+
* is cached per `blockedBy`, not called once per row. */
|
|
124
35
|
export function applyDeclaredValues(refs, declared) {
|
|
125
36
|
const cache = new Map();
|
|
126
37
|
const closed = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-value-closure.js","sourceRoot":"","sources":["../../src/query/declared-value-closure.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"declared-value-closure.js","sourceRoot":"","sources":["../../src/query/declared-value-closure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC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SAAS,CAAC,CAAC;QACtC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,UAAU,GAAG,sBAAsB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACzD,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAyB;YACpC,GAAG;YACH,SAAS;YACT,UAAU;YACV,KAAK;YACL,WAAW,EAAE,0BAA0B;SACxC,CAAC;QACF,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAChD,CAAC"}
|
package/dist/query/memory.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The reason the interface exists. Building one of these from a `BuildResult` is
|
|
5
|
-
* four lines and needs no file, no schema, no writer and no worker — so the
|
|
6
|
-
* traversal and query tests below it exercise the same code paths production
|
|
7
|
-
* uses, without any of the setup that would otherwise make them slow enough to
|
|
8
|
-
* skip.
|
|
9
|
-
*/
|
|
1
|
+
/** In-memory `AdjacencyProvider`. Built from a `BuildResult` in four lines — no file, schema,
|
|
2
|
+
* writer or worker — so tests exercise the same code paths production uses without slow setup. */
|
|
10
3
|
import type { IREdge, IRNode, UnresolvedRef } from "@descryy/ir";
|
|
11
4
|
import { type AdjacencyProvider } from "./provider.ts";
|
|
12
5
|
export interface MemoryGraph {
|
|
@@ -15,6 +8,9 @@ export interface MemoryGraph {
|
|
|
15
8
|
readonly unresolved?: readonly UnresolvedRef[];
|
|
16
9
|
readonly commitSha?: string | null;
|
|
17
10
|
readonly graphBuiltAt?: number | null;
|
|
11
|
+
/** Run-level provenance for `sourcesRun()`. Explicit, not derived — an in-memory graph has no
|
|
12
|
+
* `adapter_runs` table; a test that cares states it directly instead of proving it indirectly. */
|
|
13
|
+
readonly sourcesRun?: readonly string[];
|
|
18
14
|
}
|
|
19
15
|
export declare function createMemoryProvider(graph: MemoryGraph): AdjacencyProvider;
|
|
20
16
|
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/query/memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/query/memory.ts"],"names":[],"mappings":"AAAA;mGACmG;AAEnG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAY,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,EAIL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC/C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC;uGACmG;IACnG,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAsE1E"}
|
package/dist/query/memory.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The reason the interface exists. Building one of these from a `BuildResult` is
|
|
5
|
-
* four lines and needs no file, no schema, no writer and no worker — so the
|
|
6
|
-
* traversal and query tests below it exercise the same code paths production
|
|
7
|
-
* uses, without any of the setup that would otherwise make them slow enough to
|
|
8
|
-
* skip.
|
|
9
|
-
*/
|
|
1
|
+
/** In-memory `AdjacencyProvider`. Built from a `BuildResult` in four lines — no file, schema,
|
|
2
|
+
* writer or worker — so tests exercise the same code paths production uses without slow setup. */
|
|
10
3
|
import { applyAdjacencyOptions, DEFAULT_NODE_SET_LIMIT, } from "./provider.js";
|
|
11
4
|
import { IR_SCHEMA_VERSION } from "../store/schema.js";
|
|
12
5
|
export function createMemoryProvider(graph) {
|
|
@@ -21,14 +14,12 @@ export function createMemoryProvider(graph) {
|
|
|
21
14
|
commitSha: graph.commitSha ?? null,
|
|
22
15
|
graphBuiltAt: graph.graphBuiltAt ?? null,
|
|
23
16
|
irSchemaVersion: IR_SCHEMA_VERSION,
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
// report — one is the healthy value, same as a single-commit SQLite store.
|
|
17
|
+
// One snapshot, not multiple adapter_runs rows — no commit-spread signal to report; 1 is
|
|
18
|
+
// the healthy value, same as a single-commit SQLite store.
|
|
27
19
|
commitSpread: 1,
|
|
28
20
|
};
|
|
29
|
-
// Indexed once
|
|
30
|
-
//
|
|
31
|
-
// an O(3n) one for no reason.
|
|
21
|
+
// Indexed once, not filtered per call — the contract engine asks for three types in a row,
|
|
22
|
+
// and a linear scan each time turns an O(n) report into O(3n) for no reason.
|
|
32
23
|
const byType = new Map();
|
|
33
24
|
for (const node of graph.nodes) {
|
|
34
25
|
let bucket = byType.get(node.type);
|
|
@@ -38,6 +29,30 @@ export function createMemoryProvider(graph) {
|
|
|
38
29
|
}
|
|
39
30
|
for (const bucket of byType.values())
|
|
40
31
|
bucket.sort((a, b) => a.id.localeCompare(b.id));
|
|
32
|
+
// Derived only when the caller doesn't state `sourcesRun`: the adapter half of every
|
|
33
|
+
// `producedBy`, plus every producer in `corroboratedBy` (where a merge's loser is still
|
|
34
|
+
// named). Approximation good enough for tests; store-backed answers from adapter_runs instead.
|
|
35
|
+
const adapterIdOf = (producedBy) => producedBy.split("@")[0] ?? producedBy;
|
|
36
|
+
const derivedSources = new Set();
|
|
37
|
+
for (const node of graph.nodes) {
|
|
38
|
+
derivedSources.add(adapterIdOf(node.producedBy));
|
|
39
|
+
const corroborated = node.attrs?.["corroboratedBy"];
|
|
40
|
+
if (Array.isArray(corroborated)) {
|
|
41
|
+
for (const p of corroborated)
|
|
42
|
+
if (typeof p === "string")
|
|
43
|
+
derivedSources.add(adapterIdOf(p));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const edge of graph.edges) {
|
|
47
|
+
derivedSources.add(adapterIdOf(edge.producedBy));
|
|
48
|
+
const corroborated = edge.attrs?.["corroboratedBy"];
|
|
49
|
+
if (Array.isArray(corroborated)) {
|
|
50
|
+
for (const p of corroborated)
|
|
51
|
+
if (typeof p === "string")
|
|
52
|
+
derivedSources.add(adapterIdOf(p));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const sourcesRun = graph.sourcesRun !== undefined ? [...graph.sourcesRun] : [...derivedSources].sort();
|
|
41
56
|
return {
|
|
42
57
|
node: (id) => nodes.get(id),
|
|
43
58
|
outgoing: (id, options) => applyAdjacencyOptions(out.get(id) ?? [], options),
|
|
@@ -54,6 +69,7 @@ export function createMemoryProvider(graph) {
|
|
|
54
69
|
return { refs: truncated ? all.slice(0, limit) : all, truncated };
|
|
55
70
|
},
|
|
56
71
|
baseStamp: () => stamp,
|
|
72
|
+
sourcesRun: () => sourcesRun,
|
|
57
73
|
};
|
|
58
74
|
}
|
|
59
75
|
//# sourceMappingURL=memory.js.map
|
package/dist/query/memory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/query/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AG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;QACvE,CAAC;QACD,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE;YAC1B,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,CAAC;YAC/C,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;YACzF,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,CAAC;YAC7B,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;YAC5D,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;QACpE,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK;QACtB,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1,49 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* ## Why this is not `tierFor`
|
|
6
|
-
*
|
|
7
|
-
* `scoping/tiers.ts` already bands a score into §12.7's tiers 1-4 on **absolute
|
|
8
|
-
* thresholds** (0.7 and 0.3). Reusing it here was the obvious move and it is
|
|
9
|
-
* the wrong one, for a reason that is invisible from the type: the two scores
|
|
10
|
-
* are different quantities that happen to share the range (0, 1].
|
|
11
|
-
*
|
|
12
|
-
* - `scope` scores through `scoping/`: designed per-edge weights, then
|
|
13
|
-
* `finalScore` applies co-change and incident boosts. `weights.ts` says in
|
|
14
|
-
* its own comment that these must "stay on the same scale as an absolute tier
|
|
15
|
-
* threshold" — the thresholds were calibrated against *this* pipeline.
|
|
16
|
-
* - `impact` and `pr_analysis` score through `weightedBfs`, whose default
|
|
17
|
-
* `weightFor` is `edge.confidence` and nothing else. No designed weights, no
|
|
18
|
-
* boosts. `pr_analysis` passes only a budget, so it takes that default.
|
|
19
|
-
*
|
|
20
|
-
* Feeding the second into thresholds calibrated for the first would produce
|
|
21
|
-
* bands that look like §12.7's and mean something else — a calibrated label on
|
|
22
|
-
* an uncalibrated number, which is worse than no band at all because it reads
|
|
23
|
-
* as more precise than it is.
|
|
24
|
-
*
|
|
25
|
-
* ## So this bands on rank, and rank is a fact about the answer
|
|
26
|
-
*
|
|
27
|
-
* "This was the highest-scoring item in this reply" is true whatever produced
|
|
28
|
-
* the score, and it is exactly what "show me the top few" asks for. It claims
|
|
29
|
-
* nothing about magnitude, nothing about a threshold, and nothing that a change
|
|
30
|
-
* of scoring pipeline could silently falsify.
|
|
31
|
-
*
|
|
32
|
-
* The cut-offs are reading-surface sizes rather than measurements — the same
|
|
33
|
-
* footing `NODE_BUDGETS`'s own comment puts its figures on. Tune from data.
|
|
2
|
+
* Bands on rank, not score: `scope` is calibrated for `scoping/tiers.ts`'s thresholds (0.7/0.3), but
|
|
3
|
+
* `impact`/`pr_analysis` score via `weightedBfs`'s uncalibrated default — reusing thresholds there would
|
|
4
|
+
* be a calibrated-looking label on an uncalibrated number. Cut-offs are reading-surface sizes, not measurements.
|
|
34
5
|
*/
|
|
35
6
|
/** Where an item falls in its answer's own ordering. */
|
|
36
7
|
export type Prominence = "top" | "notable" | "rest";
|
|
37
|
-
/**
|
|
38
|
-
* Rank cut-offs, inclusive upper bounds.
|
|
39
|
-
*
|
|
40
|
-
* `top` is three because that is what a developer reads before acting; the
|
|
41
|
-
* same figure `FINDING_CAPS["pre-push"]` reaches independently, from the same
|
|
42
|
-
* reasoning about a blocked developer's attention. It is **not** imported from
|
|
43
|
-
* there: that cap governs findings through the governance funnel, this governs
|
|
44
|
-
* presentation ordering, and coupling them would make a change to either mean
|
|
45
|
-
* a change to both.
|
|
46
|
-
*/
|
|
8
|
+
/** Rank cut-offs, inclusive. `top: 3` matches `FINDING_CAPS["pre-push"]` independently — not imported, different concerns. */
|
|
47
9
|
export declare const PROMINENCE_CUTOFFS: {
|
|
48
10
|
readonly top: 3;
|
|
49
11
|
readonly notable: 10;
|
|
@@ -55,19 +17,8 @@ export interface Ranked {
|
|
|
55
17
|
readonly rank: number;
|
|
56
18
|
readonly prominence: Prominence;
|
|
57
19
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Attach `rank` and `prominence` to items already ordered highest-first.
|
|
60
|
-
*
|
|
61
|
-
* Deliberately does **not** sort. Every caller here already orders its own
|
|
62
|
-
* list, and re-sorting would either be a no-op or silently disagree with the
|
|
63
|
-
* order the caller reported elsewhere in the same reply. Ranking a list that
|
|
64
|
-
* is not in score order is a caller bug this function cannot detect, which is
|
|
65
|
-
* why it says so here rather than pretending to be total over any input.
|
|
66
|
-
*/
|
|
20
|
+
/** Attach `rank`/`prominence` to items already ordered highest-first. Deliberately does not sort. */
|
|
67
21
|
export declare function withProminence<T>(ordered: readonly T[]): readonly (T & Ranked)[];
|
|
68
|
-
/**
|
|
69
|
-
* How many of each band a list holds — the counts a reply shows so a reader
|
|
70
|
-
* knows what the shown items were selected from.
|
|
71
|
-
*/
|
|
22
|
+
/** How many of each band a list holds, so a reader knows what shown items were selected from. */
|
|
72
23
|
export declare function prominenceCounts(total: number): Readonly<Record<Prominence, number>>;
|
|
73
24
|
//# sourceMappingURL=prominence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prominence.d.ts","sourceRoot":"","sources":["../../src/query/prominence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prominence.d.ts","sourceRoot":"","sources":["../../src/query/prominence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD,8HAA8H;AAC9H,eAAO,MAAM,kBAAkB;;;CAAmC,CAAC;AAEnE,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAIrD;AAED,MAAM,WAAW,MAAM;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAMhF;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAIpF"}
|
package/dist/query/prominence.js
CHANGED
|
@@ -1,47 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* ## Why this is not `tierFor`
|
|
6
|
-
*
|
|
7
|
-
* `scoping/tiers.ts` already bands a score into §12.7's tiers 1-4 on **absolute
|
|
8
|
-
* thresholds** (0.7 and 0.3). Reusing it here was the obvious move and it is
|
|
9
|
-
* the wrong one, for a reason that is invisible from the type: the two scores
|
|
10
|
-
* are different quantities that happen to share the range (0, 1].
|
|
11
|
-
*
|
|
12
|
-
* - `scope` scores through `scoping/`: designed per-edge weights, then
|
|
13
|
-
* `finalScore` applies co-change and incident boosts. `weights.ts` says in
|
|
14
|
-
* its own comment that these must "stay on the same scale as an absolute tier
|
|
15
|
-
* threshold" — the thresholds were calibrated against *this* pipeline.
|
|
16
|
-
* - `impact` and `pr_analysis` score through `weightedBfs`, whose default
|
|
17
|
-
* `weightFor` is `edge.confidence` and nothing else. No designed weights, no
|
|
18
|
-
* boosts. `pr_analysis` passes only a budget, so it takes that default.
|
|
19
|
-
*
|
|
20
|
-
* Feeding the second into thresholds calibrated for the first would produce
|
|
21
|
-
* bands that look like §12.7's and mean something else — a calibrated label on
|
|
22
|
-
* an uncalibrated number, which is worse than no band at all because it reads
|
|
23
|
-
* as more precise than it is.
|
|
24
|
-
*
|
|
25
|
-
* ## So this bands on rank, and rank is a fact about the answer
|
|
26
|
-
*
|
|
27
|
-
* "This was the highest-scoring item in this reply" is true whatever produced
|
|
28
|
-
* the score, and it is exactly what "show me the top few" asks for. It claims
|
|
29
|
-
* nothing about magnitude, nothing about a threshold, and nothing that a change
|
|
30
|
-
* of scoring pipeline could silently falsify.
|
|
31
|
-
*
|
|
32
|
-
* The cut-offs are reading-surface sizes rather than measurements — the same
|
|
33
|
-
* footing `NODE_BUDGETS`'s own comment puts its figures on. Tune from data.
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* Rank cut-offs, inclusive upper bounds.
|
|
37
|
-
*
|
|
38
|
-
* `top` is three because that is what a developer reads before acting; the
|
|
39
|
-
* same figure `FINDING_CAPS["pre-push"]` reaches independently, from the same
|
|
40
|
-
* reasoning about a blocked developer's attention. It is **not** imported from
|
|
41
|
-
* there: that cap governs findings through the governance funnel, this governs
|
|
42
|
-
* presentation ordering, and coupling them would make a change to either mean
|
|
43
|
-
* a change to both.
|
|
2
|
+
* Bands on rank, not score: `scope` is calibrated for `scoping/tiers.ts`'s thresholds (0.7/0.3), but
|
|
3
|
+
* `impact`/`pr_analysis` score via `weightedBfs`'s uncalibrated default — reusing thresholds there would
|
|
4
|
+
* be a calibrated-looking label on an uncalibrated number. Cut-offs are reading-surface sizes, not measurements.
|
|
44
5
|
*/
|
|
6
|
+
/** Rank cut-offs, inclusive. `top: 3` matches `FINDING_CAPS["pre-push"]` independently — not imported, different concerns. */
|
|
45
7
|
export const PROMINENCE_CUTOFFS = { top: 3, notable: 10 };
|
|
46
8
|
/** `rank` is 1-based: the highest-scoring item in an answer is rank 1. */
|
|
47
9
|
export function prominenceOf(rank) {
|
|
@@ -51,15 +13,7 @@ export function prominenceOf(rank) {
|
|
|
51
13
|
return "notable";
|
|
52
14
|
return "rest";
|
|
53
15
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Attach `rank` and `prominence` to items already ordered highest-first.
|
|
56
|
-
*
|
|
57
|
-
* Deliberately does **not** sort. Every caller here already orders its own
|
|
58
|
-
* list, and re-sorting would either be a no-op or silently disagree with the
|
|
59
|
-
* order the caller reported elsewhere in the same reply. Ranking a list that
|
|
60
|
-
* is not in score order is a caller bug this function cannot detect, which is
|
|
61
|
-
* why it says so here rather than pretending to be total over any input.
|
|
62
|
-
*/
|
|
16
|
+
/** Attach `rank`/`prominence` to items already ordered highest-first. Deliberately does not sort. */
|
|
63
17
|
export function withProminence(ordered) {
|
|
64
18
|
return ordered.map((item, index) => ({
|
|
65
19
|
...item,
|
|
@@ -67,10 +21,7 @@ export function withProminence(ordered) {
|
|
|
67
21
|
prominence: prominenceOf(index + 1),
|
|
68
22
|
}));
|
|
69
23
|
}
|
|
70
|
-
/**
|
|
71
|
-
* How many of each band a list holds — the counts a reply shows so a reader
|
|
72
|
-
* knows what the shown items were selected from.
|
|
73
|
-
*/
|
|
24
|
+
/** How many of each band a list holds, so a reader knows what shown items were selected from. */
|
|
74
25
|
export function prominenceCounts(total) {
|
|
75
26
|
const top = Math.min(total, PROMINENCE_CUTOFFS.top);
|
|
76
27
|
const notable = Math.max(0, Math.min(total, PROMINENCE_CUTOFFS.notable) - top);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prominence.js","sourceRoot":"","sources":["../../src/query/prominence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prominence.js","sourceRoot":"","sources":["../../src/query/prominence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,8HAA8H;AAC9H,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAW,CAAC;AAEnE,0EAA0E;AAC1E,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,IAAI,kBAAkB,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,IAAI,IAAI,kBAAkB,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACzD,OAAO,MAAM,CAAC;AAChB,CAAC;AAQD,qGAAqG;AACrG,MAAM,UAAU,cAAc,CAAI,OAAqB;IACrD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,GAAG,IAAI;QACP,IAAI,EAAE,KAAK,GAAG,CAAC;QACf,UAAU,EAAE,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC;KACpC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;IAC/E,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC;AACpE,CAAC"}
|