@descryy/core 0.4.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 +23 -11
- package/dist/contracts/engine.d.ts.map +1 -1
- package/dist/contracts/engine.js +23 -11
- package/dist/contracts/engine.js.map +1 -1
- package/dist/contracts/orphans.d.ts +18 -122
- package/dist/contracts/orphans.d.ts.map +1 -1
- package/dist/contracts/orphans.js +36 -134
- package/dist/contracts/orphans.js.map +1 -1
- package/dist/contracts/paths.d.ts +4 -114
- package/dist/contracts/paths.d.ts.map +1 -1
- package/dist/contracts/paths.js +7 -140
- package/dist/contracts/paths.js.map +1 -1
- package/dist/contracts/shapes.d.ts +13 -66
- package/dist/contracts/shapes.d.ts.map +1 -1
- package/dist/contracts/shapes.js +20 -91
- package/dist/contracts/shapes.js.map +1 -1
- package/dist/governance/budget.d.ts +12 -48
- package/dist/governance/budget.d.ts.map +1 -1
- package/dist/governance/budget.js +12 -48
- package/dist/governance/budget.js.map +1 -1
- package/dist/governance/candidate-boundary.d.ts +4 -32
- package/dist/governance/candidate-boundary.d.ts.map +1 -1
- package/dist/governance/candidate-boundary.js +4 -32
- package/dist/governance/candidate-boundary.js.map +1 -1
- package/dist/governance/escalation.d.ts +7 -45
- package/dist/governance/escalation.d.ts.map +1 -1
- package/dist/governance/escalation.js +7 -45
- package/dist/governance/escalation.js.map +1 -1
- package/dist/governance/fact-boundary.d.ts +7 -49
- package/dist/governance/fact-boundary.d.ts.map +1 -1
- package/dist/governance/fact-boundary.js +5 -43
- package/dist/governance/fact-boundary.js.map +1 -1
- package/dist/governance/finding-funnel.d.ts +11 -72
- package/dist/governance/finding-funnel.d.ts.map +1 -1
- package/dist/governance/finding-funnel.js +9 -68
- package/dist/governance/finding-funnel.js.map +1 -1
- package/dist/graph/build.d.ts +9 -90
- package/dist/graph/build.d.ts.map +1 -1
- package/dist/graph/build.js +15 -62
- package/dist/graph/build.js.map +1 -1
- package/dist/graph/cross-language.d.ts +4 -43
- package/dist/graph/cross-language.d.ts.map +1 -1
- package/dist/graph/cross-language.js +9 -77
- package/dist/graph/cross-language.js.map +1 -1
- package/dist/graph/merge.d.ts +8 -88
- package/dist/graph/merge.d.ts.map +1 -1
- package/dist/graph/merge.js +9 -93
- package/dist/graph/merge.js.map +1 -1
- package/dist/graph/observed-tests.d.ts +7 -68
- package/dist/graph/observed-tests.d.ts.map +1 -1
- package/dist/graph/observed-tests.js +5 -60
- package/dist/graph/observed-tests.js.map +1 -1
- package/dist/graph/persist.d.ts +2 -25
- package/dist/graph/persist.d.ts.map +1 -1
- package/dist/graph/persist.js +2 -25
- package/dist/graph/persist.js.map +1 -1
- package/dist/graph/runtime-confirmation.d.ts +14 -91
- package/dist/graph/runtime-confirmation.d.ts.map +1 -1
- package/dist/graph/runtime-confirmation.js +19 -103
- package/dist/graph/runtime-confirmation.js.map +1 -1
- package/dist/ledger/mint.d.ts +9 -43
- package/dist/ledger/mint.d.ts.map +1 -1
- package/dist/ledger/mint.js +15 -65
- package/dist/ledger/mint.js.map +1 -1
- package/dist/ledger/resolve.d.ts +13 -81
- package/dist/ledger/resolve.d.ts.map +1 -1
- package/dist/ledger/resolve.js +13 -76
- package/dist/ledger/resolve.js.map +1 -1
- package/dist/multipr/fingerprint.d.ts +5 -46
- package/dist/multipr/fingerprint.d.ts.map +1 -1
- package/dist/multipr/fingerprint.js +22 -74
- package/dist/multipr/fingerprint.js.map +1 -1
- package/dist/multipr/hidden-dependency.d.ts +13 -73
- package/dist/multipr/hidden-dependency.d.ts.map +1 -1
- package/dist/multipr/hidden-dependency.js +12 -63
- package/dist/multipr/hidden-dependency.js.map +1 -1
- package/dist/multipr/mechanical.d.ts +25 -160
- package/dist/multipr/mechanical.d.ts.map +1 -1
- package/dist/multipr/mechanical.js +21 -137
- package/dist/multipr/mechanical.js.map +1 -1
- package/dist/multipr/migration-heads.d.ts +18 -105
- package/dist/multipr/migration-heads.d.ts.map +1 -1
- package/dist/multipr/migration-heads.js +15 -84
- package/dist/multipr/migration-heads.js.map +1 -1
- package/dist/multipr/overlap.d.ts +16 -94
- package/dist/multipr/overlap.d.ts.map +1 -1
- package/dist/multipr/overlap.js +25 -105
- package/dist/multipr/overlap.js.map +1 -1
- package/dist/multipr/scope-store.d.ts +15 -80
- package/dist/multipr/scope-store.d.ts.map +1 -1
- package/dist/multipr/scope-store.js +17 -87
- package/dist/multipr/scope-store.js.map +1 -1
- package/dist/multipr/superseded.d.ts +10 -95
- package/dist/multipr/superseded.d.ts.map +1 -1
- package/dist/multipr/superseded.js +7 -60
- package/dist/multipr/superseded.js.map +1 -1
- package/dist/query/confirmed-facts.d.ts +12 -58
- package/dist/query/confirmed-facts.d.ts.map +1 -1
- package/dist/query/confirmed-facts.js +8 -47
- package/dist/query/confirmed-facts.js.map +1 -1
- package/dist/query/declared-value-closure.d.ts +13 -104
- package/dist/query/declared-value-closure.d.ts.map +1 -1
- package/dist/query/declared-value-closure.js +15 -104
- package/dist/query/declared-value-closure.js.map +1 -1
- package/dist/query/memory.d.ts +4 -16
- package/dist/query/memory.d.ts.map +1 -1
- package/dist/query/memory.js +9 -22
- package/dist/query/memory.js.map +1 -1
- package/dist/query/prominence.d.ts +6 -55
- package/dist/query/prominence.d.ts.map +1 -1
- package/dist/query/prominence.js +6 -55
- package/dist/query/prominence.js.map +1 -1
- package/dist/query/provider.d.ts +27 -93
- package/dist/query/provider.d.ts.map +1 -1
- package/dist/query/provider.js +8 -29
- package/dist/query/provider.js.map +1 -1
- package/dist/query/queries.d.ts +15 -65
- package/dist/query/queries.d.ts.map +1 -1
- package/dist/query/queries.js +30 -104
- package/dist/query/queries.js.map +1 -1
- package/dist/query/refusal-fetch.d.ts +8 -85
- package/dist/query/refusal-fetch.d.ts.map +1 -1
- package/dist/query/refusal-fetch.js +11 -93
- package/dist/query/refusal-fetch.js.map +1 -1
- package/dist/query/refusal-questions.d.ts +17 -92
- package/dist/query/refusal-questions.d.ts.map +1 -1
- package/dist/query/refusal-questions.js +14 -78
- package/dist/query/refusal-questions.js.map +1 -1
- package/dist/query/resolution-floor.d.ts +3 -23
- package/dist/query/resolution-floor.d.ts.map +1 -1
- package/dist/query/resolution-floor.js +3 -23
- package/dist/query/resolution-floor.js.map +1 -1
- package/dist/query/root-cause-score.d.ts +11 -161
- package/dist/query/root-cause-score.d.ts.map +1 -1
- package/dist/query/root-cause-score.js +6 -137
- package/dist/query/root-cause-score.js.map +1 -1
- package/dist/query/row-closure-picture.d.ts +5 -67
- package/dist/query/row-closure-picture.d.ts.map +1 -1
- package/dist/query/row-closure-picture.js +6 -67
- package/dist/query/row-closure-picture.js.map +1 -1
- package/dist/query/similar-incidents.d.ts +6 -41
- package/dist/query/similar-incidents.d.ts.map +1 -1
- package/dist/query/similar-incidents.js +15 -69
- package/dist/query/similar-incidents.js.map +1 -1
- package/dist/query/sqlite.d.ts +3 -7
- package/dist/query/sqlite.d.ts.map +1 -1
- package/dist/query/sqlite.js +9 -19
- package/dist/query/sqlite.js.map +1 -1
- package/dist/query/test-coverage.d.ts +5 -45
- package/dist/query/test-coverage.d.ts.map +1 -1
- package/dist/query/test-coverage.js +10 -53
- package/dist/query/test-coverage.js.map +1 -1
- package/dist/query/traverse.d.ts +22 -126
- package/dist/query/traverse.d.ts.map +1 -1
- package/dist/query/traverse.js +25 -126
- package/dist/query/traverse.js.map +1 -1
- package/dist/query/unresolved.d.ts +19 -164
- package/dist/query/unresolved.d.ts.map +1 -1
- package/dist/query/unresolved.js +11 -138
- package/dist/query/unresolved.js.map +1 -1
- package/dist/query/verification-status.d.ts +12 -109
- package/dist/query/verification-status.d.ts.map +1 -1
- package/dist/query/verification-status.js +9 -99
- package/dist/query/verification-status.js.map +1 -1
- package/dist/recording/migrate.d.ts +4 -10
- package/dist/recording/migrate.d.ts.map +1 -1
- package/dist/recording/migrate.js +4 -10
- package/dist/recording/migrate.js.map +1 -1
- package/dist/recording/reader.d.ts +2 -7
- package/dist/recording/reader.d.ts.map +1 -1
- package/dist/recording/reader.js +2 -7
- package/dist/recording/reader.js.map +1 -1
- package/dist/recording/redact.d.ts +6 -57
- package/dist/recording/redact.d.ts.map +1 -1
- package/dist/recording/redact.js +8 -64
- package/dist/recording/redact.js.map +1 -1
- package/dist/recording/schema.d.ts +3 -38
- package/dist/recording/schema.d.ts.map +1 -1
- package/dist/recording/schema.js +3 -38
- package/dist/recording/schema.js.map +1 -1
- package/dist/recording/writer.d.ts +11 -74
- package/dist/recording/writer.d.ts.map +1 -1
- package/dist/recording/writer.js +3 -43
- package/dist/recording/writer.js.map +1 -1
- package/dist/scoping/fanout.d.ts +6 -68
- package/dist/scoping/fanout.d.ts.map +1 -1
- package/dist/scoping/fanout.js +6 -68
- package/dist/scoping/fanout.js.map +1 -1
- package/dist/scoping/score.d.ts +20 -70
- package/dist/scoping/score.d.ts.map +1 -1
- package/dist/scoping/score.js +20 -70
- package/dist/scoping/score.js.map +1 -1
- package/dist/scoping/tiers.d.ts +4 -16
- package/dist/scoping/tiers.d.ts.map +1 -1
- package/dist/scoping/tiers.js +4 -16
- package/dist/scoping/tiers.js.map +1 -1
- package/dist/scoping/traverse.d.ts +3 -25
- package/dist/scoping/traverse.d.ts.map +1 -1
- package/dist/scoping/traverse.js +14 -49
- package/dist/scoping/traverse.js.map +1 -1
- package/dist/scoping/weights.d.ts +10 -74
- package/dist/scoping/weights.d.ts.map +1 -1
- package/dist/scoping/weights.js +14 -86
- package/dist/scoping/weights.js.map +1 -1
- package/dist/sources/confirmed/incidents.d.ts +5 -35
- package/dist/sources/confirmed/incidents.d.ts.map +1 -1
- package/dist/sources/confirmed/incidents.js +14 -48
- package/dist/sources/confirmed/incidents.js.map +1 -1
- package/dist/sources/git/diff.d.ts +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 +33 -133
- package/dist/sources/git/source.js.map +1 -1
- package/dist/sources/migrations/across-change.d.ts +94 -0
- package/dist/sources/migrations/across-change.d.ts.map +1 -0
- package/dist/sources/migrations/across-change.js +278 -0
- package/dist/sources/migrations/across-change.js.map +1 -0
- package/dist/sources/migrations/dialects.d.ts +20 -36
- package/dist/sources/migrations/dialects.d.ts.map +1 -1
- package/dist/sources/migrations/dialects.js +11 -36
- package/dist/sources/migrations/dialects.js.map +1 -1
- package/dist/sources/migrations/index.d.ts +3 -1
- package/dist/sources/migrations/index.d.ts.map +1 -1
- package/dist/sources/migrations/index.js +2 -1
- package/dist/sources/migrations/index.js.map +1 -1
- package/dist/sources/migrations/read.d.ts +14 -79
- package/dist/sources/migrations/read.d.ts.map +1 -1
- package/dist/sources/migrations/read.js +14 -89
- package/dist/sources/migrations/read.js.map +1 -1
- package/dist/sources/workspace/workspace.d.ts +6 -42
- package/dist/sources/workspace/workspace.d.ts.map +1 -1
- package/dist/sources/workspace/workspace.js +10 -53
- package/dist/sources/workspace/workspace.js.map +1 -1
- package/dist/store/driver/driver.d.ts +9 -38
- package/dist/store/driver/driver.d.ts.map +1 -1
- package/dist/store/driver/driver.js +4 -22
- package/dist/store/driver/driver.js.map +1 -1
- package/dist/store/driver/node-sqlite.d.ts +3 -12
- package/dist/store/driver/node-sqlite.d.ts.map +1 -1
- package/dist/store/driver/node-sqlite.js +4 -18
- package/dist/store/driver/node-sqlite.js.map +1 -1
- package/dist/store/index.d.ts +2 -7
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +4 -10
- package/dist/store/index.js.map +1 -1
- package/dist/store/migrate.d.ts +14 -50
- package/dist/store/migrate.d.ts.map +1 -1
- package/dist/store/migrate.js +15 -52
- package/dist/store/migrate.js.map +1 -1
- package/dist/store/reader.d.ts +19 -84
- package/dist/store/reader.d.ts.map +1 -1
- package/dist/store/reader.js +25 -92
- package/dist/store/reader.js.map +1 -1
- package/dist/store/schema.d.ts +14 -76
- package/dist/store/schema.d.ts.map +1 -1
- package/dist/store/schema.js +14 -76
- package/dist/store/schema.js.map +1 -1
- package/dist/store/writer.d.ts +14 -88
- package/dist/store/writer.d.ts.map +1 -1
- package/dist/store/writer.js +29 -123
- package/dist/store/writer.js.map +1 -1
- package/dist/tiers/certify.d.ts +46 -281
- package/dist/tiers/certify.d.ts.map +1 -1
- package/dist/tiers/certify.js +46 -226
- package/dist/tiers/certify.js.map +1 -1
- package/dist/tiers/ladder.d.ts +7 -51
- package/dist/tiers/ladder.d.ts.map +1 -1
- package/dist/tiers/ladder.js +13 -89
- package/dist/tiers/ladder.js.map +1 -1
- package/dist/validation/attributes.d.ts +6 -55
- package/dist/validation/attributes.d.ts.map +1 -1
- package/dist/validation/attributes.js +6 -55
- package/dist/validation/attributes.js.map +1 -1
- package/dist/validation/config-graph.d.ts +7 -56
- package/dist/validation/config-graph.d.ts.map +1 -1
- package/dist/validation/config-graph.js +15 -61
- package/dist/validation/config-graph.js.map +1 -1
- package/dist/validation/env.d.ts +7 -1
- package/dist/validation/env.d.ts.map +1 -1
- package/dist/validation/env.js +3 -1
- package/dist/validation/env.js.map +1 -1
- package/dist/validation/join-substitution.d.ts +22 -120
- package/dist/validation/join-substitution.d.ts.map +1 -1
- package/dist/validation/join-substitution.js +13 -90
- package/dist/validation/join-substitution.js.map +1 -1
- package/dist/validation/migration-integrity.d.ts +11 -72
- package/dist/validation/migration-integrity.d.ts.map +1 -1
- package/dist/validation/migration-integrity.js +16 -79
- package/dist/validation/migration-integrity.js.map +1 -1
- package/dist/validation/migrations.d.ts +22 -101
- package/dist/validation/migrations.d.ts.map +1 -1
- package/dist/validation/migrations.js +19 -83
- package/dist/validation/migrations.js.map +1 -1
- package/dist/validation/nodes.d.ts +3 -1
- package/dist/validation/nodes.d.ts.map +1 -1
- package/dist/validation/nodes.js +3 -1
- package/dist/validation/nodes.js.map +1 -1
- package/dist/validation/rollback.d.ts +10 -73
- package/dist/validation/rollback.d.ts.map +1 -1
- package/dist/validation/rollback.js +15 -82
- package/dist/validation/rollback.js.map +1 -1
- package/dist/validation/route-drift.d.ts +9 -62
- package/dist/validation/route-drift.d.ts.map +1 -1
- package/dist/validation/route-drift.js +7 -52
- package/dist/validation/route-drift.js.map +1 -1
- package/dist/validation/sources.d.ts +16 -94
- package/dist/validation/sources.d.ts.map +1 -1
- package/dist/validation/sources.js +51 -147
- package/dist/validation/sources.js.map +1 -1
- package/dist/worker/pool.d.ts +6 -45
- package/dist/worker/pool.d.ts.map +1 -1
- package/dist/worker/pool.js +5 -42
- package/dist/worker/pool.js.map +1 -1
- package/dist/worker/protocol.d.ts +7 -20
- package/dist/worker/protocol.d.ts.map +1 -1
- package/dist/worker/protocol.js +3 -10
- package/dist/worker/protocol.js.map +1 -1
- package/dist/worker/traversal.worker.d.ts +2 -21
- package/dist/worker/traversal.worker.d.ts.map +1 -1
- package/dist/worker/traversal.worker.js +4 -23
- package/dist/worker/traversal.worker.js.map +1 -1
- package/package.json +11 -2
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":"AAA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,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,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P,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"}
|
package/dist/scoping/weights.js
CHANGED
|
@@ -1,65 +1,11 @@
|
|
|
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 { EDGE_TYPES } from "@descryy/ir";
|
|
53
6
|
import { DEFAULT_FANOUT_BUCKETS, maxAttenuation } from "./fanout.js";
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* **Tuning, not architecture.** §12 is marked `DECIDED, TUNING OPEN` and §32
|
|
58
|
-
* items 1 and 4 list edge weights as values to set from real traversal data.
|
|
59
|
-
* These are starting points chosen to reproduce §12.3's example, and the three
|
|
60
|
-
* that matter are the ones that example names: `CALLS`, `PROPAGATES_TO` and
|
|
61
|
-
* `IMPORTS`.
|
|
62
|
-
*/
|
|
7
|
+
/** Default weights — tuning, not architecture (§12 `DECIDED, TUNING OPEN`, §32
|
|
8
|
+
* items 1/4). Starting points chosen to reproduce §12.3's example. */
|
|
63
9
|
export const DEFAULT_EDGE_WEIGHTS = {
|
|
64
10
|
// Structural: a change here really does reach the other side.
|
|
65
11
|
CALLS: 0.95,
|
|
@@ -69,21 +15,15 @@ export const DEFAULT_EDGE_WEIGHTS = {
|
|
|
69
15
|
RETURNS: 0.85,
|
|
70
16
|
WRITES: 0.8,
|
|
71
17
|
READS: 0.75,
|
|
72
|
-
//
|
|
73
|
-
// declaration that embeds it may stop compiling — but it is weaker than a
|
|
74
|
-
// call: the dependant names the type, it does not execute anything. Placed
|
|
75
|
-
// between READS and IMPLEMENTS, and provisional like every other value here.
|
|
18
|
+
// Shape dependency: structural but weaker than a call (names the type, doesn't execute it).
|
|
76
19
|
USES_TYPE: 0.7,
|
|
77
20
|
IMPLEMENTS: 0.7,
|
|
78
21
|
INHERITS: 0.7,
|
|
79
|
-
// §12.3's example:
|
|
80
|
-
// `logger.ts` survives and the engine reports noise as impact.
|
|
22
|
+
// §12.3's example: must decay fast or `logger.ts` survives as noise.
|
|
81
23
|
IMPORTS: 0.4,
|
|
82
|
-
//
|
|
83
|
-
// impact decay, so this only needs to be non-zero.
|
|
24
|
+
// Reached deliberately by test-discovery, not impact decay — just needs non-zero.
|
|
84
25
|
TESTS: 0.5,
|
|
85
|
-
// History
|
|
86
|
-
// 0.5 confidence already (DEC-019); a low weight keeps it as a hint.
|
|
26
|
+
// History not structure; R0, already capped at 0.5 confidence (DEC-019) — low weight keeps it a hint.
|
|
87
27
|
CHANGES_WITH: 0.35,
|
|
88
28
|
INCIDENT_CORRELATED: 0.3,
|
|
89
29
|
FIXED_BY: 0.3,
|
|
@@ -94,21 +34,14 @@ export const DEFAULT_SCOPING_CONFIG = {
|
|
|
94
34
|
maxCouplingFactor: 1.3,
|
|
95
35
|
maxIncidentFactor: 1.2,
|
|
96
36
|
maxScore: 1,
|
|
97
|
-
// §12.3's
|
|
98
|
-
// the prune point sits between them. Above it, §12.7's tier 4 (below 0.3) is
|
|
99
|
-
// kept but is the first thing budget pressure discards.
|
|
37
|
+
// Between §12.3's dropped logger.ts (0.16) and kept utils.ts (0.40).
|
|
100
38
|
threshold: 0.2,
|
|
101
39
|
};
|
|
102
40
|
export class ScopingConfigError extends Error {
|
|
103
41
|
name = "ScopingConfigError";
|
|
104
42
|
}
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* The check is per edge type because the failure is: one type's weight, boosted
|
|
109
|
-
* to its declared maxima, reaching 1.0. A global average would hide exactly the
|
|
110
|
-
* case that matters.
|
|
111
|
-
*/
|
|
43
|
+
/** Refuses a config that could fail to terminate (DEC-028's config-load half).
|
|
44
|
+
* Checked per edge type — a global average would hide one type reaching 1.0. */
|
|
112
45
|
export function validateScopingConfig(config) {
|
|
113
46
|
if (!(config.maxScore > 0) || config.maxScore > 1) {
|
|
114
47
|
throw new ScopingConfigError(`maxScore must be within (0, 1]; got ${config.maxScore}`);
|
|
@@ -120,7 +53,7 @@ export function validateScopingConfig(config) {
|
|
|
120
53
|
if (!(config.threshold > 0) || config.threshold >= 1) {
|
|
121
54
|
throw new ScopingConfigError(`threshold must be within (0, 1); got ${config.threshold}`);
|
|
122
55
|
}
|
|
123
|
-
// DEC-067's table, checked before
|
|
56
|
+
// DEC-067's table, checked before the termination assertion.
|
|
124
57
|
const buckets = config.fanOutBuckets;
|
|
125
58
|
if (buckets.length === 0) {
|
|
126
59
|
throw new ScopingConfigError("fanOutBuckets must not be empty; use a single open bucket to disable attenuation");
|
|
@@ -140,13 +73,8 @@ export function validateScopingConfig(config) {
|
|
|
140
73
|
if (buckets[buckets.length - 1].upTo !== Number.POSITIVE_INFINITY) {
|
|
141
74
|
throw new ScopingConfigError(`the last fan-out bucket must be open (upTo: Infinity), or a node above ${previous} falls in no bucket`);
|
|
142
75
|
}
|
|
143
|
-
// DEC-028's config-load half, widened by DEC-067
|
|
144
|
-
//
|
|
145
|
-
// `maxConfidence` is 1.0 by definition, so a weight of 1.0 is exactly the
|
|
146
|
-
// non-terminating case. Attenuation multiplies into the same product, so a
|
|
147
|
-
// multiplier above 1.0 would make a weight that decays on its own stop
|
|
148
|
-
// decaying in transit. DEC-067 requires this check to widen *before* such a
|
|
149
|
-
// value ships, so it is written now while every multiplier is still <= 1.
|
|
76
|
+
// DEC-028's config-load half, widened by DEC-067: weight × maxAttenuation ×
|
|
77
|
+
// maxConfidence(1.0) must stay < 1, since history factors no longer compound per hop.
|
|
150
78
|
const largest = maxAttenuation(buckets);
|
|
151
79
|
const offenders = [];
|
|
152
80
|
for (const type of EDGE_TYPES) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights.js","sourceRoot":"","sources":["../../src/scoping/weights.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"weights.js","sourceRoot":"","sources":["../../src/scoping/weights.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAqB,MAAM,aAAa,CAAC;AAmBxF;uEACuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAuC;IACtE,8DAA8D;IAC9D,KAAK,EAAE,IAAI;IACX,aAAa,E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W,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC;YAC3C,SAAS,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,kBAAkB,CAC1B,wFAAwF;YACtF,mDAAmD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YACrF,wFAAwF;YACxF,4CAA4C;YAC5C,wFAAwF;YACxF,iBAAiB,CACpB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* A `ConfirmedIncident` lives in `.descry/config.json` because it is testimony
|
|
7
|
-
* — a developer fixed something and said so, and no commit records that they
|
|
8
|
-
* said it (see the type's own doc). But a store is derived data: DEC-017 drops
|
|
9
|
-
* every derived table on a schema change and rebuilds from source. So a
|
|
10
|
-
* confirmed incident written *only* into the graph would survive until the next
|
|
11
|
-
* IR-version bump and then vanish, which is the failure the EARNED partition
|
|
12
|
-
* exists to prevent — arriving through a writer that simply did not think about
|
|
13
|
-
* it.
|
|
14
|
-
*
|
|
15
|
-
* Making this a source solves it by construction. The file is the record; the
|
|
16
|
-
* graph is a projection of the record; every `analyze` re-projects. There is no
|
|
17
|
-
* migration to write and no earned table to extend, and the same discipline
|
|
18
|
-
* every other producer in this system already follows applies unchanged: a
|
|
19
|
-
* batch in, `writeBatch` out, invalidation by producer id.
|
|
20
|
-
*
|
|
21
|
-
* ## Identity
|
|
22
|
-
*
|
|
23
|
-
* The `INCIDENT` node keys on `confirmed:<confirmedAt>:<summary>` — the moment
|
|
24
|
-
* the developer said it, plus what they said. Deliberately **not** the file set:
|
|
25
|
-
* node ids never contain a path (renames churn them and silently destroy
|
|
26
|
-
* incident links), and a developer correcting the file list of an incident they
|
|
27
|
-
* already recorded is editing one incident rather than creating a second.
|
|
28
|
-
*
|
|
29
|
-
* ## What it does not do
|
|
30
|
-
*
|
|
31
|
-
* It mints no `FIX_PATTERN` unless the record names a fixing commit, and it
|
|
32
|
-
* never infers one from HEAD. "The developer confirmed an incident" and "the
|
|
33
|
-
* developer confirmed which commit fixed it" are separate claims, and only the
|
|
34
|
-
* second one licenses a `FIXED_BY` edge.
|
|
35
|
-
*/
|
|
1
|
+
/** IRSource projecting developer-confirmed incidents (`.descry/config.json`)
|
|
2
|
+
* into the graph. A source, not a direct write: a store is derived data
|
|
3
|
+
* (DEC-017 drops it on schema bump), so a direct write would silently
|
|
4
|
+
* vanish. `INCIDENT` keys on `confirmed:<at>:<summary>`, never the file
|
|
5
|
+
* set (no paths in node ids). Mints `FIX_PATTERN` only when a commit is named — never inferred from HEAD. */
|
|
36
6
|
import { type ConfirmedIncident, type IdentityScope, type IRSource } from "@descryy/ir";
|
|
37
7
|
export declare const CONFIRMED_INCIDENT_SOURCE_ID = "confirmed-incidents";
|
|
38
8
|
export declare const CONFIRMED_INCIDENT_SOURCE_VERSION = "0.1.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incidents.d.ts","sourceRoot":"","sources":["../../../src/sources/confirmed/incidents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"incidents.d.ts","sourceRoot":"","sources":["../../../src/sources/confirmed/incidents.ts"],"names":[],"mappings":"AAAA;;;;8GAI8G;AAE9G,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAIlB,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAClE,eAAO,MAAM,iCAAiC,UAAU,CAAC;AAGzD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAClD;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE7F;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,8BAA8B,GAAG,QAAQ,CAsI/F"}
|