> Every Taji docs page as Markdown: https://docs.taji.is/llms.txt

# Checks a change needs

Source of truth: the `Makefile`, the headers of `engine/crates/taji/scripts/*.sh` and `.github/workflows/ci.yml`; each command's own flags stay in [`AGENTS.md`](https://github.com/TajiAI/Taji/blob/main/AGENTS.md#commands), and `paths_resolve` in `engine/crates/taji/tests/docs.rs` holds the paths here. Find your change in the table below and run its row before you push: CI runs only on a `v*` tag and a maintainer's dispatch, never on a push to `main` or a pull request.

## Build the kernel

Every gate boots the kernel, and the page is embedded at compile time, so build the page first. `make setup` installs the rest (Node packages, the headless browsers, `.python`).

```sh
make setup
pnpm --filter @taji/ui build
cargo build -p taji-open
```

## Format and lint

Rust, in the repo root, `substrate/`, `substrate/taji-indicators-wasm/`, `plugins/outsider` and `plugins/keyed`. The last three are their own workspaces, so no workspace run reaches them, and their clippy takes `--locked --all-targets -- -D warnings` without `--workspace`.

```sh
cargo fmt --all --check
cargo clippy --locked --workspace --all-targets -- -D warnings
```

TypeScript: `make lint` (Biome's `useExhaustiveDependencies`, `useHookAtTopLevel` and `noImportCycles`; per-file counts in `scripts/lint-baseline.json` only fall).

`make check` runs what CI runs on Linux in one command: the page and kernel builds, fmt and clippy in the root, `substrate/`, `plugins/outsider` and `plugins/keyed`, `cargo test --locked --no-fail-fast --workspace` in the root and `substrate/`, `make test type-check lint`, and `python_gate.sh`.

## By what you changed

| You changed | Run | Needs |
|---|---|---|
| The kernel (`engine/crates/`), the order path, `substrate/` | `cargo test -p <crate>` while you work; before a push, `cargo test --workspace`, also in `substrate/`. A new `pub` item in `taji-trading` is listed in its `tests/dependency_audit.rs`. Never `-- --ignored` across a workspace: the vendor legs rest a paper order wherever a key is found | The Rust toolchain |
| A wire route or answer (`engine/crates/taji/src/wire/`) | `cargo test -p taji --lib wire::`. Every route is a row of `wire/mod.rs`'s `//!` header (`every_dispatched_route_literal_is_in_the_header`). A new trading verb with no gate is named in `routes.rs` `STAGED` or `REGROUPS`, and a request type an answer shares takes `#[serde(deny_unknown_fields)]` (`answers_are_open_and_bodies_closed`). A new route is claimed by a flow's `COVERS` in `engine/crates/taji-open/tests/headless/`: `cargo build -p taji-open --example headless`, then `cargo test -p taji-open --test headless coverage::completeness` (the suite runs that example, which `--test` never rebuilds) | A stale fixture needs [its rewrite](#rewrite-a-stale-wire-fixture) |
| The plugin contract (`schema/taji.json`, `taji-plugin`, a manifest) | `cargo test -p taji-plugin` (pins the schema's hash and version; a breaking change bumps it: [Compatibility](https://docs.taji.is/reference/compatibility.md)); `plugin_gate.sh`; `outsider_gate.sh` when the schema moves | The gates' [needs](#gates); `outsider_gate.sh` builds its plugins offline against `schema/taji.json` alone |
| A provider (`plugins/<id>`) | `cargo test -p <name>` (mostly `taji-<id>`) and `cargo test -p taji --lib coverage` (it counts every provider's rows); a product no provider served before is a route, claimed as the wire row says; where `plugins/<id>/tests/live.rs` exists, `cargo test -p taji-<id> --test live -- --ignored --test-threads=1`. Then [the fixture](#rewrite-a-stale-wire-fixture): coverage is read off the adapter and the README's measured sections | The live suite needs that vendor's key; with none, report it skipped |
| A pane or the window (`ui/`, `window/`, `packages/`, `plugins/*/ui`) | A pane reading a platform product is a `PANELS` and a `FIRST_PAINT` row of `engine/crates/taji/src/wire/coverage/panels.rs` (`cargo test -p taji --lib coverage`, then [the fixture](#rewrite-a-stale-wire-fixture)); `make test` (ends with every phone scene in Playwright's iPhone WebKit, WebGPU and `gl=1` WebGL2; a real iPhone is the owner's gate), `make type-check`, `ui_gate.sh`; a landing that touches `.ts` or `.tsx` also `make lint`. A package's tests run as its script does, `bun test --isolate`: bare `bun test plugins/chart/ui` fails on Happy DOM's double registration. New surfaces start as scenes ([UI](https://docs.taji.is/contribute/ui.md)) | `make setup`'s headless browsers; `ui_gate.sh` also Chrome with a GPU |
| A scene's mounts, accessibility, preferences or phone touch | `pnpm --filter @taji/ui mock:app:reach <out dir> [--scenes <glob>]`: clean mounts, axe, preferences and phone touch per scene; the exit code is the FAIL count | Chrome |
| The top bar | `pnpm --filter @taji/ui mock:app:toolbar [scene id...]`: the bar's fold at every window width | Chrome |
| The chart's speed | `pnpm --filter @taji/ui mock:app:perf <out.json>`: frames, first paint, chart idle wakes, tick commits; in `ui_gate.sh` | Chrome with a GPU |
| Styling that moves across scenes (the cascade-layer batch) | `bash ui/mock/app/eiddiff.sh <base-rev> <dir>`: both revisions are dumped on one machine, and `<dir>/diff.tsv` must hold no unexplained row | `<base-rev>` in this repo's history: it adds a worktree under `<dir>` and removes it after |
| The check harness (`ui/mock/app/check.ts`, `checkNow` in `ui/mock/app/scenes.ts`) or a stock renderer (`packages/plugin/layer/stock/`) | `taji plugin check` on every plugin holding `golden/` (`taji-darkpool`, `taji-gex`, `taji-orderflow`, `taji-sectors`), re-blessed in the same commit, with what moved said in its message | The built kernel's `taji` |
| The MCP bridge, registration or the skill (`agent/`) | `make test`, `make type-check`; `register_gate.sh` when `agent/src/register.ts` changes | The built kernel |
| Python (`substrate/taji-python`, a plugin's Python worker) | `python_gate.sh` | `make setup`'s `.python`; `GATE_ONLINE=1` also dials PyPI |
| Docs (`docs/`, `docs-site/`, a `README.md`, a plugin page) | `cargo test -p taji --test docs` and `cargo test -p taji --test legacy_words`; `pnpm --dir docs-site exec node --test test/anchors.test.ts` checks every `#fragment` without a build; `make docs` for a change under `docs/` or `docs-site/`, after `make docs-capture EXAMPLE=<dir>` for an example you changed. `docs/reference/coverage/` is generated: change its source, then [rewrite the fixture](#rewrite-a-stale-wire-fixture) | `make docs`: the network for `pnpm install`. `make docs-capture` builds nothing: the kernel built, `ui/dist` (and `window/dist` for a pane's shot), `.python`, `jq`, `bun` and the network, no key |
| A dependency (`Cargo.toml`, `Cargo.lock`) | `cargo deny check` and `cargo vet --locked` in the changed workspace, at `ci.yml`'s versions. Commit `Cargo.lock`: CI builds `--locked` | `cargo-deny` 0.22.1 and `cargo-vet` 0.10.3 (`cargo install --locked`) |
| Packaging (`engine/crates/taji/scripts/stage.sh`) | `cargo test -p taji --lib resources`; `stage.sh digest <dir>` prints the digest; `stage.sh check <dir>` exits 1 on a tree missing a licence notice, a `bin/` file's or the Python runtime's (`python3 notices_test.py` tests it and `notices.py`, `python3 stage_check_test.py` the Python notices); `secret_scan.sh <dir>` exits 1 on a tree holding a secret | A staged tree, `<dir>` |

## Gates

Gate scripts are in `engine/crates/taji/scripts/` and exit non-zero on failure, most with the count of failed checks. A gate's header says what it boots and checks. Each boots a headless kernel on throwaway state, store and Taji home; `KERNEL` names the binary and defaults to the workspace's debug `taji`.

| Gate | Checks | Needs |
|---|---|---|
| `desk_gate.sh` | the binary keeps a desk across a quit | the built kernel; builds nothing |
| `matrix_gate.sh` | every frozen row of `tests/fixtures/matrix.tsv` is still in `GET /read/data/coverage`, and an unlinked provider answers 422 `not_linked` | the built kernel, `jq` |
| `frame_gate.sh` | installed plugins' window halves, framed | the built kernel, `bun`, headless Chromium |
| `ui_gate.sh` | the window: the bundle, the routes a browser asks for, the embedded copy, the chart's speed budgets | builds the page, then `cargo build -p taji-open` itself; Chrome with a GPU for the budgets |
| `plugin_gate.sh` | the plugin seam, proven by `plugins/hello`; runs `process_gate.sh`, then `cargo test -p taji --lib plugin` and `make test` | builds what it boots; headless Chromium |
| `process_gate.sh` | a process plugin: its row, its sandbox, a restart after `kill -9` | `cargo build -p taji-open -p echo -p probe` first |
| `outsider_gate.sh` | plugins built and run as an outsider builds them | the built kernel; a check needing a regular US session SKIPs outside one |
| `plugin_install_gate.sh` | installing a plugin from a signed registry | `cargo build -p taji-open -p echo` first; headless Chromium |
| `register_gate.sh` | agent registration on every platform it detects, the bridge's nine tools | the built kernel; builds nothing |
| `python_gate.sh` | Python as a confined process, and the unit tests of `read_gate.py`, `ws_gate.py`, `frame_scrub.py`, `agent_walk.py` and `remote_walk.py` | `make setup`'s `.python` |

## Rewrite a stale wire fixture

`the_wire_fixture_is_the_kernels` (`cargo test -p taji --lib wire::`) fails, naming the fix, when a route, answer type or coverage moves:

```sh
cargo test -p taji --lib wire::fixture::write_the_wire_fixture -- --ignored
```

It rewrites `engine/crates/taji/tests/fixtures/wire/*.json`, `schema/wire.json` and `docs/reference/coverage/`. Then:

1. Read `git diff schema/wire.json`: declare every change ([Contributing](https://github.com/TajiAI/Taji/blob/main/CONTRIBUTING.md#api-changes)).
2. `pnpm --filter @taji/wire gen` regenerates `packages/wire/wire.ts` (`make test` fails while stale); `make type-check` then catches a client a changed type breaks.
3. Commit them with it.

## What CI covers

[`.github/workflows/ci.yml`](https://github.com/TajiAI/Taji/blob/main/.github/workflows/ci.yml) runs on a `v*` tag and a maintainer's dispatch, never on a push to `main` or a pull request: until then these checks are yours. `release.yml` signs the installers on a `v*` tag and runs no tests.

| Check | CI | You |
|---|---|---|
| `cargo fmt --check`, `cargo clippy -D warnings` | `lint`, both workspaces and `taji-indicators-wasm`; clippy also on macOS and Windows x64, for their own code | [Format and lint](#format-and-lint) |
| `cargo test --locked --workspace` | macOS and Linux, both workspaces; `taji-indicators-wasm` on Linux | the kernel row, wire, schema and docs tests included |
| `cargo test --locked --workspace`, `make test`, `make type-check`, a clean tree on Windows x64; `taji-host`'s sandbox suite on Windows arm64 (`windows.yml`, called by `ci.yml`) | `windows` | those rows, on Windows |
| `make test`, `make type-check` | macOS and Linux | the pane row |
| `make lint` | Linux | the same |
| A clean tree after tests | Linux (`git diff --exit-code`) | `git status` after the fixture rewrite |
| `cargo deny check`, `cargo vet --locked` | `licences`, both workspaces | the dependency row |
| The Tailscale sidecar (`plugins/tailscale/sidecar`): `go mod verify`, `go mod tidy -diff`, `go vet`, `go test -race`, a build for each release target, `govulncheck` | `sidecar` | those commands there |
| zizmor and actionlint over the workflows | `workflows` | none |
| osv-scanner over `pnpm-lock.yaml`, both `requirements.lock`, `go.mod`; `cargo deny check advisories` in all five Cargo workspaces | `advisories` | none |
| `python_gate.sh` offline (no `GATE_ONLINE`), `desk_gate.sh`, `register_gate.sh` | macOS and Linux | the Python, pane and agent rows |
| `pnpm --filter @taji/ui mock:app:reach <dir> --scenes 'connections,look-*,watchlist-*,alert-*,ticket-*'` (a sample of the scenes; exit = FAIL count) | `scenes`, Linux | the scene row, over the scenes you touched |
| `plugin_gate.sh` (which runs `process_gate.sh`), `outsider_gate.sh`, `plugin_install_gate.sh`, `frame_gate.sh`, `ui_gate.sh` | macOS | the plugin and window rows |
| Live suites, `python_gate.sh` with `GATE_ONLINE=1` | not run | the provider and Python rows |

No pixel baseline is committed: pixels depend on the machine and the Chrome build, and the `scenes` job runs a sample, not every scene.

## Walks

A walk is never a gate: it needs your keys, devices or a headed Chrome, and (`ui_walk.sh` apart, which boots a keyless kernel) drives a kernel you started. Its header holds its steps and what it needs; it prints numbered PASS/FAIL checkpoints and exits with the FAIL count.

| Walk | Drives |
|---|---|
| `agent_walk.py`, `panel_walk.py` | the MCP tools through your agent; the Agent panel's routes |
| `channels_walk.py`, `voice_walk.py`, `remote_walk.py` | the Discord channel, the voice provider, the public address |
| `ui_walk.sh` | the pages, shot |
| `engine/crates/taji-open/scripts/vendor_live.sh` | every vendor's live legs (no key: SKIP) |
| `engine/crates/taji-open/scripts/economic_walk.py`, `lookup_probe.py` | `get/economic`; each vendor's contract-lookup claims |
| `plugins/<id>/scripts/<id>_walk.py` | one provider: edgar, ibkr, massive, robinhood-web (`robinhood_web_walk.py`), schwab, tradestation, tradovate. Schwab accounts are live: its `order` phase runs only on your yes |

## See also

- [`AGENTS.md`](https://github.com/TajiAI/Taji/blob/main/AGENTS.md#commands): every command's flags
- [Compatibility](https://docs.taji.is/reference/compatibility.md): what a breaking change bumps
- [The window's UI](https://docs.taji.is/contribute/ui.md): scenes and the window's rules
- [Writing Taji docs](https://docs.taji.is/contribute/docs.md): the tests that hold a page
