Contributing to Trine

Thank you for helping. Trine's rule is that a feature isn't done until every engine agrees on it and a test holds it there; the steps below are how a change gets there.

Building and testing

cargo build --release
cargo test --release              # every golden, engine, LSP, FFI, Python, packaging and spec test
python3 tools/conform.py          # every program on all engines (add --wasi if wasmtime is installed)
./target/release/trine fuzz --cases 300

tools/release_check.sh runs all of it, plus the benchmark gate and the docs site, the way a release does (docs/RELEASE.md).

Making a change

  1. Say what it is in ROADMAP.md. Tick the item when it's done and add a row to the log: what changed, what it was measured at, what was found on the way.
  2. Keep the engines together. The interpreter is the reference; the VM and native code must print the same output and the same first error line (tools/conform.py). A new built-in goes into all of them (types.rs, interp.rs or sysio.rs, ir.rs, cgen.rs and runtime/trine_rt.h).
  3. Test it. A golden test in tests/golden.rs, or an example with its .out (examples are run on every engine), or a program in tests/errors/ for a new diagnostic (with its code in docs/AGENTS.md).
  4. Measure if it could cost speed. python3 tools/bench.py --instructions compares instruction counts with the baseline and fails at 3%.
  5. Write the docs. The spec (docs/SPEC.md) for syntax and rules, the card (docs/CARD.md) if a newcomer needs it, the topic page otherwise. Docs say what's true now, without history.
  6. Format. trine fmt every .tr file you touch; cargo build must have no warnings.

Compatibility

Trine 1.0 promises what docs/COMPATIBILITY.md says. A change that would break a program that works (tests/compat/ holds a frozen corpus) needs a new edition and a trine migrate rewrite, not a quiet change.

Security

A way for a Trine program to escape the capability model (read a file it wasn't granted, reach the network or the environment without a grant, corrupt memory, or make engines disagree) is a security bug: please report it privately to the maintainers rather than in a public issue (docs/SECURITY.md). Each fixed one gets a case in sandbox_escapes_are_refused.

Licensing

Trine is dual-licensed under MIT and Apache-2.0. Unless you say otherwise, any contribution you submit for inclusion in Trine is licensed the same way, without additional terms.