Skip to content

feat: delegate low-level ops to the tx3c binary; drop tx3-* crates#110

Merged
scarmuega merged 3 commits into
mainfrom
feat/delegate-to-tx3c
May 19, 2026
Merged

feat: delegate low-level ops to the tx3c binary; drop tx3-* crates#110
scarmuega merged 3 commits into
mainfrom
feat/delegate-to-tx3c

Conversation

@scarmuega
Copy link
Copy Markdown
Contributor

@scarmuega scarmuega commented May 19, 2026

What

trix no longer links tx3-lang/tx3-tir. Every low-level Tx3 operation is delegated to the tx3c binary as a subprocess; a dependent tool's CLI surface is the versioned contract (driver pattern, cf. cargo↔rustc). cargo tree -i tx3-lang / -i tx3-tir now both error.

  • spawn/compat.rs: per-tool version matrix + ensure_supported(), routed through every external-CLI chokepoint (tx3c, cshell, dolos). Inclusive lower bound; exclusive upper bound derived as the next major (a breaking CLI change must come with a major bump, so same-major releases are accepted). Distinct too-old / too-new messages. TX3_SKIP_COMPAT_CHECK escape hatch.
  • check / inspect tir: delegate to tx3c (build --diagnostics-format json, build --emit tir-json, decode --emit tir-json); diagnostics reconstructed from the JSON contract (terminal output unchanged).
  • codegen: legacy in-process module removed; the tx3c-delegating path is the only one. Output nests under gen/<project>/.
  • Cargo.toml: drop tx3-lang/tx3-tir, add semver.
  • design/004-toolchain-delegation.md: the general "trix drives dependent CLIs as subprocesses" decision (tx3c/dolos/cshell), tool-agnostic.

⚠️ Release ordering — do not merge/tag before tx3 0.18.0

  • Depends on feat(tx3c): add decode verb, emit tir-json and diagnostics-format tx3#324 (the tx3c surface). Compat window is tx3c >= 0.18.0, < 1.0.0; that surface ships in tx3 0.18.0. Confirm the lower bound against the actually published tx3 version before tagging trix.
  • CI must export TX3_SKIP_COMPAT_CHECK=1 until a tx3c >= 0.18.0 is installed (a locally built tx3c still reports the pre-release version). The e2e harness already sets it; a workflow-level export is needed for any path that runs the built trix directly. Remove once tx3 0.18.0 is in CI's toolchain.

Known follow-up (accepted)

CURRENT_CODEGEN_VERSION is flipped to codegen-v1beta0 for the built-in SDK plugins (web/rust/python/go). The SDK repos do not yet ship codegen-v1beta0 bindgen templates — a knowingly-accepted gap to close via a fast follow-up in those repos before a user-facing release.

Out of scope / handoff

The tx3-lang/up channel must pair tx3 0.18.0's tx3c with the next trix so tx3up installs a matched set. Not in this repo.

Verification

  • cargo build; cargo tree -i tx3-lang / -i tx3-tir both error.
  • cargo test: 20 passed, 1 failed — the failure is devnet_starts_and_cshell_connects (dolos binary absent in this env), pre-existing and unrelated; expected green in CI where dolos is present.
  • Compat boundaries verified: tx3c 0.17.0 → too-old; 0.18.0 / 0.19.0 / 0.99.0 → ok; 1.0.0 → too-new.
  • inspect tir (project + interface) byte-identical to direct tx3c; check reproduces analyzer codes/messages and exit status.

🤖 Generated with Claude Code

scarmuega and others added 3 commits May 19, 2026 09:32
trix no longer links tx3-lang/tx3-tir. Every low-level Tx3 operation is
delegated to the tx3c binary as a subprocess; the tx3c CLI surface is the
versioned contract (driver/compiler split, cf. cargo<->rustc). This
decouples trix's release cadence from the toolchain's.

- spawn/compat.rs: per-tool version-window matrix + ensure_supported(),
  routed through every external-CLI chokepoint (tx3c, cshell, dolos).
  tx3c window is >= 0.18.0, < 0.19.0 (the release introducing decode /
  --emit tir-json / --diagnostics-format). TX3_SKIP_COMPAT_CHECK escape
  hatch for developing/CI against an unreleased toolchain.
- check / inspect tir: delegate to tx3c (build --diagnostics-format json,
  build --emit tir-json, decode --emit tir-json); diagnostic rendering
  reconstructed from the JSON contract.
- codegen: remove the in-process legacy module; the tx3c-delegating path
  is the only one. Built-in SDK plugins pinned to codegen-v1beta0.
- Cargo.toml: drop tx3-lang/tx3-tir, add semver.
- tests/e2e: nested codegen layout, ungate codegen_deps, skip-compat in
  the harness.
- design/004-toolchain-delegation.md: records the architecture.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- design/004: reframe as the general "trix drives dependent CLIs as
  subprocesses" decision (tx3c/dolos/cshell), not tx3c-specific.
- spawn/compat: drop the stored `before`; the exclusive upper bound is
  derived as the next major (`min.major + 1`.0.0). A breaking CLI change
  must come with a major bump, so trix accepts any same-major release and
  no longer needs an update per dependent-tool minor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`cargo clippy -- -D warnings` (the CI lint step) rejected the long-standing
unused `use trix::{builder, devnet, dirs, home, spawn, wallet}` imports in
the bin root. Only cli/commands/config/global/telemetry/updates are used.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega merged commit 04d3261 into main May 19, 2026
6 checks passed
@scarmuega scarmuega deleted the feat/delegate-to-tx3c branch May 19, 2026 15:18
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