This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
test(console,plugin-list): make two Storage.prototype spy instruments measure what they claim (objectui#7786) - #7790
Merged
Conversation
… measure what they claim (objectui#7786) Both suites spied on `Storage.prototype` and graded green without measuring what their names promised. `apps/console/src/__tests__/bootSplash.test.ts` injected its "no localStorage access" fault with `vi.spyOn(Storage.prototype, 'getItem')`, which never reached the script under test: happy-dom hands `localStorage` out through a proxy that has already bound `getItem`, and `vitest.setup.base.ts` may swap the store for a plain object that never inherited from `Storage.prototype`. Measured on Node 22.22.2, the version CI pins, a direct `localStorage.getItem` in that test did not throw, so the case asserted only that an ordinary boot does not throw. The fault is now injected where the script resolves it, a counter-probe asserts it is observable before anything is graded on its absence, and a stored `dark` choice makes the expected `light` outcome reachable only when storage is genuinely unreadable. `packages/plugin-list/src/__tests__/UserFilters.addTab.test.tsx` carries the negative assertion `expect(setItem).toHaveBeenCalledTimes(0)`, which a blind spy satisfies for the wrong reason. It now proves the spy observes two writes the test makes itself, in both `sessionStorage` and `localStorage`, before asserting anything about writes the component did not make. Tests only: no runtime source is touched and the changeset declares that nothing ships. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 28, 2026
…404 (objectui#10755) (objectstack-ai#10766) Fixes objectstack-ai#10755 Clause-②: no Dispatched implementation of the `domain:ui` seat 2 claim (comment `5853230223`) on objectui#10755, session `https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN`. Citations only, on three published docs pages: no sentence's claim moves, and the frontmatter of all three files is byte-identical. ## What changed - The ten objectui issue links that answer 404 now cite the landing commit on `main`, as a 9-character backticked sha. That is the form `content/docs/guide/ci-cd-pipeline.md` already uses for commits (five of its six existing sha citations are 9 characters), and the form PR objectui#10707 chose for the same class on objectui#10701. - Two prose-only mentions of the same dead numbers, inside the same two sentences, are re-pointed so each sentence stays coherent: "in objectstack-ai#7638's card body" reads "in the second card's body", and "over the file objectstack-ai#8057 is entirely about" reads "over the file that third writer lives in". Lychee does not read those; the reader does. Each sentence's claim is unchanged. - Commits, not PRs, at every site. Two of the landing PRs answer 404 themselves (PR 7637 for objectui#7627, PR 7805 for objectui#7753), so PR numbers are not uniformly alive; commits on `main` are. The same ten numbers answer 200 in objectstack, each an unrelated subject, so a repo-qualified re-cite would send a reader to the wrong record. - No lychee config or workflow change, and no changeset: `content/**` is not a released package (`check-changeset-presence` below). ## H1 reproduction, at the base `704e05b09d` (origin/main at claim time) - Lychee is not preinstalled in this container; the 0.18.1 release binary was fetched into the scratchpad. `lychee --verbose --no-progress --config lychee.toml` over the three files: `🔍 195 Total (in 15s) ✅ 182 OK 🚫 13 Errors`, exit 2. Ten `[404]` lines, one per objectui issue URL, exactly the card's ten, on the same lines the card names (re-read at the base). The other three errors are this container's egress proxy, not link rot: `github.com/changesets/changesets` and `github.com/lycheeverse/lychee` answer 403 ("GitHub access to this repository is not enabled for this session") and `git-cliff.org` is a CONNECT 403. The CI run `36294593837` had 10 errors and none of these; they recur identically at the head. - REST `GET /repos/objectstack-ai/objectui/issues/N`: all ten answer 404, on the API and on the HTML page. Lit controls: objectui#7013, objectstack-ai#7015, objectstack-ai#9229 and objectstack-ai#7790 answer 200. Neighbours objectui#5792, objectstack-ai#5794, objectstack-ai#7792 and objectstack-ai#9231 also answer 404 and are cited nowhere in the swept trees. - objectstack `GET /repos/objectstack-ai/objectstack/issues/N`: all ten answer 200 and every subject is unrelated (a spec docs generator PR, a bulkCreate card, a QA run, an email-template PR, and so on). ## H2 and H3, site by site Each row: the quoted anchor in the sentence, the dead citation, the replacement, and the evidence (the dead number's REST status is 404 in every row; the landing commit's subject is quoted without its conventional-commit prefix). | file | sentence anchor | old | new | evidence | |:--|:--|:--|:--|:--| | `ci-cd-pipeline.md` | "three times so far, each found by a human and never by a gate (…, the third in the same package as the first)" | objectui#6943 | "and a third in the same package as the first, all three recorded in `6aeba673c`, the commit that landed this gate" | `6aeba673c` "require the directory form of the tooling exclude in every published build tsconfig" (PR 7409 answers 200). Its message records objectui#4006, objectstack-ai#4836 and objectstack-ai#6943 as the three incidents. objectstack-ai#4006 and objectstack-ai#4836 stay linked; both answer 200. | | `ci-cd-pipeline.md` | "measured at two cards and three copied call sites (…), both closed by pointing the prose at `resolveRecordSourceObjectName`" | objectui#7627, objectui#7638 | "measured at two cards and three copied call sites, both cards closed by pointing the prose at `resolveRecordSourceObjectName` (`b041b9c0c`, `2ce2612df`)" | `b041b9c0c` "one shared record-source object-name reader, six plugins delegate" (PR 7637 answers 404); its message settles objectui#7627 by name. `2ce2612df` "the record-page URL follows the record source, not the top-level key" (PR 7648 answers 200); `abdcd189c`'s message names PR 7648 as the change that removed the spelling objectui#7638 was filed about, and its diff points the hook's `@example` at `resolveRecordSourceObjectName` (7 occurrences). | | `ci-cd-pipeline.md` | "in objectstack-ai#7638's card body and then in the dispatch that repeated it" (prose, not a link) | objectui#7638 | "in the second card's body and then in the dispatch that repeated it" | The two cards are named in the preceding clause; the claim is unchanged. | | `ci-cd-pipeline.md` | "a count ratchet would have been green too, which is why … rejected that option on the instance itself" | objectui#7753 | "which is why `72498f257`, the commit that landed this gate, rejected that option on the instance itself" | `72498f257` "a census derives every handler key a registered renderer reads and requires its arm to declare it (objectui#7753)" (PR 7805 answers 404). Its message records the substitution that held `RUNTIME_SLOT` at 44 and `ALL_SITES` at 66, the count reading the sentence describes. | | `ci-cd-pipeline.md` | "… then reproduced the identical defect on a THIRD writer neither guard covered, in that card's own required dogfood" | objectui#8057 | "The identical defect was then reproduced on a THIRD writer neither guard covered, in that card's own required dogfood (recorded in `9662aca56`, the commit that landed this gate)" | `9662aca56` "apply the object-metadata write invariant at the write doors, not at an enumeration of writers" (PR 9238 answers 200). Its message: "objectui#8057 then reproduced the identical defect on a third writer in that card's own required dogfood, and a sweep found nine more". "That card" is objectui#7714, linked in the preceding sentence, which answers 200. | | `ci-cd-pipeline.md` | "returns ZERO over the file objectstack-ai#8057 is entirely about" (prose, not a link) | objectui#8057 | "returns ZERO over the file that third writer lives in" | The third writer is referenced two sentences earlier; the claim is unchanged. | | `ci-cd-pipeline.md` | "widened from `content/docs/**` alone by …" | objectui#7878 | "widened from `content/docs/**` alone in `59a3a233d`" | `59a3a233d` "widen the expression-carriage census to check:doc-types' surface (objectui#7878)" (PR 8105 answers 200). | | `ci-cd-pipeline.md` | "cwd the only variable (…). Root `AGENTS.md` had taught" | objectui#7791 | "cwd the only variable (`223b1e4a3`). Root `AGENTS.md` had taught" | `223b1e4a3` "root the capability spec-parity pin at the file, not the cwd (objectui#7791)" (PR 7796 answers 200). Its message carries the two-cwd measurement. | | `ci-cd-pipeline.md` | "The defect it closes (…):" | objectui#5793 | "The defect it closes, repaired in the gate's own landing commit `111741454`:" | `111741454` "gate @objectstack/spec range floors against published symbols" (PR 6076 answers 200). Its message describes the `plugin-detail` `ReferenceRailEntry` defect in the sentence's own words, and its diff bumps `packages/plugin-detail/package.json`'s `@objectstack/spec` floor from `^17.0.0` to `^17.1.0`, so the same commit landed the gate and repaired the defect. | | `lookup.mdx` | "and must never reach authored object metadata (…)" | objectui#7014 | "and must never reach authored object metadata (`0e3b3be09`)" | `0e3b3be09` "correct three false spec-alignment claims and pin the real boundary" (PR 7510 answers 200). `e1545cfe6` (PR 7994), the commit that wrote this sentence, says it carries PR 7510's attribution. The claim itself is stale; see Acceptance note 1 for why the citation is kept resting on the landing commit rather than dropped. | | `select.mdx` | "on both the editable and the read-only path (…)" | objectui#9230 | "on both the editable and the read-only path (`20b507aff`)" | `20b507aff` "render a picklist option value when its label is blank (objectui#9230)" (PR 9258 answers 200). | All ten shas are unique at 9 characters (`git rev-parse --short=9` returns 9 for each) and each is an ancestor of `origin/main` by construction (they were taken from `git log origin/main`). ## H4 the whole tree, not only the ten - `git grep` at `origin/main` over `content/**`, `docs/**`, `README.md` and `skills/**` for `github.com/objectstack-ai/objectui/(issues|pull)/N`: 191 distinct numbers across 14 files. REST on every one: 181 answer 200, 10 answer 404, and the ten are the card's ten. Nothing outside the three files. - Lychee, same config plus `--exclude '.*' --include` for objectui issue and PR URLs (offline-safe: it reaches github.com only), over `content/docs/**/*.md`, `content/docs/**/*.mdx`, `docs/**/*.md`, `docs/**/*.mdx`, `README.md` and `skills/**/*.md` at the head `08be3d7708`: `🔍 530 Total (in 14s) ✅ 188 OK 🚫 0 Errors 👻 342 Excluded`, exit 0. - Bare-number mentions of the same ten (`objectui#N` in prose, which lychee cannot see) elsewhere in the tree at `origin/main`: 204 sites outside the three files: 38 in `packages/*/src` non-test text (JSDoc and comments, some of which ship in `dist` per PR objectui#10707's `dist` reading), 20 in pending `.changeset/*.md` files (which publish verbatim into the CHANGELOG at the next release), 81 in test files, 28 in `scripts/`, 6 under `.github/`, 1 in governed agent text, 30 elsewhere. Not widened into this PR; listed under Acceptance notes for a card. ## Gates, all on the head `08be3d7708` - Lychee over the three files, repo config: `🔍 185 Total (in 17s) ✅ 182 OK 🚫 3 Errors`, exit 2 — the 3 are the container proxy artefacts named under H1 and zero are objectui links (the base run had 13 errors, 10 of them these links). Objectui-scoped (`--exclude '.*' --include` objectui issue/PR URLs): `🔍 185 Total (in 13s) ✅ 173 OK 🚫 0 Errors 👻 12 Excluded`, exit 0. - `pnpm docs:check-links` (`check-doc-links`): `Links are valid across 17 scan roots.`, exit 0. - `pnpm check:control-bytes`: `check-control-bytes: OK (scanned 8943 tracked text file(s); skipped 85 binary).`, exit 0. - `pnpm check:new-line-citations`: `VERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0`. - `node scripts/check-changeset-presence.mjs`: `3 file(s) changed, 0 of them published source of a package the release covers … No source or published contract of a released package changed in this range, so no changeset is owed.`, exit 0. - `pnpm check:doc-fences` exit 0; `pnpm check:doc-example-ids` exit 0 (`414 real reference(s) all resolve in the catalog registry`). - The test readers `node scripts/markdown-test-inputs.mjs --list` names for the classes `content/docs/**` and `content/docs/guide/ci-cd-pipeline.md` (26 files, including `ci-cd-pipeline-doc.test.ts` and `check-links-workflow.test.ts`), run as one `pnpm exec vitest run` from the repo root: `Test Files 26 passed (26)`, `Tests 1195 passed (1195)`. - Frontmatter lines 1 to 4, md5 before and after, identical: `ci-cd-pipeline.md` `6ca230b6b64dac22a2031d21ff311b13`, `lookup.mdx` `289a5c887fd231f6b0b0824f53769fad`, `select.mdx` `bae97ed7e436e0a06b8a154242ec15f1`. - NOT MEASURED: the `Check Links` workflow itself, which runs on `schedule` and `workflow_dispatch` only. Per the triage, re-run it via `workflow_dispatch` once this lands to show the weekly sweep green. ## Serial - At claim time (06:07Z) no open PR touched the three files. Before the final push, `origin/main` was fetched into the private ref `refs/issue-10755/main` = `f308a655b8`, two commits past the base (`f308a655b8`, `baac95a261`). `git diff --stat` between the base and that ref over the three files is empty, and `git merge-tree --write-tree HEAD refs/issue-10755/main` exits 0, so no merge commit is owed. ## Acceptance notes 1. **The `lookup.mdx` paragraph around the re-cited sentence is a stale contract claim (not widened; for a card).** It says the installed spec's `SelectOptionSchema` "is strict over exactly `{label, value, color, default, visibleWhen}` and refuses `description` by name", that authoring it "fails the whole field with a 422", and that the key "must never reach authored object metadata". Measured on the installed `@objectstack/spec` 17.4.0 (`@objectstack/spec/data`): `SelectOptionSchema.safeParse` of an option with `description` is ACCEPTED, `FieldSchema` with that option is ACCEPTED, and the refusal control `icon` is REFUSED with `unrecognized_keys`. Spec 17.3.0 declared the key under the maintainer's 2026-08-25 ruling on objectui#6140 / objectui#6153 (Option A); `544ecba84f` (PR 9588) already moved the shipped docblocks off the refusal, and `packages/types/src/__tests__/select-option-spec-extension-7014.test.ts` pins the moved boundary. The repair is a paragraph rewrite, outside this order's surface (citations only). The citation at that site is kept resting on the landing commit `0e3b3be09`, the commit that made the measurement the sentence still repeats, so a reader following it lands on when, and against which spec version, the claim was true; dropping the pointer would leave the stale sentence with nothing to date it by. 2. **Sibling class, one sweep card rather than ten:** the 204 bare-number mentions of the same ten numbers outside the three files (H4, last bullet). The shipping subset is the 38 `packages/*/src` non-test sites and the 20 pending changesets; objectui#7014 alone has 30 mentions, including three pending changesets named after it. This is the class objectui#10701 was filed for, and that card itself suggested one sweep card if more numbers in the range were gone. 3. **Neighbouring numbers that also answer 404** (objectui#5792, objectstack-ai#5794, objectstack-ai#7792, objectstack-ai#9231) are cited nowhere in the swept trees; observation only. 4. **Instrument versions:** local lychee is 0.18.1; `lycheeverse/lychee-action@v2` runs the current release. Same `lychee.toml`, same globs; the CI reading is the authoritative one, and the three residual errors above are container-specific. --- _Generated by [Claude Code](https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN)_ Co-authored-by: Claude <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #7786
Two suites spied on
Storage.prototypeand graded green without measuringwhat their names promised. They are two different defects, so they get two
different repairs — neither of them touches runtime source,
vitest.setup.base.ts(PR #7785's surface), or the i18n suite.
1.
apps/console/src/__tests__/bootSplash.test.ts— the injected fault never landedit('survives a browser with no localStorage access')installedvi.spyOn(Storage.prototype, 'getItem').mockImplementation(() => { throw … })and then asserted
runBootSplash()does not throw. The spy never reached thescript under test, for two reasons that are both live in this repo:
localStorageout through a proxy that has already boundgetItem, so a prototype patch installed after the store's method was firstreached is invisible to it;
vitest.setup.base.tsmay swap the store for a plain in-memory objectthat never inherited from
Storage.prototypeat all.So the case asserted that an ordinary boot does not throw, under a name
promising a blocked browser. Not repaired by bolting a probe onto the old
spy (that would go red for the wrong reason — instrument in the wrong place, not
a bug in
runBootSplash), and not by renaming the test down to what itactually did. Instead the fault is now injected where the script resolves it —
the same property-replacement shape
packages/i18n/src/__tests__/provider-locale-persistence.test.tsxalready uses against this exact hazard — plus two things it did not have:
expect(() => localStorage.getItem(…)).toThrow('storage blocked')before anything is graded on the absence of a throw;
darktheme choice, so the expectedlightoutcome is reachableonly when storage is genuinely unreadable (previously
lightwas alsowhat an empty store produced, so the assertion held either way).
The original property descriptor is restored in
finally, and the test assertsthe store is readable again afterwards.
2.
packages/plugin-list/src/__tests__/UserFilters.addTab.test.tsx— a negative assertion with no liveness checkThe load-bearing line is
expect(setItem).toHaveBeenCalledTimes(0)— anegative assertion, which a blind instrument satisfies for the wrong
reason. This is the counter-probe fix, shaped like the one in
anonSeedScope-5746.enumeration.test.tsx: before asserting anything aboutwrites it did not make, the test now asserts the spy observes writes it makes
itself — in both
sessionStorageandlocalStorage, since a store can behanded out already bound to its own method and the comment above the spy claims
to cover both. The probe's own writes are then
mockClear()ed, so theload-bearing assertion is left verbatim as the claim it always was.
Readings — every claim below was measured, on Node v22.22.2 (the version CI pins)
Measured on the tree committed as
ddfecb545, in a dedicated worktree cut fromorigin/main6771c805a. The suites ran on the working tree that was then committed unchanged as that sha; both lit controls ran with it asHEAD.Suites green (actual counts, not "green")
pnpm exec vitest run --maxWorkers=2 apps/console/pnpm exec vitest run --maxWorkers=2 packages/plugin-list/The two repaired files carry 15 tests (
bootSplash.test.ts) and 12(
UserFilters.addTab.test.tsx) of those totals.⭐ Lit control E1 — item 1's probe shouts when the fault is injected the old way
The mutation puts the pre-repair injection point back (
vi.spyOn(Storage.prototype, 'getItem').mockImplementation(blocked)) and leaves the new counter-probe in place.That failure is the card's premise, reproduced independently here: on Node 22.22.2 the
prototype spy does not reach the store. Restoration, under
trap … EXIT INT TERM, withgit checkout HEAD -- ABSOLUTE_PATH:⭐ Lit control E2 — item 2's probe shouts when the spy is blind
The mutation points the spy at a target the test never reads
(
vi.spyOn({ setItem: () => {} }, 'setItem')) — blind in exactly the way the card describes.Both mutations were confirmed on disk by blob hash before their run — a mutation that
never lands yields a green reading that means nothing.
Item 1's positive reading — the condition is now genuinely simulated
The same assertion that goes red under E1 (
expect(() => localStorage.getItem(THEME_STORAGE_KEY)) .toThrow('storage blocked'), inside that very test) passes on the repaired tree — it is part ofthe 981 green console tests above. So a direct
localStorage.getItem(...)in that test now reallydoes throw,
runBootSplash()is then measured against a store it genuinely cannot read, and itsurvives it:
data-boot-themecomes outlightfrom the OS preference even thoughdarkissitting in the store.
Gates and type-check
type-checkin this repodependsOn: ["^build"], so a bare per-packagetsc --noEmitin a fresh worktree is not the gate — it reports an unresolved-module cascade
(384 / 64 / 197 errors, overwhelmingly
TS2307/TS2882, none of them naming a linethis PR wrote). Measured properly, through turbo, so the dependency closure is built
first:
Both
type-checktasks executed (cache miss, not replayed):@object-ui/plugin-list:type-check(
tsc --noEmit && tsc -p tsconfig.test.json) and@object-ui/console:type-check(
tsc --noEmit && tsc -b tsconfig.node.json --force). Zeroerror TSlines in the whole run.Lint — a declared narrowing, not a skipped run
The repo-wide
pnpm lint(eslint . --no-inline-config) is CI's run. Locally this wasnarrowed to the two changed files, and the narrowing is measurable rather than assumed:
results, so neither is ignored;
--format json: 2 files linted, 0 errors, 0 warnings, exit0;eslint.config.jsconfigures no type-aware program (noproject/projectService),so this diff cannot move the verdict on any file it does not touch.
The i18n file — re-checked, and it is indeed a false positive
packages/i18n/src/__tests__/provider-locale-persistence.test.tsxwas not touched. Its onlyStorage.prototypeoccurrence is the comment on line 155 saying it deliberately does not spy onthe prototype — the grep matched that sentence, not an instrument:
It already replaces the property and restores it in
finally, which is the shape item 1 has nowbeen repaired into. Confirmed false positive.
Not touched
vitest.setup.base.tsandpackages/app-shell/src/console/__tests__/anonSeedScope-5746.enumeration.test.tsxare PR #7785's surface and are untouched here; no runtime source of
runBootSplash()orUserFiltersis touched. The whole diff is two__tests__/files plus one changeset.🤖 Generated with Claude Code
https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
Generated by Claude Code