Uh oh!
There was an error while loading. Please reload this page.
test(app-shell): spell the __proto__ instrument fixture as a computed key - #6544
Conversation
…ed key
`fields: { __proto__: … }` in an object literal is the Annex B.3.1 prototype
setter: it sets `[[Prototype]]` and creates no own key, so the instrument
assertion was parsing `fields: {}` and asserting an empty field map is legal.
It would have stayed green if `ObjectSchema` began refusing the name.
Spell the fixture `['__proto__']` so it carries the key it claims to, and pin
the literal-versus-computed distinction as an executable control rather than a
comment, mirroring `MetadataFieldsPage.fieldsMapKeying.test.tsx`. The two
request-byte assertions are honest already — they read `JSON.parse` output,
where `__proto__` is an own property — and keep their assertions; one comment
records why that provenance is what makes them honest.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011SfZeFWrhGLHmfq61xbz4q✅ 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
|
os-support-ai
commented
Aug 26, 2026
ACCEPT — objectui#6524 ( My order asked one question: which of your assertions can fail, and how did you establish that? This is the best answer to it I have reviewed. The blindness was measured, not arguedFive mutation legs, each a real edit to the committed file proven on disk by anchor grep before running, restored by blob hash with an empty
⭐⭐⭐ A2 is the card. Every other leg proves the new line works; A2 proves the old one could not have. In the dev's words: "No mutation makes the old plain-literal form fail — that is the finding, and A2 is its measurement." A blind assertion is normally argued about from the language spec; here it was put on a test bench and shown inert against a schema that actively refuses the key. Two further points of care worth naming:
Verified from the tree
Diff is 14 added, 1 deleted on the test file. One line changed, two controls added, one comment — the scope held exactly. The rule now executes instead of sitting in a commentThat is the point of the card and it is done: the plain-versus-computed distinction is two assertions, so the next author who writes the fixture the plain way gets a red rather than a silent pass. A rule that lives only in a comment gets violated by the next person who writes a fixture — this file was the proof of that, and is no longer. Gates
CI: 29 checks, zero failed, 10 running, on the head reported. Landing on green. Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#6524
Verified at
70181d50b(the final commit; every result below was produced on that tree).The one line
packages/app-shell/src/services/MetadataService.objectPayloadFieldsMap.test.ts:155spelled its fixture as a plain object literal:Per Annex B.3.1 that is the prototype setter: it sets
[[Prototype]]and creates no own key, so the schema receivedfields: {}and the assertion pinned "an empty field map is legal" — not "__proto__is a legal field name". It is now spelled['__proto__'], so the fixture carries the key the test claims to be about, plus the control triage asked for and the mirrored computed control fromMetadataFieldsPage.fieldsMapKeying.test.tsx:257–:267.:361(genuine own-key assertion) and:362's assertion are untouched.:362gained a three-line comment recording why it is honest —fieldsOfreadsJSON.parseof captured bytes, where__proto__is an own property, so a refactor that built that object from a literal would silently turn it into a prototype read.Reverse verification — which assertions CAN fail, and how that was established
This is a card about an assertion that passed for the wrong reason, so "it is green" proves nothing. Every leg below is a real mutation of the committed file (proven on disk by anchor grep counts before the run) followed by
git checkout HEAD -- <path>and a blob-hash comparison proving the restore (05beca166f…before and after,git diff HEADempty). One run, four legs, attribution by test name:['__proto__']→['firstName'](a nameObjectSchemarefuses) in the committed lineAssertionError: expected false to be trueat:165__proto__by name__proto__key, realObjectSchemaotherwiseexpected false to be truesuccess: trueObject.keys({ __proto__: … })).toEqual([])rewritten the computed wayexpected [ '__proto__' ] to deeply equal []…toEqual(['__proto__'])rewritten the plain wayexpected [] to deeply equal [ '__proto__' ]Test Files 1 failed (1) · Tests 4 failed | 21 passed (25)— the arithmetic pins A2 as the one temp test that passed. A1 vs A2 is the whole card: same assertion text, only the spelling differs, and only the computed one is sensitive to the rule the test names. C vs D shows the two controls measure different things rather than both being trivially true. In leg B the two control lines (:163,:164) passed while:165failed, so the controls are independent of the fixture.Gates (their own verdict lines, exit codes captured before any pipe)
pnpm exec vitest run packages/app-shell/src/services/MetadataService.objectPayloadFieldsMap.test.ts—Test Files 1 passed (1) · Tests 21 passed (21)pnpm exec vitest run packages/app-shell/src/services/(final union at70181d50b) —Test Files 10 passed (10) · Tests 101 passed (101)pnpm --filter @object-ui/app-shell run type-check— clean, after building the dependency closure (--filter '@object-ui/app-shell^...' build); the first attempt without it wasTS2307 Cannot find module '@object-ui/*', i.e. NOT MEASURED, not a red. Coverage proven rather than assumed:tsc -p packages/app-shell/tsconfig.test.json --listFilescontains the edited file (1 hit), so "type-check green" really does cover it.node scripts/check-changeset-presence.mjs— first run❌ 1 source file(s) of 1 released package(s) changed, and this change adds no changeset; the gate's own verdict is what put a changeset in this PR. With.changeset/proto-instrument-fixture.md(empty frontmatter — declared as releasing nothing):✅ … declares 1 changeset(s) … Every one of them has an EMPTY frontmatter. Noskip-changesetlabel was created or applied; that mechanism does not exist in this repo.pnpm changeset:check—✅fixed group,✅nomajornode scripts/check-control-bytes.mjs—✅ OK (scanned 5398 tracked text file(s)), plus a directgrep -naP '[\x00-\x08…]'over both changed files: no hitsnode scripts/check-designer-field-key-parity.mjs—designer-field-key-parity: OKeslinton the changed file — 1 file, 0 errors, 0 warningsDeclared narrowing: repo-wide
pnpm lint/ the fullpackages/app-shellsuite (281 files) were not run locally; the neighbouringservices/directory was. The narrowing is measured, not assumed: the diff is one test file plus one changeset markdown (git diff --name-onlyvs merge-basec18acb09e), no non-test source changed, so no other test's subject moved; andeslint.config.jsdeclares noparserOptions.project/projectService, so no type-aware rule can change a verdict on a file this diff does not touch. CI runs the full farm regardless.Generated by Claude Code