@descryy/core 0.1.1 → 0.3.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.
Files changed (105) hide show
  1. package/dist/budget/index.d.ts +5 -0
  2. package/dist/budget/index.d.ts.map +1 -0
  3. package/dist/budget/index.js +3 -0
  4. package/dist/budget/index.js.map +1 -0
  5. package/dist/budget/reply.d.ts +67 -0
  6. package/dist/budget/reply.d.ts.map +1 -0
  7. package/dist/budget/reply.js +76 -0
  8. package/dist/budget/reply.js.map +1 -0
  9. package/dist/budget/size.d.ts +43 -0
  10. package/dist/budget/size.d.ts.map +1 -0
  11. package/dist/budget/size.js +52 -0
  12. package/dist/budget/size.js.map +1 -0
  13. package/dist/contracts/engine.d.ts.map +1 -1
  14. package/dist/contracts/engine.js +27 -10
  15. package/dist/contracts/engine.js.map +1 -1
  16. package/dist/contracts/orphans.d.ts +17 -0
  17. package/dist/contracts/orphans.d.ts.map +1 -1
  18. package/dist/contracts/orphans.js +19 -2
  19. package/dist/contracts/orphans.js.map +1 -1
  20. package/dist/graph/cross-language.d.ts +0 -7
  21. package/dist/graph/cross-language.d.ts.map +1 -1
  22. package/dist/graph/cross-language.js +36 -2
  23. package/dist/graph/cross-language.js.map +1 -1
  24. package/dist/graph/index.d.ts +2 -0
  25. package/dist/graph/index.d.ts.map +1 -1
  26. package/dist/graph/index.js +1 -0
  27. package/dist/graph/index.js.map +1 -1
  28. package/dist/graph/observed-tests.d.ts +118 -0
  29. package/dist/graph/observed-tests.d.ts.map +1 -0
  30. package/dist/graph/observed-tests.js +123 -0
  31. package/dist/graph/observed-tests.js.map +1 -0
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +2 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/multipr/mechanical.d.ts.map +1 -1
  37. package/dist/multipr/mechanical.js +1 -0
  38. package/dist/multipr/mechanical.js.map +1 -1
  39. package/dist/query/confirmed-facts.d.ts +21 -5
  40. package/dist/query/confirmed-facts.d.ts.map +1 -1
  41. package/dist/query/confirmed-facts.js +30 -7
  42. package/dist/query/confirmed-facts.js.map +1 -1
  43. package/dist/query/index.d.ts +7 -1
  44. package/dist/query/index.d.ts.map +1 -1
  45. package/dist/query/index.js +4 -1
  46. package/dist/query/index.js.map +1 -1
  47. package/dist/query/memory.d.ts.map +1 -1
  48. package/dist/query/memory.js +4 -0
  49. package/dist/query/memory.js.map +1 -1
  50. package/dist/query/prominence.d.ts +73 -0
  51. package/dist/query/prominence.d.ts.map +1 -0
  52. package/dist/query/prominence.js +79 -0
  53. package/dist/query/prominence.js.map +1 -0
  54. package/dist/query/provider.d.ts +7 -0
  55. package/dist/query/provider.d.ts.map +1 -1
  56. package/dist/query/provider.js.map +1 -1
  57. package/dist/query/queries.d.ts.map +1 -1
  58. package/dist/query/queries.js +39 -15
  59. package/dist/query/queries.js.map +1 -1
  60. package/dist/query/resolution-floor.d.ts +36 -0
  61. package/dist/query/resolution-floor.d.ts.map +1 -0
  62. package/dist/query/resolution-floor.js +39 -0
  63. package/dist/query/resolution-floor.js.map +1 -0
  64. package/dist/query/sqlite.d.ts.map +1 -1
  65. package/dist/query/sqlite.js +1 -0
  66. package/dist/query/sqlite.js.map +1 -1
  67. package/dist/query/test-coverage.d.ts +65 -0
  68. package/dist/query/test-coverage.d.ts.map +1 -0
  69. package/dist/query/test-coverage.js +95 -0
  70. package/dist/query/test-coverage.js.map +1 -0
  71. package/dist/query/traverse.d.ts +60 -2
  72. package/dist/query/traverse.d.ts.map +1 -1
  73. package/dist/query/traverse.js +0 -0
  74. package/dist/query/traverse.js.map +1 -1
  75. package/dist/scoping/traverse.d.ts.map +1 -1
  76. package/dist/scoping/traverse.js +18 -4
  77. package/dist/scoping/traverse.js.map +1 -1
  78. package/dist/sources/confirmed/incidents.d.ts +47 -0
  79. package/dist/sources/confirmed/incidents.d.ts.map +1 -0
  80. package/dist/sources/confirmed/incidents.js +173 -0
  81. package/dist/sources/confirmed/incidents.js.map +1 -0
  82. package/dist/sources/confirmed/index.d.ts +3 -0
  83. package/dist/sources/confirmed/index.d.ts.map +1 -0
  84. package/dist/sources/confirmed/index.js +2 -0
  85. package/dist/sources/confirmed/index.js.map +1 -0
  86. package/dist/sources/git/diff.d.ts +26 -0
  87. package/dist/sources/git/diff.d.ts.map +1 -1
  88. package/dist/sources/git/diff.js +60 -1
  89. package/dist/sources/git/diff.js.map +1 -1
  90. package/dist/sources/git/incidents.d.ts +109 -0
  91. package/dist/sources/git/incidents.d.ts.map +1 -0
  92. package/dist/sources/git/incidents.js +187 -0
  93. package/dist/sources/git/incidents.js.map +1 -0
  94. package/dist/sources/git/index.d.ts +3 -1
  95. package/dist/sources/git/index.d.ts.map +1 -1
  96. package/dist/sources/git/index.js +2 -1
  97. package/dist/sources/git/index.js.map +1 -1
  98. package/dist/sources/git/source.d.ts.map +1 -1
  99. package/dist/sources/git/source.js +0 -0
  100. package/dist/sources/git/source.js.map +1 -1
  101. package/dist/store/schema.d.ts +5 -4
  102. package/dist/store/schema.d.ts.map +1 -1
  103. package/dist/store/schema.js +42 -2
  104. package/dist/store/schema.js.map +1 -1
  105. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/sources/git/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAwBH,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAA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G,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,kGAAkG;IAClG,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAmID;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,IAAI,SAAS,EACb,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAEjC;AAED,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;CAChD;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAIjC"}
@@ -12,6 +12,21 @@
12
12
  * rather than silently shrinking the reply — the empty-denominator rule
13
13
  * applies to a dropped patch exactly as it does to a dropped finding.
14
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
+ *
15
30
  * One `git diff` invocation for every file at once, not one per file — a
