test(spec-tooling): restore the liveness author-lint's array fan-out assertion (#7079) - #7689
Merged
Merged
Conversation
…assertion (#7079) `getNested` fans a dotted warn-map path out over an ARRAY container level, so `navigation.runAction` must check EVERY navigation entry, not just index 0. That reach lost its only test subject when #6774 flipped `dashboard.widgets.colorVariant` to `live`: the assertion "fans out over EVERY widget, not just the first" had nowhere left to stand, and was removed with a tombstone comment rather than downgraded into a silence check that would pass on a walk which never looks past `widgets[0]`. `app.props.navigation.children.runAction` (#4848's spec half — `planned` + `authorWarn`, because the declared deep-link auto-run slot is validated at authoring but no shipped shell reads it yet) is now a dotted warned path under an array container: `navigation` is an array in every authored app. Rebuild the assertion against it in the deleted test's construction — the warned key on `navigation[1]` and nowhere on `navigation[0]`, so a walk that stops at the first element finds `undefined`, emits nothing, and goes red. Verified by mutation, not by a green suite: with `getNested` temporarily taking only `c[0]` at an array level, this assertion is the ONLY failure across the package (1883 passed / 1 failed), so the red is attributable to the broken walk rather than to collateral damage. Reverting the mutation returns 1884 passed. Alongside it: a control pinning that index 0 is not a blind spot either, the `checkItem` one-finding-per-(item, path) contract the length assertion rests on, and a clean-navigation silence pin. The tombstone comment is replaced by a pointer to this resolution. Test-only; `getNested` and the lint's behaviour are untouched. Fixes #7079 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DveDnLVD1syPGfXryonczk
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 0 changed package(s). ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7079
What was lost, and what pays it back
getNested(packages/lint/src/lint-liveness-properties.ts:146) resolves a dotted warn-map path by fanning it out over an array container level —navigation.runActionmust check every navigation entry, not justnavigation[0]. That reach is the half a walk can lose silently: agetNestedthat stopped at index 0 still warns on every single-entry fixture, on every top-level warned key, and on the first item of every real app, so nothing else in the suite goes red.It had exactly one subject,
dashboard.widgets.colorVariant, and #6774 flipped that row tolive. The assertion — "fans out over EVERY widget, not just the first" — was removed with a tombstone comment rather than downgraded into a silence check that would pass on a broken fan-out. #7079 recorded the loss.app.props.navigation.children.runActionis now a dotted warned path under an array container: #4848's spec half,planned+authorWarn(the declared deep-link auto-run slot is validated at authoring, but no shipped shell reads it yet), andnavigationis an array in all three authored apps. The assertion is rebuilt against it in the deleted test's construction — the warned key onnavigation[1], nowhere onnavigation[0].The evidence is the mutation, not the green suite
A test that merely passes today would be the exact non-test this card was filed to avoid. So
getNestedwas temporarily broken to take onlyc[0]at an array level:The new assertion is the only failure in the entire package — the red is attributable to the broken walk, not to collateral damage. Mutation reverted,
getNestedbyte-identical tomain:Also in the block
checkItemone-finding-per-(item, path)contract thetoHaveLength(1)rests on, so that number is pinned rather than accidental;:448replaced by a pointer to this resolution.Because the discriminating assertion is a positive warning, it cannot pass vacuously:
lintLivenessPropertiesreturns[]both when the ledgers fail to load and when the walk is broken, and this block fails in either case.Option 1 (export
getNested) — declined, deliberatelyThe card offered a ledger-independent unit test via an exported
getNestedor an@internalseam, and named its cost: a second contract on a function whose entire design is "ledger-driven, coverage grows by marking entries". Declined, because the mutation above shows the ledger-driven test already delivers the one fact the card asks for — it distinguishes a working walk from one that never looks past[0]. A seam would add public surface to@objectstack/lintfor no additional discriminating power, and would cost the property this test has and a unit test would not: it holds the real shipped ledger to itsauthorWarnon that row, the contract this file's header docblock describes.Scope
Entirely
packages/lint/src/lint-liveness-properties.test.ts(+99 / −9, one file). No ledger row was added or flipped — the subject already existed.lint-liveness-properties.ts,packages/spec/liveness/*.json,packages/spec/src/**/*.zod.tsandcontent/docs/releases/**are untouched.Gates
pnpm --filter @objectstack/lint run testpnpm --filter @objectstack/lint run typecheckskip-changeset: test-only, nothing published changes —packages/lint'sfilesshipsdist,README.md,CHANGELOG.md, and vitest sources are in none of them. AGENTS.md:1018 requires a changeset for feature work; the label's own description is "PR has no user-facing published change; bypasses the changeset gate". Precedent: #7579 (test(drivers): remove redundant object: key from mongodb/sql query test literals), merged test-only with the label.Generated by Claude Code