…objectui#10106) (objectstack-ai#10149)
Fixes objectstack-ai#10106
Clause-②: no — a provider's republish identity. No exported symbol and
no key on a published payload moves. Re-declared from the actual diff:
the diff adds a module-private `isEqualPayload` and a `settle` closure
inside `useSettledSchema`'s effect; the hook's exported signature, its
`SettledSchema` interface and every key on the value it publishes are
byte-unchanged.
## The re-take — it REPRODUCES
The card was wholly second-hand (filed from objectui#10036's hand-back,
re-run by nobody), so the first deliverable was the measurement, not a
diff. Taken first-hand on the REAL consumer, `ObjectGantt`, with an
instrumented adapter, swapping the adapter on provider `object`, three
cases in ONE command so that "two" is a discrimination and not a
counting artefact of the harness:
| swap | `find` on the new adapter | expand sets |
|---|---|---|
| byte-identical answer, as a FRESH object (SUBJECT) | **2** |
`[['owner'], ['owner']]` |
| the SAME def object from both adapters (CONTROL) | **1** |
`[['owner']]` |
| a genuinely DIFFERENT def (CONTROL) | **2** | `[['owner'],
['owner','account']]` |
The middle row is what makes the top row a finding: the same harness
counts ONE the moment the producer keeps the payload's identity, so the
extra query is the republish and nothing else. The bottom row is where
two queries are WARRANTED — the second carries an expand set the first
could not have — which is why the repair may never be "fetch less".
After the repair, re-measured in the same harness: SUBJECT **2 → 1**
(`[['owner']]`), and both controls unchanged (**1** and **2**, the
latter still widening to `['owner','account']`).
`getObjectSchema` was called exactly once on the new adapter in every
case, before and after: this is not "the refetch was skipped".
## What was repaired, and where
`AGENTS.md` §5 commandment objectstack-ai#10 closes with two halves:
> a provider that refetches may not republish an equal payload as a new
object, and a consumer that needs stability keys on the data, not on a
cache
The consumers are already on the right side of the second half —
`ObjectGantt`, `ObjectCalendar`, `ObjectView`, `ObjectTimeline` and
`ObjectGallery` each key their record fetch on `def`, the payload, not
on a memo identity. The breach was the first half, at the producer:
`useSettledSchema` re-read `getObjectSchema` on an adapter change and
settled a fresh `def` object for a byte-identical answer, re-firing
every one of those fetches.
The fix is at that producer and nowhere else: a settle whose answer is
value-equal to the one already published keeps the object consumers
hold. Nothing moved into a consumer's dependency list, and no cache was
introduced — commandment objectstack-ai#10 names both as the wrong cure in the same
sentence.
Why `ready` does not save anyone here, since it is easy to misread:
`ready` is `resolution.key === key`, and an adapter swap does not move
the key. `ready` stays TRUE right through the swap, so a consumer's gate
holds nothing back — the first query goes out at once on the definition
already in hand, and the republish adds the second. That is now pinned
too.
## Evidence
**RED-before** — the pin run against the hook byte-identical to
`origin/main`, with the file state proved in the SAME command (`git
hash-object` on the hook equal to its `HEAD` blob, both printed as
`bb550f98d`): `2 failed | 3 passed`. The two subject assertions failed;
all three controls passed.
**GREEN-after** — same pin with the repair on disk (blob `f287de8b6`,
printed in the same command): `5 passed`.
**Ablation from the committed state** — the `settle` bail-out replaced
by the pre-repair unconditional republish. The mutation was proved by
content and by hash, never by an exit code: injected marker count `1`,
removed-guard count `0`, blob `f287de8b6 → ae320ff3b`. The pin went `2
failed | 3 passed` — the same two, with all three controls still green.
Restore proved the same way: blob back to `f287de8b6`, `git diff HEAD`
empty.
**Suites** — `packages/react` in full plus every `useSettledSchema`
consumer pin (`ObjectGantt` fetch gate, `ObjectCalendar`, `ObjectKanban`
x2, `ObjectGallery`, `ObjectTimeline`, `ObjectTree`, `ObjectView`) and
the two doc-example reader gate suites: **115 files / 1353 tests
passed**, at `fe23217e9` with a clean tree (printed in the same
command).
**Type-check** — `@object-ui/react`: `tsc --noEmit` and `tsc -p
tsconfig.test.json`, both clean. The test project SELECTS the new pin
(`--listFiles` finds it).
**Gates, re-run last, at `fe23217e9` with nothing unstaged** —
`check:control-bytes`, `check:new-line-citations`, `check:doc-examples`,
`check:doc-example-ids`, `check:doc-example-readers`,
`check:doc-snippets`, `check:doc-types`, `check:readme-exports`,
`check:test-path-roots`, `check:vi-mock-specifiers`,
`check:unreferenced-sources`, `check:pending-changeset-literals`,
`check-changeset-presence`, `check-changeset-fixed`,
`check-changeset-no-major`, and `eslint` on both changed files: all exit
0.
⚠️ `check:doc-examples` and `check:readme-exports` first answered
PRECONDITION NOT MET / population COLLAPSED (no `dist` on disk —
`readme-exports` reported `typesResolved: 0` against a floor of 2).
Those runs are recorded as not-a-verdict, not as passes. Both were then
re-run properly after `turbo run build` over the filter the gate itself
prints, and the green above is from those runs, with a healthy
population (`readme-exports`: 3384 export symbols from 36 of 40
packages, 58 keys compared).
**Changeset** — decided by running the gate, not from memory:
`check-changeset-presence` exited 1 and named `@object-ui/react`; a
`patch` changeset was added and it now exits 0.
## Acceptance notes
Noted while in the file, ⛔ not filed and ⛔ not fixed here:
- `useSettledSchema.test.ts`'s case "re-fetches when dataSource identity
changes even if the key does not" carries a comment stating "Ready flips
false the instant the source changes, same mechanism as a key change".
That is not what the code does: `ready` is `resolution.key === key` and
an adapter swap leaves the key alone, so `ready` stays true — which is
exactly the mechanism this card rests on. The assertions in that case
are correct and still pass; only the sentence is wrong. Left alone
because it is a different class from this card's defect, and correcting
someone else's prose is not this card's business; the correct statement
is now written and pinned in the new file next to it.
## Not in scope, deliberately
- The count is pinned at the hook's own boundary, through the consumer
recipe the hook's `@example` publishes, because this card's file surface
is `useSettledSchema.ts` and its tests. The `ObjectGantt` reading above
was taken with a throwaway probe, reported here and removed — it is not
part of the diff.
- PR objectstack-ai#10100 (objectui#10036) neither caused nor fixes this; it is still
open and touches `packages/plugin-gantt` only, so there is no overlap
with this branch.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq
---
_Generated by [Claude
Code](https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq)_
Co-authored-by: Claude <noreply@anthropic.com>
Fixes #10036
Clause-②: no — an internal hook dependency array. It moves no exported symbol and no key on a published payload.
The ninth and tenth instances of the class ruled on objectui#8640 (
AGENTS.md§5 commandment #10), both sitting on one seam inpackages/plugin-gantt/src/ObjectGantt.tsx. ⛔ The direction is not re-argued here; the commandment already decided it.Premise, re-taken on
origin/mainbefore any editAll three legs held, the card's own control included:
reload's dependency array listedeffectiveDataSource, andeffectiveDataSourceis auseMemoresult.reload, auseCallbackresult.dataItemswas removed from that same array because a discard «was enough to givereloada fresh identity and re-fire the mount effect below (objectui#6592)». One banned identity came off that line and another was left on it — finding the removal and the survivor in the same read is what says the instrument was reading rather than guessing.Why this is not theoretical on this component
resolveDataSource(@object-ui/core) answersprovider: 'object'with the context adapter unchanged, but constructs a newApiDataSourcefor'api'and a newValueDataSourcefor'value'. So on those two providers a discarded memo hands back a fresh adapter for a byte-identical authored config, rebuildsreload, and re-fires the mount effect — one redundant round trip, per discard, on a view nobody touched.ObjectGantt.discardedConfigMemo.test.tsxalready named exactly this gap in its own docblock as a "Known boundary" for theapi/valueproviders. This PR measures it.useCallbackyields a fresh function whatever its own dependency list says — an empty list included — so the mount effect would still have re-fired. Both sides of the seam, or neither holds.The repair
effectiveDataSourceRef—reloadreads the adapter through a ref refreshed on every render, so it is always the adapter the current render resolved, and never a reason to rebuild the callback.adapterInputsKey—reloadand the fetch effect key on whatresolveDataSourceactually reads out of the authored config, per provider arm (read+writeforapi,itemsforvalue, nothing but the fallback otherwise), alongside the host'sdataSourceandapiFetch. Those three are that memo's own dependency list, with the memoiseddataConfigreplaced by the values it is derived from.reloadRef— the fetch effect calls through a ref and repeats the same value list instead of namingreload.⛔ No lint rule was silenced and no
eslint-disablewas added. The one disable onreload's array is pre-existing and still says what it said ((rest as any).dataintentionally untracked).pnpm exec eslinton both changed files exits 0 with no errors; the count of react-hooks findings inObjectGantt.tsxwent down by one against the pre-fix file, measured by linting the pre-fix content beside it in one--format jsonrun. Two newreact-hooks/refswarnings appear for the two render-phase ref writes — the rule this repo deliberately downgraded towarn, and the same idiomapp-shell'sAdapterProviderandMetadataProvideralready use for auseMemoresult.⛔ Why the key is the per-arm slice and not the whole config
The first attempt keyed on the whole config's deep value, and the objectui#6592 pin caught it: that pin moves an inert field inside
schema.datawhich "is read by nothing under test", and the fetch must not re-fire. The whole-config key made that authored-but-inert byte a refetch trigger on theobjectprovider — where the adapter is the context DataSource and the config contributes nothing to it at all. That is a widening, so it was withdrawn. The note abovedataItemssays such an input "cannot be flattened to a fixed primitive list"; true of a fixed list, and the reason it gives is right — theapiarm's input is a whole request config. A per-arm value is expressible, and it is the one that neither widens nor narrows.The forced-discard pin: achievable, and it discriminates
Yes.
packages/plugin-gantt/src/ObjectGantt.discardedReloadIdentity-10036.test.tsxfollowspackages/permissions/src/__tests__/providerCtxIdentity.discarded.test.tsx: it patchesuseMemoanduseCallbackat the module level throughvi.mock('react', …)— the only patch the component's ownimportbindings see — and fires a discard on demand by bumping an epoch appended to every armed dependency list. It arms every memo and callback in the tree rather than matching a marker, because a marker oneffectiveDataSourcealone would leavereload's ownuseCallbackun-discarded, which is the half leg 2 names.The observable is a request count, not an identity compare: requests are served by a double passed as
apiFetch, so nothing reaches happy-dom's origin and is attributed to this file by the network-escape guard. The proxy carries its own self-check (provesTheProxyDiscriminates), and an "armed but not fired" re-render inside the pin proves a green cannot come from the proxy having broken caching outright.RED before, GREEN after — file state proved in the same command as each run
The ablation restores the pre-fix
ObjectGantt.tsxfrom the branch point while the pin file stays byte-identical, proves the swap by object hash, runs, restores fromHEAD, proves the restore by hash and by an emptygit status --porcelain, and runs again. ⛔ No leg concludes anything from an exit code.Two readings the numbers carry beyond "it went red":
What the non-regression pins hold
A changed
apiendpoint, a changed authoredfilter, a swappedapiFetch, and a swapped context adapter each still refetch, and the new double is the one that runs in the last two.resource,dataProviderandhasInlineDataare derived from the authored config the first pins move;objectSchemaandpermsare unchanged members of the same list.Gates, re-run as the last action before the push
At commit
19d1eebf1, tree equal to the pushed commit,git status --porcelainempty, each run printing that state in the same command. All files tracked at the time of the run, so the populations include this change rather than collapsing around it — the scanned counts moved with it (8120 text files, 5188 source files, 3341 test files).check-changeset-presencecheck-changeset-no-major/-fixed/-overwrite/-claimscheck-control-bytescheck-new-cross-file-line-citationscheck-vi-mock-specifiers/-inherit/-override-shapecheck-test-path-rootscheck-unreferenced-sourcescheck-governed-queue-guard --testeslinton both changed filestype-check(tsc --noEmit+tsc -p tsconfig.test.json)vitest run packages/plugin-gantt/The changeset is a real
patchon@object-ui/plugin-gantt, decided by running the gate, not from memory: the gate namessrc/files of a released package, and a removed redundant round trip is user-visible.Is a mechanical guard owed? — triage's question, answered
Yes for this shape, and the sweep's own two finds are the argument. Commandment #10 records that a lint rule is feasible for the same-file shape only,
eslint-rules/being where it would live, with the cross-module instances out of reach of any single-file rule. Both instances this sweep produced are same-file:reloadandeffectiveDataSourceare declared in one component here, and objectui#10044'scandidateSignature = useMemo(…, [candidates])sits directly under thecandidatesmemo inuseRecordSearch.ts. ⇒ The two that a per-class remediation would have had to catch are exactly the two a feasible rule reaches. ⛔ Filing and writing it is outside this card's file surface; it is reported for the seat to file rather than smuggled in here.Acceptance notes — noticed, not fixed here
provider: 'object'.useSettledSchemare-readsgetObjectSchemathrough the new adapter and settles a fresh definition object for a byte-identical answer;objectSchemais a genuine member of the fetch effect's value list, so the record query runs a second time. That is the seam commandment [WIP] Enhance every detail of the designer #10 spells out in as many words — "a provider that refetches may not republish an equal payload as a new object" — one link upstream, inpackages/react/src/hooks/useSettledSchema.ts, outside this card's file surface. It is unchanged by this PR (before and after alike). The new pin deliberately does not pin the exact count for that case, so it will not go red on the day it is repaired; it pins that the new adapter is the one that runs. Reported for filing.effectiveDataSourcein four write-back / delete callback dependency arrays. Those are handler identities: a discard re-creates a handler, it does not issue a request, so no correctness rests on them and they are out of this card's scope. Noted, not filed.Generated by Claude Code