refactor(actions)!: target is the only handler slot — delete the execute alias (objectstack#3856) - #2990
Merged
Merged
Conversation
…xecute` alias (objectstack#3856) `ActionRunner.executeScript` read `action.target || action.execute`. Against `@objectstack/spec` 17 that fallback is unreachable: `execute` is a tombstoned key (objectstack#3855) the parser rejects with the rename prescription, so no parsed action can carry it and the `||` could only ever yield `target`. Verified against 17.0.0-rc.0 — an action declaring `execute` fails `ActionSchema.safeParse` and a `target` action's parsed output has no `execute` key. Deleted rather than kept as harmless residue: two handler slots is what let one action run one script server-side and a different one client-side (objectstack#3713, where this renderer preferred the alias while the spec transform preferred `target`). A dead slot still reads as a live contract. objectstack#3856 predicted a compile error here and there wasn't one — the real finding. Neither reader was typed against the spec's `z.infer`; both hand-declared the key: - `@object-ui/types` `ActionSchema.execute` removed, so `execute: '…'` now fails `tsc` at the authoring site (TS2353). - `@object-ui/core` `ActionDef.execute` removed too, but `ActionDef` carries a `[key: string]: any` index signature, so stale hand-authored metadata still compiles. For that path `executeScript` returns the rename prescription rather than a bare "No script provided" — removing an authorable key has to be audible, and binding no handler silently is the objectstack#2169 "Mark Done does nothing" shape. The four action renderers stop forwarding `execute`, and Studio's `ActionPreview` no longer falls back to it (previewing an alias-only draft as bound contradicted the parse that rejects it on save). Tests move to `target`; the "prefer canonical over the alias" case becomes a regression test that the alias is not read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014DBMo8gnFduzgpuSHd5Eje
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 objectstack-ai/objectstack#3856.
The claim, confirmed
ActionRunner.executeScriptreadaction.target || action.execute. Against@objectstack/spec17 that fallback is unreachable — and by a stronger mechanism than objectstack#3856 assumed. #3742 droppedexecutefrom parsed output; objectstack#3855 went further and tombstoned it, so the parser now rejects an authoredexecutewith the rename prescription.Verified empirically against the resolved
17.0.0-rc.0:No parsed action can carry the key, so
||could only ever yieldtarget. Deleted rather than left as harmless residue: two handler slots is exactly what let one action run one script server-side and a different one client-side (objectstack#3713, where this renderer preferred the alias while the spec transform preferredtarget). A dead slot still reads as a live contract to the next maintainer.The real finding: the type, not the fallback
objectstack#3856 asked whether a TypeScript reader here should already fail to compile, "because if it still compiles, something in objectui is reading a looser type than the spec's." It still compiled. Neither reader was typed against the spec's
z.infer— both hand-declared the key:@object-ui/typesActionSchemaexecute?: stringexecute: '…'failstsc(TS2353) at the authoring site@object-ui/coreActionDefActionDefcarries a[key: string]: anyindex signature, so removing the declaration produces no compile error there and stale hand-authored metadata (never parsed by the spec) still type-checks. Silently binding no handler is the objectstack#2169 "Mark Done does nothing" shape, so for that pathexecuteScriptnow returns the rename prescription instead of a bare "No script provided" — the same reasoning the spec's own tombstone gives for keeping the removal audible. This is not a tolerant fallback: the script does not run.Changes
@object-ui/core—executeScriptreadstargetonly;ActionDef.executeremoved; retired-key branch returns the rename prescription (ordered after the existingbodybranch, since abodyaction ignorestargetand "rename it" would be wrong advice there).@object-ui/types—ActionSchema.executeremoved;targetdocumented as the only handler slot.@object-ui/components—action:button,action:icon,action:menu,action:groupstop forwardingexecuteinto the runner.@object-ui/app-shell— Studio'sActionPreviewdrops?? d.execute; previewing an alias-only draft as "bound" contradicted the parse that rejects it on save.execute:-authored actions across 6 suites move totarget. The "should prefer canonical target over the deprecated execute alias" case becomes a regression test that the alias is not read and that the error prescribes the rename.Grep is clean: no
executeread on action metadata remains anywhere inpackages/,apps/, orexamples/. No docs, JSON, or example metadata authored the alias.Verification
pnpm type-check— 76/76 tasks pass.pnpm test— full suite green (action suites: 13 files / 204 tests).pnpm lint— 45/45, 0 errors.executeonActionSchema→ TS2353; onActionDef→ still compiles (index signature), which is what the runtime prescription covers.Requires
@objectstack/spec17. Metadata still on the alias is rewritten byos migrate meta --from 16.🤖 Generated with Claude Code
https://claude.ai/code/session_014DBMo8gnFduzgpuSHd5Eje
Generated by Claude Code