@objectstack/lint 17.0.0-rc.4 → 17.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1428 -0
- package/dist/index.cjs +1787 -624
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +324 -123
- package/dist/index.d.ts +324 -123
- package/dist/index.js +1765 -610
- package/dist/index.js.map +1 -1
- package/dist/{runtime-Cs64ShwN.d.cts → runtime-B50yywI_.d.cts} +49 -4
- package/dist/{runtime-Cs64ShwN.d.ts → runtime-B50yywI_.d.ts} +49 -4
- package/dist/runtime.cjs +1214 -428
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1204 -407
- package/dist/runtime.js.map +1 -1
- package/package.json +6 -5
|
@@ -55,10 +55,8 @@ type AuthoringRuleTier = 'gating' | 'advisory';
|
|
|
55
55
|
/**
|
|
56
56
|
* Which tier of the stack a rule reads.
|
|
57
57
|
*
|
|
58
|
-
* - `normalized` — the `normalizeStackInput` output,
|
|
59
|
-
*
|
|
60
|
-
* `views: []`, `userFilters` on an object list view, a `visibleOn` alias): by
|
|
61
|
-
* the time `result.data` exists the evidence is gone.
|
|
58
|
+
* - `normalized` — the `normalizeStackInput` output, run before this package's
|
|
59
|
+
* caller had a chance to Zod-parse.
|
|
62
60
|
* - `parsed` — the post-parse stack, where defaults are filled and shapes are
|
|
63
61
|
* settled.
|
|
64
62
|
*
|
|
@@ -66,6 +64,53 @@ type AuthoringRuleTier = 'gating' | 'advisory';
|
|
|
66
64
|
* `os validate`'s verdict to give), so it runs BOTH tiers on the normalized
|
|
67
65
|
* stack. Every rule here is written to tolerate that — it is what `os lint`
|
|
68
66
|
* already did for the reference-integrity suite and the security linter.
|
|
67
|
+
*
|
|
68
|
+
* ## What `normalized` does NOT buy, measured (#6073)
|
|
69
|
+
*
|
|
70
|
+
* This tier used to be justified as "the rules that need it check keys the
|
|
71
|
+
* parse strips — a flat list view in `views: []`, `userFilters` on an object
|
|
72
|
+
* list view, a `visibleOn` alias — by the time `result.data` exists the
|
|
73
|
+
* evidence is gone". **All three of those examples were measured false**, each
|
|
74
|
+
* for its own reason, and the pins live in `authoring-rule-input-tier.test.ts`:
|
|
75
|
+
*
|
|
76
|
+
* 1. `defineStack` — the documented and universal way a TS config declares a
|
|
77
|
+
* stack — PARSES at definition time, so for such a config the value every
|
|
78
|
+
* command hands this registry is already `result.data`: parse-time defaults
|
|
79
|
+
* filled (`flow.runAs === 'user'`), unknown keys resolved. Re-normalizing it
|
|
80
|
+
* cannot resurrect anything. That half was measured in #5693 and re-measured
|
|
81
|
+
* here.
|
|
82
|
+
* 2. But nothing is lost, because since #4001 the two cited view schemas do not
|
|
83
|
+
* STRIP — they REFUSE. `ViewSchema` and `ObjectListViewSchema` are strict, so
|
|
84
|
+
* `defineStack` throws on the flat list view and on `quickFilters` /
|
|
85
|
+
* `userFilters: { element: 'tabs' }`, naming the same sites the rules name,
|
|
86
|
+
* one layer earlier and with the schema's own fix hint. Measured end to end:
|
|
87
|
+
* `os lint` and `os validate` on an example app carrying the flat view both
|
|
88
|
+
* refuse the config at LOAD, before any rule runs.
|
|
89
|
+
* 3. The `visibleOn` alias never reaches this tier on ANY input shape: the
|
|
90
|
+
* ADR-0087 D2 conversion (`view-visibleOn-to-visibleWhen`,
|
|
91
|
+
* `page-component-visibility-to-visibleWhen`) folds it into `visibleWhen`
|
|
92
|
+
* INSIDE `normalizeStackInput` — one layer before the tier, not during the
|
|
93
|
+
* parse. #6318 acted on that: the alias-KEY rule this premise justified
|
|
94
|
+
* (`visibility-alias-deprecated`) was retired, since the D2 conversion
|
|
95
|
+
* notice already covers its whole evidence surface with better wording and
|
|
96
|
+
* a stated retirement window. The alias-KEY half of premise 3 is therefore
|
|
97
|
+
* no longer merely false — there is nothing left reading it.
|
|
98
|
+
*
|
|
99
|
+
* ## What it does buy, and why the tier stays
|
|
100
|
+
*
|
|
101
|
+
* The surviving reason is the one `validate-functional-completeness.ts` states
|
|
102
|
+
* and the measurement confirms: a `normalized`-tier finding reaches the author
|
|
103
|
+
* even when an unrelated schema error elsewhere would stop the parse. On the
|
|
104
|
+
* raw (non-`defineStack`) path that is not theoretical — `os validate` stops at
|
|
105
|
+
* the schema step and reports zero rule findings, while `os lint`, which never
|
|
106
|
+
* parses, still names `view-container-shape` and
|
|
107
|
+
* `list-view-filters-in-views-mode`. Plus the plain fact that `os lint` has no
|
|
108
|
+
* parsed stack to give.
|
|
109
|
+
*
|
|
110
|
+
* So: read `normalized` as "does not REQUIRE a parsed stack", never as "is
|
|
111
|
+
* guaranteed to see pre-parse evidence". A new rule whose only evidence is a key
|
|
112
|
+
* a strict schema rejects is a rule that will never fire — put the diagnostic in
|
|
113
|
+
* the schema instead, where #4001 already puts it.
|
|
69
114
|
*/
|
|
70
115
|
type AuthoringRuleInputTier = 'normalized' | 'parsed';
|
|
71
116
|
/** Per-run inputs a rule may need beyond the stack itself. */
|
|
@@ -55,10 +55,8 @@ type AuthoringRuleTier = 'gating' | 'advisory';
|
|
|
55
55
|
/**
|
|
56
56
|
* Which tier of the stack a rule reads.
|
|
57
57
|
*
|
|
58
|
-
* - `normalized` — the `normalizeStackInput` output,
|
|
59
|
-
*
|
|
60
|
-
* `views: []`, `userFilters` on an object list view, a `visibleOn` alias): by
|
|
61
|
-
* the time `result.data` exists the evidence is gone.
|
|
58
|
+
* - `normalized` — the `normalizeStackInput` output, run before this package's
|
|
59
|
+
* caller had a chance to Zod-parse.
|
|
62
60
|
* - `parsed` — the post-parse stack, where defaults are filled and shapes are
|
|
63
61
|
* settled.
|
|
64
62
|
*
|
|
@@ -66,6 +64,53 @@ type AuthoringRuleTier = 'gating' | 'advisory';
|
|
|
66
64
|
* `os validate`'s verdict to give), so it runs BOTH tiers on the normalized
|
|
67
65
|
* stack. Every rule here is written to tolerate that — it is what `os lint`
|
|
68
66
|
* already did for the reference-integrity suite and the security linter.
|
|
67
|
+
*
|
|
68
|
+
* ## What `normalized` does NOT buy, measured (#6073)
|
|
69
|
+
*
|
|
70
|
+
* This tier used to be justified as "the rules that need it check keys the
|
|
71
|
+
* parse strips — a flat list view in `views: []`, `userFilters` on an object
|
|
72
|
+
* list view, a `visibleOn` alias — by the time `result.data` exists the
|
|
73
|
+
* evidence is gone". **All three of those examples were measured false**, each
|
|
74
|
+
* for its own reason, and the pins live in `authoring-rule-input-tier.test.ts`:
|
|
75
|
+
*
|
|
76
|
+
* 1. `defineStack` — the documented and universal way a TS config declares a
|
|
77
|
+
* stack — PARSES at definition time, so for such a config the value every
|
|
78
|
+
* command hands this registry is already `result.data`: parse-time defaults
|
|
79
|
+
* filled (`flow.runAs === 'user'`), unknown keys resolved. Re-normalizing it
|
|
80
|
+
* cannot resurrect anything. That half was measured in #5693 and re-measured
|
|
81
|
+
* here.
|
|
82
|
+
* 2. But nothing is lost, because since #4001 the two cited view schemas do not
|
|
83
|
+
* STRIP — they REFUSE. `ViewSchema` and `ObjectListViewSchema` are strict, so
|
|
84
|
+
* `defineStack` throws on the flat list view and on `quickFilters` /
|
|
85
|
+
* `userFilters: { element: 'tabs' }`, naming the same sites the rules name,
|
|
86
|
+
* one layer earlier and with the schema's own fix hint. Measured end to end:
|
|
87
|
+
* `os lint` and `os validate` on an example app carrying the flat view both
|
|
88
|
+
* refuse the config at LOAD, before any rule runs.
|
|
89
|
+
* 3. The `visibleOn` alias never reaches this tier on ANY input shape: the
|
|
90
|
+
* ADR-0087 D2 conversion (`view-visibleOn-to-visibleWhen`,
|
|
91
|
+
* `page-component-visibility-to-visibleWhen`) folds it into `visibleWhen`
|
|
92
|
+
* INSIDE `normalizeStackInput` — one layer before the tier, not during the
|
|
93
|
+
* parse. #6318 acted on that: the alias-KEY rule this premise justified
|
|
94
|
+
* (`visibility-alias-deprecated`) was retired, since the D2 conversion
|
|
95
|
+
* notice already covers its whole evidence surface with better wording and
|
|
96
|
+
* a stated retirement window. The alias-KEY half of premise 3 is therefore
|
|
97
|
+
* no longer merely false — there is nothing left reading it.
|
|
98
|
+
*
|
|
99
|
+
* ## What it does buy, and why the tier stays
|
|
100
|
+
*
|
|
101
|
+
* The surviving reason is the one `validate-functional-completeness.ts` states
|
|
102
|
+
* and the measurement confirms: a `normalized`-tier finding reaches the author
|
|
103
|
+
* even when an unrelated schema error elsewhere would stop the parse. On the
|
|
104
|
+
* raw (non-`defineStack`) path that is not theoretical — `os validate` stops at
|
|
105
|
+
* the schema step and reports zero rule findings, while `os lint`, which never
|
|
106
|
+
* parses, still names `view-container-shape` and
|
|
107
|
+
* `list-view-filters-in-views-mode`. Plus the plain fact that `os lint` has no
|
|
108
|
+
* parsed stack to give.
|
|
109
|
+
*
|
|
110
|
+
* So: read `normalized` as "does not REQUIRE a parsed stack", never as "is
|
|
111
|
+
* guaranteed to see pre-parse evidence". A new rule whose only evidence is a key
|
|
112
|
+
* a strict schema rejects is a rule that will never fire — put the diagnostic in
|
|
113
|
+
* the schema instead, where #4001 already puts it.
|
|
69
114
|
*/
|
|
70
115
|
type AuthoringRuleInputTier = 'normalized' | 'parsed';
|
|
71
116
|
/** Per-run inputs a rule may need beyond the stack itself. */
|