@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
|
@@ -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 { fileQsp, nodeId, } from "@descryy/ir";
|
|
37
7
|
export const CONFIRMED_INCIDENT_SOURCE_ID = "confirmed-incidents";
|
|
38
8
|
export const CONFIRMED_INCIDENT_SOURCE_VERSION = "0.1.0";
|
|
@@ -50,9 +20,8 @@ export function createConfirmedIncidentSource(options) {
|
|
|
50
20
|
// INCIDENT and FIX_PATTERN are workspace-scoped (DEC-054), FILE is
|
|
51
21
|
// repo-scoped, and `scopeOf` picks between them per type.
|
|
52
22
|
const scope = { repo, workspace: ctx.root.workspace };
|
|
53
|
-
// A record for another
|
|
54
|
-
// structural refusal `applyConfirmedFacts` makes
|
|
55
|
-
// never an inference about a second case.
|
|
23
|
+
// A record for another repo is not this batch's business — same
|
|
24
|
+
// structural refusal `applyConfirmedFacts` makes: never infer across cases.
|
|
56
25
|
const mine = options.incidents.filter((i) => i.repo === repo);
|
|
57
26
|
const nodes = [];
|
|
58
27
|
const edges = [];
|
|
@@ -69,9 +38,8 @@ export function createConfirmedIncidentSource(options) {
|
|
|
69
38
|
name: path.split("/").pop() ?? path,
|
|
70
39
|
file: path,
|
|
71
40
|
range: null,
|
|
72
|
-
// A
|
|
73
|
-
//
|
|
74
|
-
// decision made where none may be made (DEC-026).
|
|
41
|
+
// A path says nothing about language; guessing from extension would
|
|
42
|
+
// be a language decision made where none may be made (DEC-026).
|
|
75
43
|
language: null,
|
|
76
44
|
producedBy: PRODUCED_BY,
|
|
77
45
|
resolution: 0,
|
|
@@ -90,9 +58,8 @@ export function createConfirmedIncidentSource(options) {
|
|
|
90
58
|
producedBy: PRODUCED_BY,
|
|
91
59
|
resolution: 0,
|
|
92
60
|
attrs: {
|
|
93
|
-
// The record's own shape decides this
|
|
94
|
-
//
|
|
95
|
-
// exactly when a person asserted it.
|
|
61
|
+
// The record's own shape decides this: a run id present means a
|
|
62
|
+
// run witnessed it, absent means a person asserted it.
|
|
96
63
|
detectedVia: incident.observedInRun === undefined ? "developer-confirmed" : "runtime-observed",
|
|
97
64
|
...(incident.observedInRun === undefined ? {} : { observedInRun: incident.observedInRun }),
|
|
98
65
|
confirmedBy: incident.confirmedBy,
|
|
@@ -158,10 +125,9 @@ export function createConfirmedIncidentSource(options) {
|
|
|
158
125
|
producedBy: PRODUCED_BY,
|
|
159
126
|
sourceFiles,
|
|
160
127
|
skippedFiles: [],
|
|
161
|
-
// R0
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
// to express it would be the overclaim that ladder exists to prevent.
|
|
128
|
+
// R0: a person's sentence isn't a resolution level. The reliability
|
|
129
|
+
// consequence lives in `humanAsserted` (DEC-223), a separate ceiling —
|
|
130
|
+
// slotting testimony into R0-R4 would be the overclaim the ladder prevents.
|
|
165
131
|
reachedResolution: 0,
|
|
166
132
|
nodes,
|
|
167
133
|
edges,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incidents.js","sourceRoot":"","sources":["../../../src/sources/confirmed/incidents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"incidents.js","sourceRoot":"","sources":["../../../src/sources/confirmed/incidents.ts"],"names":[],"mappings":"AAAA;;;;8GAI8G;AAE9G,OAAO,EACL,OAAO,EACP,MAAM,GASP,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,4BAA4B,GAAG,qBAAqB,CAAC;AAClE,MAAM,CAAC,MAAM,iCAAiC,GAAG,OAAO,CAAC;AACzD,MAAM,WAAW,GAAG,GAAG,4BAA4B,IAAI,iCAAiC,EAAE,CAAC;AAQ3F,2EAA2E;A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AW;gBACvB,WAAW;gBACX,YAAY,EAAE,EAAE;gBAChB,oEAAoE;gBACpE,uEAAuE;gBACvE,4EAA4E;gBAC5E,iBAAiB,EAAE,CAAC;gBACpB,KAAK;gBACL,KAAK;gBACL,UAAU;aACX,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,48 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* bare path list. This answers "what changed in them" — per-file status and
|
|
6
|
-
* line counts always, plus the actual unified-diff patch text when it is
|
|
7
|
-
* cheap enough to hand to a model. §4's own worry ("the client's context
|
|
8
|
-
* window is not yours to spend") is the reason a patch is never returned
|
|
9
|
-
* unconditionally: a single large file rewrite can be tens of thousands of
|
|
10
|
-
* tokens, and a caller that wanted only "did this file change and how much"
|
|
11
|
-
* pays that cost with no way to decline it. `patchOmittedReason` names why,
|
|
12
|
-
* rather than silently shrinking the reply — the empty-denominator rule
|
|
13
|
-
* applies to a dropped patch exactly as it does to a dropped finding.
|
|
14
|
-
*
|
|
15
|
-
* Two size caps here, because one of them bounds nothing on its own:
|
|
16
|
-
* `maxPatchBytes` per file, and `maxTotalPatchBytes` across every patch in the
|
|
17
|
-
* reply. The second exists because a real 48-file branch diff, with 44 patches
|
|
18
|
-
* each *under* the per-file cap, summed to 229KB and hard-failed the call —
|
|
19
|
-
* the reply never reached the caller at all, which is the one failure mode a
|
|
20
|
-
* disclosure cannot repair after the fact.
|
|
21
|
-
*
|
|
22
|
-
* And a third above this file, for the same reason one level out: the same
|
|
23
|
-
* diff re-run with `maxTotalPatchBytes` correctly enforced still failed, at
|
|
24
|
-
* 84,516 characters, because these two caps bound patch text and a reply is
|
|
25
|
-
* not only patch text. `MAX_REPLY_BYTES` and `ToolAnswer.fitToBudget` in the
|
|
26
|
-
* MCP layer bound the serialized reply itself. Nothing here needs to know
|
|
27
|
-
* about that; it is noted because "the aggregate cap is enforced" was once
|
|
28
|
-
* mistaken for "the call now succeeds," and they are different claims.
|
|
29
|
-
*
|
|
30
|
-
* One `git diff` invocation for every file at once, not one per file — a
|
|
31
|
-
* PR touching fifty files would otherwise spawn fifty processes. The output
|
|
32
|
-
* is a concatenation of per-file blocks, each beginning with a line
|
|
33
|
-
* `diff --git a/<path> b/<path>`; parsing splits on that boundary and reads
|
|
34
|
-
* the more specific `rename from`/`rename to`/`new file mode`/
|
|
35
|
-
* `deleted file mode`/`Binary files … differ`/`---`/`+++` lines within each
|
|
36
|
-
* block, which are unambiguous where the `diff --git` header line alone is
|
|
37
|
-
* not (a path containing the literal substring `" b/"` defeats that header's
|
|
38
|
-
* own regex — an accepted, narrow gap, not a silent one, since every other
|
|
39
|
-
* line used here does not share it).
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* The stable prefix of `patchOmittedReason` when the *total* budget, not the
|
|
43
|
-
* per-file cap, is what withheld a patch. Exported so a caller can tell the
|
|
44
|
-
* two apart without matching on prose it does not own.
|
|
2
|
+
* §18's `get_git_diff`: live diff, patch text only when cheap — `patchOmittedReason` names why otherwise.
|
|
3
|
+
* Two caps here (`maxPatchBytes` per file, `maxTotalPatchBytes` total) plus a third in the MCP layer
|
|
4
|
+
* (`MAX_REPLY_BYTES`) — measured real failures at 229KB and 84,516 chars before these existed.
|
|
45
5
|
*/
|
|
6
|
+
/** Stable prefix of `patchOmittedReason` when the total budget, not the per-file cap, withheld a patch. */
|
|
46
7
|
export declare const TOTAL_PATCH_BUDGET_REASON_PREFIX = "the reply's total patch budget";
|
|
47
8
|
export interface GitDiffFile {
|
|
48
9
|
/** Path as it is known after the change (the only path for A/M/D). */
|
|
@@ -64,35 +25,80 @@ export interface GitDiffOptions {
|
|
|
64
25
|
readonly files?: readonly string[];
|
|
65
26
|
/** A file's patch is omitted (stats are still reported) above this many bytes. Default 20,000. */
|
|
66
27
|
readonly maxPatchBytes?: number;
|
|
67
|
-
/**
|
|
68
|
-
* The cap on the sum of all returned patches. Files past it keep their
|
|
69
|
-
* stats and name the budget as the reason. Default 40,000.
|
|
70
|
-
*/
|
|
28
|
+
/** Cap on the sum of all returned patches; files past it keep their stats. Default 40,000. */
|
|
71
29
|
readonly maxTotalPatchBytes?: number;
|
|
72
30
|
}
|
|
73
|
-
/**
|
|
74
|
-
* `base...head` (three dots), matching `changedFiles`'s own reasoning: two
|
|
75
|
-
* dots would include everything changed on `base` since the branch point,
|
|
76
|
-
* misattributing someone else's history to this diff.
|
|
77
|
-
*/
|
|
31
|
+
/** `base...head` (three dots) — two dots would include everything changed on `base` since the branch point. */
|
|
78
32
|
export declare function gitDiff(cwd: string, base: string, head?: string, options?: GitDiffOptions): Promise<readonly GitDiffFile[]>;
|
|
79
33
|
export interface GitWorkingTreeDiffOptions extends GitDiffOptions {
|
|
80
|
-
/**
|
|
81
|
-
* `"unstaged"` (default) — the working tree against the index (`git diff -M`),
|
|
82
|
-
* i.e. edits not yet `git add`-ed.
|
|
83
|
-
* `"staged"` — the index against `HEAD` (`git diff -M --cached`), i.e. what
|
|
84
|
-
* a commit right now would contain.
|
|
85
|
-
* `"all"` — the working tree against `HEAD` (`git diff -M HEAD`), staged and
|
|
86
|
-
* unstaged combined — everything not yet committed.
|
|
87
|
-
*/
|
|
34
|
+
/** `"unstaged"` (default): tree vs. index. `"staged"`: index vs. HEAD. `"all"`: tree vs. HEAD (both). */
|
|
88
35
|
readonly scope?: "unstaged" | "staged" | "all";
|
|
89
36
|
}
|
|
90
37
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* (`HEAD...HEAD` is empty by construction). Reuses the exact same block
|
|
94
|
-
* parser, rename detection and patch cap `gitDiff` does — see
|
|
95
|
-
* `DEC-NEXT-working-tree-diff-in-core` for why a second parser was rejected.
|
|
38
|
+
* Working-tree counterpart to {@link gitDiff}: a live diff against uncommitted state, which no
|
|
39
|
+
* two-revision `git diff` form can express. Reuses the same parser (`DEC-NEXT-working-tree-diff-in-core`).
|
|
96
40
|
*/
|
|
97
41
|
export declare function gitWorkingTreeDiff(cwd: string, options?: GitWorkingTreeDiffOptions): Promise<readonly GitDiffFile[]>;
|
|
42
|
+
export interface GitWorkingTreeChangeOptions extends GitWorkingTreeDiffOptions {
|
|
43
|
+
/**
|
|
44
|
+
* Include files git has never seen, as new-file patches.
|
|
45
|
+
*
|
|
46
|
+
* **Off by default**, so no existing caller changes behaviour by upgrading,
|
|
47
|
+
* and because it is a different question: the three scopes above all ask
|
|
48
|
+
* about files git already tracks.
|
|
49
|
+
*/
|
|
50
|
+
readonly includeUntracked?: boolean;
|
|
51
|
+
/** Cap on untracked files diffed. The real count is reported regardless. */
|
|
52
|
+
readonly maxUntracked?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Directory prefixes whose contents are not the change under review.
|
|
55
|
+
*
|
|
56
|
+
* The same argument as `--exclude-standard`, for state a `.gitignore` does not
|
|
57
|
+
* happen to cover. Descry writes its own graph database inside the repository
|
|
58
|
+
* and nothing gitignores it, so the first working-tree answer on a fresh
|
|
59
|
+
* checkout listed that database and its two SQLite sidecars as the
|
|
60
|
+
* developer's uncommitted change — three files they did not write, at the top
|
|
61
|
+
* of an answer about what they did.
|
|
62
|
+
*
|
|
63
|
+
* Matched as a path prefix at a segment boundary, so `.descry` excludes
|
|
64
|
+
* `.descry/graph.db` and not `src/.descryfile.ts`.
|
|
65
|
+
*/
|
|
66
|
+
readonly exclude?: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
export interface GitWorkingTreeChange {
|
|
69
|
+
readonly files: readonly GitDiffFile[];
|
|
70
|
+
/** Untracked files found, before any cap. */
|
|
71
|
+
readonly untrackedTotal: number;
|
|
72
|
+
/** True when the cap kept some of them out of `files`. */
|
|
73
|
+
readonly untrackedTruncated: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The working tree as a change set, including files git has never seen.
|
|
77
|
+
*
|
|
78
|
+
* ## Why untracked needs its own mechanism
|
|
79
|
+
*
|
|
80
|
+
* No form of `git diff` reports an untracked file. `git diff HEAD` compares
|
|
81
|
+
* against what the index and `HEAD` hold, and a file git has never seen is in
|
|
82
|
+
* neither — so a working-tree mode built on the scopes above alone still misses
|
|
83
|
+
* the most common shape of work in progress: a new file, written, not yet
|
|
84
|
+
* added. That is exactly the case this was built for.
|
|
85
|
+
*
|
|
86
|
+
* ## `--no-index` rather than `add -N`
|
|
87
|
+
*
|
|
88
|
+
* The usual trick is `git add -N` to give the file an intent-to-add entry, then
|
|
89
|
+
* diff normally. **It writes to the index**, and a read tool that mutates the
|
|
90
|
+
* caller's repository to answer a question is not a read tool — it would also
|
|
91
|
+
* race any real `git add` the developer runs while it works.
|
|
92
|
+
*
|
|
93
|
+
* `git diff --no-index -- /dev/null <path>` needs no index and emits exactly the
|
|
94
|
+
* `new file mode` block the shared parser already handles, with the real path.
|
|
95
|
+
* It exits non-zero when the files differ, which for this call is always, so a
|
|
96
|
+
* non-zero exit here is the success case and is read for its stdout.
|
|
97
|
+
*
|
|
98
|
+
* ## `--exclude-standard` is load-bearing
|
|
99
|
+
*
|
|
100
|
+
* Without it the first answer on any real repository is a dependency directory
|
|
101
|
+
* reported as the developer's uncommitted work.
|
|
102
|
+
*/
|
|
103
|
+
export declare function gitWorkingTreeChange(cwd: string, options?: GitWorkingTreeChangeOptions): Promise<GitWorkingTreeChange>;
|
|
98
104
|
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/sources/git/diff.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/sources/git/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA4BH,2GAA2G;AAC3G,eAAO,MAAM,gCAAgC,mCAAmC,CAAC;AAEjF,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,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,OAAO,CAAC;IACpC,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,6CAA6C;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,oBAAoB,CAAC,CA6C/B"}
|
package/dist/sources/git/diff.js
CHANGED
|
@@ -1,79 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* bare path list. This answers "what changed in them" — per-file status and
|
|
6
|
-
* line counts always, plus the actual unified-diff patch text when it is
|
|
7
|
-
* cheap enough to hand to a model. §4's own worry ("the client's context
|
|
8
|
-
* window is not yours to spend") is the reason a patch is never returned
|
|
9
|
-
* unconditionally: a single large file rewrite can be tens of thousands of
|
|
10
|
-
* tokens, and a caller that wanted only "did this file change and how much"
|
|
11
|
-
* pays that cost with no way to decline it. `patchOmittedReason` names why,
|
|
12
|
-
* rather than silently shrinking the reply — the empty-denominator rule
|
|
13
|
-
* applies to a dropped patch exactly as it does to a dropped finding.
|
|
14
|
-
*
|
|
15
|
-
* Two size caps here, because one of them bounds nothing on its own:
|
|
16
|
-
* `maxPatchBytes` per file, and `maxTotalPatchBytes` across every patch in the
|
|
17
|
-
* reply. The second exists because a real 48-file branch diff, with 44 patches
|
|
18
|
-
* each *under* the per-file cap, summed to 229KB and hard-failed the call —
|
|
19
|
-
* the reply never reached the caller at all, which is the one failure mode a
|
|
20
|
-
* disclosure cannot repair after the fact.
|
|
21
|
-
*
|
|
22
|
-
* And a third above this file, for the same reason one level out: the same
|
|
23
|
-
* diff re-run with `maxTotalPatchBytes` correctly enforced still failed, at
|
|
24
|
-
* 84,516 characters, because these two caps bound patch text and a reply is
|
|
25
|
-
* not only patch text. `MAX_REPLY_BYTES` and `ToolAnswer.fitToBudget` in the
|
|
26
|
-
* MCP layer bound the serialized reply itself. Nothing here needs to know
|
|
27
|
-
* about that; it is noted because "the aggregate cap is enforced" was once
|
|
28
|
-
* mistaken for "the call now succeeds," and they are different claims.
|
|
29
|
-
*
|
|
30
|
-
* One `git diff` invocation for every file at once, not one per file — a
|
|
31
|
-
* PR touching fifty files would otherwise spawn fifty processes. The output
|
|
32
|
-
* is a concatenation of per-file blocks, each beginning with a line
|
|
33
|
-
* `diff --git a/<path> b/<path>`; parsing splits on that boundary and reads
|
|
34
|
-
* the more specific `rename from`/`rename to`/`new file mode`/
|
|
35
|
-
* `deleted file mode`/`Binary files … differ`/`---`/`+++` lines within each
|
|
36
|
-
* block, which are unambiguous where the `diff --git` header line alone is
|
|
37
|
-
* not (a path containing the literal substring `" b/"` defeats that header's
|
|
38
|
-
* own regex — an accepted, narrow gap, not a silent one, since every other
|
|
39
|
-
* line used here does not share it).
|
|
2
|
+
* §18's `get_git_diff`: live diff, patch text only when cheap — `patchOmittedReason` names why otherwise.
|
|
3
|
+
* Two caps here (`maxPatchBytes` per file, `maxTotalPatchBytes` total) plus a third in the MCP layer
|
|
4
|
+
* (`MAX_REPLY_BYTES`) — measured real failures at 229KB and 84,516 chars before these existed.
|
|
40
5
|
*/
|
|
41
6
|
import { execFile } from "node:child_process";
|
|
42
7
|
import { promisify } from "node:util";
|
|
43
8
|
import { applySerializedSizeBudget } from "../../budget/index.js";
|
|
44
|
-
import { cleanGitEnv } from "./env.js";
|
|
9
|
+
import { cleanGitEnv, HARDENED_GIT_CONFIG_ARGS } from "./env.js";
|
|
45
10
|
const execFileAsync = promisify(execFile);
|
|
46
|
-
//
|
|
11
|
+
// Strips GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE/GIT_COMMON_DIR, applies HARDENED_GIT_CONFIG_ARGS (env.ts, B-11).
|
|
47
12
|
function run(command, args, options) {
|
|
48
|
-
return execFileAsync(command, args, {
|
|
13
|
+
return execFileAsync(command, [...HARDENED_GIT_CONFIG_ARGS, ...args], {
|
|
49
14
|
...options,
|
|
50
15
|
encoding: "utf8",
|
|
51
16
|
env: cleanGitEnv(),
|
|
52
17
|
});
|
|
53
18
|
}
|
|
54
19
|
const DEFAULT_MAX_PATCH_BYTES = 20_000;
|
|
55
|
-
/**
|
|
56
|
-
* The cap on the sum of every returned patch. A per-file cap bounds no total:
|
|
57
|
-
* 44 files each under the 20,000-byte per-file cap summed to 229KB and
|
|
58
|
-
* hard-failed an ordinary 48-file branch diff before the reply was ever
|
|
59
|
-
* returned.
|
|
60
|
-
*
|
|
61
|
-
* Was 80,000, lowered after the same diff was re-run against that value and
|
|
62
|
-
* the call *still* failed, at 84,516 characters: 80,000 bytes of patch text
|
|
63
|
-
* leaves nothing for the 48 per-file rows, the disclosures and the envelope
|
|
64
|
-
* that surround them, so a budget that large is one the reply can never
|
|
65
|
-
* actually afford to spend. 40,000 leaves the reply's own size ceiling
|
|
66
|
-
* (`MAX_REPLY_BYTES`, in the MCP layer) room to be a backstop rather than the
|
|
67
|
-
* thing that fires on every ordinary wide diff — which matters because this
|
|
68
|
-
* budget's reason names an action the caller can take and that ceiling's does
|
|
69
|
-
* not. A starting value, as before, not a measurement.
|
|
70
|
-
*/
|
|
20
|
+
/** Cap on the sum of every returned patch — a per-file cap alone let 44 files summed to 229KB hard-fail a real diff. Was 80,000, lowered after 84,516 chars still failed. Starting value. */
|
|
71
21
|
const DEFAULT_MAX_TOTAL_PATCH_BYTES = 40_000;
|
|
72
|
-
/**
|
|
73
|
-
* The stable prefix of `patchOmittedReason` when the *total* budget, not the
|
|
74
|
-
* per-file cap, is what withheld a patch. Exported so a caller can tell the
|
|
75
|
-
* two apart without matching on prose it does not own.
|
|
76
|
-
*/
|
|
22
|
+
/** Stable prefix of `patchOmittedReason` when the total budget, not the per-file cap, withheld a patch. */
|
|
77
23
|
export const TOTAL_PATCH_BUDGET_REASON_PREFIX = "the reply's total patch budget";
|
|
78
24
|
function stripPrefix(path, prefix) {
|
|
79
25
|
return path.startsWith(prefix) ? path.slice(prefix.length) : path;
|
|
@@ -138,7 +84,9 @@ function parseDiffBlock(block) {
|
|
|
138
84
|
async function runGitDiff(cwd, revisionArgs, options) {
|
|
139
85
|
const maxPatchBytes = options.maxPatchBytes ?? DEFAULT_MAX_PATCH_BYTES;
|
|
140
86
|
const maxTotalPatchBytes = options.maxTotalPatchBytes ?? DEFAULT_MAX_TOTAL_PATCH_BYTES;
|
|
141
|
-
|
|
87
|
+
// --no-ext-diff (B-11): renders real patch text, so a repo-local
|
|
88
|
+
// `diff.external` would actually run here otherwise.
|
|
89
|
+
const args = ["diff", "--no-ext-diff", "-M", ...revisionArgs];
|
|
142
90
|
if (options.files !== undefined && options.files.length > 0)
|
|
143
91
|
args.push("--", ...options.files);
|
|
144
92
|
const { stdout } = await run("git", args, { cwd, maxBuffer: 256 * 1024 * 1024 });
|
|
@@ -170,19 +118,13 @@ async function runGitDiff(cwd, revisionArgs, options) {
|
|
|
170
118
|
: null,
|
|
171
119
|
});
|
|
172
120
|
}
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
// here and keeps the reason it already has.
|
|
121
|
+
// Aggregate cap, applied after per-file decisions — a file already withheld
|
|
122
|
+
// (binary or over its own cap) costs nothing here.
|
|
176
123
|
return applySerializedSizeBudget(files, {
|
|
177
124
|
maxTotalBytes: maxTotalPatchBytes,
|
|
178
125
|
sizeOf: (f) => (f.patch === null ? 0 : Buffer.byteLength(f.patch, "utf8")),
|
|
179
|
-
// Short on purpose
|
|
180
|
-
//
|
|
181
|
-
// files, or raise maxTotalPatchBytes") was paid for once per file to say
|
|
182
|
-
// the same thing each time, and measured at ~30KB on that diff: more than
|
|
183
|
-
// the patches it was explaining the absence of. The caller is told what to
|
|
184
|
-
// do once, in the reply's own note, which is where advice that is identical
|
|
185
|
-
// for every file belongs.
|
|
126
|
+
// Short on purpose: this reason repeats per file (187 of 200 on one wide
|
|
127
|
+
// diff), so a longer advice tail measured ~30KB — bigger than the patches it explained.
|
|
186
128
|
withhold: (f, spentBytes) => ({
|
|
187
129
|
...f,
|
|
188
130
|
patch: null,
|
|
@@ -191,24 +133,135 @@ async function runGitDiff(cwd, revisionArgs, options) {
|
|
|
191
133
|
}),
|
|
192
134
|
}).items;
|
|
193
135
|
}
|
|
194
|
-
/**
|
|
195
|
-
* `base...head` (three dots), matching `changedFiles`'s own reasoning: two
|
|
196
|
-
* dots would include everything changed on `base` since the branch point,
|
|
197
|
-
* misattributing someone else's history to this diff.
|
|
198
|
-
*/
|
|
136
|
+
/** `base...head` (three dots) — two dots would include everything changed on `base` since the branch point. */
|
|
199
137
|
export async function gitDiff(cwd, base, head = "HEAD", options = {}) {
|
|
200
138
|
return runGitDiff(cwd, [`${base}...${head}`], options);
|
|
201
139
|
}
|
|
202
140
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* (`HEAD...HEAD` is empty by construction). Reuses the exact same block
|
|
206
|
-
* parser, rename detection and patch cap `gitDiff` does — see
|
|
207
|
-
* `DEC-NEXT-working-tree-diff-in-core` for why a second parser was rejected.
|
|
141
|
+
* Working-tree counterpart to {@link gitDiff}: a live diff against uncommitted state, which no
|
|
142
|
+
* two-revision `git diff` form can express. Reuses the same parser (`DEC-NEXT-working-tree-diff-in-core`).
|
|
208
143
|
*/
|
|
209
144
|
export async function gitWorkingTreeDiff(cwd, options = {}) {
|
|
210
145
|
const scope = options.scope ?? "unstaged";
|
|
211
146
|
const revisionArgs = scope === "staged" ? ["--cached"] : scope === "all" ? ["HEAD"] : [];
|
|
212
147
|
return runGitDiff(cwd, revisionArgs, options);
|
|
213
148
|
}
|
|
149
|
+
/** Untracked files past this many are counted and not diffed. */
|
|
150
|
+
const DEFAULT_MAX_UNTRACKED = 200;
|
|
151
|
+
/**
|
|
152
|
+
* The working tree as a change set, including files git has never seen.
|
|
153
|
+
*
|
|
154
|
+
* ## Why untracked needs its own mechanism
|
|
155
|
+
*
|
|
156
|
+
* No form of `git diff` reports an untracked file. `git diff HEAD` compares
|
|
157
|
+
* against what the index and `HEAD` hold, and a file git has never seen is in
|
|
158
|
+
* neither — so a working-tree mode built on the scopes above alone still misses
|
|
159
|
+
* the most common shape of work in progress: a new file, written, not yet
|
|
160
|
+
* added. That is exactly the case this was built for.
|
|
161
|
+
*
|
|
162
|
+
* ## `--no-index` rather than `add -N`
|
|
163
|
+
*
|
|
164
|
+
* The usual trick is `git add -N` to give the file an intent-to-add entry, then
|
|
165
|
+
* diff normally. **It writes to the index**, and a read tool that mutates the
|
|
166
|
+
* caller's repository to answer a question is not a read tool — it would also
|
|
167
|
+
* race any real `git add` the developer runs while it works.
|
|
168
|
+
*
|
|
169
|
+
* `git diff --no-index -- /dev/null <path>` needs no index and emits exactly the
|
|
170
|
+
* `new file mode` block the shared parser already handles, with the real path.
|
|
171
|
+
* It exits non-zero when the files differ, which for this call is always, so a
|
|
172
|
+
* non-zero exit here is the success case and is read for its stdout.
|
|
173
|
+
*
|
|
174
|
+
* ## `--exclude-standard` is load-bearing
|
|
175
|
+
*
|
|
176
|
+
* Without it the first answer on any real repository is a dependency directory
|
|
177
|
+
* reported as the developer's uncommitted work.
|
|
178
|
+
*/
|
|
179
|
+
export async function gitWorkingTreeChange(cwd, options = {}) {
|
|
180
|
+
const all = await gitWorkingTreeDiff(cwd, options);
|
|
181
|
+
const tracked = all.filter((file) => !isExcluded(file.path, options.exclude));
|
|
182
|
+
if (options.includeUntracked !== true) {
|
|
183
|
+
return { files: tracked, untrackedTotal: 0, untrackedTruncated: false };
|
|
184
|
+
}
|
|
185
|
+
const maxUntracked = options.maxUntracked ?? DEFAULT_MAX_UNTRACKED;
|
|
186
|
+
const listArgs = ["ls-files", "--others", "--exclude-standard"];
|
|
187
|
+
if (options.files !== undefined && options.files.length > 0) {
|
|
188
|
+
listArgs.push("--", ...options.files);
|
|
189
|
+
}
|
|
190
|
+
const { stdout } = await run("git", listArgs, { cwd, maxBuffer: 64 * 1024 * 1024 });
|
|
191
|
+
const untracked = stdout
|
|
192
|
+
.split("\n")
|
|
193
|
+
.map((line) => line.trim())
|
|
194
|
+
.filter((line) => line !== "" && !isExcluded(line, options.exclude))
|
|
195
|
+
.sort();
|
|
196
|
+
const diffed = untracked.slice(0, maxUntracked);
|
|
197
|
+
const added = [];
|
|
198
|
+
for (const path of diffed) {
|
|
199
|
+
let text;
|
|
200
|
+
try {
|
|
201
|
+
const result = await run("git", ["diff", "--no-index", "--", "/dev/null", path], {
|
|
202
|
+
cwd,
|
|
203
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
204
|
+
});
|
|
205
|
+
text = result.stdout;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
// Non-zero exit is the ordinary outcome here: `--no-index` reports a
|
|
209
|
+
// difference the way `diff(1)` does. The patch is on the error.
|
|
210
|
+
const stdout = error.stdout;
|
|
211
|
+
if (typeof stdout !== "string" || stdout.trim() === "")
|
|
212
|
+
continue;
|
|
213
|
+
text = stdout;
|
|
214
|
+
}
|
|
215
|
+
const parsed = parseUntrackedBlock(text, path, options);
|
|
216
|
+
if (parsed !== null)
|
|
217
|
+
added.push(parsed);
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
files: [...tracked, ...added].sort((a, b) => a.path.localeCompare(b.path)),
|
|
221
|
+
untrackedTotal: untracked.length,
|
|
222
|
+
untrackedTruncated: untracked.length > diffed.length,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Is this path inside an excluded directory?
|
|
227
|
+
*
|
|
228
|
+
* A segment-boundary prefix match rather than `startsWith`: `.descry` must
|
|
229
|
+
* exclude `.descry/graph.db` and leave `src/.descryfile.ts` alone.
|
|
230
|
+
*/
|
|
231
|
+
function isExcluded(path, exclude) {
|
|
232
|
+
if (exclude === undefined)
|
|
233
|
+
return false;
|
|
234
|
+
return exclude.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
235
|
+
}
|
|
236
|
+
/** One `--no-index` block, through the same cap rules every other patch gets. */
|
|
237
|
+
function parseUntrackedBlock(text, path, options) {
|
|
238
|
+
const block = text.split(/\n(?=diff --git )/).find((b) => b.startsWith("diff --git "));
|
|
239
|
+
if (block === undefined)
|
|
240
|
+
return null;
|
|
241
|
+
const parsed = parseDiffBlock(block);
|
|
242
|
+
if (parsed === null)
|
|
243
|
+
return null;
|
|
244
|
+
const maxPatchBytes = options.maxPatchBytes ?? DEFAULT_MAX_PATCH_BYTES;
|
|
245
|
+
const bytes = Buffer.byteLength(block, "utf8");
|
|
246
|
+
const overCap = !parsed.binary && bytes > maxPatchBytes;
|
|
247
|
+
return {
|
|
248
|
+
// `--no-index` was given a path relative to `cwd` and echoes it back, but
|
|
249
|
+
// the finding is reported under the path the caller asked about.
|
|
250
|
+
path,
|
|
251
|
+
fromPath: null,
|
|
252
|
+
// A file git has never seen is an addition, whatever the block header says
|
|
253
|
+
// about `/dev/null` on the left.
|
|
254
|
+
status: "A",
|
|
255
|
+
binary: parsed.binary,
|
|
256
|
+
additions: parsed.binary ? null : parsed.additions,
|
|
257
|
+
deletions: parsed.binary ? null : 0,
|
|
258
|
+
patch: parsed.binary || overCap ? null : block,
|
|
259
|
+
patchOmittedReason: parsed.binary
|
|
260
|
+
? "binary file — no textual patch"
|
|
261
|
+
: overCap
|
|
262
|
+
? `diff for this file is ${bytes} bytes, over the ${maxPatchBytes}-byte cap — narrow ` +
|
|
263
|
+
'"files" to fetch it on its own, or raise "maxPatchBytes"'
|
|
264
|
+
: null,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
214
267
|
//# sourceMappingURL=diff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/sources/git/diff.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/sources/git/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,+GAA+G;AAC/G,SAAS,GAAG,CACV,OAAe,EACf,IAAuB,EACvB,OAA4C;IAE5C,OAAO,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,wBAAwB,EAAE,GAAG,IAAI,CAAa,EAAE;QAChF,GAAG,OAAO;QACV,QAAQ,EAAE,MAAe;QACzB,GAAG,EAAE,WAAW,EAAE;KACnB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAEvC,6LAA6L;AAC7L,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAE7C,2GAA2G;AAC3G,MAAM,CAAC,MAAM,gCAAgC,GAAG,gCAAgC,CAAC;AAoCjF,SAAS,WAAW,CAAC,IAAY,EAAE,MAAc;IAC/C,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,8BAA8B,CAAC,IA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aAAa,CAAC,CAAC,CAAC;IACvF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,uBAAuB,CAAC;IACvE,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,KAAK,GAAG,aAAa,CAAC;IACxD,OAAO;QACL,0EAA0E;QAC1E,iEAAiE;QACjE,IAAI;QACJ,QAAQ,EAAE,IAAI;QACd,2EAA2E;QAC3E,iCAAiC;QACjC,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS;QAClD,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;QAC9C,kBAAkB,EAAE,MAAM,CAAC,MAAM;YAC/B,CAAC,CAAC,gCAAgC;YAClC,CAAC,CAAC,OAAO;gBACP,CAAC,CAAC,yBAAyB,KAAK,oBAAoB,aAAa,qBAAqB;oBACpF,0DAA0D;gBAC5D,CAAC,CAAC,IAAI;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/** B-11: `cwd` may be an untrusted repo (e.g. an extracted archive with an
|
|
2
|
+
* attacker-authored `.git/config`). `GIT_CONFIG_NOSYSTEM` closes only the
|
|
3
|
+
* system-config layer, not repo-local config — see `HARDENED_GIT_CONFIG_ARGS`. */
|
|
1
4
|
export declare function cleanGitEnv(base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
5
|
+
/** `-c` overrides ahead of every git subcommand against a caller-supplied repo (B-11): neutralises `core.fsmonitor`/`core.pager` (external-command hooks; `GIT_CONFIG_NOSYSTEM` can't reach repo-local config), zero behavioural cost since output here never hits a tty.
|
|
6
|
+
* `diff.external` handled separately via `--no-ext-diff` at its two call sites (`diff.ts`, `multipr/fingerprint.ts`).
|
|
7
|
+
* `filter.*.clean` is NOT addressed — driver name is dynamic per-repo; unreachable through any call here today, disclosed as a residual gap. */
|
|
8
|
+
export declare const HARDENED_GIT_CONFIG_ARGS: readonly string[];
|
|
2
9
|
//# sourceMappingURL=env.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/sources/git/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/sources/git/env.ts"],"names":[],"mappings":"AAMA;;mFAEmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CAKpF;AAED;;iJAEiJ;AACjJ,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAA2D,CAAC"}
|