Repository navigation
how to contribute testing
Sych separates deterministic correctness contracts from model-quality measurements and live integration probes. The normal check includes Rust and the Vue dashboard; PostgreSQL, the public documentation site and environment-dependent integration cases have separate entry points.
From the repository root, run just check. Its exact expansion in justfile is:
| Recipe | Commands, in order |
|---|---|
lint |
cargo fmt --all --check; cargo machete; cargo clippy --workspace --all-targets --all-features --locked -- -D warnings; cargo run --locked -q -p sych-style -- crates
|
test |
cargo test --workspace --all-features --locked |
web-check |
In web/: pnpm install --frozen-lockfile && pnpm check
|
web/package.json expands pnpm check to API generation, Oxlint/ESLint, Prettier check, vue-tsc --build, vitest run and vite build, in that order. A Rust-only test run or frontend build is not the complete check.
Rust is pinned to 1.94.1 in rust-toolchain.toml; CI installs cargo-machete 0.9.2 and just 1.59.0. Dashboard prerequisites are pnpm 12.16.1 and Node ^22.18.0 || >=24.12.0; CI uses Node 24. See Tooling.
| Boundary | Examples and harness |
|---|---|
| Planner, reducer and context |
crates/sych-core/tests/review.rs, crates/sych-core/tests/reduce.rs, crates/sych-core/tests/broker/, crates/sych-core/tests/analysis/
|
| Git and fact adapters |
crates/sych-adapters/tests/git_snapshot/, crates/sych-adapters/tests/ci_reports.rs, crates/sych-adapters/tests/lint.rs, crates/sych-adapters/tests/easement.rs
|
| Application analysis |
crates/sych-app/tests/analysis.rs, crates/sych-app/tests/checkpoints.rs, crates/sych-app/tests/verify_search.rs, crates/sych-app/tests/test_integrity.rs
|
| Server state machine and HTTP |
crates/sych-app/tests/world/mod.rs, crates/sych-app/tests/http/mod.rs, crates/sych-app/tests/server.rs, crates/sych-app/tests/api.rs
|
| Persistence and recovery |
crates/sych-storage/tests/finalize.rs, crates/sych-storage/tests/ledger.rs, crates/sych-storage/tests/retention.rs, crates/sych-storage/tests/upgrade.rs
|
| Dashboard display and requests |
web/src/modules/Runs/__tests__/report.spec.ts, module component specs, common utility specs |
Focused examples:
cargo test --locked -p sych-core --test contracts
cargo test --locked -p sych-app --test outbox
cargo test --locked -p sych-storage --test upgrade
cd web
pnpm exec vitest run src/modules/Runs/__tests__/report.spec.tsThe server world harness uses a loopback GitHub fake, a local file:// Git origin, migrated storage, fake models and a controlled per-thread clock. HTTP tests bind a real loopback listener. Tests can simulate a push, late CI, lost reply, restart, revoked lease or changed permission without paying for inference or relying on GitHub timing. This is not a recorded live GitHub end-to-end test. See Server.
The normal workspace suite defaults to SQLite. CI also requires:
SYCH_TEST_POSTGRES_URL=postgres://postgres:sych-test@127.0.0.1:55432/postgres just test-postgresUse a disposable local PostgreSQL admin database, never production. The recipe first checks that the variable is set, then runs:
cargo test --locked -p sych-storage -p sych-app --tests -- --test-threads=1
cargo test --locked -p sych-storage --test postgres -- --ignored --test-threads=1crates/sych-storage/tests/support/database.rs, also reused by the app world harness, accepts only loopback/localhost URLs targeting /postgres with restricted connection parameters. It creates a uniquely named database from template0 for each owned test context and drops that database afterward. The account needs database-creation/deletion permission. The guard does not turn a valuable local cluster into a disposable one.
The explicitly ignored PostgreSQL cases cover SQLite import, data/identity rollback, real consumers, concurrent budget reservations/job claims, lease fencing and a GC pin race. SQLite-specific upgrade/PRAGMA cases still test SQLite. .github/workflows/ci.yml uses PostgreSQL 18.6 pinned by image digest and runs both recipes; just check alone does not run these ignored cases.
Fixtures describe expected behavior, including intentionally malformed or unsafe inputs:
| Corpus | Contract |
|---|---|
fixtures/core/ |
Old documents, version rejection and stable canonical hashes |
fixtures/config/ |
Configuration parsing/validation examples |
fixtures/git/ |
Snapshot scenario data |
fixtures/ci/ |
Report normalization, limits, malformed SARIF, XML/XXE refusals and path handling |
fixtures/publication/ |
Exact anchor placement and summary/inline golden text |
fixtures/review/ |
Scripted review bundles |
fixtures/storage/v2-seed.sql |
Upgrade preserves runs, artifact pins and unknown charges |
crates/sych-core/tests/contracts.rs checks old-fixture round trips, required schema versions, rejection of unknown majors, required UNKNOWN details, canonical hashes, generated JSON Schemas/OpenAPI and internal OpenAPI references/path parameters. Regenerate intentionally with:
just schemas
cd web
pnpm gen:apijust schemas sets SYCH_BLESS=1 only for the generated_ contract tests. Review the output in schemas/; do not hand-edit generated schemas or the client declaration at web/src/modules/Api/schema.gen.d.ts. Normal tests compare generated content to committed contracts.
web/vitest.config.ts uses jsdom and excludes e2e/**. The committed frontend suite is unit/component/helper testing, not a browser E2E suite or a coverage-percentage gate. Static-serving/auth/API trust boundaries also have Rust tests in crates/sych-app/tests/ui.rs, crates/sych-app/tests/auth.rs and crates/sych-app/tests/api.rs. More details are in Frontend development.
The public documentation site is separate and uses npm:
cd site
npm ci
npm test
npm run buildsite/scripts/sync-docs.test.mjs tests title conversion, guide/repository links, images, preserved code/external links, missing-link refusal and install-prompt parity with README. The build synchronizes docs/ through site/scripts/sync-docs.mjs before Astro. .github/workflows/pages.yml runs these checks for relevant PRs and deploys only eligible main builds. Site tests/build are not included in just check. See Documentation website.
sych eval run --suite eval/smoke.yaml --models fake
sych eval validate --suite eval/quality/devcrates/sych-app/src/eval.rs builds temporary Git repositories and storage, disables semantics and uses scripted fake replies from eval/fake/. eval/smoke.yaml checks supported/violated/unknown/not-applicable behavior, rejection of author claims as proof and empty scope. It makes no model calls.
crates/sych-app/src/quality/mod.rs validates labels, safe/unsafe/unknown variants, scenario pairs, exact source anchors and expected/forbidden syntax facts. Repository-backed cases require --repo NAME=PATH; absent fixture repositories are reported as skipped, not passed model tests.
The empty public holdout split is intentional. eval/quality/holdout/README.md requires whole scenarios/PRs, including their safe/unsafe/unknown siblings, to stay in one split. Do not inspect holdout cases while tuning prompts, rules or detectors. Validation checks the labels, not whether the model finds the defect.
After explicit approval for paid calls and configuring bounded storage/model profiles:
sych eval measure --suite eval/quality/dev --config sych.yaml --models cheap_api --runs 2 --output report.json
sych eval compare before.json after.json
sych eval judge report.json --judgments judgments.yamleval measure follows the ordinary review path and durable ledger, so per-run/day/month budgets apply across the suite. --runs accepts 1–10 repeats per case. Pipeline C is the normal pipeline; B removes the high-risk search; A is a diff-only reviewer without semantics, risk audit or verifier and scores its unverified candidates as remarks.
Interpret the report according to crates/sych-app/src/quality/score.rs and crates/sych-app/src/quality/stages.rs:
- Defect/rule-violation anchor overlap is a location proxy, not a semantic judgment. Precision, recall and clean-case rates need that qualification.
- Distinguish tolerated non-target findings and overrated nits from false findings. Keep obligation agreement, unknown preservation, partial coverage, unreviewed paths and context limits visible.
- Missed labels are attributed once to
not_shown,discovery_failed,not_discovered,verifier_rejected,verifier_unresolvedorconfirmed_unmatched. - Preserve errors, skipped cases, unknown costs, sample size and repeat spread. A zero denominator produces no rate, not a perfect score.
- Compare the same suite/case set and configuration.
eval comparerejects differing known config hashes; an old report without a hash cannot prove equal budgets. -
eval judgemakes no model calls. Owner judgments rescore correctness by meaning; unjudged location matches do not become semantic matches.
For verifier-only experiments, eval measure --replay REPORT rereads the earlier stored discoveries and verifies them without new search. It cannot combine with --runs or baseline A. Replay obligations, coverage and unknown-preservation results are not comparable to a fresh full review.
No quality score is claimed by this wiki. Historical prose measurements are not new measurements of this revision. The finite large-PR benchmark is another paid, opt-in experiment, not the CI gate.
Some adapter tests are ignored because they need Docker, network downloads or both, for example in crates/sych-adapters/src/sandbox.rs, crates/sych-adapters/src/execution.rs, crates/sych-adapters/src/semantic/deps.rs and crates/sych-adapters/src/tools/tests.rs. Inspect and run a specific case only in a suitable disposable environment; a blanket --ignored is not part of the normal check.
This wiki-writing run inspected the test definitions but did not execute the application suites, paid evaluations, Docker probes or live SCM smoke. Follow Development workflow for an actual code contribution.