16
31
  * PR touching fifty files would otherwise spawn fifty processes. The output
17
32
  * is a concatenation of per-file blocks, each beginning with a line
@@ -25,6 +40,7 @@
25
40
  */
26
41
  import { execFile } from "node:child_process";
27
42
  import { promisify } from "node:util";
43
+ import { applySerializedSizeBudget } from "../../budget/index.js";
28
44
  import { cleanGitEnv } from "./env.js";
29
45
  const execFileAsync = promisify(execFile);
30
46
  // Always strips GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE/GIT_COMMON_DIR — see env.ts.
@@ -36,6 +52,29 @@ function run(command, args, options) {
36
52
  });
37
53
  }
38
54
  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
+ */
71
+ 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
+ */
77
+ export const TOTAL_PATCH_BUDGET_REASON_PREFIX = "the reply's total patch budget";
39
78
  function stripPrefix(path, prefix) {
40
79
  return path.startsWith(prefix) ? path.slice(prefix.length) : path;
41
80
  }
@@ -98,6 +137,7 @@ function parseDiffBlock(block) {
98
137
  }
99
138
  async function runGitDiff(cwd, revisionArgs, options) {
100
139
  const maxPatchBytes = options.maxPatchBytes ?? DEFAULT_MAX_PATCH_BYTES;
140
+ const maxTotalPatchBytes = options.maxTotalPatchBytes ?? DEFAULT_MAX_TOTAL_PATCH_BYTES;
101
141
  const args = ["diff", "-M", ...revisionArgs];
102
142
  if (options.files !== undefined && options.files.length > 0)
103
143
  args.push("--", ...options.files);
@@ -130,7 +170,26 @@ async function runGitDiff(cwd, revisionArgs, options) {
130
170
  : null,
131
171
  });
132
172
  }
133
- return files;
173
+ // The aggregate cap, applied after every per-file decision: a file whose
174
+ // patch was already withheld (binary, or over its own cap) costs nothing
175
+ // here and keeps the reason it already has.
176
+ return applySerializedSizeBudget(files, {
177
+ maxTotalBytes: maxTotalPatchBytes,
178
+ sizeOf: (f) => (f.patch === null ? 0 : Buffer.byteLength(f.patch, "utf8")),
179
+ // Short on purpose. This reason lands on *every* file past the boundary —
180
+ // 187 of 200 on a wide diff — so the advice tail it used to carry ("narrow
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.
186
+ withhold: (f, spentBytes) => ({
187
+ ...f,
188
+ patch: null,
189
+ patchOmittedReason: `${TOTAL_PATCH_BUDGET_REASON_PREFIX} of ${maxTotalPatchBytes} bytes was already spent ` +
190
+ `(${spentBytes} bytes on earlier files)`,
191
+ }),
192
+ }).items;
134
193
  }
