Skip to content

fix date updated - #43

Merged
Cassie Breviu (cassiebreviu) merged 1 commit into
mainfrom
docs-udpdate-july
Jul 17, 2024
Merged

fix date updated#43
Cassie Breviu (cassiebreviu) merged 1 commit into
mainfrom
docs-udpdate-july

Conversation

@cassiebreviu

Copy link
Copy Markdown
Contributor

No description provided.

@sethjuarez
Seth Juarez (sethjuarez) deleted the docs-udpdate-july branch February 11, 2025 04:09
Seth Juarez (sethjuarez) added a commit that referenced this pull request Aug 5, 2026
Picks up typra #77 -- named-collection entry shorthand now routes an
immediate scalar to a declared field consistently across all backends,
and the scalar's JSON type is inferred into the discriminator rather than
being written into it verbatim.

This commit is the dependency bump and its regeneration only. It does not
close the named-collection contract on its own; the schema must declare
which field the shorthand targets, which lands in the next commit.

Regeneration touched 46 files, 106 insertions / 69 deletions, spread
across the Rust, Go, TypeScript, Python and C# models.

Measured effect of this commit in isolation (Rust, the only backend where
all four immediate-scalar vectors were already executable before this
work):

  cargo test --no-fail-fast --test named_collection_vectors
    0.4.22   2 passed / 2 failed
    0.4.23   2 passed / 2 failed

No net change yet -- but the failure text changes, and that change is the
point. At 0.4.22 the scalar landed in the discriminator:

    kind "Seattle"

At 0.4.23 the discriminator is inferred correctly and the residue is
purely which declared field receives the value:

    expected default "Seattle", got null
    collection shorthand unexpectedly populated example "Seattle"

Rust has converged onto the manifestation Go and C# already had, so all
backends now fail identically and for one remaining reason.

Not verified: Python does not build (typra #43), so its regenerated
models are unexecuted.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Seth Juarez (sethjuarez) added a commit that referenced this pull request Aug 5, 2026
One line on Property. `named_collection_vectors.json` requires that an
immediate primitive value in a name-keyed collection -- `inputs: { "city":
"Seattle" }` -- load as:

    { name: "city", kind: "string", default: "Seattle" }

with `example` absent. The vector header states it directly: "Immediate
primitive Property values infer kind and default without leaking
direct-coercion example semantics."

Without this declaration the emitter falls back to the @Coerce target,
which for Property is `example` (properties.tsp:17 and siblings). That is
correct for direct coercion and wrong for the collection shorthand -- one
@Coerce set cannot express both contexts, which is why typra #77 added
@entryShorthand for the collection case specifically.

Measured, all four executable backends, this commit alone (parent is the
0.4.23 bump):

  runtime            before          after
  rust  (4 targets)  2 / 2 failed    4 passed / 0 failed
  go    (13 vectors) 9 / 4 failed    13 passed / 0 failed
  ts    (14 tests)   10 / 4 failed   14 passed / 0 failed
  csharp(13 vectors) 9 / 4 failed    13 passed / 0 failed

Full-suite regression check at this commit:

  rust    cargo test --no-fail-fast     908 passed /  0 failed  (24 targets)
  go      go test -count=1 ./...        ok, no failures
  ts      npm test                     1692 passed /  2 failed
  csharp  dotnet test                  1305 passed / 49 failed

Rust is fully green for the first time in this effort. The 4 named-
collection failures cleared in every backend and nothing else changed
state.

Residual failures, all pre-existing and none related to this change:
  ts     2  model-enrichment assertions in packages/openai and
            packages/foundry, unrelated to the emitted models
  csharp 48 typra #53 (fixture generator omits required model-typed
            fields) and 1 typra #71

Not verified: Python still does not build (typra #43), so its regenerated
loader is unexecuted. Java and Swift have no runtime in this repository.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Seth Juarez (sethjuarez) added a commit that referenced this pull request Aug 5, 2026
…dels

Fifth and final executable backend for the named-collection contract,
after Go (ba4866e), TypeScript (36c9619) and C# (1a0c3e2). Rust was
this contract's only executable home for most of this effort.

Measured:

  .venv/Scripts/python -m pytest tests/test_named_collection_vectors.py
    13 passed / 0 failed

  ruff check    All checks passed!
  ruff format   1 file already formatted

Python confirms the two-part #46 fix (emitter 0.4.23 plus the
@entryShorthand("default") declaration in e2152ef) holds in a fifth
independent backend. All five now pass the contract:

  rust    4 targets   0 failed
  go      13 vectors  0 failed
  ts      14 tests    0 failed
  csharp  13 vectors  0 failed
  python  13 vectors  0 failed

Also corrects the record on Python's status. This effort has been carrying
"Python does not build (typra #43)" as a standing assumption; it is stale.
Measured full suite on this commit:

  .venv/Scripts/python -m pytest tests/ -q
    1468 passed / 1 failed / 17 skipped / 56 deselected  (11m48s)

The single failure is test_spec_vectors.py::test_wire_vector
[kind_to_json_type_mapping], and it is not a Python defect:

  ValueError: tools[0].parameters[4].items: missing required field

spec/vectors/wire/wire_vectors.json declares that parameter as
{"name": "an_array", "kind": "array"} with no items, so the vector
requires ArrayProperty.items to be optional. It cannot be made optional --
schema/model/core/properties.tsp:80 must stay `items:` because `items?:`
emits uncompilable Rust (typra #71). Verified by experiment: applying
items?: and regenerating produces E0308 at property.rs:113 and :247, and
the change was reverted.

C# fails the identical vector: SpecVectorWireTests.OpenAI_Chat_WireFormat
(name: "kind_to_json_type_mapping") with "tools.parameters.items: missing
required field". So #71 blocks a canonical spec vector wherever
wire_vectors.json is executed, rather than costing one isolated test.

Not verified: Java and Swift have no runtime in this repository.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant