fix(automation): null the prefix for a concealed read-grant target (#3526) #4722
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.43) × (1 − Review Confidence (0.31)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 385 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 54% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4722"
general
weight: 0.35
claude[bot]
Closes #3526
What and why
Ruling 0222 (option 1,
cor:agt:010:01rev 43): onAutomationApproval.readGrants, a grant whose target the adopter cannot read already returnedmemoryUrn: null, but still returnedprefix, a node path inside a memory the adopter cannot read. The shared projectionprojectAutomationReadGrantnow follows one rule: a grant row never shows a prefix without its URN.The change
src/api/graphql/schema/automationReadGrantProjection.ts:prefixisrow.prefixonly whenmemoryUrnis projected, else null. That is the whole production change (9 lines with its comment).| Call site | Passes | Result |
|---|---|---|
| approval,
resolvers.automationPin.tsliveReadGrants|nullmemory when the adopter cannot read the target | URN null, prefix null (changed) || give,
resolvers.automationReadGrant.ts| the target's row | both shown (unchanged) || revoke | the target's row | both shown (unchanged) |
| list (incl. a soft-deleted target, the historical projection) | the target's row | both shown (unchanged) |
Only the approval path ever passes a null memory for a concealed target (grep of non-test
src), so the doors are unchanged in behaviour; the pins below prove it. A soft-deleted target is concealed on the approval too (the memory lookup returns null), so its prefix goes with its URN.Pins (
resolvers.concealedReadGrantPrefix3526.test.ts)Red at
f52cb88dd(4 of 9): unreadable target with a prefix returns[null, 'secret:plans']not[null, null]; a prefixed and a whole-memory grant on concealed targets are distinguishable; a soft-deleted target keeps its prefix; the projection keeps the prefix for a null memory. Green controls by design (5): a readable target shows both, a readable whole-memory grant shows a null prefix, and give, revoke, list (with a soft-deleted target) still show URN and prefix to a manager.Mutants
Gate items
1 red-first approval pin: yes. 2 readable and whole-memory controls: yes. 3 every call site pinned: yes (approval, give, revoke, list incl. soft-deleted). 4 mutant per guard: yes. 5 manifest claim kept, not reworded: no manifest or spec edit here. 6 out of scope: the approval's other fields, grant create and revoke semantics, MCP and CLI (no other surface returns the field).
Existing tests
None changed. The existing
#2883approval test ([null, null]for a hidden target with a null prefix) still passes; the rest of the automation grant files pass (8 files, 390 tests; two 5 s timeouts under host load 130+ pass at--testTimeout=60000).Out of scope / downstream
Spec Built line for
cor:agt:010:01is the specs engineer's follow-through after merge. No migration, no SDL change, no client change.— Arden, server-engineer · claude-sonnet-5-5