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
fix(lint): `validateOrgAxisRedLines` reads the sharing-rule keys the spec declares — the ADR-0105 D6 red lines fired on nothing before (#4984)
6
+
7
+
The two ADR-0105 D6 red lines are declared `error` and gate `os validate` /
8
+
`os build` / `os lint`. On the sharing-rule path neither of them could fire.
9
+
10
+
`validateOrgAxisRedLines` read `rule.criteria ?? rule.filter` and
11
+
`rule.sharedTo ?? rule.recipient`. `SharingRuleSchema` is `.strict()` and its
12
+
declared keys are `condition` and `sharedWith`; all four names it was reading
13
+
exist only as **rejected aliases** in `sharingRuleUnknownKeyError`, the
14
+
prescription attached to the refusal message. The rule runs on the post-parse
15
+
stack (`input: 'parsed'`), so for every spec-valid stack those four properties
16
+
were `undefined`, `JSON.stringify(undefined ?? '')` was `'""'`, and the
17
+
`parent_organization_id` test was constantly false.
18
+
19
+
**This is a behaviour change: the rule previously never triggered.** Both red
20
+
lines are now live on the sharing-rule path:
21
+
22
+
| Authored shape | Before | After |
23
+
|:--|:--|:--|
24
+
|`condition` reading `parent_organization_id`| passed |`error``org-axis-permission-inheritance` at `sharingRules[i].condition`|
25
+
|`sharedWith` reading `parent_organization_id`| passed |`error``org-axis-permission-inheritance` at `sharingRules[i].sharedWith`|
26
+
|`sharedWith: { type: 'business_unit' }` on a `tenancy.enabled: false` object | passed |`error``org-axis-cross-org-bu-grant` at `sharingRules[i].sharedWith`|
27
+
28
+
A stack that ships today keeps building unless it contains one of those three —
29
+
the shapes D6 forbids and the gate was meant to have been refusing all along.
30
+
The rejected aliases are deliberately **not** read: a rule spelling `criteria`
31
+
or `sharedTo` is refused by the schema's own parse with the canonical key
32
+
named, and a consumer must not tolerate what the producer's contract rejects.
33
+
34
+
`condition` is an `ExpressionInput`, so all three of its shapes are scanned —
35
+
the authored bare string, the parsed `{ dialect, source }` envelope, and the
36
+
compiled `{ dialect, ast }` form.
37
+
38
+
The rule's own tests were the reason this survived review: their fixtures used
39
+
the same rejected aliases, so the suite was green while the gate was dead. Every
40
+
sharing-rule fixture now goes through `SharingRuleSchema` before the lint sees
41
+
it, and every object fixture through `ObjectSchema` — a fixture that drifts from
42
+
the spec surface fails at the fixture instead of silently exercising a shape no
0 commit comments