chore(schema): bump @typra/emitter to 0.4.21 and regenerate - #453
chore(schema): bump @typra/emitter to 0.4.21 and regenerate#453Seth Juarez (sethjuarez) wants to merge 3 commits into
Conversation
0.4.20 is the first release cut from typra's `main` since 0.4.2. Versions 0.4.3 through 0.4.18 were published from an unmerged branch, so this pin moves from 0.4.2 straight to the current `latest`. Regeneration follows in the next commit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pure regeneration - `npm run generate` in `schema/`, no handwritten edits.
This pulls in every emitter fix that accumulated behind typra's unmerged PR
stack, plus the defects found and fixed while landing it.
Measured effect on this repository's suites:
go test ./... 58 failed -> 2 failed
TypeScript (4 workspaces) 63 failed -> 10 failed
Zero generated-test failures remain in either backend. All 12 remaining
failures are in handwritten tests and are unrelated to code generation:
Go (2)
TestReferenceTurnRunnerMatchesSharedGoldenReplayVectors and its
permission_denied subtest, package prompty/model.
TypeScript (10)
tests/harness/turn-runner.test.ts (1) golden replay journal vectors
tests/loader.test.ts (5) allowedFileRoots, structured output
tests/models.test.ts (2) Azure modalities, OpenAI enrichment
tests/spec-vectors.test.ts (2) empty_frontmatter_body_only,
tools_mcp_load
Emitter fixes included, by typra issue:
#37 non-abstract polymorphic bases absorb unclaimed discriminator values
#38 open discriminators are no longer pre-validated ahead of dispatch
#39 Go numeric coercions bridge encoding/json float64 and yaml.v3 int
#46 named-collection round-trips, including duplicate and unnamed entries
#47 diagnostic paths carry array element indices, e.g. messages[3].role
#53 generated tests synthesize required complex fields from nested samples
#54 Go abstract-open discriminators absorb unknown kinds into the base
#56 TypeScript dictionary-load tests use the built example payload
#64 TypeScript never emits a generated test file with no test cases
Not verified: this repository's Rust, C# and Python suites were not run for
this bump. Python does not build (typra#43).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
0.4.21 ships the #59 fix: C#, Python and TypeScript now absorb unknown discriminators on abstract open bases via a concrete UnknownX carrier, completing the reject-before-the-open-fallback family (typra #37, #38, #54, #59). On main's current schema the fix is a no-op for Connection, whose `kind` is still the closed `ConnectionType` alias, so no Unknown carrier is emitted. The only substantive regeneration delta is the private -> protected widening of the raw-payload machinery on Property, which the carrier needs to reach from a subclass. Measured against 0.4.21 (branch wip/connection-open-discriminator, where the open discriminator is live): Go go test ./... 1 failure (#449) Rust cargo test 293 passed / 3 failed (#452) TS vitest run 1510 passed / 12 failed (#449, #450, #451) Every remaining failure is attributed to a filed prompty-side issue. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b31c70d1-3bf8-4b6d-80a9-db836f2a4166
| @@ -23,6 +23,9 @@ type AiResourceInfo struct { | |||
|
|
|||
| // LoadAiResourceInfo creates a AiResourceInfo from a map[string]interface{} | |||
| func LoadAiResourceInfo(data interface{}, ctx *LoadContext) (AiResourceInfo, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -20,6 +20,9 @@ type AnthropicImageSource struct { | |||
|
|
|||
| // LoadAnthropicImageSource creates a AnthropicImageSource from a map[string]interface{} | |||
| func LoadAnthropicImageSource(data interface{}, ctx *LoadContext) (AnthropicImageSource, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -19,6 +19,9 @@ type AnthropicTextBlock struct { | |||
|
|
|||
| // LoadAnthropicTextBlock creates a AnthropicTextBlock from a map[string]interface{} | |||
| func LoadAnthropicTextBlock(data interface{}, ctx *LoadContext) (AnthropicTextBlock, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -22,6 +22,9 @@ type AnthropicToolDefinition struct { | |||
|
|
|||
| // LoadAnthropicToolDefinition creates a AnthropicToolDefinition from a map[string]interface{} | |||
| func LoadAnthropicToolDefinition(data interface{}, ctx *LoadContext) (AnthropicToolDefinition, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -20,6 +20,9 @@ type AnthropicToolResultBlock struct { | |||
|
|
|||
| // LoadAnthropicToolResultBlock creates a AnthropicToolResultBlock from a map[string]interface{} | |||
| func LoadAnthropicToolResultBlock(data interface{}, ctx *LoadContext) (AnthropicToolResultBlock, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -19,6 +19,9 @@ type AnthropicUsage struct { | |||
|
|
|||
| // LoadAnthropicUsage creates a AnthropicUsage from a map[string]interface{} | |||
| func LoadAnthropicUsage(data interface{}, ctx *LoadContext) (AnthropicUsage, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -21,6 +21,9 @@ type AnthropicWireMessage struct { | |||
|
|
|||
| // LoadAnthropicWireMessage creates a AnthropicWireMessage from a map[string]interface{} | |||
| func LoadAnthropicWireMessage(data interface{}, ctx *LoadContext) (AnthropicWireMessage, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -22,6 +22,9 @@ type AnthropicToolUseBlock struct { | |||
|
|
|||
| // LoadAnthropicToolUseBlock creates a AnthropicToolUseBlock from a map[string]interface{} | |||
| func LoadAnthropicToolUseBlock(data interface{}, ctx *LoadContext) (AnthropicToolUseBlock, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -19,6 +19,9 @@ type AuthorizationCodeFlow struct { | |||
|
|
|||
| // LoadAuthorizationCodeFlow creates a AuthorizationCodeFlow from a map[string]interface{} | |||
| func LoadAuthorizationCodeFlow(data interface{}, ctx *LoadContext) (AuthorizationCodeFlow, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
| @@ -20,6 +20,9 @@ type CompactionCompletePayload struct { | |||
|
|
|||
| // LoadCompactionCompletePayload creates a CompactionCompletePayload from a map[string]interface{} | |||
| func LoadCompactionCompletePayload(data interface{}, ctx *LoadContext) (CompactionCompletePayload, error) { | |||
| if ctx == nil { | |||
| ctx = NewLoadContext() | |||
|
Verified against the published package — pinned Full Rust suite -if let Some(value) = value.as_f64().map(|value| value as f32) { ... "float" ... }
-if let Some(value) = value.as_i64() { ... "integer" ... }
+if let Some(value) = value.as_i64() { ... "integer" ... }
+if let Some(value) = value.as_f64() { ... "float" ... }Go and TypeScript output is byte-identical to |
|
Superseded — flagging rather than closing, since the landing decision isn't mine to make. This PR pins Why the newer pin mattersThe 0.4.21 → 0.4.22 regeneration delta is exactly one file plus a version stamp: Effect: What
|
| runtime | result | attribution |
|---|---|---|
| Go | 0 failures | — |
| TypeScript | 1518 passed / 0 failed | — |
| Python | 1468 passed / 1 failed | typra #71 |
| Rust | 2 failed | typra #46 |
| C# | 1292 passed / 49 failed | typra #53 ×48, #71 ×1 |
Progression across the effort: Go 62→0, TypeScript 67→0, Rust 39→2, Python 10→1, C# 53→49. 52 failures remain across all five runtimes and all 52 are emitter-side — zero prompty-owned defects left. 48 of the 52 are typra #53 alone.
Two measurement notes, since they produced wrong numbers for me
cargo testfail-fast stops at the first failing target. Every "293 passed / 3 failed" figure quoted earlier in this effort was lib-only; the true figure was 39. Always--no-fail-fast. Likewisego test ./...serves cached results — always-count=1after regeneration.- Run
npm installinruntime/typescriptbeforenpm run generate, or prettier won't resolve and regeneration emits a spurious ~276-file / ~3900-line diff that is pure line-wrapping and reads exactly like a semantic regression.
Suggestion
Either rebase this PR onto the 0.4.22 pin, or close it in favour of wip/typra-0.4.20-regen. As it stands, merging it would land a pin that's already stale and reintroduce a Rust failure that's fixed on the newer branch.
|
Superseded by #456, which takes the model layer to The
#456 also carries live-provider validation (OpenAI + Anthropic) across four runtimes. Closing this in favour of it is safe once #456 is reviewed. |
Supersedes #448, which pinned
0.4.20.0.4.21ships the #59 fix — C#, Python and TypeScript now absorb unknown discriminators on abstract open polymorphic bases via a concreteUnknownXcarrier, matching what Rust and Go already did. That completes the reject-before-the-open-fallback family across four backends (typra #37, #38, #54, #59).Regeneration delta is small, and that is expected
On
main's current schema the #59 fix is a no-op forConnection, whosekindis still the closedConnectionTypealias — so noUnknowncarrier is emitted here. The defect is latent onmainand becomes live onwip/connection-open-discriminator, which changeskindto a barestring.The only substantive delta is the
private→protectedwidening of the raw-payload machinery onProperty, which the carrier subclass needs to reach:``diff
``
Measurements
Against published
0.4.21, measured onwip/connection-open-discriminatorwhere the open discriminator is actually live:go test ./...cargo testvitest runtests/connection-roundtrip-vectors.test.tswent from 2 failed / 1 passed → 0 failed / 3 passed.Every remaining failure is attributed, and none of them is an emitter defect
ReferenceTurnRunnerskipstool_resulton the permission-denied pathmodel,approvalMode,itemsrequired; vectors and fixtures omit themcustom-connection.test.tsfor a type removed from the schemaconnection/contextAttributions were confirmed by experiment rather than by reading: flipping the three schema declarations in #450 took
spec-vectors.test.tsfrom 2 failures to 0 andloader.test.tsfrom 5 to 4; addingitemstostructured.promptytookloader.test.tsfrom 5 to 1. Both changes were reverted.Not verified
vscodeor non-coreTypeScript workspaces.Note for reviewers regenerating locally
Run
npm installinruntime/typescriptbeforenpm run generate. Without it prettier does not resolve and regeneration emits a spurious ~276-file, ~3900-line reformatting diff that is pure line-wrapping.