feat(compat): enforce project-declared minimum tx3c version from trix.toml#121
Merged
Conversation
….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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
[toolchain]table totrix.tomlso a protocol can declare the minimumtx3cversion it requires:trixenforces it through the existing version-gating path (spawn::compat), which already probestx3c --versionbefore each invocation. A project-declared minimum is a lower bound only: it raises the floor of trix's built-inCOMPAT_MATRIXsupport window but never relaxes its upper bound, so atx3cthat 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.tx3is informative) — a source never travels without itstrix.toml. This mirrors Cargo'srust-version, and checking before spawn avoids any chance of an oldtx3cchoking on newer syntax before it can report the requirement.Changes
config/model.rs—ToolchainConfig { tx3c: Option<String> }+ optionaltoolchainonRootConfig(skipped when absent).spawn/compat.rs—register_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 therun_scoped_commandchokepoint, 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;clippyclean.🤖 Generated with Claude Code