test(qa): assertArmed — a fixture proves the control under test is engaged before it measures anything (#8074) - #8407
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This was referenced Aug 13, 2026
os-zhuang
marked this pull request as ready for review
August 13, 2026 11:38
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 #8074
What this is
packages/qa/dogfood/test/armed.ts—assertArmed: a fixture names the control it is about to measure and the default that would silence it, and the harness reads that declaration off the live booted stack before the fixture is allowed to measure anything.The card's common factor is not a missing fixture helper — it is a platform default that disarms the thing under test, while the harness keeps reporting success. So the guard is built around the precondition, not around any one of the three defaults.
Scope — stated plainly, because two of three is the honest answer
org_member⇒ the write floor never appliesprincipalArmedpasswordHistoryCount: 0⇒ nothing to reject againstauthSettingArmedInstance 3 is out of reach of a runtime probe by construction: its assertion was evaluated by
tsc, not by vitest, and what disarmed it lived intsconfig.json. Three measured reasons not to build a package-local imitation of it:scripts/check-type-check-coverage.mjsalready owns the coverage half repo-wide (itsTEST_DEBTledger lifts a package's test-layer exclusion, compiles it, ratchets the count);PINS_CHECKEDrecognising only@ts-expect-error— is [finding] PINS_CHECKED detects only@ts-expect-error, so other compile-time pin idioms in a hidden test layer are invisible to it — measured on a live example #8113 and is explicitly not this card's;@objectstack/dogfoodis in neither ledger, its tsconfigincludeis["src/**/*", "test/**/*"], and a deliberate type error in a dogfood test file makespnpm --filter @objectstack/dogfood typecheckgo red (TS2322, ablation G below). Instance 3's mechanism is absent from this surface.The module's header carries this reasoning, so the mechanism cannot read as though it covers all three.
Three design decisions, each load-bearing
beforeAll, not from anit(). A disarmed fixture must produce zero green cells. The hand-rolled[integrity]idiom this generalises is an ordinary case, so a disarm reddens one cell and every sibling still prints green — and Apublic_read_writeobject is only writable by the row's creator —showcase_contributorgets 403 editing ashowcase_projectit can read, where the access matrix declaresedit:true#8023's harm was exactly a green cell in a 124-cell matrix re-drive. Measured, on Apublic_read_writeobject is only writable by the row's creator —showcase_contributorgets 403 editing ashowcase_projectit can read, where the access matrix declaresedit:true#8023's own fixture: ablatingorgContext: trueused to leave 9 green cells; it now yields 10 skipped, 0 green.assertArmed([])throws;principalArmedwith nothing required andseededArmedwith an emptywherethrow at construction.Consumers — five fixtures that patch-and-trust today
owd-public-read-write-write-floor(#8023),bearer-lane-password-change(#8049),two-factor-lockout,oidc-authorize-env-gate. All four state their vacuity risk in prose and then trust the arming; none reads it back. They now do.Every guard is shown to fire
This card is about assertions that cannot fail, so the guard is held to its own standard. Direction predicted before each run:
assertArmedneuteredarmedWhenaccepts a truthy non-booleanprincipalArmedalways armedorgContextorgContext: trueTS2322F(ii) is the one worth reading twice: the pre-#8074 fixture records nine passing cells for a control that was never armed. That is the harm, reproduced.
Two positive controls in the guard's own suite assert that a fully armed declaration resolves — without them, an
assertArmedthat simply always threw would satisfy every rejection case above.No dependency package was mutated in any ablation: all six files live in
packages/qa/dogfood/test/and vitest transforms them from source, so nodist/rebuild sits between mutate and run.Verification
vitest runover the five affected fixtures: 55 passed.pnpm --filter @objectstack/dogfood typecheck: clean.scripts/pm/dispatch-gates.mjs:check:nul-bytes,check:test-source-alias,check:type-source-resolution,check:query-options-erasure,check:type-check-coverage— all green.eslint --no-inline-configon all six files: clean.Tests-only (
packages/qa/dogfood/test/**;@objectstack/dogfoodisprivate: true), so no changeset —skip-changesetapplied.Generated by Claude Code