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,spec): close the round-2 pin gap and correct false-at-head wording
REWORK round 2 for #20206 (at-tier record 5856823202, items 1-2):
1. `validate-object-references.test.ts`'s non-array refusal test pinned
only [null, 42, 'core']; add `{}` and a keyed object so all three
validators pin the identical set `packagesOf` itself does.
2. Text corrected to match the head, wording only:
(a) "four call sites" / "four copies" -> "five ... three files" in
the `packagesOf` docblock and the `object-graph.test.ts` comment,
now that `validate-mapping-target-fields.ts` is a fifth site.
(b) every sentence claiming lint reads `null` "the way
`resolveArtifactPackageOrder` does" or raises "the SAME code ...
for the identical defect" is qualified for `null` specifically:
on `main`, core still reads `null` as absent and names it via
`typeof`; that only changes once #19926 (PR #20228) lands. Fixed
in the docblock, the inline naming comment, the lint changeset
and the ledger-row comment in `error-code-ledger.zod.ts`.
(c) the lint changeset's door-reachability claim corrected: only
`os lint` reaches `packagesOf`'s refusal (exit 1, message on
stdout via `printError`, `code` under `--json`); `os validate`
and `os build` already refuse a malformed `packages` earlier, at
`ObjectStackDefinitionSchema.safeParse`, before these rules run
(re-read `validate.ts:293`, `compile.ts:356`, `lint.ts:673/1140`,
`format.ts:369` directly to confirm).
No `packagesOf` semantics changed.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcAS3qiYYZNezaxZxaUdMV
Copy file name to clipboardExpand all lines: .changeset/20206-lint-packages-non-array-refused.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
"@objectstack/lint": minor
3
3
---
4
4
5
-
`packages/lint`'s five `stack.packages` readers (four named by #20206, plus one added by #20208 after that card's site census) now refuse a PRESENT non-array `packages` — `{}`, `0`, `'x'`, a keyed object, and (as of this round) `null` too — the same way `@objectstack/core`'s `resolveArtifactPackageOrder` already does, instead of silently reading it as "no packages" (#20206, ruling A on #15293 comment 5634034754; the `null` leg is ruling A on #19926, comment 5805260775: `null` is malformed, everywhere).
5
+
`packages/lint`'s five `stack.packages` readers (four named by #20206, plus one added by #20208 after that card's site census) now refuse a PRESENT non-array `packages` — `{}`, `0`, `'x'`, a keyed object, and (as of this round) `null` too — instead of silently reading it as "no packages" (#20206, ruling A on #15293 comment 5634034754; the `null` leg is ruling A on #19926, comment 5805260775: `null` is malformed, everywhere). For every shape other than `null`, this is the same way `@objectstack/core`'s `resolveArtifactPackageOrder` already refuses it, with the same registered code; for `null`, `resolveArtifactPackageOrder` still reads it as absent on `main`, and the two readers align only once #19926 (PR #20228) lands.
6
6
7
7
Clause-②: no (narrowing)
8
8
9
9
<!-- adr-0087: not-required (no-migration-prescription) an already-malformed `packages` value is refused rather than converted; no key, export or stored value moves, and nothing in this repo emits the shape today -->
10
10
11
-
-**What changes**: `validateObjectReferences`, `validateTranslationReferences` and `validateMappingTargetFields` (the three public `@objectstack/lint` functions these readers sit behind) now throw an `INVALID_ARTIFACT_PACKAGES` error (ADR-0112, `status: 422`) instead of returning findings, when the stack they are handed carries a `packages` key that is present but not an array — `null` included. `os validate` / `os lint`/ `os build` surface it as a refusal on stderr (and in `error`/`code` under `--json`) instead of reporting the stack as clean.
11
+
-**What changes**: `validateObjectReferences`, `validateTranslationReferences` and `validateMappingTargetFields` (the three public `@objectstack/lint` functions these readers sit behind) now throw an `INVALID_ARTIFACT_PACKAGES` error (ADR-0112, `status: 422`) instead of returning findings, when the stack they are handed carries a `packages` key that is present but not an array — `null` included. Only `os lint`reaches this refusal — exit 1, the message on stdout (`printError`), `code` under `--json`; `os validate` and `os build` already refuse a malformed `packages` earlier, at `ObjectStackDefinitionSchema.safeParse`, before these rules ever run.
12
12
-**What does not change**: an absent `packages` (the key omitted, or explicitly `undefined`) is still read as "no packages" — unchanged. A well-formed `packages[]` array is read exactly as before, junk entries dropped exactly as before.
13
13
-**Fix**: write `packages` as an array of `{ manifest: … }` entries, or omit the key entirely for a single-package stack.
0 commit comments