135
194
  /**
136
195
  * `base...head` (three dots), matching `changedFiles`'s own reasoning: two
@@ -1 +1 @@
1
- {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/sources/git/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,kFAAkF;AAClF,SAAS,GAAG,CACV,OAAe,EACf,IAAuB,EACvB,OAA4C;IAE5C,OAAO,aAAa,CAAC,OAAO,EAAE,IAAgB,EAAE;QAC9C,GAAG,OAAO;QACV,QAAQ,EAAE,MAAe;QACzB,GAAG,EAAE,WAAW,EAAE;KACnB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAkCvC,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,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAEnE,IAAI,QAAQ,GAAkB,IAAI,CAAC;IACnC,IAAI,MAAM,GAAkB,IAAI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AAO,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,MAAM,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAcD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAW,EACX,UAAqC,EAAE;IAEvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC;IAC1C,MAAM,YAAY,GAAG,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzF,OAAO,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Which commits in a history describe a failure, and how we know.
3
+ *
4
+ * Split out of `source.ts` when the answer stopped being one regex. The git
5
+ * source minted an `INCIDENT` for exactly one thing — a commit body carrying
6
+ * `This reverts commit <40 hex>` — and that produced **zero** incidents across
7
+ * three measured repositories (734/459/203 commits) and two in a real product
8
+ * repository. `similarIncidents` was therefore built, tested, correct and
9
+ * starved: its recall is not 0%, it is not computable, because it has never
10
+ * been given a real incident to find.
11
+ *
12
+ * ## The rule every mechanism here answers to
13
+ *
14
+ * `INCIDENT` is an EARNED node (DEC-017). It is never dropped, it survives
15
+ * every rebuild, and `INCIDENT_CORRELATED` biases diff-scoping traversal toward
16
+ * the files it names for as long as the store exists. A wrong incident is not a
17
+ * bad answer that a later run corrects — it is unrecoverable pollution in the
18
+ * one table that cannot be recomputed away. So:
19
+ *
20
+ * **Every mechanism rests on something a person declared. None rests on
21
+ * something Descry inferred.**
22
+ *
23
+ * A revert trailer is written by `git revert`. A `Revert "…"` subject is typed
24
+ * by a person or by GitHub's own button on their behalf. `Fixes #123` is a
25
+ * developer stating that something was broken and this commit fixed it. What is
26
+ * deliberately *not* here is any reading of "fix", "hotfix" or "bug" in prose —
27
+ * the original mechanism's own comment says why, and it applies unchanged to
28
+ * every mechanism added since: matching on the word "fix" would classify
29
+ * ordinary work as an incident.
30
+ *
31
+ * ## Refusals, not guesses
32
+ *
33
+ * A `Revert "X"` naming a subject this history does not contain, or containing
34
+ * twice, produces a `DetectedRefusal` rather than a ranked guess. Two candidates
35
+ * is a genuine ambiguity and picking the nearer one would be recency standing in
36
+ * for evidence — the same discipline every resolver in this project follows.
37
+ *
38
+ * See `DEC-NEXT-incident-minting-beyond-explicit-reverts`.
39
+ */
40
+ import type { Commit } from "./history.ts";
41
+ /**
42
+ * How an incident was established. Written to `attrs.detectedVia` on the
43
+ * `INCIDENT` node and on its `FIXED_BY` edge, so a consumer can tell a
44
+ * machine-written trailer from a developer's typed sentence.
45
+ */
46
+ export type IncidentMechanism = "explicit-revert" | "manual-revert" | "issue-reference";
47
+ export interface DetectedIncident {
48
+ readonly mechanism: IncidentMechanism;
49
+ /** The commit that resolved it. Always a real commit in the history read. */
50
+ readonly fix: Commit;
51
+ /**
52
+ * The commit that broke it, for the mechanisms that name one.
53
+ *
54
+ * `null` for `issue-reference`, where no bad commit is named at all — the
55
+ * incident is the issue, and that is a different shape rather than a missing
56
+ * field.
57
+ */
58
+ readonly incidentCommit: Commit | null;
59
+ /** `#123`, for `issue-reference`. `null` for the revert mechanisms. */
60
+ readonly issueRef: string | null;
61
+ /**
62
+ * The files to correlate the incident with, already deduplicated and sorted.
63
+ *
64
+ * For a revert these are the files the *reverted* commit touched — where the
65
+ * defect was. For an issue reference there is no such commit, so they are the
66
+ * files the *fix* touched, which is the same claim reached from the other
67
+ * side: this is where the broken code lived.
68
+ */
69
+ readonly correlatedPaths: readonly string[];
70
+ }
71
+ /** A revert whose target could not be established. Disclosed, never dropped. */
72
+ export interface DetectedRefusal {
73
+ readonly fixSha: string;
74
+ /** The subject the revert quoted. */
75
+ readonly rawTarget: string;
76
+ readonly reason: string;
77
+ }
78
+ /**
79
+ * A revert trailer naming a sha this history does not contain.
80
+ *
81
+ * Not a refusal yet, and the distinction is load-bearing: `readHistory` reads
82
+ * HEAD-reachable, non-merge commits within a window, and a squash-merged or
83
+ * branch-deleted target is genuinely absent from that view while still being
84
+ * present in the object database. The caller holds the git process and can go
85
+ * look; this function is synchronous and cannot. Resolved out of band by
86
+ * `source.ts`, and only *then* refused if the object is really gone.
87
+ */
88
+ export interface UnresolvedTrailer {
89
+ readonly fix: Commit;
90
+ readonly revertedSha: string;
91
+ }
92
+ export interface IncidentDetection {
93
+ readonly incidents: readonly DetectedIncident[];
94
+ readonly refusals: readonly DetectedRefusal[];
95
+ readonly unresolvedTrailers: readonly UnresolvedTrailer[];
96
+ }
97
+ /** `git revert` writes this. Machine-generated, and the strongest signal available. */
98
+ declare const REVERT_TRAILER: RegExp;
99
+ /**
100
+ * Every incident this history declares, plus every revert whose target it does
101
+ * not contain.
102
+ *
103
+ * `commits` is the history as `readHistory` returns it — newest first. Order is
104
+ * not relied on for correctness: a revert's target is found by timestamp, so
105
+ * the result is identical for any permutation of the same commits.
106
+ */
107
+ export declare function detectIncidents(commits: readonly Commit[]): IncidentDetection;
108
+ export { REVERT_TRAILER };
109
+ //# sourceMappingURL=incidents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incidents.d.ts","sourceRoot":"","sources":["../../../src/sources/git/incidents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAExF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;IAC9C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC3D;AAED,uFAAuF;AACvF,QAAA,MAAM,cAAc,QAAuC,CAAC;AAkD5D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,iBAAiB,CAgG7E;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,187 @@
1
+ /**
2
+ * Which commits in a history describe a failure, and how we know.
3
+ *
4
+ * Split out of `source.ts` when the answer stopped being one regex. The git
5
+ * source minted an `INCIDENT` for exactly one thing — a commit body carrying
6
+ * `This reverts commit <40 hex>` — and that produced **zero** incidents across
7
+ * three measured repositories (734/459/203 commits) and two in a real product
8
+ * repository. `similarIncidents` was therefore built, tested, correct and
9
+ * starved: its recall is not 0%, it is not computable, because it has never
10
+ * been given a real incident to find.
11
+ *
12
+ * ## The rule every mechanism here answers to
13
+ *
14
+ * `INCIDENT` is an EARNED node (DEC-017). It is never dropped, it survives
15
+ * every rebuild, and `INCIDENT_CORRELATED` biases diff-scoping traversal toward
16
+ * the files it names for as long as the store exists. A wrong incident is not a
17
+ * bad answer that a later run corrects — it is unrecoverable pollution in the
18
+ * one table that cannot be recomputed away. So:
19
+ *
20
+ * **Every mechanism rests on something a person declared. None rests on
21
+ * something Descry inferred.**
22
+ *
23
+ * A revert trailer is written by `git revert`. A `Revert "…"` subject is typed
24
+ * by a person or by GitHub's own button on their behalf. `Fixes #123` is a
25
+ * developer stating that something was broken and this commit fixed it. What is
26
+ * deliberately *not* here is any reading of "fix", "hotfix" or "bug" in prose —
27
+ * the original mechanism's own comment says why, and it applies unchanged to
28
+ * every mechanism added since: matching on the word "fix" would classify
29
+ * ordinary work as an incident.
30
+ *
31
+ * ## Refusals, not guesses
32
+ *
33
+ * A `Revert "X"` naming a subject this history does not contain, or containing
34
+ * twice, produces a `DetectedRefusal` rather than a ranked guess. Two candidates
35
+ * is a genuine ambiguity and picking the nearer one would be recency standing in
36
+ * for evidence — the same discipline every resolver in this project follows.
37
+ *
38
+ * See `DEC-NEXT-incident-minting-beyond-explicit-reverts`.
39
+ */
40
+ /** `git revert` writes this. Machine-generated, and the strongest signal available. */
41
+ const REVERT_TRAILER = /This reverts commit ([0-9a-f]{40})/;
42
+ /**
43
+ * `Revert "the original subject"` — the subject form, written by a person or by
44
+ * GitHub's Revert button, often with no sha anywhere in the commit.
45
+ *
46
+ * Anchored at the start and requiring the quotes: `Revert the auth change` is
47
+ * prose about what the commit does, not a reference to a specific commit, and
48
+ * reading it as one would be exactly the inference this module refuses to make.
49
+ */
50
+ const REVERT_SUBJECT = /^Revert\s+"(.+)"\s*$/;
51
+ /**
52
+ * A closed list of fix-shaped verbs, and only immediately before the reference.
53
+ *
54
+ * `Fixes #123` is a developer stating that something was broken. `See #123` and
55
+ * `Part of #124` are not — they relate a commit to an issue and say nothing
56
+ * about a defect. The verb is what carries the claim, so the verb is what is
57
+ * matched; a bare `#123` mints nothing.
58
+ *
59
+ * `GH-123` is GitHub's own cross-reference form and means the same thing.
60
+ */
61
+ const ISSUE_VERBS = "fix|fixes|fixed|close|closes|closed|resolve|resolves|resolved";
62
+ /** In the subject, anywhere: a subject is a claim about the commit itself. */
63
+ const SUBJECT_ISSUE = new RegExp(`\\b(?:${ISSUE_VERBS})\\s+(?:#|GH-)(\\d+)\\b`, "gi");
64
+ /**
65
+ * In the body, **only in trailer position** — the start of a line, with nothing
66
+ * but whitespace before it.
67
+ *
68
+ * Measured, not supposed. Run over this repository's own history, the
69
+ * anywhere-in-the-body form matched three commits, and all three were prose
70
+ * *about* the convention rather than uses of it: a sentence quoting
71
+ * `"Fixes #123"` as an example, and a bullet reading
72
+ * `- issue-reference: \`Fixes #123\` and its closed list…`. A commit message
73
+ * discussing the convention is not a commit message using it, and an EARNED
74
+ * node minted from one is permanent.
75
+ *
76
+ * The trailer position is where the convention actually lives — it is what
77
+ * GitHub's own tooling emits and what a template puts there — so this costs
78
+ * almost no real recall and removes a whole class of false positive. Rule 2:
79
+ * when in doubt, omit.
80
+ */
81
+ const BODY_ISSUE = new RegExp(`^[ \\t]*(?:${ISSUE_VERBS})\\s+(?:#|GH-)(\\d+)\\b`, "gim");
82
+ function pathsOf(commit) {
83
+ return [...new Set(commit.changes.map((c) => c.path))].sort();
84
+ }
85
+ /**
86
+ * Every incident this history declares, plus every revert whose target it does
87
+ * not contain.
88
+ *
89
+ * `commits` is the history as `readHistory` returns it — newest first. Order is
90
+ * not relied on for correctness: a revert's target is found by timestamp, so
91
+ * the result is identical for any permutation of the same commits.
92
+ */
93
+ export function detectIncidents(commits) {
94
+ const incidents = [];
95
+ const refusals = [];
96
+ const unresolvedTrailers = [];
97
+ const bySha = new Map(commits.map((c) => [c.sha, c]));
98
+ const bySubject = new Map();
99
+ for (const commit of commits) {
100
+ const existing = bySubject.get(commit.subject);
101
+ if (existing === undefined)
102
+ bySubject.set(commit.subject, [commit]);
103
+ else
104
+ existing.push(commit);
105
+ }
106
+ for (const commit of commits) {
107
+ // The trailer first, and exclusively: `git revert` writes both the trailer
108
+ // and the `Revert "…"` subject, so reading the subject as an independent
109
+ // mechanism would mint one incident twice under two different names.
110
+ const revertedSha = REVERT_TRAILER.exec(commit.body)?.[1];
111
+ if (revertedSha !== undefined) {
112
+ const target = bySha.get(revertedSha);
113
+ if (target === undefined)
114
+ unresolvedTrailers.push({ fix: commit, revertedSha });
115
+ else {
116
+ incidents.push({
117
+ mechanism: "explicit-revert",
118
+ fix: commit,
119
+ incidentCommit: target,
120
+ issueRef: null,
121
+ correlatedPaths: pathsOf(target),
122
+ });
123
+ }
124
+ continue;
125
+ }
126
+ const quoted = REVERT_SUBJECT.exec(commit.subject)?.[1];
127
+ if (quoted !== undefined) {
128
+ // Backwards only. A commit cannot revert something that had not happened
129
+ // when it was written, and a same-subject commit landing afterwards is a
130
+ // different commit that happens to share a name.
131
+ const candidates = (bySubject.get(quoted) ?? []).filter((c) => c.timestamp < commit.timestamp);
132
+ if (candidates.length === 1) {
133
+ const target = candidates[0];
134
+ incidents.push({
135
+ mechanism: "manual-revert",
136
+ fix: commit,
137
+ incidentCommit: target,
138
+ issueRef: null,
139
+ correlatedPaths: pathsOf(target),
140
+ });
141
+ }
142
+ else if (candidates.length === 0) {
143
+ refusals.push({
144
+ fixSha: commit.sha,
145
+ rawTarget: quoted,
146
+ reason: 'the commit quotes a subject it reverts, but no commit in the history read here has ' +
147
+ "that subject — it may predate the read window, or live on a branch this read cannot see",
148
+ });
149
+ }
150
+ else {
151
+ refusals.push({
152
+ fixSha: commit.sha,
153
+ rawTarget: quoted,
154
+ reason: `${candidates.length} commits share that subject, so the revert does not identify one. ` +
155
+ "Choosing the nearest would be recency standing in for evidence",
156
+ });
157
+ }
158
+ continue;
159
+ }
160
+ // An issue reference is a claim about a *defect*, made by the person who
161
+ // fixed it. Read from the subject anywhere and from the body only in
162
+ // trailer position — see `BODY_ISSUE` for the three false positives that
163
+ // distinction was measured against.
164
+ const refs = new Set();
165
+ for (const match of commit.subject.matchAll(SUBJECT_ISSUE))
166
+ refs.add(`#${match[1]}`);
167
+ for (const match of commit.body.matchAll(BODY_ISSUE))
168
+ refs.add(`#${match[1]}`);
169
+ for (const issueRef of [...refs].sort()) {
170
+ incidents.push({
171
+ mechanism: "issue-reference",
172
+ fix: commit,
173
+ incidentCommit: null,
174
+ issueRef,
175
+ correlatedPaths: pathsOf(commit),
176
+ });
177
+ }
178
+ }
179
+ // Deterministic: two runs over the same history must produce a byte-identical
180
+ // batch, or the store's content hash moves for no reason.
181
+ incidents.sort((a, b) => a.fix.sha.localeCompare(b.fix.sha) || (a.issueRef ?? "").localeCompare(b.issueRef ?? ""));
182
+ refusals.sort((a, b) => a.fixSha.localeCompare(b.fixSha) || a.rawTarget.localeCompare(b.rawTarget));
183
+ unresolvedTrailers.sort((a, b) => a.fix.sha.localeCompare(b.fix.sha));
184
+ return { incidents, refusals, unresolvedTrailers };
185
+ }
186
+ export { REVERT_TRAILER };
187
+ //# sourceMappingURL=incidents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incidents.js","sourceRoot":"","sources":["../../../src/sources/git/incidents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAiEH,uFAAuF;AACvF,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,WAAW,GAAG,+DAA+D,CAAC;AAEpF,8EAA8E;AAC9E,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,SAAS,WAAW,yBAAyB,EAAE,IAAI,CAAC,CAAC;AAEtF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,cAAc,WAAW,yBAAyB,EAAE,KAAK,CAAC,CAAC;AAEzF,SAA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C,CAC3F,CAAC;IACF,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACpG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEtE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;AACrD,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -2,6 +2,8 @@ export { createGitSource, revertedShaOf, GIT_SOURCE_ID, GIT_SOURCE_VERSION, UNDI
2
2
  export type { GitSourceOptions } from "./source.ts";
