refactor: rename casRef to x-cas-ref for JSON Schema compliance (Phase 3) #292

Merged
xiaomo merged 1 commits from feat/285-phase3-x-cas-ref into main 2026-05-16 11:55:25 +00:00
Owner

What

Rename .meta({ casRef: true }) to .meta({ 'x-cas-ref': true }) for JSON Schema extension convention compliance. Add buildDescriptor test.

Why

Phase 3 of RFC #285. JSON Schema custom extensions should use x- prefix. Zod v4 toJSONSchema automatically preserves meta into JSON Schema output, so buildDescriptor needs no code changes — just the naming convention.

Changes

  • workflow-runtime: collectCasRefs checks x-cas-ref instead of casRef
  • workflow-runtime tests: all .meta({ casRef }) → .meta({ 'x-cas-ref' })
  • workflow-register: new build-descriptor.test.ts verifying x-cas-ref in descriptor output

Dependency

⚠️ Should merge after PR #290 (Phase 2), then rebase.

Testing

220 tests pass, 0 fail. All steps in #291 verified.

Fixes #291, Refs #285

## What Rename .meta({ casRef: true }) to .meta({ 'x-cas-ref': true }) for JSON Schema extension convention compliance. Add buildDescriptor test. ## Why Phase 3 of RFC #285. JSON Schema custom extensions should use x- prefix. Zod v4 toJSONSchema automatically preserves meta into JSON Schema output, so buildDescriptor needs no code changes — just the naming convention. ## Changes - workflow-runtime: collectCasRefs checks x-cas-ref instead of casRef - workflow-runtime tests: all .meta({ casRef }) → .meta({ 'x-cas-ref' }) - workflow-register: new build-descriptor.test.ts verifying x-cas-ref in descriptor output ## Dependency ⚠️ Should merge after PR #290 (Phase 2), then rebase. ## Testing 220 tests pass, 0 fail. All steps in #291 verified. Fixes #291, Refs #285
xiaoju added 1 commit 2026-05-16 11:30:48 +00:00
Rename .meta({ casRef: true }) to .meta({ 'x-cas-ref': true }) across
all schema annotations. Zod v4 toJSONSchema automatically outputs
x-cas-ref in the generated JSON Schema, so buildDescriptor preserves
the annotation without any code changes.

Add buildDescriptor test verifying x-cas-ref appears in descriptor
output for annotated fields and is absent for plain fields.

220 tests pass, 0 fail.

Fixes #291, Refs #285
xiaoju force-pushed feat/285-phase3-x-cas-ref from 8a345691ed to 33f9425848 2026-05-16 11:52:21 +00:00 Compare
xiaomo approved these changes 2026-05-16 11:55:23 +00:00
xiaomo left a comment
Owner

LGTM

LGTM ✅
xiaomo merged commit ebfb99bf4c into main 2026-05-16 11:55:25 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#292