Skip to content

feat(compat): enforce project-declared minimum tx3c version from trix.toml#121

Merged
scarmuega merged 1 commit into
mainfrom
feat/toolchain-min-version
Jun 8, 2026
Merged

feat(compat): enforce project-declared minimum tx3c version from trix.toml#121
scarmuega merged 1 commit into
mainfrom
feat/toolchain-min-version

Conversation

@scarmuega

Copy link
Copy Markdown
Contributor

Summary

Adds an optional [toolchain] table to trix.toml so a protocol can declare the minimum tx3c version it requires:

[toolchain]
tx3c = "0.22.0"

trix enforces it through the existing version-gating path (spawn::compat), which already probes tx3c --version before each invocation. A project-declared minimum is a lower bound only: it raises the floor of trix's built-in COMPAT_MATRIX support window but never relaxes its upper bound, so a tx3c that is too old for the protocol is rejected before it is ever spawned.

Why the manifest (not an in-source pragma)

An in-source pragma tx3c "X.Y.Z" was prototyped and rejected. A minimum-version requirement is a tooling/build concern, not a language one, and the registry's primary artifact is the lowered TII (the .tx3 is informative) — a source never travels without its trix.toml. This mirrors Cargo's rust-version, and checking before spawn avoids any chance of an old tx3c choking on newer syntax before it can report the requirement.

Changes

  • config/model.rsToolchainConfig { tx3c: Option<String> } + optional toolchain on RootConfig (skipped when absent).
  • spawn/compat.rsregister_project_requirements + folding the project floor into the existing check; pure, testable helpers (evaluate, collect_project_mins). A malformed version string in [toolchain] fails fast.
  • main.rs — register the project's declared minimums at the run_scoped_command chokepoint, before any tool spawn.
  • init.rs — updated config literals.

Tests

7 new unit tests in spawn::compat: project-min as a lower bound; matrix window; project-min raising the floor above the matrix; matrix upper bound still applying when the project min is satisfied; manifest parse / absent-table / invalid-version. Full suite green; clippy clean.

Note: covers the pure decision logic and manifest parsing via unit tests; not exercised against a live installed tx3c (the subprocess plumbing is the pre-existing ensure_supported path).

🤖 Generated with Claude Code

….toml

Add an optional `[toolchain]` table to `trix.toml` so a protocol can declare
the minimum `tx3c` version it requires:

    [toolchain]
    tx3c = "0.22.0"

`trix` enforces it through the existing version-gating path (`spawn::compat`),
which already probes `tx3c --version` before each invocation. A project-declared
minimum is a lower bound only: it raises the floor of trix's built-in
`COMPAT_MATRIX` support window but never relaxes its upper bound, so a tx3c that
is too old for the protocol is rejected before it is ever spawned.

The directive lives in the manifest rather than in `.tx3` source because the
minimum-version requirement is a tooling/build concern, not a language one, and
because the registry's primary artifact is the lowered TII (the `.tx3` is
informative) — a source never travels without its `trix.toml`.

The version decision and manifest parsing are factored into pure helpers
(`evaluate`, `collect_project_mins`) with unit tests; a malformed version string
in `[toolchain]` fails fast at startup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega merged commit 7804beb into main Jun 8, 2026
6 checks passed
@scarmuega scarmuega deleted the feat/toolchain-min-version branch June 8, 2026 12: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