Commit d114d5e
feat(cli): carry the computed advisory lists on every
* feat(cli): carry the computed advisory lists on every `os build --json` failure exit (#11772)
`warnings` lived on the terminal success payload only (plus `ruleAdvisories`
alone on the author-time-rules failure), while the text face prints its
advisory blocks — the #11529 author-time advisories at 3b and the #3786
undeclared authoring-key findings at 3d — several gates earlier, each ending
in `— re-run with --json for the full list`. A build that then failed at a
later gate emitted that gate's failure payload, and none of those carried the
list: the remedy the notice named returned a payload without the withheld
entries in it (the #11643 / #11391 "the remedy named is unreachable" shape).
Maintainer ruling 2026-08-25, option 1 of three: every `emitJson` failure exit
carries the lists the run has ALREADY COMPUTED, so `warnings` means the same
thing on every exit. Option 2 (shape depends on how far the run got) and
option 3 (weaken the pointer) were both rejected.
Nine failure exits, three more than the filing card's table listed — it missed
the protocol-parse exit, the `--no-runtime-bundle` refusal and the bottom
catch-all. Every one now reads a single `warningsSoFar()` site, which the
success payload reads too, so the member order (`os validate --json`'s, minus
its trailing `structuralWarnings`) cannot drift between exits.
Carrying, not computing: each list stays computed at the step that owns it, so
an exit upstream of a step reports that list empty rather than paying for a
computation it had not already done.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR
* fix(cli): bind the hoisted advisory list to splitBySeverity's return type (#11772)
`Test Core (2/6)` failed on `packages/lint/src/authoring-rule-wiring.test.ts:291`
-- "os build imports no unratcheted symbol from @objectstack/lint":
AssertionError: compile.ts imports AuthoringFinding from @objectstack/lint
directly. Register the rule in AUTHORING_RULES, or add the symbol to
LINT_IMPORT_RATCHET with a reason.
expected [ 'AuthoringFinding' ] to deeply equal []
WHY THIS CARD TRIPPED IT. Hoisting the four advisory lists out of the `try` so
every `emitJson` failure exit can read `warningsSoFar()` turned one inferred
binding into a declared one. Before the hoist the list arrived destructured --
`const { errors: ruleErrors, advisories: ruleAdvisories } = splitBySeverity(...)`
-- and its type was inferred, so no name was imported. A `let` declared ahead of
the assignment needs a written type, and the first spelling reached for the
underlying finding type, adding `AuthoringFinding` to compile.ts's import list.
The #4409 import scan reads that list and had never been told about the symbol.
`import type` does not escape the scan, and that is deliberate: `lintImportsIn()`
matches `/import\s+(?:type\s+)?\{([^}]*)\}\s*from\s*['"]@objectstack\/lint['"]/g`
and then strips a per-name `type ` prefix, so both the statement-level and the
inline modifier are seen. The guard is asking which SYMBOLS this command file
names, not which of them survive to runtime.
THE FIX. Bind the annotation to the function that produces the value:
let ruleAdvisories: ReturnType<typeof splitBySeverity>['advisories'] = [];
`splitBySeverity` is already an import this file makes and already carries a
LINT_IMPORT_RATCHET entry ("Pure partition of a finding list into gating vs
advisory. Carries no rule identity at all."), so no symbol is added and no
exemption is widened. It resolves to exactly the same type the old annotation
spelled -- `AuthoringFinding[]`, the function is sync so no `Awaited` is
involved -- and `tsc --noEmit` is clean.
WHY THIS IS NOT A GATE BYPASS. Nothing was added to LINT_IMPORT_RATCHET or to
AUTHORING_RULES, no assertion in authoring-rule-wiring.test.ts was touched, and
no test was skipped or relaxed. The ratchet's exemption set is byte-identical
before and after; the import list it scans is what shrank. The annotation is
strictly tighter than the one it replaces: it is now pinned to
`splitBySeverity`'s declared shape, so if that function's `advisories` member
ever changes type this binding follows it instead of silently disagreeing --
the same "one list cannot drift from itself" idiom this card applied to the
member ORDER of `warningsSoFar()`, now applied to the list's TYPE.
Behaviour is unchanged: type-only edit, no emitted JS differs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR
---------
Co-authored-by: Claude <noreply@anthropic.com>os build --json failure exit (#12079)1 parent 71f9cd1 commit d114d5e
4 files changed
Lines changed: 700 additions & 28 deletions
File tree
- .changeset
- packages/cli
- src/commands
- test
| 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 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
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 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
86 | 139 | | |
87 | 140 | | |
88 | 141 | | |
| |||
141 | 194 | | |
142 | 195 | | |
143 | 196 | | |
144 | | - | |
| 197 | + | |
145 | 198 | | |
146 | 199 | | |
147 | 200 | | |
| |||
196 | 249 | | |
197 | 250 | | |
198 | 251 | | |
199 | | - | |
| 252 | + | |
200 | 253 | | |
201 | 254 | | |
202 | 255 | | |
| |||
223 | 276 | | |
224 | 277 | | |
225 | 278 | | |
226 | | - | |
| 279 | + | |
| 280 | + | |
227 | 281 | | |
228 | 282 | | |
229 | 283 | | |
| |||
237 | 291 | | |
238 | 292 | | |
239 | 293 | | |
240 | | - | |
| 294 | + | |
241 | 295 | | |
242 | 296 | | |
243 | 297 | | |
| |||
277 | 331 | | |
278 | 332 | | |
279 | 333 | | |
280 | | - | |
| 334 | + | |
281 | 335 | | |
282 | 336 | | |
283 | 337 | | |
| |||
287 | 341 | | |
288 | 342 | | |
289 | 343 | | |
| 344 | + | |
290 | 345 | | |
291 | 346 | | |
292 | 347 | | |
| |||
322 | 377 | | |
323 | 378 | | |
324 | 379 | | |
325 | | - | |
| 380 | + | |
326 | 381 | | |
327 | 382 | | |
328 | 383 | | |
| |||
334 | 389 | | |
335 | 390 | | |
336 | 391 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
349 | 404 | | |
350 | 405 | | |
351 | 406 | | |
| |||
382 | 437 | | |
383 | 438 | | |
384 | 439 | | |
385 | | - | |
| 440 | + | |
386 | 441 | | |
387 | 442 | | |
388 | 443 | | |
| |||
423 | 478 | | |
424 | 479 | | |
425 | 480 | | |
426 | | - | |
| 481 | + | |
427 | 482 | | |
428 | 483 | | |
429 | | - | |
| 484 | + | |
430 | 485 | | |
431 | 486 | | |
432 | 487 | | |
| |||
480 | 535 | | |
481 | 536 | | |
482 | 537 | | |
483 | | - | |
| 538 | + | |
484 | 539 | | |
485 | 540 | | |
486 | 541 | | |
| |||
504 | 559 | | |
505 | 560 | | |
506 | 561 | | |
507 | | - | |
| 562 | + | |
508 | 563 | | |
509 | 564 | | |
510 | 565 | | |
| |||
584 | 639 | | |
585 | 640 | | |
586 | 641 | | |
587 | | - | |
| 642 | + | |
588 | 643 | | |
589 | 644 | | |
590 | 645 | | |
| |||
642 | 697 | | |
643 | 698 | | |
644 | 699 | | |
645 | | - | |
| 700 | + | |
646 | 701 | | |
647 | 702 | | |
648 | 703 | | |
| |||
0 commit comments