Commit f163028
* feat(lint): reference-integrity validation for object and action names (#3583)
The HotCRM audit found ~20 shipped instances of one bug class — metadata
naming something that does not exist — all passing `objectstack validate`
and `objectstack lint` cleanly and failing silently at runtime. This
closes the object-name and action-name half of that class.
Root cause of the false negatives: every cross-reference check answered
"might this come from another package?" with a PREFIX GUESS
(`startsWith('sys_')`), which cannot distinguish `sys_user` (real) from
`sys_approval_process` (fictional — removed by ADR-0019, registered by
nothing). So spec now ships a curated PLATFORM_PROVIDED_OBJECT_NAMES
registry, kept honest by a conformance test that scans each package's
*.object.ts declarations, following the PLATFORM_CAPABILITY_NAMES
precedent (lint keeps its one-way lint -> spec dependency).
New rules, wired into BOTH `os validate` and `os lint` in the same
change so the paths cannot drift:
- validate-object-references: action-param reference/objectOverride,
dashboard globalFilters optionsFrom.object, nav requiresObject gates.
Unresolved + unprefixed => error (the pure typo class); unresolved +
platform-prefixed but unregistered => warning (a third-party package
may still provide it).
- validate-action-name-refs: bulkActions/rowActions, page quick-actions
actionNames, nav action items. Unresolved => error, matching the
existing dashboard-action-target posture; the runtime ships no
built-in action names, so a miss is dead, full stop.
Fixes found while mapping the surface:
- defineStack skipped app.areas[].navigation entirely, so an areas-based
app got NO nav cross-reference checking; it also only recursed into
`group` children, missing children on `object` nav items.
- i18n coverage only walked the record-map shape of field `options`,
but the canonical shape is a {value,label}[] ARRAY — option-label
coverage never fired for canonically-shaped select fields.
- Hook conditions lost all field-awareness when `object` was an array
of targets; now checked per target with de-duplicated diagnostics.
- A widget binding no `dataset` silently bypassed every binding and
chart check on the raw-config paths; `dataset` is schema-required, so
it is now reported.
Verified zero false positives against all three example apps (app-crm,
app-showcase, app-todo). Suites: lint 390, spec 6669, cli 639 passing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBks5G7AkwrvgF2kL5rfkT
* fix: address CI findings on the reference-integrity rules (#3583)
- Raw NUL byte in the hook-dedup key (validate-expressions.ts) tripped
`check:nul-bytes`. A raw NUL makes grep/ripgrep treat the whole file
as binary and silently return zero matches, so the file drops out of
code search and every grep-based lint. Written as the \u0000 escape
per the repo convention — byte-identical at runtime.
- CodeQL (high): the `{…}` interpolation test used /\{[^}]+\}/, which
backtracks quadratically on a long run of `{` with no closing brace.
Replaced with a linear two-index scan; same semantics, including the
"at least one character between the braces" rule.
- spec public API gained 6 exports (the platform-object registry), so
the api-surface snapshot needed regenerating. 0 breaking, 6 added.
Also wire the two rules into `os compile` alongside `validate`/`lint`.
Every sibling reference rule (widget bindings, dashboard action refs,
filter tokens) already runs there, so leaving these out would recreate
the exact validate/lint/compile wiring drift the assessment flagged.
Document the new checks in docs/deployment/validating-metadata.mdx —
a "Dangling object and action names" section with the resolvability
severity table, plus the entry-points row.
Suites: lint 390, spec 6669, cli 636 passing; eslint, nul-bytes and
api-surface checks clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBks5G7AkwrvgF2kL5rfkT
* chore: register sys_migration after merging main (#3583)
Merging main brought in the ADR-0104 deployment-migration gate, whose
`sys_migration` object the platform-object registry did not list — and
the conformance ratchet failed exactly as intended, which is the point
of having it rather than a prefix heuristic.
Also regenerates the api-surface snapshot for the union of main's new
exports and this branch's.
Re-verified on the merged base: lint 390, spec 6681, cli 637 passing;
eslint, nul-bytes, api-surface clean; and the three example apps
(app-crm, app-showcase, app-todo) still produce zero findings.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBks5G7AkwrvgF2kL5rfkT
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 984396b commit f163028
22 files changed
Lines changed: 1881 additions & 20 deletions
File tree
- .changeset
- content/docs/deployment
- packages
- cli
- src
- commands
- utils
- test
- lint/src
- spec
- src
- system/constants
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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
86 | 119 | | |
87 | 120 | | |
88 | 121 | | |
| |||
93 | 126 | | |
94 | 127 | | |
95 | 128 | | |
| 129 | + | |
96 | 130 | | |
97 | 131 | | |
98 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
322 | 360 | | |
323 | 361 | | |
324 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
490 | 523 | | |
491 | 524 | | |
492 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
284 | 327 | | |
285 | 328 | | |
286 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
225 | 238 | | |
226 | 239 | | |
227 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
132 | 177 | | |
133 | 178 | | |
134 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
184 | 194 | | |
0 commit comments