Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

test(plugin-timeline): return the array the readiness predicate accepted - #7826

Merged
os-sam merged 1 commit into
mainfrom
claude/issue-7466-colorfield-ladder-settlement
Sep 6, 2026
Merged

os-sam merged 1 commit into
mainfrom
claude/issue-7466-colorfield-ladder-settlement

Conversation

@claude

@claude claude Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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.

⚠️ main is 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.

pnpm exec vitest run packages/plugin-timeline/src/ObjectTimeline.colorFieldLadder-7243.test.tsx
tree runs failures
main, unperturbed, N=32 at concurrency 4 32 0
pre-#7527 harness, same loop 32 0

The second row is the point. The loop returns 0/32 on the tree that is known to carry the defect, so 0/32 on main measures 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 lastItems gave the reason: one write per colorsFor call. The late second write that the whole failure depends on never happens in this container.

ObjectTimeline's data effect lists objectDef in its deps, and a separate getObjectSchema() sets objectDef. 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 holding getObjectSchema by 25ms in the fixture splits them and makes the second paint appear.

Under that lever, everything becomes deterministic and discriminating:

tree perturbation runs failures
pre-#7527 harness getObjectSchema +25ms 3 3
this file, as on main getObjectSchema +25ms 6 0
main minus unmount() + DOM guard (token predicate alone) getObjectSchema +25ms 8 3
... plus this PR's bound capture getObjectSchema +25ms 16 0

Row 1 is the card's exact signature, at the second await of rung 2:

FAIL packages/plugin-timeline/src/ObjectTimeline.colorFieldLadder-7243.test.tsx:123
  > rung 2: 3- and 6-digit hex literals pass through
AssertionError: expected [ '#abc' ] to deeply equal [ '#123456' ]
- Expected
+ Received
  [
-   "#123456",
+   "#abc",
  ]

⇒ Shape 2 confirmed. Shape 1 was never in play — every run above uses the shared ladder unmodified, and createFieldColorResolver is a pure function of value. packages/core/src/utils/record-color.ts is 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.

colorsFor validated lastItems inside the waitFor predicate 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's act yields to the macrotask queue on its way out of waitFor — a real window in which a still-live writer can answer it. Today that never bites, because unmount() has removed every other writer. But that makes the author-identifying predicate depend on a different guard to be sound: strip unmount() and the predicate alone fails 3/8.

Binding the capture makes the value asserted and the value validated the same object by construction:

let settled: typeof lastItems = [];
await waitFor(() => {
  const items = lastItems;
  expect(items.map((i) => i.title)).toEqual(stampedRows.map((r) => r.subject));
  settled = items;
});
return settled.map((i) => i.color);

Same tree, 3/8 to 0/16.

⛔ No cheap exit is used. No retry, no sleep, no widened timeout, no quarantine, and the two consecutive awaits in rung 2 — the only call sequence that exposes this — are untouched. The it blocks 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 anchored grep counts, and restored under trap … EXIT INT TERM with restoration proved by state (git hash-object == the HEAD blob, git diff HEAD empty), never by an exit code.

leg mutation runs failures
A perturbation + strip unmount()/DOM guard + revert this PR's capture 8 2
B perturbation + strip unmount()/DOM guard, capture intact 16 0

Header 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 tree

Exit codes captured by redirecting first, never through a pipe; each gate quoted from its own verdict line.

check-changeset-presence     EXIT=0  ✅  1 source file(s) of 1 released package(s) changed, and this change
                                         declares 1 changeset(s): .changeset/7466-timeline-colorfieldladder-settlement.md.
                                         Every one of them has an EMPTY frontmatter — declared as releasing
                                         nothing, which is the explicit exemption and a complete answer to this gate.
check-changeset-no-major     EXIT=0  ✅  No changeset declares a `major` bump.
check-changeset-fixed        EXIT=0  ✅  All workspace packages are in the changeset fixed group.
check-changeset-overwrite    EXIT=0  ✅  No pre-existing changeset was modified or deleted.
check-control-bytes          EXIT=0  ✅  check-control-bytes: OK (scanned 6361 tracked text file(s); skipped 85 binary).
check-vi-mock-inherit        EXIT=0  ✅  check-vi-mock-inherit: OK (4315 tracked source file(s), 2596 test-named …)
check-vi-mock-specifiers     EXIT=0  ✅  check-vi-mock-specifiers: OK (4315 tracked source file(s), 2596 test-named …)
check-type-check-coverage    EXIT=0  ✅  test type-check coverage: 41/41 packages compile their tests …
check-lint-coverage          EXIT=0  ✅  lint coverage: 46/46 packages linted, 0 with outstanding errors (0 total).
vitest (the changed file)    EXIT=0      Test Files 1 passed (1) · Tests 7 passed (7)
pnpm --filter … test         EXIT=0      Test Files 22 passed (22) · Tests 287 passed (287)
pnpm --filter … type-check   EXIT=0      tsc --noEmit && tsc -p tsconfig.test.json
pnpm --filter … lint         EXIT=0      27 files, 0 errors, 103 warnings (unchanged: 6 on the edited file before and after)

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 --listFiles lists it (1 hit), so EXIT=0 is a measurement and not a **/*.test.ts exclusion.

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 . inside packages/plugin-timeline reports 27 files; ② the count is read from --format json; ③ this diff cannot move any untouched file's verdict, because eslint.config.js sets no parserOptions.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


Generated by Claude Code

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
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3187.4 KB 3191.4 KB
Main entry chunk (gzip) 143.2 KB 350 KB
Entry file index-DRjAR2je.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.67KB 5.75KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 510.60KB 116.20KB
core (index.js) 6.96KB 2.79KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 182.08KB 50.62KB
fields (index.js) 242.44KB 61.25KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.98KB 10.98KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 47.87KB 13.31KB
plugin-charts (index.js) 70.92KB 19.75KB
plugin-chatbot (index.js) 196.19KB 46.37KB
plugin-dashboard (index.js) 132.88KB 34.69KB
plugin-designer (index.js) 212.86KB 43.19KB
plugin-detail (index.js) 250.55KB 64.06KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.87KB 32.66KB
plugin-gantt (index.js) 167.26KB 41.00KB
plugin-grid (index.js) 209.29KB 56.78KB
plugin-kanban (index.js) 52.71KB 14.55KB
plugin-list (index.js) 113.28KB 27.59KB
plugin-map (index.js) 20.44KB 6.78KB
plugin-markdown (index.js) 13.93KB 4.81KB
plugin-report (index.js) 43.59KB 11.97KB
plugin-timeline (index.js) 30.84KB 8.85KB
plugin-tree (index.js) 9.20KB 3.19KB
plugin-view (index.js) 85.24KB 20.94KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Merged via the queue into main with commit cf7f2af Sep 6, 2026
34 checks passed
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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

1 participant