3
3
  export { readHistory, gitHead, isGitRepository, filesInCommit, changedFiles, resolveCommitBySha, logForPath, } from "./history.ts";
4
4
  export type { Commit, CommitChange, HistoryOptions, PathLogCommit, PathLogOptions, PathLogResult, } from "./history.ts";
5
- export { gitDiff, gitWorkingTreeDiff } from "./diff.ts";
5
+ export { gitDiff, gitWorkingTreeDiff, TOTAL_PATCH_BUDGET_REASON_PREFIX } from "./diff.ts";
6
6
  export type { GitDiffFile, GitDiffOptions, GitWorkingTreeDiffOptions } from "./diff.ts";
7
+ export { detectIncidents } from "./incidents.ts";
8
+ export type { DetectedIncident, DetectedRefusal, IncidentDetection, IncidentMechanism, UnresolvedTrailer, } from "./incidents.ts";
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sources/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,MAAM,EACN,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sources/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,MAAM,EACN,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC;AAC1F,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { createGitSource, revertedShaOf, GIT_SOURCE_ID, GIT_SOURCE_VERSION, UNDIRECTED_EDGE_TYPES, } from "./source.js";
2
2
  export { readHistory, gitHead, isGitRepository, filesInCommit, changedFiles, resolveCommitBySha, logForPath, } from "./history.js";
