Skip to content

feat(codegen): port client-lib plugin to TII v1beta0#12

Merged
scarmuega merged 7 commits into
mainfrom
feat/codegen-v1beta0
May 20, 2026
Merged

feat(codegen): port client-lib plugin to TII v1beta0#12
scarmuega merged 7 commits into
mainfrom
feat/codegen-v1beta0

Conversation

@scarmuega
Copy link
Copy Markdown
Contributor

Summary

  • Ports .trix/client-lib/ from the legacy bindgen-v1alpha2 data shape to TII v1beta0. The old template silently dropped every transaction against a v1beta0 TII.
  • Generated __init__.py now emits per-transaction Params dataclasses + *_TIR envelopes + Client methods, protocol identity constants (PROTOCOL_NAME, PROTOCOL_VERSION, TARGET_TII_VERSION), an embedded PROFILES map + ENVIRONMENT_SCHEMA, and a Client that accepts a profile selector.
  • Adds sdk/tests/test_codegen.py — a render-fixture test that renders the shared transfer.tii and imports the generated module.

Blocked on

⚠️ Draft. The render-fixture test requires a tx3c release that includes the json helper — tx3-lang/tx3#325. Mark ready once that release is available to CI.

Follow-up

After merge, cut the immutable codegen-v1beta0 tag on this repo (parity-matrix C.4).

Test plan

  • pytest tests/test_codegen.py with tx3c ≥ the json-helper release

🤖 Generated with Claude Code

scarmuega and others added 7 commits May 20, 2026 06:34
The .trix/client-lib plugin still rendered against the legacy
bindgen-v1alpha2 data shape, so every transaction was silently dropped
against a v1beta0 TII. Rewrites the template to consume
tii.transactions / tii.profiles / tii.environment, emits protocol
identity constants and an embedded profile surface wired into the
Client, and adds a render-fixture test that imports the generated
module.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The codegen render-fixture test shells out to `tx3c`; the unit job did
not have it on PATH. Adds the tx3-lang/actions/setup step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The codegen render-fixture test needs the `json` renderer helper, which
ships in the beta channel ahead of stable. Tracks beta until the helper
reaches the stable toolchain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The render-fixture test exercises the .trix/client-lib templates and
tx3c, not the SDK runtime, so it does not belong in the unit job. Marks
it with the `codegen` pytest marker, excludes it from the unit job, and
runs it in a new `codegen` CI job.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The render-fixture check exercises the .trix/client-lib templates and
tx3c, not the SDK runtime, so it should not be SDK test code. Removes
the pytest test and marker and replaces them with a CI-owned shell
script that the `codegen` job runs: it invokes `tx3c codegen` directly,
smoke-checks the generated surface, and imports the output against this
repo's SDK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The codegen check must replicate what a consumer gets: the rendered
output resolves the published runtime SDK at the version its generated
manifest pins. Drops the patch / replace / paths / editable-install
overrides that bound the check to in-repo SDK source. This also exercises
the version pin in the generated manifest itself.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts the codegen job's toolchain setup to the default stable channel.
The check stays red until a tx3c release carrying the codegen `json`
helper reaches stable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega marked this pull request as ready for review May 20, 2026 11:05
@scarmuega scarmuega merged commit d88e97e into main May 20, 2026
2 of 3 checks passed
@scarmuega scarmuega deleted the feat/codegen-v1beta0 branch May 20, 2026 11:05
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