Skip to content

how to contribute tooling

bondiano edited this page Nov 12, 2026 · 1 revision

Repository tooling

The repository has three build surfaces: the Rust workspace, the pnpm dashboard and the npm documentation site. Generated contracts connect Rust to the dashboard; pinned analysis tools are a separate runtime concern from developer lint commands.

Toolchain and manifests

Surface Authoritative source Selection
Rust rust-toolchain.toml, Cargo.toml, Cargo.lock Rust 1.94.1, Rust 2024 workspace; locked dependencies
Repository runner justfile, .github/workflows/ci.yml CI uses just 1.59.0
Dependency hygiene .github/workflows/ci.yml cargo-machete 0.9.2
Dashboard web/package.json, web/pnpm-lock.yaml pnpm 12.16.1; Node `^22.18.0
Documentation site site/package.json, site/package-lock.json npm; CI Node 24

The CLI package is sych-app, but the binary is sych at crates/sych-app/bin/sych.rs. See CLI.

Root recipes

Command Purpose
just build cargo build --workspace --locked
just run --help Run the sych binary through Cargo with locked dependencies
just fmt Rustfmt all workspace sources
just style-fix Apply the house-style blank-line fixer, then rustfmt
just lint Format check, machete, Clippy and the house-style checker
just test Workspace unit, integration and documentation tests with all features
just web-check Frozen pnpm install and complete dashboard check
just web-fmt Dashboard formatting and lint fixes
just check lint, test, then web-check
just test-postgres Opt-in application/storage contracts plus ignored PostgreSQL cases
just schemas Bless generated JSON Schema and OpenAPI contracts

The exact commands and environment caveats are in Testing. crates/sych-style/src/lib.rs is a repository AST style tool; it is not the multi-language fact-producing reviewer linter described in Facts.

Contract generation

flowchart LR
    DTO["Rust DTOs and API contract"] --> Tests["contracts generated_ tests"]
    Tests --> Schema["schemas/*.schema.json and openapi.json"]
    Schema --> Gen["web: pnpm gen:api"]
    Gen --> Client["Api/schema.gen.d.ts"]
    Client --> Check["Types, tests and build"]
Loading
  1. Change the DTO/schema registration or OpenAPI contract in crates/sych-core/src/schema.rs, crates/sych-core/src/api.rs and its modules under crates/sych-core/src/api/ as appropriate.
  2. Run just schemas, which invokes SYCH_BLESS=1 cargo test --locked -p sych-core --test contracts generated_.
  3. Review the generated schema/OpenAPI changes, including compatibility/version behavior.
  4. Run pnpm gen:api in web/; just web-check also does this automatically.
  5. Run the normal contracts without blessing and the full check.

crates/sych-core/tests/contracts.rs compares output to committed files and verifies OpenAPI references and path parameters. The generated declaration is web/src/modules/Api/schema.gen.d.ts; do not edit it by hand. New HTTP routes still need explicit handler registration and authorization in crates/sych-app/src/server/mod.rs, not merely a schema entry. See API.

Dashboard and site tools are not interchangeable

web/package.json uses openapi-typescript, Oxlint, ESLint/FEOD, Prettier, vue-tsc, Vitest and Vite. web/vite.config.ts fixes /ui/ and proxies /v1 and /auth to SYCH_URL or the default local server. See Frontend development for module boundaries.

site/package.json uses npm run sync, npm test, npm run dev, npm run build and npm run preview. site/pages.mjs selects published guides; site/scripts/sync-docs.mjs rewrites/validates repository links and copies assets. Edit docs/, not synchronized content under the site build tree. The wiki under droid-wiki/ is not the Pages publication input. See Documentation website.

Runtime analysis tooling

crates/sych-adapters/src/tools/mod.rs loads crates/sych-adapters/src/tools/pinned.json and crates/sych-adapters/src/tools/indexers.json. Downloads/build inputs are versioned and checked, with owned npm lockfiles and scripts disabled for those installs. Unsupported versions/platforms produce explicit limitations rather than silently using an executable from PATH.

These tools include language servers, linters and easement/indexers. They are not installed by cargo machete, and a developer's global linter version does not replace the pinned runtime version. First semantic use can require network/cache space; Rust semantic analysis also needs Cargo. Tool downloads have their own bounds, separate from review model budgets.

sych semantic gathers facts without models. sych doctor checks availability without paid calls by default; see Debugging. Dependency installation and isolated execution have additional policy/sandbox requirements, not implied permission to run reviewed repository scripts.

Finite large-PR measurement

scripts/large-pr-bench [RUNS] is a paid, finite experiment, not a watch process, CI requirement or deployment load test. It runs the cases in eval/quality/large/ through eval measure; the default is two reviews per case, and the underlying CLI accepts 1–10 repeats.

It clones/fetches Sych and Runlark, creates local worktrees and deterministic planted commits from eval/bench/plants/, copies the selected config and price catalog, migrates a dedicated SQLite database and writes measurement artifacts. Run it only with authorization for network access, local Git/cache changes and model spending.

scripts/large-pr-bench 1

The script requires SYCH_OPENROUTER_API_KEY; use an account/key with a spending limit. It also needs Git, jq, Python 3 and either Cargo or a supplied SYCH_BIN.

Setting/output Meaning
SYCH_BENCH_CACHE Clone cache; default ~/.cache/sych-bench
SYCH_BENCH_OUT Result directory; default timestamped runs/ under the cache
SYCH_BENCH_CONFIG Alternative config; default eval/bench/sych.yaml
SYCH_BIN Existing executable instead of Cargo-running this checkout
report.json Quality-measurement report
outcomes.jsonl, stats.json Execution outcomes and derived per-run statistics
migrate.log, measure.log Command output for investigation

The checked-in benchmark analysis budget is 3,000,000 micro-USD, 60 attempts, at most four parallel calls and a 900-second active deadline, with separate tour and tenant caps in eval/bench/sych.yaml. These are configured bounds, not a predicted bill or total wall-clock guarantee; clone/build/preparation time is separate.

Reported fields include execution outcome, failed passes, coverage, matched/expected findings, attempts, output-bound hits, maximum reported reasoning tokens, known cost and unknown-cost attempts. The script's seconds is the span between recorded model-attempt timestamps, not full end-to-end latency. Reaching an output bound is treated as a truncation signal even if the provider's finish reason differs.

Compare repeated runs with the same cases/config and inspect failures and unknown charges. Do not call PLAN_EXECUTED complete scope coverage: generated/excluded files can still produce gaps. No benchmark was executed and no performance or quality score is asserted in this wiki.

Automation and release tools

Source Responsibility
.github/workflows/ci.yml Rust/dashboard checks, disposable PostgreSQL and Sych CI reports
.github/workflows/pages.yml npm site tests/build and Pages deployment
.github/workflows/image.yml Main-only reviewer image build and digest reporting
.github/workflows/release.yml Tagged native CLI archives/checksums, draft release and image tag
scripts/wait-sych Bounded current-head review wait after an authorized push

Follow Development workflow rather than treating automation commands as authorization to publish. Runtime installation and durable-state handling are in Deployment.

Clone this wiki locally