@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
package/dist/scoping/score.js
CHANGED
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* logged incidents, is not unfairly under-scored. `EdgeConfidence` defaults to
|
|
9
|
-
* the edge's own value, which is 1.0 for a well-resolved adapter — so in a clean
|
|
10
|
-
* R3 repository the last three terms vanish and the formula is just weight
|
|
11
|
-
* decay. They do their work in a degraded one, which is the point.
|
|
12
|
-
*
|
|
13
|
-
* **The formula is applied in two parts, not as one product per hop.** Path
|
|
14
|
-
* decay uses only `EdgeWeight × EdgeConfidence`, which is strictly below 1 and
|
|
15
|
-
* therefore always terminates; the two history factors are applied once to a
|
|
16
|
-
* node's final score. See the long note in `weights.ts` for why the literal
|
|
17
|
-
* per-hop form cannot hold alongside §12.3 and §12.7, and DEC-037 for the
|
|
18
|
-
* decision. The short version: compounding a node's incident history at every
|
|
19
|
-
* hop of a path that merely passes through it counts the same evidence
|
|
20
|
-
* repeatedly.
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Per-node history factors, computed once and cached.
|
|
24
|
-
*
|
|
25
|
-
* Both are looked up on the node being *entered*, not on the edge: "this file
|
|
26
|
-
* has been involved in incidents" and "this file moves with the change" are
|
|
27
|
-
* properties of the destination, and computing them per edge would multiply the
|
|
28
|
-
* same boost in twice for a node reached two ways.
|
|
29
|
-
*/
|
|
1
|
+
/** §12.4 impact score: ParentScore × EdgeWeight × ChangeCouplingFactor ×
|
|
2
|
+
* IncidentCorrelationFactor × EdgeConfidence. History factors default 1.0
|
|
3
|
+
* (new file/no incidents isn't under-scored). Applied in two parts, not
|
|
4
|
+
* per-hop: path decay uses EdgeWeight×EdgeConfidence only (<1, terminates);
|
|
5
|
+
* history factors apply once to a node's final score (DEC-037, §12.3/§12.7). */
|
|
6
|
+
/** Per-node history factors, computed once and cached — looked up on the
|
|
7
|
+
* node entered, not the edge, or a node reached two ways double-boosts. */
|
|
30
8
|
export class HistoryFactors {
|
|
31
9
|
#provider;
|
|
32
10
|
#config;
|
|
@@ -38,19 +16,9 @@ export class HistoryFactors {
|
|
|
38
16
|
this.#config = config;
|
|
39
17
|
this.#seeds = seeds;
|
|
40
18
|
}
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* Boosts a node that historically moves with something in the diff. Two things
|
|
45
|
-
* make this narrower than it first appears, and both are honest limits rather
|
|
46
|
-
* than bugs:
|
|
47
|
-
*
|
|
48
|
-
* - `CHANGES_WITH` is **file-to-file**, so this only fires for `FILE` nodes.
|
|
49
|
-
* A `FUNCTION` never has co-change history of its own.
|
|
50
|
-
* - The edge is stored in one canonical direction (DEC-036), so both
|
|
51
|
-
* directions must be read. This is the one edge type where `outgoing` alone
|
|
52
|
-
* is wrong.
|
|
53
|
-
*/
|
|
19
|
+
/** §12.4's `ChangeCouplingFactor` (`CHANGES_WITH`, §11.7). File-to-file
|
|
20
|
+
* only — a `FUNCTION` has no co-change history. Stored in one canonical
|
|
21
|
+
* direction (DEC-036), so both `outgoing`/`incoming` must be read. */
|
|
54
22
|
couplingFor(nodeId) {
|
|
55
23
|
const cached = this.#coupling.get(nodeId);
|
|
56
24
|
if (cached !== undefined)
|
|
@@ -73,13 +41,9 @@ export class HistoryFactors {
|
|
|
73
41
|
this.#coupling.set(nodeId, factor);
|
|
74
42
|
return factor;
|
|
75
43
|
}
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* Saturating rather than linear: the third incident on a file says much less
|
|
80
|
-
* than the first, and an unbounded count would let one pathological file
|
|
81
|
-
* dominate every blast radius it appears in.
|
|
82
|
-
*/
|
|
44
|
+
/** §12.4's `IncidentCorrelationFactor` (`INCIDENT_CORRELATED`, §11.6).
|
|
45
|
+
* Saturating, not linear — an unbounded count would let one pathological
|
|
46
|
+
* file dominate every blast radius. */
|
|
83
47
|
incidentFor(nodeId) {
|
|
84
48
|
const cached = this.#incident.get(nodeId);
|
|
85
49
|
if (cached !== undefined)
|
|
@@ -91,34 +55,20 @@ export class HistoryFactors {
|
|
|
91
55
|
return factor;
|
|
92
56
|
}
|
|
93
57
|
}
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* Strictly below 1 for any valid configuration, so the path score decreases
|
|
98
|
-
* monotonically and traversal terminates on any graph, cyclic or not. That is
|
|
99
|
-
* the whole termination argument, and it does not depend on what the history
|
|
100
|
-
* factors happen to be — which is what makes it a guarantee rather than a hope.
|
|
101
|
-
*/
|
|
58
|
+
/** Per-hop decay: `EdgeWeight × EdgeConfidence` only — strictly <1, so path
|
|
59
|
+
* score decreases monotonically and traversal terminates on any graph. */
|
|
102
60
|
export function hopDecay(edge, config) {
|
|
103
61
|
return config.edgeWeights[edge.type] * edge.confidence;
|
|
104
62
|
}
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* Capped at `maxScore` because §12.7 tiers on absolute thresholds — a boosted
|
|
109
|
-
* score above 1.0 would put a two-hop node above the diff itself.
|
|
110
|
-
*/
|
|
63
|
+
/** A node's final score: best path decay, adjusted once by its own history.
|
|
64
|
+
* Capped at `maxScore` (§12.7 tiers on absolute thresholds). */
|
|
111
65
|
export function finalScore(pathScore, nodeId, config, history) {
|
|
112
66
|
const boosted = pathScore * history.couplingFor(nodeId) * history.incidentFor(nodeId);
|
|
113
67
|
return Math.min(boosted, config.maxScore);
|
|
114
68
|
}
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* Pruning happens on the *unboosted* path score, so the prune point must be
|
|
119
|
-
* lowered by this much — otherwise a node that would clear the threshold once
|
|
120
|
-
* boosted is discarded before its boost is ever computed.
|
|
121
|
-
*/
|
|
69
|
+
/** Largest boost history can add. Pruning runs on the unboosted path score,
|
|
70
|
+
* so the prune point must be lowered by this much or a boostable node is
|
|
71
|
+
* discarded before its boost is computed. */
|
|
122
72
|
export function maxBoost(config) {
|
|
123
73
|
return config.maxCouplingFactor * config.maxIncidentFactor;
|
|
124
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score.js","sourceRoot":"","sources":["../../src/scoping/score.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"score.js","sourceRoot":"","sources":["../../src/scoping/score.ts"],"names":[],"mappings":"AAAA;;;;iFAIiF;AAOjF;4EAC4E;AAC5E,MAAM,OAAO,cAAc;IAChB,SAAS,CAAoB;IAC7B,OAAO,CAAgB;IACvB,MAAM,CAAsB;IAC5B,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtC,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE/C,YAAY,QAA2B,EAAE,MAAqB,EAAE,KAA0B;QACxF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;2EAEuE;IACvE,WAAW,CAAC,MAAc;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;QAExC,MAAM,KAAK,GAAe,CAA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M,CAAC;QACzF,MAAM,SAAS,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED;2EAC2E;AAC3E,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,MAAqB;IAC1D,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;AACzD,CAAC;AAED;iEACiE;AACjE,MAAM,UAAU,UAAU,CACxB,SAAiB,EACjB,MAAc,EACd,MAAqB,EACrB,OAAuB;IAEvB,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtF,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED;;8CAE8C;AAC9C,MAAM,UAAU,QAAQ,CAAC,MAAqB;IAC5C,OAAO,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC7D,CAAC"}
|
package/dist/scoping/tiers.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Scope tiers
|
|
3
|
-
*
|
|
4
|
-
* | Tier | Criteria | Treatment |
|
|
5
|
-
* | --- | --- | --- |
|
|
6
|
-
* | 1 | Directly changed (the diff itself) | Always included |
|
|
7
|
-
* | 2 | Impact score > ~0.7 | Included |
|
|
8
|
-
* | 3 | Impact score ~0.3–0.7 | Included if budget allows |
|
|
9
|
-
* | 4 | Impact score < ~0.3 | Dropped under budget pressure |
|
|
2
|
+
* Scope tiers (§12.7): 1 = seed, always included. 2 = score > 0.7, included.
|
|
3
|
+
* 3 = score 0.3–0.7, included if budget allows. 4 = score < 0.3, dropped under budget pressure.
|
|
10
4
|
*/
|
|
11
5
|
export type ScopeTier = 1 | 2 | 3 | 4;
|
|
12
6
|
export declare const TIER_THRESHOLDS: {
|
|
@@ -14,14 +8,8 @@ export declare const TIER_THRESHOLDS: {
|
|
|
14
8
|
readonly tier3: 0.3;
|
|
15
9
|
};
|
|
16
10
|
export declare function tierFor(score: number, isSeed: boolean): ScopeTier;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* `ide-hover` added P28: architecture §7.5 calls hover out as needing the
|
|
20
|
-
* tightest budget of the seven AI-layer triggers but never gives a figure —
|
|
21
|
-
* no DEC, no blueprint number, unlike the other three. 50 is a deliberate
|
|
22
|
-
* starting value (a quarter of pre-push's 200), not a measurement; tune from
|
|
23
|
-
* data like the rest.
|
|
24
|
-
*/
|
|
11
|
+
/** Node budgets by trigger (DEC-007/§12.6 for pre-push/pr/nightly). `ide-hover`
|
|
12
|
+
* (P28) has no DEC number; 50 is a starting value (quarter of pre-push), not measured. */
|
|
25
13
|
export declare const NODE_BUDGETS: {
|
|
26
14
|
readonly "pre-push": 200;
|
|
27
15
|
readonly "ide-hover": 50;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../../src/scoping/tiers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../../src/scoping/tiers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtC,eAAO,MAAM,eAAe;;;CAAsC,CAAC;AAEnE,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,CAKjE;AAED;2FAC2F;AAC3F,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
package/dist/scoping/tiers.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Scope tiers
|
|
3
|
-
*
|
|
4
|
-
* | Tier | Criteria | Treatment |
|
|
5
|
-
* | --- | --- | --- |
|
|
6
|
-
* | 1 | Directly changed (the diff itself) | Always included |
|
|
7
|
-
* | 2 | Impact score > ~0.7 | Included |
|
|
8
|
-
* | 3 | Impact score ~0.3–0.7 | Included if budget allows |
|
|
9
|
-
* | 4 | Impact score < ~0.3 | Dropped under budget pressure |
|
|
2
|
+
* Scope tiers (§12.7): 1 = seed, always included. 2 = score > 0.7, included.
|
|
3
|
+
* 3 = score 0.3–0.7, included if budget allows. 4 = score < 0.3, dropped under budget pressure.
|
|
10
4
|
*/
|
|
11
5
|
export const TIER_THRESHOLDS = { tier2: 0.7, tier3: 0.3 };
|
|
12
6
|
export function tierFor(score, isSeed) {
|
|
@@ -18,14 +12,8 @@ export function tierFor(score, isSeed) {
|
|
|
18
12
|
return 3;
|
|
19
13
|
return 4;
|
|
20
14
|
}
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* `ide-hover` added P28: architecture §7.5 calls hover out as needing the
|
|
24
|
-
* tightest budget of the seven AI-layer triggers but never gives a figure —
|
|
25
|
-
* no DEC, no blueprint number, unlike the other three. 50 is a deliberate
|
|
26
|
-
* starting value (a quarter of pre-push's 200), not a measurement; tune from
|
|
27
|
-
* data like the rest.
|
|
28
|
-
*/
|
|
15
|
+
/** Node budgets by trigger (DEC-007/§12.6 for pre-push/pr/nightly). `ide-hover`
|
|
16
|
+
* (P28) has no DEC number; 50 is a starting value (quarter of pre-push), not measured. */
|
|
29
17
|
export const NODE_BUDGETS = {
|
|
30
18
|
"pre-push": 200,
|
|
31
19
|
"ide-hover": 50,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiers.js","sourceRoot":"","sources":["../../src/scoping/tiers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tiers.js","sourceRoot":"","sources":["../../src/scoping/tiers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAW,CAAC;AAEnE,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,MAAe;IACpD,IAAI,MAAM;QAAE,OAAO,CAAC,CAAC;IACrB,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC;IAC5C,IAAI,KAAK,IAAI,eAAe,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,CAAC;AACX,CAAC;AAED;2FAC2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,GAAG;IACf,WAAW,EAAE,EAAE;IACf,EAAE,EAAE,KAAK;IACT,OAAO,EAAE,KAAK;CACN,CAAC"}
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* stops when the score falls below the threshold — **never on hop count**, which
|
|
6
|
-
* is the entire argument of §12.2: a delete reaching a payment gateway four hops
|
|
7
|
-
* away matters, a logging import one hop away does not, and hop-count scoping
|
|
8
|
-
* cannot tell them apart.
|
|
9
|
-
*
|
|
10
|
-
* ## Tier 1 is budget-exempt, and reported separately
|
|
11
|
-
*
|
|
12
|
-
* The diff itself is not a *result* of scoping, it is its input. A PR touching
|
|
13
|
-
* 1,200 files would otherwise consume the entire 1,000-node PR budget on tier 1
|
|
14
|
-
* alone and report zero impact — the answer would be least useful exactly when
|
|
15
|
-
* the change is largest. Seeds are therefore always included and never counted
|
|
16
|
-
* against the budget, and `budgetUsed` reports only what expansion spent.
|
|
17
|
-
*
|
|
18
|
-
* ## Pruning happens on the unboosted score
|
|
19
|
-
*
|
|
20
|
-
* A node's history boost is applied to its final score, not per hop (DEC-037),
|
|
21
|
-
* so expansion cannot know a node's boosted score until it has been reached. The
|
|
22
|
-
* prune point is therefore lowered by the largest boost the configuration
|
|
23
|
-
* permits — otherwise a node that *would* clear the threshold once boosted is
|
|
24
|
-
* discarded before its boost is ever computed. Admissible, in the A* sense: it
|
|
25
|
-
* can keep a node that later scores below threshold, never drop one that would
|
|
26
|
-
* have scored above it.
|
|
2
|
+
* §12.5 diff scoping: seeds are changed nodes at score 1.0; best-first expansion stops on score below
|
|
3
|
+
* threshold, never on hop count (§12.2). Tier 1 (the diff) is always included, budget-exempt, reported
|
|
4
|
+
* separately. Pruning uses the unboosted score, lowered by the max boost (DEC-037) — admissible: never drops a node that would clear the threshold once boosted.
|
|
27
5
|
*/
|
|
28
6
|
import type { IREdge, IRNode } from "@descryy/ir";
|
|
29
7
|
import type { AdjacencyProvider, QueryResult } from "../query/provider.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/scoping/traverse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/scoping/traverse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAY,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIvF,OAAO,EAAyB,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,KAAK;IACpB,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,mFAAmF;IACnF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAKD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,YAAiB,GACzB,WAAW,CAAC,KAAK,CAAC,CA6JpB"}
|
package/dist/scoping/traverse.js
CHANGED
|
@@ -1,49 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* stops when the score falls below the threshold — **never on hop count**, which
|
|
6
|
-
* is the entire argument of §12.2: a delete reaching a payment gateway four hops
|
|
7
|
-
* away matters, a logging import one hop away does not, and hop-count scoping
|
|
8
|
-
* cannot tell them apart.
|
|
9
|
-
*
|
|
10
|
-
* ## Tier 1 is budget-exempt, and reported separately
|
|
11
|
-
*
|
|
12
|
-
* The diff itself is not a *result* of scoping, it is its input. A PR touching
|
|
13
|
-
* 1,200 files would otherwise consume the entire 1,000-node PR budget on tier 1
|
|
14
|
-
* alone and report zero impact — the answer would be least useful exactly when
|
|
15
|
-
* the change is largest. Seeds are therefore always included and never counted
|
|
16
|
-
* against the budget, and `budgetUsed` reports only what expansion spent.
|
|
17
|
-
*
|
|
18
|
-
* ## Pruning happens on the unboosted score
|
|
19
|
-
*
|
|
20
|
-
* A node's history boost is applied to its final score, not per hop (DEC-037),
|
|
21
|
-
* so expansion cannot know a node's boosted score until it has been reached. The
|
|
22
|
-
* prune point is therefore lowered by the largest boost the configuration
|
|
23
|
-
* permits — otherwise a node that *would* clear the threshold once boosted is
|
|
24
|
-
* discarded before its boost is ever computed. Admissible, in the A* sense: it
|
|
25
|
-
* can keep a node that later scores below threshold, never drop one that would
|
|
26
|
-
* have scored above it.
|
|
2
|
+
* §12.5 diff scoping: seeds are changed nodes at score 1.0; best-first expansion stops on score below
|
|
3
|
+
* threshold, never on hop count (§12.2). Tier 1 (the diff) is always included, budget-exempt, reported
|
|
4
|
+
* separately. Pruning uses the unboosted score, lowered by the max boost (DEC-037) — admissible: never drops a node that would clear the threshold once boosted.
|
|
27
5
|
*/
|
|
28
6
|
import { createResolutionFloor } from "../query/resolution-floor.js";
|
|
29
7
|
import { attenuationFor } from "./fanout.js";
|
|
30
8
|
import { finalScore, HistoryFactors, hopDecay, maxBoost } from "./score.js";
|
|
31
9
|
import { NODE_BUDGETS, tierFor } from "./tiers.js";
|
|
32
10
|
import { DEFAULT_SCOPING_CONFIG, ScopingConfigError, validateScopingConfig, } from "./weights.js";
|
|
33
|
-
/**
|
|
34
|
-
* `CHANGES_WITH` is stored in one canonical direction (DEC-036), so scoping must
|
|
35
|
-
* read it both ways. Every other edge type is genuinely directional: impact
|
|
36
|
-
* flows from a changed callee to its callers, not the reverse.
|
|
37
|
-
*/
|
|
11
|
+
/** `CHANGES_WITH` is stored in one canonical direction (DEC-036), so scoping must read it both ways. */
|
|
38
12
|
const UNDIRECTED = new Set(["CHANGES_WITH"]);
|
|
39
13
|
export function scopeChange(provider, changedIds, options = {}) {
|
|
40
14
|
const config = options.config ?? DEFAULT_SCOPING_CONFIG;
|
|
41
15
|
// Refuse to start rather than fail mid-traversal — DEC-028.
|
|
42
16
|
validateScopingConfig(config);
|
|
43
|
-
// DEC-067: `perNodeLimit` truncates the
|
|
44
|
-
//
|
|
45
|
-
// gentler bucket than it belongs in and under-attenuate it. Refused rather
|
|
46
|
-
// than silently mis-bucketed.
|
|
17
|
+
// DEC-067: `perNodeLimit` truncates the count attenuation is derived from,
|
|
18
|
+
// so a limit at/below the last boundary would under-attenuate a hub.
|
|
47
19
|
const finite = config.fanOutBuckets.filter((b) => Number.isFinite(b.upTo));
|
|
48
20
|
const lastBoundary = finite.length === 0 ? 0 : finite[finite.length - 1].upTo;
|
|
49
21
|
if (options.perNodeLimit !== undefined && options.perNodeLimit <= lastBoundary) {
|
|
@@ -59,17 +31,15 @@ export function scopeChange(provider, changedIds, options = {}) {
|
|
|
59
31
|
const pruneAt = config.threshold / maxBoost(config);
|
|
60
32
|
const best = new Map();
|
|
61
33
|
const queue = [];
|
|
62
|
-
// R0, not R4, when no edge is
|
|
63
|
-
//
|
|
64
|
-
// would report that as the strongest evidence tier in the system.
|
|
34
|
+
// R0, not R4, when no edge is traversed — a bare `let floor = 4` would
|
|
35
|
+
// report an isolated node as the strongest evidence tier there is.
|
|
65
36
|
const floor = createResolutionFloor();
|
|
66
37
|
for (const id of changedIds) {
|
|
67
38
|
best.set(id, { score: 1, depth: 0, via: null });
|
|
68
39
|
queue.push({ id, score: 1, depth: 0 });
|
|
69
40
|
}
|
|
70
|
-
// Best-first. A
|
|
71
|
-
//
|
|
72
|
-
// practice and a sorted pop keeps the algorithm readable.
|
|
41
|
+
// Best-first. A heap would be faster, but the queue stays small in
|
|
42
|
+
// practice (bounded by the score threshold), so a sorted pop stays readable.
|
|
73
43
|
while (queue.length > 0) {
|
|
74
44
|
queue.sort((a, b) => b.score - a.score);
|
|
75
45
|
const current = queue.shift();
|
|
@@ -90,11 +60,8 @@ export function scopeChange(provider, changedIds, options = {}) {
|
|
|
90
60
|
if (UNDIRECTED.has(edge.type))
|
|
91
61
|
candidates.push({ edge, next: edge.to });
|
|
92
62
|
}
|
|
93
|
-
// DEC-067
|
|
94
|
-
//
|
|
95
|
-
// hand, so no index or second query is needed. The seed exemption lives
|
|
96
|
-
// inside `attenuationFor`: a hub that was *changed* expands at full
|
|
97
|
-
// strength, a hub that was merely *reached* does not.
|
|
63
|
+
// DEC-067: `candidates.length` is this node's fan-out. The seed exemption
|
|
64
|
+
// lives in `attenuationFor` — a changed hub expands at full strength, a merely-reached one doesn't.
|
|
98
65
|
const attenuation = attenuationFor(candidates.length, current.depth, config.fanOutBuckets);
|
|
99
66
|
for (const { edge, next } of candidates) {
|
|
100
67
|
// Attenuation can only shrink a score, so `pruneAt` stays admissible —
|
|
@@ -151,10 +118,8 @@ export function scopeChange(provider, changedIds, options = {}) {
|
|
|
151
118
|
}
|
|
152
119
|
const resolutionFloor = floor.value();
|
|
153
120
|
if (!floor.observed()) {
|
|
154
|
-
// R0 here means "no edge was followed"
|
|
155
|
-
//
|
|
156
|
-
// below would state the second. Naming the real one, rather than letting a
|
|
157
|
-
// reader infer a badly-resolved walk where no walk happened.
|
|
121
|
+
// R0 here means "no edge was followed" — different from "an edge was
|
|
122
|
+
// followed and resolved no better than R0", which the else-branch states.
|
|
158
123
|
notes.push("No edge was traversed from the changed node(s) at all, so this radius rests on no edge " +
|
|
159
124
|
"evidence. That is not a finding that nothing is affected: the graph holds no traversable " +
|
|
160
125
|
"edge touching them, which a graph built without the source that would carry those edges " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/scoping/traverse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/scoping/traverse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAgC,MAAM,YAAY,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,GAEtB,MAAM,cAAc,CAAC;AAgCtB,wGAAwG;AACxG,MAAM,UAAU,GAA0B,IAAI,GAAG,CAAW,CAAC,cAAc,CAAC,CAAC,CAAC;AAE9E,MAAM,UAAU,WAAW,CACzB,QAA2B,EAC3B,UAA6B,EAC7B,UAAwB,EAAE;IAE1B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,sBAAsB,CAAC;IACxD,4DAA4D;IAC5D,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAE9B,2EAA2E;IAC3E,qEAAqE;IACrE,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,IAAI,CAAC;IAC/E,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY,IAAI,YAAY,EAAE,CAAC;QAC/E,M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B,OAAO,CAAC,MAAM,gBAAgB;YACrF,iDAAiD,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB;YACvF,yCAAyC,CAC5C,CAAC;IACJ,CAAC;IACD,MAAM,eAAe,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;QACtB,qEAAqE;QACrE,0EAA0E;QAC1E,KAAK,CAAC,IAAI,CACR,yFAAyF;YACvF,2FAA2F;YAC3F,0FAA0F;YAC1F,0DAA0D,CAC7D,CAAC;IACJ,CAAC;SAAM,IAAI,eAAe,IAAI,CAAC,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CACR,6DAA6D,eAAe,eAAe;YACzF,gFAAgF,CACnF,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CACR,4BAA4B,OAAO,CAAC,MAAM,mCAAmC,MAAM,QAAQ;YACzF,yFAAyF;YACzF,YAAY,CACf,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAe,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC;IACvE,OAAO;QACL,IAAI,EAAE;YACJ,OAAO;YACP,QAAQ;YACR,OAAO;YACP,MAAM;YACN,UAAU,EAAE,QAAQ,CAAC,MAAM;SAC5B;QACD,KAAK;QACL,SAAS,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;QAC7B,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -1,53 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* ## The one number in the architecture that cannot be used as written
|
|
5
|
-
*
|
|
6
|
-
* §12.3's worked example decays a `CALLS` edge by **×1.0** on its first hop and
|
|
7
|
-
* by **×0.95** on its third. The 0.95 is the usable one; 1.0 is not, for two
|
|
8
|
-
* independent reasons:
|
|
9
|
-
*
|
|
10
|
-
* 1. **It breaks the premise of the whole engine.** §12.2 argues that hop count
|
|
11
|
-
* is a poor proxy for importance and that expansion must stop on *score*. An
|
|
12
|
-
* edge weight of 1.0 means a `CALLS` chain never decays — every node reachable
|
|
13
|
-
* by calls scores exactly 1.0 forever, so the stopping rule degenerates into
|
|
14
|
-
* "stop when the budget runs out", which is hop-count scoping wearing a
|
|
15
|
-
* different name.
|
|
16
|
-
* 2. **It does not terminate.** With `EdgeConfidence` at 1.0 for an R3 edge, the
|
|
17
|
-
* hop factor is exactly 1.0, and on a `CALLS` cycle the traversal never ends.
|
|
18
|
-
* DEC-028 requires the factor to be strictly inside (0, 1).
|
|
19
|
-
*
|
|
20
|
-
* The defaults below therefore use 0.95, and §12.3's stated outcome still holds:
|
|
21
|
-
* the payment gateway three hops out survives and `logger.ts` two hops out is
|
|
22
|
-
* dropped. That test discriminates on the *shape* of the decay, not on whether
|
|
23
|
-
* the first hop was 1.00 or 0.95.
|
|
24
|
-
*
|
|
25
|
-
* ## Three parts of the architecture cannot all be true — and the resolution
|
|
26
|
-
*
|
|
27
|
-
* Writing this file surfaced a genuine inconsistency between §12.3, §12.4 and
|
|
28
|
-
* §12.7. Any two can hold; all three cannot.
|
|
29
|
-
*
|
|
30
|
-
* - **§12.3** needs *high* weights. Its worked example decays `CALLS` and
|
|
31
|
-
* `PROPAGATES_TO` at ~0.95 so a three-hop chain still scores 0.90.
|
|
32
|
-
* - **§12.7** tiers on *absolute* thresholds — tier 2 above 0.7, tier 4 below
|
|
33
|
-
* 0.3 — which are only meaningful if a few hops of a strong edge stay high.
|
|
34
|
-
* Scale the weights down for headroom and the payment gateway §12.3 calls
|
|
35
|
-
* critical lands in tier 4, "dropped under budget pressure".
|
|
36
|
-
* - **§12.4** multiplies by `ChangeCouplingFactor` and
|
|
37
|
-
* `IncidentCorrelationFactor` *at every hop*, and both are boosts above 1.0.
|
|
38
|
-
* A weight of 0.95 with any coupling above 1.053 makes the hop factor exceed
|
|
39
|
-
* 1.0, at which point the score stops decaying and a cycle never terminates.
|
|
40
|
-
*
|
|
41
|
-
* **Resolution: the history factors adjust a node's score once, they do not
|
|
42
|
-
* compound per hop.** Path decay is the product of `edgeWeight × confidence`
|
|
43
|
-
* over the hops, strictly below 1 at every step, so termination is structural.
|
|
44
|
-
* Coupling and incident are then applied to the node's final score.
|
|
45
|
-
*
|
|
46
|
-
* This keeps §12.3's numbers exactly, keeps §12.7's thresholds meaningful, and
|
|
47
|
-
* keeps §12.4's terms doing the work they were introduced for. It is also more
|
|
48
|
-
* defensible than the literal formula: compounding a node's incident history at
|
|
49
|
-
* every hop of a path that merely *passes through* it counts the same evidence
|
|
50
|
-
* repeatedly, which the multiplicative form does silently. See DEC-037.
|
|
2
|
+
* Diff-scoping weights (§12.4). §12.3's worked example uses ×1.0 for a CALLS hop, which is unusable: it never decays and doesn't terminate on a cycle. DEC-028 requires the edge factor strictly inside (0, 1); defaults use 0.95.
|
|
3
|
+
* §12.3 (high weights), §12.7 (absolute tier thresholds) and §12.4 (per-hop coupling/incident boosts) can't all hold at once — resolved by applying coupling/incident once to a node's final score, not per hop, so path decay stays structurally below 1 and terminates (DEC-037).
|
|
51
4
|
*/
|
|
52
5
|
import { type EdgeType } from "@descryy/ir";
|
|
53
6
|
import { type FanOutBucket } from "./fanout.ts";
|
|
@@ -58,40 +11,23 @@ export interface ScopingConfig {
|
|
|
58
11
|
readonly maxCouplingFactor: number;
|
|
59
12
|
/** Ceiling on §12.4's `IncidentCorrelationFactor`. 1.0 disables the boost. */
|
|
60
13
|
readonly maxIncidentFactor: number;
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* absolute tier thresholds, so they must stay on the same scale as an
|
|
64
|
-
* unboosted one.
|
|
65
|
-
*/
|
|
14
|
+
/** Ceiling on a node's final boosted score — kept on the same scale as an
|
|
15
|
+
* unboosted one for §12.7's absolute tier thresholds. */
|
|
66
16
|
readonly maxScore: number;
|
|
67
17
|
/** §12.6: expansion halts once the score falls below this. Not a hop count. */
|
|
68
18
|
readonly threshold: number;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* traversal *arrived at* — never to a seed, and never to an edge's weight.
|
|
72
|
-
*/
|
|
19
|
+
/** DEC-067's fan-out attenuation, applied to a hub traversal arrived at —
|
|
20
|
+
* never to a seed or an edge's weight. */
|
|
73
21
|
readonly fanOutBuckets: readonly FanOutBucket[];
|
|
74
22
|
}
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* **Tuning, not architecture.** §12 is marked `DECIDED, TUNING OPEN` and §32
|
|
79
|
-
* items 1 and 4 list edge weights as values to set from real traversal data.
|
|
80
|
-
* These are starting points chosen to reproduce §12.3's example, and the three
|
|
81
|
-
* that matter are the ones that example names: `CALLS`, `PROPAGATES_TO` and
|
|
82
|
-
* `IMPORTS`.
|
|
83
|
-
*/
|
|
23
|
+
/** Default weights — tuning, not architecture (§12 `DECIDED, TUNING OPEN`, §32
|
|
24
|
+
* items 1/4). Starting points chosen to reproduce §12.3's example. */
|
|
84
25
|
export declare const DEFAULT_EDGE_WEIGHTS: Readonly<Record<EdgeType, number>>;
|
|
85
26
|
export declare const DEFAULT_SCOPING_CONFIG: ScopingConfig;
|
|
86
27
|
export declare class ScopingConfigError extends Error {
|
|
87
28
|
readonly name = "ScopingConfigError";
|
|
88
29
|
}
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* The check is per edge type because the failure is: one type's weight, boosted
|
|
93
|
-
* to its declared maxima, reaching 1.0. A global average would hide exactly the
|
|
94
|
-
* case that matters.
|
|
95
|
-
*/
|
|
30
|
+
/** Refuses a config that could fail to terminate (DEC-028's config-load half).
|
|
31
|
+
* Checked per edge type — a global average would hide one type reaching 1.0. */
|
|
96
32
|
export declare function validateScopingConfig(config: ScopingConfig): void;
|
|
97
33
|
//# sourceMappingURL=weights.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights.d.ts","sourceRoot":"","sources":["../../src/scoping/weights.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"weights.d.ts","sourceRoot":"","sources":["../../src/scoping/weights.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAA0C,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAExF,MAAM,WAAW,aAAa;IAC5B,uFAAuF;IACvF,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC;8DAC0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;+CAC2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;CACjD;AAED;uEACuE;AACvE,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAqBnE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,aAQpC,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAkB,IAAI,wBAAwB;CAC/C;AAED;iFACiF;AACjF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CA8DjE"}
|