3
- export { gitDiff, gitWorkingTreeDiff } from "./diff.js";
3
+ export { gitDiff, gitWorkingTreeDiff, TOTAL_PATCH_BUDGET_REASON_PREFIX } from "./diff.js";
4
+ export { detectIncidents } from "./incidents.js";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sources/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,GACX,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sources/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,GACX,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC;AAG1F,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/sources/git/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACT,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,EAAE;KACf,CAAC;AACJ,CAAC"}
@@ -69,10 +69,11 @@ export declare const NODE_ID_SCHEME: string;
69
69
  export declare const DERIVED_TABLES: readonly ["nodes", "edges", "unresolved_refs", "file_hashes", "embeddings", "adapter_runs"];
70
70
  /**
71
71
  * Cannot be regenerated: a run that witnessed an edge fire is gone once the
72
- * process exits, and a human's correction of a wrong edge is not in the source
73
- * at all. These survive every rebuild.
72
+ * process exits, a run that executed a test is gone the same way, and a human's
73
+ * correction of a wrong edge is not in the source at all. These survive every
74
+ * rebuild.
74
75
  */
75
- export declare const EARNED_TABLES: readonly ["observed_edges", "edge_corrections", "incident_links", "pr_scopes"];
76
+ export declare const EARNED_TABLES: readonly ["observed_edges", "observed_tests", "edge_corrections", "incident_links", "pr_scopes"];
76
77
  export type DerivedTable = (typeof DERIVED_TABLES)[number];
77
78
  export type EarnedTable = (typeof EARNED_TABLES)[number];
78
79
  /**
@@ -83,5 +84,5 @@ export type EarnedTable = (typeof EARNED_TABLES)[number];
83
84
  * to list the tables in.
84
85
  */
85
86
  export declare const DERIVED_DROP_ORDER: readonly ["embeddings", "unresolved_refs", "edges", "nodes", "file_hashes", "adapter_runs"];
