Skip to content

added workflow corrections - #46

Merged
Seth Juarez (sethjuarez) merged 1 commit into
mainfrom
python
Jul 23, 2024
Merged

added workflow corrections#46
Seth Juarez (sethjuarez) merged 1 commit into
mainfrom
python

Conversation

@sethjuarez

Copy link
Copy Markdown
Member

No description provided.

Seth Juarez (sethjuarez) added a commit that referenced this pull request Aug 5, 2026
Picks up the Rust immediate-scalar coercion fix (typra #73).

Verified against the published package, not a local tarball.

Measured on this branch:
  cargo test --no-fail-fast   3 failures -> 2 failures
  tests/property_scalar_coercion_vectors   0 passed/1 failed -> 1 passed/0 failed

The regeneration delta is confined to a single file,
runtime/rust/prompty/src/model/core/property.rs (5 lines): the
integral coercion now precedes the fractional one, and the
gratuitous f32 narrowing is gone. Generated output for Go,
TypeScript, Python, C#, Java and Swift is byte-identical to
0.4.21, so those runtimes cannot have regressed.

Remaining Rust failures are both typra #46 (name-keyed scalar
shorthand does not infer kind/default); revert-checked to confirm
0.4.22 changes nothing about them.

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
The named-collection contract was executed in Rust only. Six backends
loaded and saved these shapes with nothing asserting the behaviour, so
any divergence was silent. This ports the Rust reference suite to Go.

Measured result: 9 of 13 vectors pass; 4 fail. All four failures are the
immediate-scalar inference cases and are a pre-existing emitter defect
(typra #46) that this test newly *reports* rather than introduces. No
other Go suite changes state -- `go test -count=1 ./...` is otherwise
green and `go vet ./model/` is clean.

Go's manifestation differs from Rust's, which is the point of porting it:

  vector requires : kind "string", default "Seattle", example absent
  Go produces     : kind "",       example "Seattle", default absent
  Rust produces   : kind "Seattle"

Go already routes the scalar to a non-discriminator field (it honours
coercionProperty, which resolves to `example`) and *still* fails, because
nothing infers `kind` from the value's JSON type. That makes Go a natural
experiment showing the fix needs two independent parts -- shorthand target
selection AND JSON-type-to-kind inference -- not target selection alone.

Verified: 9 passing roundtrip/rejection vectors plus 4 targeted failures
demonstrate the harness discriminates rather than failing uniformly.

Not verified: the same port for TypeScript, Python, C#, Java and Swift.
Java and Swift have no runtime in this repo.

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
…d models

Second backend port of the named-collection contract, after Go (ba4866e).
The contract previously executed in Rust only.

Measured (npm test, packages/core):
  before  1518 passed / 0 failed
  after   1528 passed / 4 failed   (+10 passing, +4 failing, 14 new)

The 4 failures are the immediate-scalar inference cases -- a pre-existing
emitter defect (typra #46) that this test newly reports rather than
introduces. No other core test changes state.

TypeScript manifests like Rust and unlike Go, which is the value of having
all three executable:

  vector requires : kind "float", default 1.5, example absent
  TypeScript      : kind "1.5"        <- scalar lands in the discriminator
  Rust            : kind "1.5"        <- same
  Go              : kind "", example 1.5

This confirms by execution, not static audit, the reported split where
Rust and TypeScript ignore `coercionProperty` while Go and C# honour it.
Because Go already routes the scalar to a non-discriminator field and
still fails, shorthand target selection alone cannot close this -- a
JSON-type-to-kind inference step is also required.

Two unrelated pre-existing failures exist elsewhere in the workspace and
are NOT caused by this change; verified by removing this file and
re-running those packages, which fail identically:
  packages/openai   listModels leaves unknown models without enrichment
  packages/foundry  listAzureModels does not set modalities

Measurement note: run the TypeScript suite with `npm test`, not a bare
`npx vitest run` from the workspace root. The per-package configs supply
`globals`, so a root invocation reports 154 spurious file-level
"describe is not defined" collection errors.

Not verified: Python, C#, Java and Swift ports of this vector.

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

Third backend port of the named-collection contract, after Go (ba4866e)
and TypeScript (36c9619). The contract previously executed in Rust only.

Measured (dotnet test, Prompty.Core.Tests):
  before  1051 passed /  48 failed  (1099 total)
  after   1060 passed /  52 failed  (1112 total)

+13 tests, +9 passing, +4 failing. The 4 failures are the immediate-scalar
inference cases -- pre-existing emitter defect typra #46, newly reported
rather than introduced. The other 48 failures are unchanged and remain
attributable to typra #53 (fixture generator omits required model-typed
fields).

With four backends now executable, the reported coercionProperty split is
confirmed by execution rather than static audit. All four fail the SAME
four vectors, in exactly two manifestations:

  vector requires        kind "string", default "Seattle", example absent
  C#   (honours it)      example "Seattle"
  Go   (honours it)      kind "", example "Seattle"
  Rust (ignores it)      kind "Seattle"
  TS   (ignores it)      kind "Seattle"

Neither group passes. Backends that already route the scalar to a
non-discriminator declared field still fail, because nothing infers `kind`
from the value's JSON type. This is a cross-backend acceptance gate for
#46: shorthand target selection alone cannot close it.

Harness note for future ports: build loader input with a recursive
JsonElement-to-native conversion (JsonElementToDict/JsonElementToObject,
the convention already used by SpecVectorTests). Passing a
JsonSerializer.Deserialize<Dictionary<string, object?>> result leaves raw
JsonElement values, which the emitted loaders do not traverse -- inputs
then load as empty and all 13 vectors fail misleadingly.

Not verified: Python, Java and Swift ports. 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