Repository navigation
Commit 2aa8b0e
Make dbt PR reviewer demo-parity reliable (#919)
* Document dbt review improvement loop
* Reduce safe refactor review noise
* Tighten PII review precision
* Add DuckDB data diff e2e coverage
* fix: address dbt review parity comments
* chore: remove non-functional planning docs from dbt review PR
* chore: drop non-functional dbt review docs edit
* test: harden dbt review parity edge cases
* fix: address consensus review findings on dbt PR reviewer (PR #919)
Fixes raised by the multi-model review of #919, prioritizing the PII
false-negative that 5 models flagged.
- PII recall (MAJOR): the diff-scoped PII dedup keyed off whether the
classifier *ran* and off ALL introduced columns, so a high-risk column
core's classifier MISSED (e.g. `ssn`) was dropped from the broad
`schema.detect_pii` fallback AND had its regex twin suppressed — silently.
Now dedup against the columns core actually CLASSIFIED (`classifiedColumns`),
and make the regex-twin suppression column-aware (`pii_into_mart` via its
matched `result.line`; `select-pii-columns` only when a precise detector
actually emitted a finding). A column core never classified now stays
eligible for the broad detector and the regex net — including on
trivial/lite tiers that don't run the `pii_exposure` lane. Low-confidence
name/address suppression is preserved (core *considered* those columns).
- Structural escalation (MAJOR): only `join_risk` (SC010 join-key regression)
escalates a core `error` to critical/blocking. Other structural rules core
marks `error` stay advisory (warning), so the lane never over-blocks on a
rule it wasn't designed to gate.
- DuckDB (MINOR): arm the 2s fallback timer BEFORE replaying a synchronous
open callback so a sync resolve/reject can clear it (no dangling timer
delaying process exit); release the half-open handle on open error.
- Concurrency (MINOR): run the diff-scoped PII lane as a concurrent task
instead of an inline `await`, so its native lineage/classify calls overlap
the other per-file engine lanes.
- Polish: align `ReviewRunner.equivalence` dialect param to optional (matches
the impl); named constants for the PII confidence thresholds; document that
PII exposure severity intentionally escalates only for `marts/reporting`;
comment the `--no-ai`/`--ai=false` dual check.
Adds regression tests: core-missed column surfaces via broad fallback;
core-missed high-risk PII still caught by the regex twin when the broad PII
lane is off; non-join `error` structural rule stays advisory; sub-error
join-key regression stays a warning. Existing 76 review + 26 driver tests
still pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* fix: address PR #919 review comments on dbt PR reviewer
Resolve the three unresolved bot-review threads on PR #919:
- `orchestrate.ts` (`piiClassifyLane`): when `columnLineage` resolves but
derives zero output targets, return `empty` (`completed: false`) instead of
`completed: true`. Zero head targets is lineage *uncertainty* (the classifier
considered nothing), not a confident "no new PII", so the file must not be
marked PII-complete — keeping the deterministic regex fallback alive. Distinct
from the `!newCols.length` case, where lineage resolved columns but none are
newly introduced (genuinely done). Defensive/intent fix: behavior-neutral for
the current detectors (the tokenless suppression path is unreachable because
`pii_into_mart` always carries a recoverable column token), but it makes the
`completed` contract honest and removes a latent footgun.
- `review.ts`: correct the misleading `noAi` comment. Only `--no-ai` is
registered, so `--ai=false` is not a supported CLI flag; `args.ai === false`
only covers programmatic callers.
- `driver-security.test.ts`: assert the DuckDB lock retry actually requests
`READ_ONLY` (record `access_mode` per attempt), not just that two attempts
occurred.
Tests: add two `review.test.ts` regressions — a zero-target-lineage guard and a
token-gated suppression guard (core muted a low-confidence column → the coarse
regex twin is suppressed). Review suite 82 pass, driver suite 26 pass.
Reviewed via multi-model consensus (Claude + 7 models); the lone objection was
test completeness, now incorporated.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* fix: drop unsupported dialect arg from checkEquivalence call
`core.checkEquivalence` ([email protected]) is typed `(sqlA, sqlB, schema)` —
3 params, no dialect (unlike `columnLineage`/`compareQueries`). A 4th `dialect`
arg was added to this call earlier on the branch (b5060e0), which the napi
binding silently ignores at runtime but which fails `tsgo` typecheck (TS2554)
and blocks the pre-push hook. Align with the binding contract and the sibling
call site in `native/sql/register.ts`. Behavior-neutral.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>1 parent 1748c37 commit 2aa8b0e
9 files changed
Lines changed: 995 additions & 55 deletions
File tree
- packages
- drivers
- src
- test
- opencode
- src
- altimate
- native
- review
- cli/cmd
- test/altimate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
74 | 90 | | |
75 | | - | |
| 91 | + | |
76 | 92 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
80 | 103 | | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
84 | 107 | | |
85 | 108 | | |
| 109 | + | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | | - | |
32 | | - | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | | - | |
66 | | - | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
100 | | - | |
101 | | - | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
139 | 147 | | |
140 | 148 | | |
141 | 149 | | |
142 | | - | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | | - | |
| 153 | + | |
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| |||
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
166 | 178 | | |
167 | 179 | | |
168 | 180 | | |
| |||
171 | 183 | | |
172 | 184 | | |
173 | 185 | | |
174 | | - | |
175 | | - | |
| 186 | + | |
| 187 | + | |
176 | 188 | | |
177 | 189 | | |
178 | 190 | | |
| |||
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
198 | 293 | | |
199 | 294 | | |
200 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
| 882 | + | |
882 | 883 | | |
883 | 884 | | |
884 | 885 | | |
| |||
0 commit comments