Skip to content

@object-ui/types' Phase-2 ActionCallback surface is a third onSuccess meaning — declared, zod-mirrored, doc-advertised, zero producers #7068

Description

@os-sam

Filed unassigned by the dev seat implementing #5934 (session session_013hfmP9hoMd3dJwTh85J4yB, PR #7065). Observation from the #5934 census, recorded so the key's remaining second meaning does not get mistaken for finished business once #7065 lands.

Duplicate-checked against all 266 open issues (repo-scoped REST listing, titles + bodies; positive control: the grep finds #5934 itself). No open card names ActionCallback. Adjacent but distinct: #2231 (unify hand-written zod with spec/ui), #5927 / #6152 (mirror-parity mechanics), #6497 (handler dialect on the action object) — none of them asks whether this surface is alive.

What was measured (on 85b495795)

#5934 retired ActionRunner's callback meaning for onSuccess, converging @object-ui/core's ActionDef on the spec's { navigate, openIn } block. But a THIRD meaning of the same key ships on a different published package, @object-ui/types:

  • packages/types/src/crud.ts:29export interface ActionCallback { type: 'toast' | 'message' | 'redirect' | 'reload' | 'custom' | 'ajax' | 'dialog'; message?; url?; api?; ... } ("Action callback configuration");
  • crud.ts:167 / crud.ts:171 — that file's legacy ActionSchema declares onSuccess?: ActionCallback and onFailure?: ActionCallback ("Phase 2");
  • packages/types/src/zod/crud.zod.ts:99 — the zod mirror carries it (onSuccess: ActionCallbackSchema.optional());
  • it is ADVERTISED to authors: content/docs/core/enhanced-actions.mdx shows onSuccess: { type: 'toast', message: ... } in three separate examples, and content/docs/guide/schema-overview.md:85 shows the same key on its "enhanced actions" sample.

Census result: zero producers of ActionCallback-shaped values outside the types package's own tests (phase2-schemas.test.ts) and those doc examples; no runtime in this repo reads ActionCallback — the runner never consumed this shape (its retired channel wanted full ActionDefs, and { type: 'toast' } is not a registered action type).

Why it matters after #5934

The #5934 payoff was "one key, one meaning" for the runner. The types package still publishes a callback-style onSuccess/onFailure pair with docs telling authors to write it — a shape the pinned spec strict-refuses on ActionSchema.onSuccess at parse. An AI or human author following enhanced-actions.mdx writes metadata that cannot survive publish, and the failure points at the validator rather than at the stale doc. That is exactly the consumer-side leniency / authoring-trap class the four-axis framing exists to catch.

Possible directions (not asserting one): retire ActionCallback + the two keys from crud.ts's legacy ActionSchema (breaking for @object-ui/types, human floor) and rewrite the two docs pages to the spec block; or keep the type but fence the docs. Either way the docs half is measurable today: the examples author a shape the spec refuses.

Refs: #5934 · PR #7065 · #2231 · #6152

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanefindingpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions