Skip to content

test(cli): move the nightly-tier failure-warnings fixtures off the bare declared-index unique - #22242

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-22208-nightly-fixtures-unique-scope
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-22208-nightly-fixtures-unique-scope

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #22208
Clause-②: no

Moves the two @objectstack/cli nightly-tier fixtures off the spelling that protocol 18 refuses. The refusal itself (PR #22103, ef1fcb26a2) is correct and is not touched here. Test-only: two files, +23 / -11, no assertion changed, and no test skipped, renamed or moved between tiers.

What changed

Both --json failure-warnings suites plant one advisory of each class and assert that each failure exit carries exactly the classes the run had computed. Their authoring-RULE advisory was a bare unique: true on a declared index. Since PR #22103 the schema parse refuses that spelling (invalid_union at objects.0.indexes.0.unique), so every fixture stopped at the parse exit and the payload carried none of the fields the tests read.

site (on 7b926f76) before after
build-json-failure-warnings.e2e.test.ts:165 (shared stack()) index unique: true index unique: 'global' + field title unique: true
build-json-failure-warnings.e2e.test.ts:300 (3b rulefail) index unique: true index unique: 'global' + field title unique: true
validate-json-failure-warnings.e2e.test.ts:192 (shared stack()) index unique: true index unique: 'global' + field title unique: true

The new advisory is unique/double-declaration (ADR-0120 D5b): a field-level unique: true (per organization) beside a single-column declared index unique: 'global' on the same column. It is the shape PR #22103 already moved the two sibling parity suites to (build-json-advisory-parity, build-json-undeclared-key-parity).

Why it is an authoring-RULE advisory and not a structural one: it is produced by the lintUniqueDeclarations entry of the author-time rule registry (packages/lint/src/authoring-rules.ts, tier advisory, commands validate + build). Its finding is severity: 'warning', so splitBySeverity puts it in ruleAdvisories and never in the gating errors. It is a record with a non-docs/ rule and no token, which is exactly what the suites' ruleAdvisories classifier selects. The structural advisory is a different list (structuralWarnings, a string computed last in validate.ts).

Docblocks: the two fixture docblocks (build :141, validate :168) name the new advisory and say in one sentence why the old spelling left. The two rulefail comments (build :291, validate :295) name it too.

No assertion named the bare-unique rule: every assertion reads the class COUNT (rule: 1), never the rule id. So no assertion line moves (git diff -U0 | grep -c 'expect(' = 0).

Readings (all on origin/main at the time; base 7b926f76, then merged with a87d8be2)

  • H1, reproduced before any edit. OS_TEST_TIERS=nightly, integration project, the two files only, on 7b926f76: Tests 11 failed | 10 passed (21). The total is the same 11 as the card. Per file: build 6 failed / 5 passed (3f, 3e, 3c, 4b, catch-all, 3b red); validate 5 failed / 5 passed (rule errors, capability errors, doc errors, catch-all late, structural control red).
  • H2, confirmed. The validate structural control's own output quotes `indexes[].unique: true` was retired at protocol 18 (ADR-0120 D1) at path objects / 0 / indexes / 0 / unique. A direct os build --json probe of the 3b fixture on the base returned { success: false, errors: [invalid_union at objects.0.indexes.0.unique], warnings: [], conversions }. That payload has no error, no issues and no advisory lists, which are the fields the ten other failures read as undefined.
  • H3, used. A probe on the new 3b fixture returned error: 'author-time rules failed', issues: ['expression-invalid'] and warnings: [unique/double-declaration (warning)]. The new validate control fixture reached valid: true with the rule record, the key string, the cap record and the structural string ("No apps or plugins defined").
  • H4, re-counted. 80 nightly-tier files (*.e2e.test.*, *.live.test.*) on 7b926f76 have exactly three declared-index unique: true sites, the three above. The other three code hits are field-level unique: true (valid under ADR-0120 D1): build-json-advisory-parity:149, build-json-undeclared-key-parity:141 and :170. The control spelling unique: 'global' hits 4 sites, so the grep sees. The card's own log names only @objectstack/cli#test red (59 of 60 tasks green). No other site found; nothing else is red for this cause.
  • H5, done as described above.

Proof

  • Fixed, nightly tier. Same command on e8d64c30 (fix) and again on 89d4dc47 (fix merged with origin/main a87d8be2): Test Files 2 passed (2) / Tests 21 passed (21). All 21 tests are named in the verbose run, including the 11 that were red and the structural control.
  • Per-PR tier untouched. vitest list --filesOnly in packages/cli: with OS_TEST_TIERS unset and with =queue, 356 files and neither of these two; with =nightly, 80 files (the card's "(80)") and both, in [integration]. The diff touches no tier config, no file name and no vitest-tiers.ts input.
  • Ablation (scripts/ablation-replace.mjs, wrap mode, plus an outer EXIT/INT/TERM restore trap). The 3b rulefail fixture was put back to its base spelling: anchor x1 -> x0, replacement x0 -> x1, blob 7dfddae7 -> bd478edf, in-flight count base-spelling = 1. The build file then read Tests 1 failed | 10 passed (11). The one red was 3b, expected undefined to be 'author-time rules failed', the payload missing error again. Restore: blob 7dfddae7 == HEAD blob, git diff HEAD empty, index blob equal, porcelain empty. The direction matched the prediction written before the run.

Local verification (final head 89d4dc47)

  • pnpm --filter @objectstack/cli typecheck: exit 0. check:test-typecheck OK; tsconfig.test.json puts both files in its 1970-file program (--listFiles), and the 28 raw errors are the ledgered 28 in three other files, 0 in these two.
  • pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2: Test Files 263 passed (263), Tests 3874 passed (3874).
  • Gates: the 50 commands node scripts/pm/dispatch-gates.mjs --commands derives for this change set are the same set as the dispatch order's list. 50 of 50 exit 0. check:dual-build-cjs-loads first exited 3 (PREREQUISITE NOT MET: nine packages outside the cli closure had no dist/); after a full pnpm build (72/72) it exits 0. dispatch-gates --ran: 50 derived, 50 run, 0 NOT-MEASURED, 0 UNRUN.
  • pnpm lint (full, eslint . --no-inline-config): exit 0. A JSON run over the two files reports 2 results, 0 errors, 0 warnings, and neither is ignored.
  • No changeset: test-only, nothing in any package's files[] moves. skip-changeset is the seat's to apply.
  • Not run locally, declared to CI: the rest of the integration project and the other nightly-tier files. Done for this card is the next Nightly Tiers run on a main that contains this change.

Acceptance notes

  • The build file's fixture docblock still says "via plantDocs", a helper that does not exist in this file (docs are passed through make(…, docs)). This is pre-existing wording, kept as is because it is outside this card's surface. Noted, not filed.
  • check-issue-citations read 0 files for this diff: packages/cli/test/** is outside its declared surface, so it judged nothing about the PR #22103 citation added in these docblocks, in either direction.
  • My first full pnpm lint crashed (exit 2, ENOENT on a transient tsup.config.bundled_*.mjs) because it ran beside my own concurrent pnpm build. That is a local race and not a lint verdict. The re-run after the build finished is the reading above.

Generated by Claude Code

claude added 2 commits October 8, 2026 07:50
…re declared-index unique

The two `--json` failure-warnings e2e suites planted their authoring-rule
advisory as a bare `unique: true` on a declared index. Protocol 18 refuses
that spelling at the schema parse (ADR-0120 D7), so every fixture stopped at
the parse exit and the payloads carried none of the fields the tests read.

Each fixture now raises `unique/double-declaration` instead: field-level
`unique: true` beside a declared index `unique: 'global'` on the same column,
the shape the sibling parity suites already moved to. It is a warning-severity
author-time rule, so it still rides `ruleAdvisories`. No assertion changes,
and no test is skipped, renamed or moved between tiers.

Claude-Session: https://claude.ai/code/session_01RWZbGvPFcRKvUqASZtunCU
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 3ae59661dc4d5029b1ce02e9cdca5cc6d5f74f83 → packageMentionDocs.

@github-actions github-actions Bot added the tests label Oct 8, 2026
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 8, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 8, 2026 09:03
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 8, 2026 09:03
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit dbb7be2 Oct 8, 2026
39 of 40 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-22208-nightly-fixtures-unique-scope branch October 8, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nightly-tiers: red on main

2 participants