Skip to content

Conformance waiver removal: Go providers (#490) + normalize-script cleanup (#485) - #498

Merged
Seth Juarez (sethjuarez) merged 3 commits into
mainfrom
sethjuarez/conformance-waiver-removal
Aug 23, 2026
Merged

Conformance waiver removal: Go providers (#490) + normalize-script cleanup (#485)#498
Seth Juarez (sethjuarez) merged 3 commits into
mainfrom
sethjuarez/conformance-waiver-removal

Conversation

@sethjuarez

Copy link
Copy Markdown
Member

Summary

Part of the conformance-waiver-removal effort. This branch lands two completed, verified issues and documents findings on the rest. No issues are auto-closed (Refs, not Closes) — closing is left to review.

Committed & verified

Investigated → documented (no code in this PR)

Deferred (environment/scope)

Test plan

  • schema: regen (npm run generate) produces zero drift with the restoreGoModelImport workaround removed.
  • runtime/go: go build ./... && go vet ./... && go test ./... green.

typra#262 shipped in @typra/emitter@1.0.1: the Go test emitter now
preserves the `prompty/model` import in generated `package prompty_test`
files natively. Verified empirically — a raw `tsp compile` (no normalize)
produces zero Go drift and zero `_test.go` files missing the import, and
`go build`/`go vet`/`go test ./model/...` all pass after removing the
workaround. Delete the obsolete `restoreGoModelImport` call and function.

The `restoreSwiftPackageResources` workaround is intentionally left in
place: it remains load-bearing (see follow-up on #485).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 911c4d26-ea96-42cf-a022-47e29fc9df73
The old comment claimed this workaround could be removed "once #260 ships
and the emitter preserves the stanza natively." #260 shipped in
@typra/emitter@1.0.1 as the `test-resources` option, but that option only
attaches resources to the Swift *test* target. The main PromptyModel
target's `Bundle.module` is required by the public `Discovery` API in
production source (Sources/PromptyModel/Discovery.swift), and SwiftPM only
synthesizes `Bundle.module` for a target that owns resources.

Verified empirically: mirroring `test-resources` (resources on the test
target only) makes `swift test` fail to compile the main target with
"type 'Bundle' has no member 'module'". The emitter exposes no main-target
resources option, so this re-injection stays load-bearing. Rewrite the
comment to record this constraint and point fully removing it at the Swift
split-package work (#487).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 911c4d26-ea96-42cf-a022-47e29fc9df73
Go previously shipped only the jinjasubset/model/vectoradapters packages —
no provider/executor layer and no real API client. Add a hand-written
`providers` package that plugs into the model's conformance-tested wire
pipeline, matching the C# provider set.

Design: executors stay thin. Each Execute builds the canonical wire-input
map via providers.BuildInput(agent, messages, wireFamily), delegates body
construction to model.BuildWireRequest, resolves the connection, and POSTs
via providers.PostJSON. Processors delegate to model.ProcessResponse. The
HTTP transport is intentionally outside the conformance surface (vectors
exercise BuildWireRequest/ProcessResponse directly), so parity here means:
implement the Executor/Processor interfaces, map Agent -> wire input,
resolve connections, register by provider key, and format tool-call turns.

Packages:
- providers            registry (Register/Get Executor+Processor, RWMutex),
                       BuildInput, messagesToWire (media Source->value),
                       ResolveConnection, PostJSON, FormatChatToolMessages.
- providers/openai     key "openai"; Bearer auth; OPENAI_API_KEY fallback;
                       chat/embeddings/images/responses path dispatch.
- providers/anthropic  key "anthropic"; x-api-key + anthropic-version;
                       ANTHROPIC_API_KEY fallback; rejects reference conns;
                       Anthropic tool-turn shape (assistant content blocks +
                       batched user tool_result).
- providers/foundry    key "foundry"; Azure deployment URL + api-version +
                       api-key header; keyless path uses
                       AZURE_OPENAI_ACCESS_TOKEN bearer against /openai/v1;
                       AZURE_OPENAI_ENDPOINT/API_KEY fallbacks.

Media parts map their Source field to the "value" wire key the builders
consume (not .Save()'s "source"), matching model/wire.go's contract.

Tests use httptest to assert URL/path, auth headers, and request body per
provider, plus registry wiring, connection resolution, tool-message
formatting, and streaming-unsupported errors. No real API calls.

go build/vet/test ./... all green.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 911c4d26-ea96-42cf-a022-47e29fc9df73
@sethjuarez
Seth Juarez (sethjuarez) merged commit 36e5d84 into main Aug 23, 2026
16 checks passed
@sethjuarez
Seth Juarez (sethjuarez) deleted the sethjuarez/conformance-waiver-removal branch August 23, 2026 22:16
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