Commit f0d7647
fix(approvals): stop pushing a free-text predicate onto a masked payload snapshot (#11103)
* fix(approvals): stop pushing a free-text predicate onto a masked payload snapshot
The approval payload snapshot is redacted at serve time, per reader (#10749),
but `listRequests` / `countRequests` pushed a free-text disjunct onto the stored
column, which the driver evaluates unmasked. The field-level read controls
enforced on the way out therefore did not hold on the way in — declared, not
enforced. This extends the settled `maskingRule` posture (#8993) to the snapshot
column: a caller whose view of the snapshot is masked keeps free-text matching
on the four columns of `sys_approval_request` they read whole, and loses only
the snapshot disjunct.
The masked/unmasked verdict comes from the same authority and the same
per-caller call the serve path uses, asked as the caller — never a second,
independently derived notion of "redacted", since that drift is the defect one
layer down. Where serve declines to narrow (no authority wired, or a wired
authority answering "unresolvable"), the disjunct is kept: consistency with
serve, not blanket fail-closed.
Dropping a disjunct is strictly narrowing — no query is refused, nothing is
widened — and four disjuncts always remain, so the `$or` is never empty.
Part of #11040
* test(approvals): index the pushed-down predicate without `Array.prototype.at`
`lib` is ES2021 for this package, where `at` does not exist. The package's own
`typecheck` excludes `**/*.test.ts`, so the error surfaced only in the
`check:type-check-coverage --re-measure` ratchet, as TEST_DEBT 348 -> 349.
Fixed in the test rather than by growing the ledger or widening `lib`: the
ratchet is shrink-only, and the file needs no ES2022 library surface.
Part of #11040
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 147f9cd commit f0d7647
3 files changed
Lines changed: 494 additions & 9 deletions
File tree
- .changeset
- packages/plugins/plugin-approvals/src
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments