This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
test(plugin-timeline): return the array the readiness predicate accepted - #7826
Merged
Merged
Conversation
The card asks which of two shapes produced `expected [ '#abc' ] to deeply equal [ '#123456' ]`. Measured, not inherited: shape 1 (a coarse cache key) never existed — `createFieldColorResolver` is a pure function of `value` — and shape 2 (async settlement) reproduces on demand once the right lever is pulled. The lever is the METADATA fetch, not machine load. `ObjectTimeline`'s data effect lists `objectDef` in its deps and a separate `getObjectSchema()` sets it, so a mount paints once when the two settle together and twice when they do not. This container settles them together — traced, one write to `lastItems` per call — which is why looping the file reproduces nothing: 0/32 on this file AND 0/32 on the pre-#7521 harness, an instrument with no demonstrated power. Holding `getObjectSchema` by 25ms splits them, and the pre-#7521 harness then fails 3/3 with the card's exact signature. Under that same lever this file is already green (0/6): the guards #7521 landed close the mechanism, and nothing here is a live defect. What the measurement also shows is that the closure rests on one leg. Removing `unmount()` and the DOM guard — leaving the author-identifying token predicate alone — fails 3/8, because `colorsFor` validates `lastItems` inside the predicate and then reads the module global a SECOND time on the next line, across the macrotask yield React's `act` performs on its way out of `waitFor`. A still-live writer can answer that second read. Binding the capture inside the predicate makes the value asserted and the value validated the same object by construction: same tree, 3/8 -> 0/16. No cheap exit is used — no retry, no sleep, no widened timeout, no split `it`, and the two consecutive awaits that expose the sequence stay exactly as they are. The header records the numbers so a future cleanup cannot delete a guard on the strength of a green run: on an idle machine every variant is green. 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 9, 2026
…me their own writer (objectui#7828) (objectstack-ai#7892) The gantt and calendar `colorField` ladder fixtures were still in the pre-objectui#7521 harness shape that produced objectui#7466's intermittent red: a module-level mutable the mock writes, an arity-only readiness predicate (`expect(lastTasks.length).toBe(rows.length)`), no unmount, and a return value re-read from the global after the predicate accepted a different one. objectui#7527 (`c2fc261f5`) hardened the timeline fixture and touched that package only; PR objectstack-ai#7826 added the bound capture there. This ports both to the two siblings. Four changes, none of them about the ladder itself: 1. the readiness predicate identifies WHICH render wrote — a title token the call owns, riding through `titleField` — instead of counting arity, which cannot separate "the component I mounted has painted" from "an earlier one painted again"; 2. the value returned is the array that predicate accepted, not a second read of the module global taken after `act` has yielded; 3. every render is torn down in a `finally`; 4. no renderer may be alive when one is mounted. In the gantt file the two `it` blocks that mounted inline now go through the same helper, because guard 4 is only worth anything if every render in the file is accounted for. Measured rather than assumed, because a green loop is not evidence here -- objectui#7466 paid for that reading, where the broken timeline harness passed 32/32 on an idle box, the same 32/32 the fixed one gets. The lever is the metadata fetch, so the lever was swept: the pre-port harness shape driving two renders inside one `it`, with `getObjectSchema` held by 0/1/2/3/4/5/6/7/8/9/10/12/15/20/25/35/50 ms, three runs per hold, all three components in the same vitest runs. ObjectTimeline (ungated control) 20 fail / 60 runs ObjectCalendar 0 fail / 60 runs ObjectGantt 0 fail / 60 runs Every timeline failure sits at a hold of 1-9ms, with the card's exact signature. The two zeroes are readable only because that control fired in the same runs. So neither sibling reproduces the failure, and this does not claim the timeline's two-paint behaviour for them: both GATE their record query on the settled object schema (objectui#6453 / objectui#7225), so their first paint arrives after the metadata read -- the measured paint time tracks the hold -- and no schema-triggered second paint follows. What is ported is the harness half, which does not depend on that: a module global plus an arity-only predicate cannot say which component wrote, whatever the component does. Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3 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 #7466
Verdict first
The failure is shape 2 (async settlement), it reproduces on demand, and it is already closed on
main— not by anything in this PR, but by objectui#7527, which landed ~10 hours after #7466 was filed. This PR claims no fix for the reported red. What it lands is the one thing the measurement showed was still resting on a single leg.mainis not a live defect. Do not read this PR as "the flake is fixed"; read it as "the flake was already fixed, here is the proof it is, and here is the leg that was load-bearing without a guard of its own."The mandated loop reading, and why the first one was worthless
The card's own standard: run the file repeatedly, report failures/total.
main, unperturbed, N=32 at concurrency 4The second row is the point. The loop returns 0/32 on the tree that is known to carry the defect, so 0/32 on
mainmeasures nothing at all. Reporting the first row alone would have been the exact error the card warns about — treating a green run as evidence. Not reproduced by repetition.Establishing the mechanism
Instrumenting the pre-#7527 file to log every write to
lastItemsgave the reason: one write percolorsForcall. The late second write that the whole failure depends on never happens in this container.ObjectTimeline's data effect listsobjectDefin its deps, and a separategetObjectSchema()setsobjectDef. A mount therefore paints once if the two settle together and twice if they do not. This container settles them together; a loaded CI runner does not. So the lever is the metadata fetch, not machine load — and holdinggetObjectSchemaby 25ms in the fixture splits them and makes the second paint appear.Under that lever, everything becomes deterministic and discriminating:
getObjectSchema+25msmaingetObjectSchema+25msmainminusunmount()+ DOM guard (token predicate alone)getObjectSchema+25msgetObjectSchema+25msRow 1 is the card's exact signature, at the second await of rung 2:
⇒ Shape 2 confirmed. Shape 1 was never in play — every run above uses the shared ladder unmodified, and
createFieldColorResolveris a pure function ofvalue.packages/core/src/utils/record-color.tsis untouched by this PR and no cache key was looked for or changed.What this PR actually changes, and why row 3 justifies it
Rows 3 and 4 are the same tree; the only difference is this diff.
colorsForvalidatedlastItemsinside thewaitForpredicate and then read the module-level global a second time on the next line. Those are two questions, and the second is asked after React'sactyields to the macrotask queue on its way out ofwaitFor— a real window in which a still-live writer can answer it. Today that never bites, becauseunmount()has removed every other writer. But that makes the author-identifying predicate depend on a different guard to be sound: stripunmount()and the predicate alone fails 3/8.Binding the capture makes the value asserted and the value validated the same object by construction:
Same tree, 3/8 to 0/16.
⛔ No cheap exit is used. No
retry, nosleep, no widened timeout, no quarantine, and the two consecutive awaits in rung 2 — the only call sequence that exposes this — are untouched. Theitblocks are not split.Ablation, anchored at this branch's commit
Run against
4f43a11fc(implementation committed first, so the restore leg points at a HEAD that contains it). Each leg proved its mutation landed on disk by blob hash plus anchoredgrepcounts, and restored undertrap … EXIT INT TERMwith restoration proved by state (git hash-object== the HEAD blob,git diff HEADempty), never by an exit code.unmount()/DOM guard + revert this PR's captureunmount()/DOM guard, capture intactHeader record
The numbers are written into the file's header on purpose. On an idle machine every variant above is green, so the next cleanup that reaches for one of these guards will find a passing run and no reason to keep it. The header gives it the lever and the failure rates instead.
Verification — union re-run at
4f43a11fc, clean treeExit codes captured by redirecting first, never through a pipe; each gate quoted from its own verdict line.
The changeset gate's BEFORE reading, for the record:
EXIT=1,❌ 1 source file(s) of 1 released package(s) changed, and this change adds no changeset. The empty-frontmatter form is what the gate itself names as the pass for a test-only diff.Typecheck really covered the edited file —
tsc -p tsconfig.test.json --listFileslists it (1 hit), soEXIT=0is a measurement and not a**/*.test.tsexclusion.Lint scope, declared
The repo-wide
eslint .is CI's run. What is reported here is a proved narrowing, all three legs: ① the universe comes from eslint's own config resolution, not a guess —eslint .insidepackages/plugin-timelinereports 27 files; ② the count is read from--format json; ③ this diff cannot move any untouched file's verdict, becauseeslint.config.jssets noparserOptions.project/projectService, so linting is not type-aware and every file's result is a function of its own bytes plus a config this PR does not touch.Provenance
c2fc261f5), for objectui#7521. bug(plugin-timeline): colorFieldLadder-7243 的 rung 2/3 在同一个it里 render 两次而不 unmount,共享模块级lastItems—— 负载高时第二个断言收到第一个的值,已踢掉合并队列 #7521 is not addressed here and is not reopened by this diff.e75f4c986), for plugin-gantt:colorFieldis passed raw intobackgroundColor, so pointing it at a select field un-colours every bar — while OMITTING the key colours them correctly (moved from objectstack-ai/objectstack#14110) #7243. Neither is affected.Generated by Claude Code