本文へ移動

仕組み

ADR-0001: T0 Lang is its own Cargo workspace; TTT hosts it through a bridge crate

これらのページは英語です。仕様は一つの言語で保つことで、一つのことだけを語ります。

Status: accepted (2026-10-09)

Context#

T0 Lang must be maintained independently of TTT (own versioning, tests, docs, releases) while TTT is where users run it. The repository already holds independent build units (data-engine/ is a separate Cargo workspace with no path dependency on the terminal). Pushing to GitHub is blocked in this environment, so creating a second remote repository is not something that can be done or verified here.

Decision#

  • t0-lang/ at the repository root is a separate Cargo workspace. It has no dependency on any trading-terminal crate, and the dependency direction is one-way: TTT depends on T0, never the reverse.
  • The TTT side of the integration (the host bridge) is a crate inside the terminal workspace, trading-terminal/crates/t0-host. It depends on the T0 crates by path and on TTT's own crates. TTT's UI uses it from terminal-app; terminal-ui only gets plain display data.
  • The workspace can be split into its own repository later with git subtree split --prefix t0-lang and consumed as a git submodule (the website/ precedent); nothing in it refers outside t0-lang/.

Alternatives#

  • A new GitHub repository now -- cannot be created or pushed from here; a submodule pointing at an unpublished repository would break every clone.
  • Crates inside trading-terminal/ -- the language would share the terminal's lockfile, lints and release cadence, and nothing would stop a compiler crate from importing a terminal crate.

Consequences#

  • Two lockfiles. The T0 crates use only serde, serde_json, sha2 beyond std, which keeps version friction with the terminal small.
  • A test in t0-host checks the manifest it publishes against the contract snapshot committed in t0-lang/contracts/ so the two sides cannot drift silently (ADR-0006).

Revisit when#

The language gets a second host or external users: then split the repository and publish versioned crates.