You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while implementing #4282. That card's second half asked for paramCollectionHandler's action?: any to be narrowed to ActionDef — "the larger and more valuable half", since it is what makes the compiler cover that file at all. The narrowing was attempted, measured, and backed out; these are the diagnostics it produced.
What the narrowing costs today
ParamCollectionHandler already declares its second parameter as ActionDef, and ActionDef is already imported by useConsoleActionRuntime.tsx — so the narrowing needs no new import and no barrel export. It is a one-token change to the annotation. Applied and type-checked on origin/main @ 7a28e1e3f:
src/hooks/useConsoleActionRuntime.tsx(253,45): error TS2339: Property 'overrideNotice' does not exist on type 'ActionDef'.
src/hooks/useConsoleActionRuntime.tsx(253,83): error TS2339: Property 'overrideNotice' does not exist on type 'ActionDef'.
src/hooks/useConsoleActionRuntime.tsx(254,18): error TS2339: Property 'overrideNotice' does not exist on type 'ActionDef'.
Three diagnostics, one key. Nothing else in the handler moved — every other read (objectName, params, name, description, label) is a declared field.
They look alike and are not. title had no producer — that is why #4282 deleted it. overrideNotice has a live producer and a live reader, and is simply undeclared:
producer: packages/app-shell/src/views/DeclaredActionsBar.tsx:305 — dispatch.overrideNotice = overrideNotice;, on an object literal that is then cast dispatch as ActionDef at :316. The cast is what makes it compile; the key never passes through a declaration.
reader: packages/app-shell/src/hooks/useConsoleActionRuntime.tsx:253-254, the three sites above.
declared: nowhere. Absent from ActionDef (packages/core/src/actions/ActionRunner.ts:112), from ACTION_DEF_KEYS, from SPEC_ACTION_KEYS, and from @objectstack/spec's ActionSchema (44 keys walked live at spec 17.0.0).
This is exactly the shape objectstack#4075 step 3 promoted description out of, and for the same stated reason — "authorable, forwarded, read, and undeclared". overrideNotice arrived later (#5178) and did not get the same treatment.
Worth noting where it currently sits in the warning path: because the key is unknown to KNOWN_ACTION_KEYS, warnOnUnknownActionKeys reports it in dev as "a key no reader recognizes" on every privileged-override dispatch — which is false, and points the author at a typo that isn't one.
add it to ACTION_DEF_KEYS in packages/core/src/actions/actionKeys.ts — actionKeys.pin.test.ts re-derives that list from the interface's AST, so the two must move together or the pin goes red;
then narrow both param handlers' action?: any to ActionDef — useConsoleActionRuntime.tsx:196 and RecordDetailView.tsx:500.
Step 3 is the payoff and should not be attempted before 1-2: the alternative that "works" today is casting the overrideNotice read at its use site, which swaps a visible any for an invisible cast and re-hides the undeclared key. That was rejected on #4282 and should stay rejected.
Scope note for whoever picks this up: it spans @object-ui/core (declaration + pinned inventory + pin test) and @object-ui/app-shell (two annotations). Step 3's RecordDetailView half overlaps #5610, which removes the dead title limb from that same handler — worth sequencing, not merging.
Found while implementing #4282. That card's second half asked for
paramCollectionHandler'saction?: anyto be narrowed toActionDef— "the larger and more valuable half", since it is what makes the compiler cover that file at all. The narrowing was attempted, measured, and backed out; these are the diagnostics it produced.What the narrowing costs today
ParamCollectionHandleralready declares its second parameter asActionDef, andActionDefis already imported byuseConsoleActionRuntime.tsx— so the narrowing needs no new import and no barrel export. It is a one-token change to the annotation. Applied and type-checked onorigin/main@7a28e1e3f:Three diagnostics, one key. Nothing else in the handler moved — every other read (
objectName,params,name,description,label) is a declared field.Why this is the opposite of #4282's
titleThey look alike and are not.
titlehad no producer — that is why #4282 deleted it.overrideNoticehas a live producer and a live reader, and is simply undeclared:packages/app-shell/src/views/DeclaredActionsBar.tsx:305—dispatch.overrideNotice = overrideNotice;, on an object literal that is then castdispatch as ActionDefat:316. The cast is what makes it compile; the key never passes through a declaration.packages/app-shell/src/hooks/useConsoleActionRuntime.tsx:253-254, the three sites above.ActionDef(packages/core/src/actions/ActionRunner.ts:112), fromACTION_DEF_KEYS, fromSPEC_ACTION_KEYS, and from@objectstack/spec'sActionSchema(44 keys walked live at spec 17.0.0).This is exactly the shape objectstack#4075 step 3 promoted
descriptionout of, and for the same stated reason — "authorable, forwarded, read, and undeclared".overrideNoticearrived later (#5178) and did not get the same treatment.Worth noting where it currently sits in the warning path: because the key is unknown to
KNOWN_ACTION_KEYS,warnOnUnknownActionKeysreports it in dev as "a key no reader recognizes" on every privileged-override dispatch — which is false, and points the author at a typo that isn't one.Suggested disposition
Promote it, the way
descriptionwas:overrideNotice?: stringonActionDefinpackages/core/src/actions/ActionRunner.ts, documented at its declaration as objectui dialect (there is no spec counterpart, and console: an admin-override decision renders as an ordinary Approve — no affordance distinction, no confirm, and thevia_overridemarker is never surfaced in any UI #5178's ruling is explicit that it must NOT be folded intodescription—actionDescriptionprefers a_actions.NAME.descriptionbundle hit, andplugin-approvalsships one forapproval_reject, so a warning routed throughdescriptiongets silently translated away);ACTION_DEF_KEYSinpackages/core/src/actions/actionKeys.ts—actionKeys.pin.test.tsre-derives that list from the interface's AST, so the two must move together or the pin goes red;action?: anytoActionDef—useConsoleActionRuntime.tsx:196andRecordDetailView.tsx:500.Step 3 is the payoff and should not be attempted before 1-2: the alternative that "works" today is casting the
overrideNoticeread at its use site, which swaps a visibleanyfor an invisible cast and re-hides the undeclared key. That was rejected on #4282 and should stay rejected.Scope note for whoever picks this up: it spans
@object-ui/core(declaration + pinned inventory + pin test) and@object-ui/app-shell(two annotations). Step 3'sRecordDetailViewhalf overlaps #5610, which removes the deadtitlelimb from that same handler — worth sequencing, not merging.Refs #4282, #5178, #4046.