You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugin-sharing): carry compileCelToFilter's reason and detail into the seeder's skip WARN (#14136)
The sharing-rule seeder collapsed the compiler's discriminated refusal
{ ok: false, reason, detail } to null one line before the WARN that
needed it. celToFilterOutcome keeps the cause (the rls-compiler
compileExpressionOutcome shape, one seam over); celToFilter stays at its
published signature and delegates. The skip decision is unchanged
(ADR-0049: never seeded as match-all).
Claude-Session: https://claude.ai/code/session_016ZC5rNQj3WEet5HAmmAkMs
Co-authored-by: Claude <noreply@anthropic.com>
The sharing-rule seeder's skip WARN now names WHY a declared rule's CEL `condition` did not translate: `compileCelToFilter`'s `reason` (the aggregatable category) and `detail` (the concrete refused shape, variable path, or parse bound) are carried into the log meta instead of being collapsed to `null` one line before the log that needed them. `celToFilter` keeps its published `Record | null` signature and delegates to the new `celToFilterOutcome` sibling (the `plugin-security` rls-compiler shape from #13942, one seam over). Skip semantics are unchanged — an unlowerable or match-all condition is still never seeded as a permissive match-all rule (ADR-0049).
@@ -197,12 +240,29 @@ export async function bootstrapDeclaredSharingRules(
197
240
// schema requires `condition`, so reaching here means a hand-crafted
198
241
// `{ dialect, source: '' }` envelope or a stale pre-built package, and
199
242
// neither earns a match-all.
200
-
constf=celToFilter(r.condition);
201
-
if(!f||isMatchAllCriteria(f)){
202
-
logger?.warn?.('[sharing-rule] skipped (missing or untranslatable CEL condition — never seeded as match-all) [experimental]',{rule: r.name,condition: r.condition});
// The compiler answered `ok`, so there is no compiler detail to
255
+
// carry — this drop is THIS file's match-all guard, and it names
256
+
// itself rather than being reported as untranslatable.
257
+
reason: 'match-all-criteria',
258
+
detail:
259
+
`the condition lowered to ${JSON.stringify(outcome.filter)}, which constrains nothing — `+
260
+
'seeding it would share every record of the object (ADR-0049)',
261
+
};
262
+
logger?.warn?.('[sharing-rule] skipped (missing or untranslatable CEL condition — never seeded as match-all) [experimental]',{rule: r.name,condition: r.condition,reason: cause.reason,detail: cause.detail});
0 commit comments