This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
refactor(auth,components,react)!: burn ledger batch 5 — 18 symbols stop wearing spec names (#3159) - #3199
Merged
os-zhuang merged 5 commits intoAug 2, 2026
Conversation
objectstack#4115 batch 5 (objectui#3159). WIP commit taken mid-verification
after a container restart; the code changes are complete and locally green,
the full-suite / mutation verification is not yet done.
Verdicts so far (17 of 18 symbols):
@object-ui/auth
- TenancyPosture, DelegableScope -> re-export (spec bindings; DelegableAdminScope
comes along, the local copy spelled that element type out inline)
- AuthUser -> derived (`extends` the spec principal; the
local declaration was missing `positions` / `tenantId` and the
`[key: string]: unknown` index signature hid that at every call site)
- AuthSession -> renamed AuthClientSession (spec models the SERVER session
record; this is the browser's token bundle — mutually unassignable)
- AuthProviderConfig -> renamed AuthProviderOptions (spec owns that name for
the OAuth registration `{id, clientId, clientSecret, scope?}`)
- AuthProvider -> ALLOW (React context provider component vs a zod enum of
provider ids; renaming breaks every consumer's JSX for no defect)
@object-ui/components
- ShareLinkPermission, ShareLinkAudience -> re-export (identical hand copies)
- ShareLink -> derived from the spec row minus `password_hash`
- SortItem -> derived (`extends` spec SortItem, adds only the React key)
- FilterCondition -> renamed FilterBuilderCondition (this one IS the flat
FilterBuilder row, unlike app-shell's, which was the ObjectQL AST)
- Field -> renamed FieldContainer (React wrapper div vs the spec's object
FIELD metadata + builder namespace)
@object-ui/react
- OfflineStrategy -> re-export
- ConflictResolutionStrategy -> renamed to the spec's OWN name for that union,
`ConflictResolution`; the old name is a DIFFERENT spec export (the
metadata-merge policy in @objectstack/spec/api)
- OfflineCacheConfig, NavigationConfig, PerformanceConfig -> derived from each
schema's INPUT side (`.default()`ed keys must stay authorable)
- OfflineConfig -> deferred at time of this commit, pending the coordinator's
correction; still on the ledger here
Also: `tsconfig.spec-parity.json` + a CI step, because every package tsconfig
excludes `**/*.test.ts` — the compile-time `Assert<Equal<Local, Spec>>` pins in
the parity tests were not compiled by anything.
Ledger: 77 -> 60 in this tree (pre-rebase baseline).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Jdef6ZFhJmiNRhNCd4DW3
…symbol-ci-rule-4r3xlc-batch5 # Conflicts: # packages/components/package.json # pnpm-lock.yaml # scripts/check-spec-symbol-derivation.mjs
…op wearing spec names Adopts main's per-package `tsconfig.typetests.json` convention (objectui#3181) instead of the root-level project this branch had added before that landed, and carries the batch-5 changeset. Verification: guard green (ledger 62 -> 45, 17 -> 14 packages), turbo type-check 78/78 after rebuilding the three packages' dists, four mutation directions red. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Jdef6ZFhJmiNRhNCd4DW3
Left behind by the batch-5 triage; they are ad-hoc probes of the spec's `.d.ts`, not something the repo should carry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Jdef6ZFhJmiNRhNCd4DW3
…y carried A derived alias has no members to hang JSDoc on, so `size`'s #2578 provenance and `width`'s deprecation would have been lost with the declaration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Jdef6ZFhJmiNRhNCd4DW3
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
August 2, 2026 11:55
os-zhuang
pushed a commit
that referenced
this pull request
Aug 2, 2026
Three conflict sites, all resolved mechanically:
* `scripts/check-spec-symbol-derivation.mjs` — took main's file
wholesale (it carries the rewritten case 2 / new case 2c header and
three new ALLOW entries from #3178/#3199 that this branch never
touched), then regenerated the DEBT block with `--ledger`. 45 → 29
collisions; removed is exactly this batch's 16, added is empty, the
other 13 packages are byte-identical.
* `packages/types/src/app.ts` — kept main's #3177 import block and
module header verbatim, adding only the `NavigationArea` import this
branch's derivation needs.
* `NavigationArea.navigation`'s justification and inverted pin —
retargeted, see below.
The spec bump is the substantive part. rc.1 gave `NavigationItem` a real
type, so this branch's stated reason for pinning
`NavigationArea.navigation` ("the spec erases it to `any`") expired, and
the inverted pin fired exactly as designed. Re-triaged: the override
stands, but on case 2c rather than case 2 — the spec's element is precise
and describes a different shape, and objectui's items still carry
`visible: boolean`, which the spec rejects at every tier. The pin now
asserts that blocker directly instead of the erasure that used to imply
it, and points at `spec-derived-unions.test.ts`, where #3177 pins the
other two.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Jdef6ZFhJmiNRhNCd4DW3
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.
Closes objectui#3159 (do not auto-close until merged). Part of objectstack#4115 — debt-ledger burn-down, batch 5 of 8.
Eighteen symbols across
@object-ui/auth,@object-ui/componentsand@object-ui/reactwere declared under names@objectstack/specalready owns. Ledger 62 → 45, 17 → 14 packages — all three packages leave the ledger entirely.Verdicts
Twelve derive, five rename, one goes to ALLOW — and one needed no fix at all.
@object-ui/auth(6)TenancyPosture@objectstack/spec/securityDelegableScopeDelegableAdminScopecomes alongAuthUserextends)AuthSessionAuthClientSessionAuthProviderConfigAuthProviderOptions{id, clientId, clientSecret, scope?}AuthProviderAuthUseris the one worth reading. The local declaration never had the spec'spositionsortenantId— the authorization inputs — and its[key: string]: unknownindex signature made that invisible both at every call site and to any structural comparison (the objectstack#4075 mechanism: an index signature absorbs anything, so[Local] extends [Spec]answers "identical" no matter how far apart they are). It nowextendsthe spec principal, so the display-only fields (image,role,roles,emailVerified) are the whole delta and a new spec field arrives on its own.AuthSessionis the counter-case, and the rename is load-bearing in both directions: the spec requiresid/userIdthe client never sees and typesexpiresAtas an ISO string, while this holds a JSDate, requirestoken, and carries arefreshTokenthe spec has no concept of. Mutually unassignable — a re-export would have been a silent contract swap wearing a burn-down's clothes.AuthProvidervsAuthProviderConfigis deliberately a split verdict, and the reason is the failure mode this issue is about rather than a general rule about components. Nobody mistakes<AuthProvider authUrl=…>for az.ZodEnumof provider ids, and renaming it breaks the React<XProvider>convention and every consumer's JSX for no defect. Its config type is the opposite: same domain, same words, andAuthProviderConfigin the spec is the OAuth registration shape — exactly the symbol the next session reads as canonical. So the component is excused with a written reason and a tripwire; the type is renamed.@object-ui/components(6)ShareLinkPermissionShareLinkAudienceShareLinkpassword_hash, plus the boolean projectionSortItemextends){field, order}plus a synthetic React keyFilterConditionFilterBuilderConditionFieldFieldContainer<div>vs the spec's object-FIELD metadataFilterConditionwas triaged here, not inherited. The cross-package guidance on this name has now been wrong once in each direction, so it is worth stating what all of them actually are:@objectstack/spec/data$and/$or/$not)@object-ui/app-shellRecord<string, any>@object-ui/typesFilterBuilderCondition(objectui#3068)@object-ui/components(this PR){id, field, operator, value},operatordrawn from the builder's ownFILTER_BUILDER_OPERATORSdropdown vocabulary, not the spec's$-tokensFilterBuilderCondition, matching@object-ui/typesCopying app-shell's verdict would have replaced a flat builder row with a recursive query type; copying types' verdict is right here, but only because reading both confirmed it. Same name, two different objects, two different answers.
ShareLinkomitspassword_hashrather than marking it optional: it is the credential itself, and typing it in a browser package is an invitation to render it.password_protectedis the one local addition.created_atis widened to| nullto match every other timestamp on the spec's own row.Fieldhad no importers at all — it was public API by way ofexport * from './custom'and nothing consumed it, so the rename costs nothing and removes a name that means "an object field's metadata" everywhere else on the platform.@object-ui/app-shellalready renamed the same kind of collision (FieldInput→ScreenFieldInput) for the same reason.@object-ui/react(6)OfflineStrategyConflictResolutionStrategyConflictResolutionOfflineCacheConfig.default()ed keys must stay authorableOfflineConfigNavigationConfigmoderequiredPerformanceConfigConflictResolutionStrategyis the batch's sharpest trap. That name is a spec export — in@objectstack/spec/api, where it means the metadata-MERGE policy (error | priority | first-wins | last-wins). The union this hook actually uses (manual | client_wins | server_wins | last_write_wins) is the spec'sConflictResolution, in/ui. Deriving under the old name would have produced a symbol whose name points at one union and whose value is another. The fix takes the spec's own name and its binding in one step — the same move asFieldGroup→ObjectFieldGroupin objectui#3169.OfflineConfigkeeps its name here. That was a cross-package call:@object-ui/typeshad anOfflineConfigtoo, but it turned out to be a service-worker route cache and has been renamedPWAOfflineConfig(objectui#3156). This hook's config is the spec's concept key for key, so it takes the spec's binding — no dialect.PerformanceConfigneeded nothing.PerformanceConfigSchema/PerformanceConfigwere retired from@objectstack/spec/uiin 17.0.0-rc.1, so the collision ended on its own and the name is objectui's now. Pinned anyway, because "the spec dropped it" is a claim with an expiry date: if the spec re-adds the name, the tripwire fails and the symbol gets re-triaged rather than silently becoming a fork. The keys still exist inside the spec (virtualScroll,debounceMs, … appear nested under@objectstack/spec/api), so this may be a move rather than a retirement — flagged below.Method notes worth carrying forward
1. Derive configs from the schema's INPUT side, and the tell is in the hook signature.
useOffline(config: OfflineConfig = {})defaults to the empty object.z.infermakes every.default()ed key required, so the output type rejects the default the hook ships with.@object-ui/reacthas nozoddependency (it renders plain objects and never parses), so rather than adding one,packages/react/src/spec-input.tsreads the input type off the schema's own_zodinternals — the spec's binding, no new dependency, no copy of the shape.2. Two "kept local to avoid a dependency" comments, both false.
useNavigationOverlay's copy said "inline … to avoid importing from@object-ui/types(which may not be a direct dependency of@object-ui/react)" — but the vocabulary belongs to@objectstack/spec, which is a direct dependency. Same shape as the app-shell comment objectui#3169 found. AnduseOffline/usePerformanceboth claimed alignment with "@objectstack/spec v2.0.7" against an installed 17.0.0-rc.1.3. Every candidate new name was run through the guard before use.
AuthClientSession,AuthProviderOptions,FilterBuilderCondition,FieldContainer— all free. (ConflictResolutionis taken, which is the point: it is a re-export.)4. A byte-faithful re-fork passes every parity assertion. Demonstrated in the mutation testing below — this is why the guard, not the tests, is the mechanism for type-only symbols.
Verification
--ledgerregenerated after blanking the block (the parallel-batch conflict recipe), then set-diffed againstorigin/main: removed = exactly the 17 symbols this batch burns (PerformanceConfigwas already off main's ledger, the spec having retired it), added = none, every other package byte-identical. 62 → 45, 17 → 14 packages.1202 files scanned against 4344 spec export names; 9 declared dialects, 45 untriaged collisions in 14 packages.turbo build --filteron the three changed packages to rebuild their dists first, thenturbo type-check --force: 78/78, includingapps/console. (Per objectstack#4115's own note: per-packagetscotherwise resolves the old dist and reads green.)type-checkproves nothing about them.Mutation testing — four directions, all red
TenancyPostureas a byte-faithful hand copytypes.ts:33)FilterConditionrenamefilter-builder.tsx:39)SortItem) inDEBTAuthProviderALLOW entryThe first is the one worth recording. With the import removed so the copy compiles cleanly,
pnpm type-checkpassed and the parity test passed 14/14 — a hand copy identical to the spec satisfiesAssert<Equal<Local, Spec>>exactly as well as the real binding does. For a type-only symbol there is no reference identity to check (unlike objectui#3169'sisAggregatedViewContainer, whereexpect(local).toBe(spec.x)catches it), so the guard is the only mechanism that can tell a derivation from a faithful fork. The parity tests pin the shape of a deliberate divergence; they cannot detect a copy.Compile-time pins are actually compiled
All three parity tests carry
Assert<Equal<Local, Spec>>pins, and this branch originally shipped them unchecked — every package tsconfig excludes**/*.test.ts, and CI's only type gate drives those configs. objectui#3187 landed the fix for that pattern while this branch was in flight, so this adopts its convention rather than the root-level project written here first: a per-packagetsconfig.typetests.jsonwith an explicit include list, chained from each package'stype-checkscript (enforced byscripts/check-type-check-coverage.mjs). That guard now reports 4 packages with a narrow type-assertion project, up from 1.Left for someone to decide
PerformanceConfigSchema's disappearance — retirement or a move? The keys still exist nested under@objectstack/spec/api. If it moved,usePerformanceshould derive from wherever it landed instead of keeping the local declaration.packages/.apps/console/src/pages/shared-record-shape.tsdeclares its own thirdShareLink— withaudience: string, so any misspelt audience is invisible there. Out of scope for a ledger batch (the ledger is packages-only), but it is the same defect one directory over, and objectui#3074 already found thatapps/consumers are easy to miss.@objectstack/specmoved fromdevDependenciestodependenciesin@object-ui/components, since its public type surface now references the spec. Flagging in case that package is meant to stay spec-free — the import is type-only and erases from the JS, but the emitted.d.tsreferences it.Generated by Claude Code