86
- export declare const SCHEMA_SQL = "\n-- ---------------------------------------------------------------------------\n-- graph_meta \u2014 identity of the store itself. Read before anything else.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS graph_meta (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n) STRICT;\n\n-- ---------------------------------------------------------------------------\n-- adapter_runs \u2014 one row per accepted IRBatch. \u00A724.1's adapter registry state\n-- and DEC-015's invalidation key are the same thing, so they are one table.\n--\n-- id is derived (hash of producer + repo + commit + source files), never an\n-- autoincrement rowid: re-ingesting an identical batch must reuse the same row,\n-- or idempotence is impossible to state.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS adapter_runs (\n id TEXT PRIMARY KEY,\n repo TEXT NOT NULL,\n -- The identity scope workspace-scoped ids in this batch were computed under\n -- (DEC-054). NULL means \"this repository alone\". Recorded because the scope is\n -- configuration: once it changes, no node id in this run can be re-derived from\n -- the row itself, and a workspace typo is otherwise invisible after the fact.\n workspace TEXT,\n commit_sha TEXT NOT NULL,\n adapter_id TEXT NOT NULL, -- the part before '@'\n adapter_version TEXT NOT NULL, -- the part after '@'\n produced_by TEXT NOT NULL, -- adapter_id@adapter_version, as written on every row\n reached_resolution INTEGER NOT NULL,\n source_files TEXT NOT NULL, -- JSON array; the invalidation key (DEC-015)\n file_count INTEGER NOT NULL,\n written_at INTEGER NOT NULL\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_runs_adapter ON adapter_runs(adapter_id);\nCREATE INDEX IF NOT EXISTS idx_runs_producer ON adapter_runs(produced_by);\n\n-- ---------------------------------------------------------------------------\n-- nodes\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS nodes (\n id TEXT PRIMARY KEY,\n type TEXT NOT NULL,\n name TEXT NOT NULL,\n file_path TEXT, -- null for fileless types (DEC-014)\n start_line INTEGER,\n end_line INTEGER,\n language TEXT, -- correction 4: nullable\n produced_by TEXT NOT NULL,\n resolution INTEGER NOT NULL,\n attrs TEXT NOT NULL, -- JSON; correction 1\n run_id TEXT NOT NULL REFERENCES adapter_runs(id) ON DELETE CASCADE\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_nodes_type ON nodes(type);\nCREATE INDEX IF NOT EXISTS idx_nodes_name ON nodes(name);\nCREATE INDEX IF NOT EXISTS idx_nodes_file ON nodes(file_path);\nCREATE INDEX IF NOT EXISTS idx_nodes_resolution ON nodes(resolution);\nCREATE INDEX IF NOT EXISTS idx_nodes_run ON nodes(run_id);\n\n-- ---------------------------------------------------------------------------\n-- edges. Primary key is hash(from, to, type) per DEC-012, so two adapters\n-- finding the same relationship collide by construction \u2014 which is what makes\n-- a merge policy statable at all. 30% of prior-art edges were exact\n-- duplicates, so this is load-bearing rather than tidy.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS edges (\n id TEXT PRIMARY KEY,\n source TEXT NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,\n target TEXT NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,\n type TEXT NOT NULL,\n resolution INTEGER NOT NULL,\n confidence REAL NOT NULL,\n produced_by TEXT NOT NULL,\n observed_by_run TEXT, -- present exactly when resolution = 4\n attrs TEXT, -- JSON or null; corrections 1 and 2\n run_id TEXT NOT NULL REFERENCES adapter_runs(id) ON DELETE CASCADE,\n CHECK (resolution BETWEEN 0 AND 4),\n CHECK (confidence BETWEEN 0.0 AND 1.0),\n CHECK ((resolution = 4) = (observed_by_run IS NOT NULL))\n) STRICT;\n\n-- Correction 5: the real access paths. Every hop filters by type.\nCREATE INDEX IF NOT EXISTS idx_edges_source_type ON edges(source, type);\nCREATE INDEX IF NOT EXISTS idx_edges_target_type ON edges(target, type);\nCREATE INDEX IF NOT EXISTS idx_edges_resolution ON edges(resolution);\nCREATE INDEX IF NOT EXISTS idx_edges_run ON edges(run_id);\n\n-- ---------------------------------------------------------------------------\n-- unresolved_refs \u2014 DEC-016. What an adapter saw but could not resolve.\n--\n-- Not edges, because a name-matched guess is a false claim under \u00A711B.1. Not\n-- discarded either, because then \u00A711B.6 recall has no denominator and \u00A720.2's\n-- \"not analysable\" category has nothing to count. On the prior-art graphs this\n-- is 52-60% of everything emitted.\n-- ---------------------------------------------------------------------------\n-- id is a content hash, never an autoincrement rowid: an insertion-order key\n-- would make the permuted-ingest determinism proof impossible to state, and two\n-- byte-identical references are the same reference.\nCREATE TABLE IF NOT EXISTS unresolved_refs (\n id TEXT PRIMARY KEY,\n from_node_id TEXT NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,\n edge_type TEXT NOT NULL,\n raw_target TEXT NOT NULL,\n file_path TEXT,\n line INTEGER,\n produced_by TEXT NOT NULL,\n reason TEXT NOT NULL,\n -- DEC-242's attrs.blockedBy/attrs.refusalClass live here, JSON or null --\n -- same optional-attrs treatment as edges (correction 2), and deliberately\n -- excluded from id's content hash below: this is classification of a\n -- refusal, not part of what makes two refusals the same refusal. Added in\n -- schema version 3 -- DEC-017 governs what that bump costs an existing\n -- store (drop derived, rebuild; earned tables untouched).\n attrs TEXT,\n run_id TEXT NOT NULL REFERENCES adapter_runs(id) ON DELETE CASCADE\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_unresolved_from ON unresolved_refs(from_node_id);\nCREATE INDEX IF NOT EXISTS idx_unresolved_target ON unresolved_refs(raw_target);\nCREATE INDEX IF NOT EXISTS idx_unresolved_run ON unresolved_refs(run_id);\n\n-- ---------------------------------------------------------------------------\n-- file_hashes \u2014 \u00A711.14 rebuild acceleration. Layer 1 change detection is\n-- defined against this table and v2.1 never declared it.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS file_hashes (\n file_path TEXT PRIMARY KEY,\n hash TEXT NOT NULL,\n last_parsed_at INTEGER NOT NULL\n) STRICT;\n\n-- ---------------------------------------------------------------------------\n-- embeddings \u2014 pointer table only. No vector extension is loaded in this build;\n-- \u00A78.2 keeps vectors in pgvector hosted or a local extension, and a column of\n-- serialised floats with no index would be a scan, not a search.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS embeddings (\n node_id TEXT PRIMARY KEY REFERENCES nodes(id) ON DELETE CASCADE,\n vector_reference TEXT NOT NULL,\n model_version TEXT NOT NULL\n) STRICT;\n\n-- ===========================================================================\n-- EARNED \u2014 DEC-017. Never dropped. No REFERENCES into the derived tables:\n-- a foreign key would cascade these away with the graph they describe, which\n-- is precisely the outcome the partition exists to prevent.\n-- ===========================================================================\n\n-- R4 evidence. An edge witnessed firing during a live run (\u00A711B.3). This is the\n-- product's core moat and cannot be recomputed from source at any price.\nCREATE TABLE IF NOT EXISTS observed_edges (\n edge_id TEXT NOT NULL,\n run_id TEXT NOT NULL,\n from_node_id TEXT NOT NULL,\n to_node_id TEXT NOT NULL,\n edge_type TEXT NOT NULL,\n commit_sha TEXT NOT NULL,\n observed_at INTEGER NOT NULL,\n PRIMARY KEY (edge_id, run_id)\n) STRICT;\n\n-- \u00A711B.5. A human said an edge was wrong, or runtime contradicted it. Feeding\n-- this back is how precision improves; losing it repeats the same false claim.\nCREATE TABLE IF NOT EXISTS edge_corrections (\n edge_id TEXT PRIMARY KEY,\n verdict TEXT NOT NULL, -- 'wrong' | 'right'\n reason TEXT NOT NULL,\n corrected_at INTEGER NOT NULL\n) STRICT;\n\n-- \u00A714.2. One pull request's computed scope, and it is EARNED rather than derived\n-- for a reason that is easy to get backwards.\n--\n-- Everything else on the derived side can be regenerated from source because the\n-- source is what produced it. A PR scope cannot: it was computed against a graph\n-- at one commit, and that graph moves. Recomputing it later answers a DIFFERENT\n-- question and returns a plausible answer to it \u2014 so dropping this table does\n-- not lose time, it loses the COMPARISON BASIS. Overlap scoring between two PRs\n-- is only meaningful when both scopes were computed against the same graph, and\n-- nothing in a recomputed row would say that it was not.\n--\n-- graph_commit_sha is therefore not decoration: it is the field that makes two\n-- rows comparable or not, and a reader that ignores it will happily overlap a\n-- scope from last week with one from today and report a number.\n--\n-- scope_json holds the node id set. Kept opaque here on purpose: the shape of a\n-- scope is the scoping layer's business, and a column per dimension would need\n-- a migration every time that layer learns something. What the store guarantees\n-- is that the bytes come back unchanged with the commit they were computed at.\nCREATE TABLE IF NOT EXISTS pr_scopes (\n pr_id TEXT NOT NULL,\n repo TEXT NOT NULL,\n -- The head commit of the PR itself.\n head_sha TEXT NOT NULL,\n -- The commit the GRAPH was at when this scope was computed. Two scopes are\n -- comparable only when these agree.\n graph_commit_sha TEXT NOT NULL,\n scope_json TEXT NOT NULL,\n node_count INTEGER NOT NULL,\n computed_at INTEGER NOT NULL,\n PRIMARY KEY (repo, pr_id, graph_commit_sha)\n) STRICT;\n\n-- The access path for overlap scoring: every scope computed against one graph.\n-- Without it, comparing N PRs scans the whole table N times.\nCREATE INDEX IF NOT EXISTS idx_pr_scopes_graph ON pr_scopes(repo, graph_commit_sha);\n\n-- Incident and fix-pattern links. Accumulated from real failures over time.\nCREATE TABLE IF NOT EXISTS incident_links (\n incident_node_id TEXT NOT NULL,\n target_node_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n created_at INTEGER NOT NULL,\n PRIMARY KEY (incident_node_id, target_node_id, kind)\n) STRICT;\n";
87
+ export declare const SCHEMA_SQL = "\n-- ---------------------------------------------------------------------------\n-- graph_meta \u2014 identity of the store itself. Read before anything else.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS graph_meta (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n) STRICT;\n\n-- ---------------------------------------------------------------------------\n-- adapter_runs \u2014 one row per accepted IRBatch. \u00A724.1's adapter registry state\n-- and DEC-015's invalidation key are the same thing, so they are one table.\n--\n-- id is derived (hash of producer + repo + commit + source files), never an\n-- autoincrement rowid: re-ingesting an identical batch must reuse the same row,\n-- or idempotence is impossible to state.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS adapter_runs (\n id TEXT PRIMARY KEY,\n repo TEXT NOT NULL,\n -- The identity scope workspace-scoped ids in this batch were computed under\n -- (DEC-054). NULL means \"this repository alone\". Recorded because the scope is\n -- configuration: once it changes, no node id in this run can be re-derived from\n -- the row itself, and a workspace typo is otherwise invisible after the fact.\n workspace TEXT,\n commit_sha TEXT NOT NULL,\n adapter_id TEXT NOT NULL, -- the part before '@'\n adapter_version TEXT NOT NULL, -- the part after '@'\n produced_by TEXT NOT NULL, -- adapter_id@adapter_version, as written on every row\n reached_resolution INTEGER NOT NULL,\n source_files TEXT NOT NULL, -- JSON array; the invalidation key (DEC-015)\n file_count INTEGER NOT NULL,\n written_at INTEGER NOT NULL\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_runs_adapter ON adapter_runs(adapter_id);\nCREATE INDEX IF NOT EXISTS idx_runs_producer ON adapter_runs(produced_by);\n\n-- ---------------------------------------------------------------------------\n-- nodes\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS nodes (\n id TEXT PRIMARY KEY,\n type TEXT NOT NULL,\n name TEXT NOT NULL,\n file_path TEXT, -- null for fileless types (DEC-014)\n start_line INTEGER,\n end_line INTEGER,\n language TEXT, -- correction 4: nullable\n produced_by TEXT NOT NULL,\n resolution INTEGER NOT NULL,\n attrs TEXT NOT NULL, -- JSON; correction 1\n run_id TEXT NOT NULL REFERENCES adapter_runs(id) ON DELETE CASCADE\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_nodes_type ON nodes(type);\nCREATE INDEX IF NOT EXISTS idx_nodes_name ON nodes(name);\nCREATE INDEX IF NOT EXISTS idx_nodes_file ON nodes(file_path);\nCREATE INDEX IF NOT EXISTS idx_nodes_resolution ON nodes(resolution);\nCREATE INDEX IF NOT EXISTS idx_nodes_run ON nodes(run_id);\n\n-- ---------------------------------------------------------------------------\n-- edges. Primary key is hash(from, to, type) per DEC-012, so two adapters\n-- finding the same relationship collide by construction \u2014 which is what makes\n-- a merge policy statable at all. 30% of prior-art edges were exact\n-- duplicates, so this is load-bearing rather than tidy.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS edges (\n id TEXT PRIMARY KEY,\n source TEXT NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,\n target TEXT NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,\n type TEXT NOT NULL,\n resolution INTEGER NOT NULL,\n confidence REAL NOT NULL,\n produced_by TEXT NOT NULL,\n observed_by_run TEXT, -- present exactly when resolution = 4\n attrs TEXT, -- JSON or null; corrections 1 and 2\n run_id TEXT NOT NULL REFERENCES adapter_runs(id) ON DELETE CASCADE,\n CHECK (resolution BETWEEN 0 AND 4),\n CHECK (confidence BETWEEN 0.0 AND 1.0),\n CHECK ((resolution = 4) = (observed_by_run IS NOT NULL))\n) STRICT;\n\n-- Correction 5: the real access paths. Every hop filters by type.\nCREATE INDEX IF NOT EXISTS idx_edges_source_type ON edges(source, type);\nCREATE INDEX IF NOT EXISTS idx_edges_target_type ON edges(target, type);\nCREATE INDEX IF NOT EXISTS idx_edges_resolution ON edges(resolution);\nCREATE INDEX IF NOT EXISTS idx_edges_run ON edges(run_id);\n\n-- ---------------------------------------------------------------------------\n-- unresolved_refs \u2014 DEC-016. What an adapter saw but could not resolve.\n--\n-- Not edges, because a name-matched guess is a false claim under \u00A711B.1. Not\n-- discarded either, because then \u00A711B.6 recall has no denominator and \u00A720.2's\n-- \"not analysable\" category has nothing to count. On the prior-art graphs this\n-- is 52-60% of everything emitted.\n-- ---------------------------------------------------------------------------\n-- id is a content hash, never an autoincrement rowid: an insertion-order key\n-- would make the permuted-ingest determinism proof impossible to state, and two\n-- byte-identical references are the same reference.\nCREATE TABLE IF NOT EXISTS unresolved_refs (\n id TEXT PRIMARY KEY,\n from_node_id TEXT NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,\n edge_type TEXT NOT NULL,\n raw_target TEXT NOT NULL,\n file_path TEXT,\n line INTEGER,\n produced_by TEXT NOT NULL,\n reason TEXT NOT NULL,\n -- DEC-242's attrs.blockedBy/attrs.refusalClass live here, JSON or null --\n -- same optional-attrs treatment as edges (correction 2), and deliberately\n -- excluded from id's content hash below: this is classification of a\n -- refusal, not part of what makes two refusals the same refusal. Added in\n -- schema version 3 -- DEC-017 governs what that bump costs an existing\n -- store (drop derived, rebuild; earned tables untouched).\n attrs TEXT,\n run_id TEXT NOT NULL REFERENCES adapter_runs(id) ON DELETE CASCADE\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_unresolved_from ON unresolved_refs(from_node_id);\nCREATE INDEX IF NOT EXISTS idx_unresolved_target ON unresolved_refs(raw_target);\nCREATE INDEX IF NOT EXISTS idx_unresolved_run ON unresolved_refs(run_id);\n\n-- ---------------------------------------------------------------------------\n-- file_hashes \u2014 \u00A711.14 rebuild acceleration. Layer 1 change detection is\n-- defined against this table and v2.1 never declared it.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS file_hashes (\n file_path TEXT PRIMARY KEY,\n hash TEXT NOT NULL,\n last_parsed_at INTEGER NOT NULL\n) STRICT;\n\n-- ---------------------------------------------------------------------------\n-- embeddings \u2014 pointer table only. No vector extension is loaded in this build;\n-- \u00A78.2 keeps vectors in pgvector hosted or a local extension, and a column of\n-- serialised floats with no index would be a scan, not a search.\n-- ---------------------------------------------------------------------------\nCREATE TABLE IF NOT EXISTS embeddings (\n node_id TEXT PRIMARY KEY REFERENCES nodes(id) ON DELETE CASCADE,\n vector_reference TEXT NOT NULL,\n model_version TEXT NOT NULL\n) STRICT;\n\n-- ===========================================================================\n-- EARNED \u2014 DEC-017. Never dropped. No REFERENCES into the derived tables:\n-- a foreign key would cascade these away with the graph they describe, which\n-- is precisely the outcome the partition exists to prevent.\n-- ===========================================================================\n\n-- R4 evidence. An edge witnessed firing during a live run (\u00A711B.3). This is the\n-- product's core moat and cannot be recomputed from source at any price.\nCREATE TABLE IF NOT EXISTS observed_edges (\n edge_id TEXT NOT NULL,\n run_id TEXT NOT NULL,\n from_node_id TEXT NOT NULL,\n to_node_id TEXT NOT NULL,\n edge_type TEXT NOT NULL,\n commit_sha TEXT NOT NULL,\n observed_at INTEGER NOT NULL,\n PRIMARY KEY (edge_id, run_id)\n) STRICT;\n\n-- Which tests actually ran, and what happened. The coverage axis \u2014 AI layer \u00A720's\n-- \"Verification status\" \u2014 a different question from confidence, needing a\n-- different carrier.\n--\n-- Earned for the same reason as observed_edges, one step over: nothing in the\n-- source says which tests executed, so a rebuild that dropped this would turn\n-- \"what I actually verified\" silently back into \"what might be affected\".\n--\n-- Not an edge, deliberately. A test-runner's evidence carries no stack, so an\n-- observed test names exactly one node \u2014 its own TEST_CASE \u2014 and pairing it with\n-- a function it merely co-occurred with would mint an edge from temporal\n-- coincidence. That is why this is a table and not a promotion of a TESTS edge\n-- to R4; see DEC-NEXT-test-run-coverage-has-no-carrier.md.\n--\n-- (node_id, run_id) is the identity: two runs of one test are two facts, while a\n-- retry inside one run is the same fact re-observed, so the latter updates in\n-- place. Within-run retries are therefore not distinguishable here \u2014 a disclosed\n-- limit, not an oversight; this table is a coverage carrier, not a flake detector.\nCREATE TABLE IF NOT EXISTS observed_tests (\n node_id TEXT NOT NULL,\n run_id TEXT NOT NULL,\n qualified_name TEXT NOT NULL,\n outcome TEXT NOT NULL, -- 'passed' | 'failed' | 'skipped'\n -- REAL, not INTEGER, and this was an INTEGER until a real run proved it could\n -- not be. Runners report fractional milliseconds \u2014 node:test emits 2.316958 \u2014\n -- and a STRICT table refuses that value outright, so every write failed on\n -- first contact with an actual suite while the unit tests, which all passed\n -- integer literals, stayed green. Rounding was the other option and is worse:\n -- sub-millisecond tests are ordinary here, and 0.36 rounded to 0 reads as\n -- \"instant\", the same falsehood the null-rather-than-zero rule below refuses.\n duration_ms REAL,\n commit_sha TEXT NOT NULL,\n observed_at INTEGER NOT NULL,\n PRIMARY KEY (node_id, run_id)\n) STRICT;\n\nCREATE INDEX IF NOT EXISTS idx_observed_tests_run ON observed_tests(run_id);\n\n-- \u00A711B.5. A human said an edge was wrong, or runtime contradicted it. Feeding\n-- this back is how precision improves; losing it repeats the same false claim.\nCREATE TABLE IF NOT EXISTS edge_corrections (\n edge_id TEXT PRIMARY KEY,\n verdict TEXT NOT NULL, -- 'wrong' | 'right'\n reason TEXT NOT NULL,\n corrected_at INTEGER NOT NULL\n) STRICT;\n\n-- \u00A714.2. One pull request's computed scope, and it is EARNED rather than derived\n-- for a reason that is easy to get backwards.\n--\n-- Everything else on the derived side can be regenerated from source because the\n-- source is what produced it. A PR scope cannot: it was computed against a graph\n-- at one commit, and that graph moves. Recomputing it later answers a DIFFERENT\n-- question and returns a plausible answer to it \u2014 so dropping this table does\n-- not lose time, it loses the COMPARISON BASIS. Overlap scoring between two PRs\n-- is only meaningful when both scopes were computed against the same graph, and\n-- nothing in a recomputed row would say that it was not.\n--\n-- graph_commit_sha is therefore not decoration: it is the field that makes two\n-- rows comparable or not, and a reader that ignores it will happily overlap a\n-- scope from last week with one from today and report a number.\n--\n-- scope_json holds the node id set. Kept opaque here on purpose: the shape of a\n-- scope is the scoping layer's business, and a column per dimension would need\n-- a migration every time that layer learns something. What the store guarantees\n-- is that the bytes come back unchanged with the commit they were computed at.\nCREATE TABLE IF NOT EXISTS pr_scopes (\n pr_id TEXT NOT NULL,\n repo TEXT NOT NULL,\n -- The head commit of the PR itself.\n head_sha TEXT NOT NULL,\n -- The commit the GRAPH was at when this scope was computed. Two scopes are\n -- comparable only when these agree.\n graph_commit_sha TEXT NOT NULL,\n scope_json TEXT NOT NULL,\n node_count INTEGER NOT NULL,\n computed_at INTEGER NOT NULL,\n PRIMARY KEY (repo, pr_id, graph_commit_sha)\n) STRICT;\n\n-- The access path for overlap scoring: every scope computed against one graph.\n-- Without it, comparing N PRs scans the whole table N times.\nCREATE INDEX IF NOT EXISTS idx_pr_scopes_graph ON pr_scopes(repo, graph_commit_sha);\n\n-- Incident and fix-pattern links. Accumulated from real failures over time.\nCREATE TABLE IF NOT EXISTS incident_links (\n incident_node_id TEXT NOT NULL,\n target_node_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n created_at INTEGER NOT NULL,\n PRIMARY KEY (incident_node_id, target_node_id, kind)\n) STRICT;\n";
87
88
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/store/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,QAAkC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,cAAc,6FAOjB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa,gFAKhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,6FAOa,CAAC;AAE7C,eAAO,MAAM,UAAU,43VAyNtB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/store/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,QAAkC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,cAAc,6FAOjB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,aAAa,kGAMhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,6FAOa,CAAC;AAE7C,eAAO,MAAM,UAAU,8gaA+PtB,CAAC"}