Synergy runs a multi-layer quality system that covers formatting, linting, type-checking, monorepo hygiene, CI workflow validation, secret scanning, package publishing validation, and tests. This runbook describes local quality commands. CI task ownership, scheduling and admission are defined in CI verification.
| Layer | Local command | CI task | Tool | Pre-push |
|---|---|---|---|---|
| Bun version check | (pre-push only) | — | check-bun-version |
✅ |
| Formatting | bun run format:check |
policy |
Prettier | ✅ |
| Lint | bun run lint |
static |
oxlint | ✅ |
| Browser crypto contract | bun test --cwd apps/web test/testing/browser-crypto-contract.test.ts |
suite-apps-web |
Bun source contract | — |
| Localization | bun run localization:check |
static |
Lingui + source contract | — |
| Type checking | bun run typecheck |
typecheck |
tsc via turbo | ✅ |
| Monorepo deps | bun run monorepo:check |
static |
sherif | ✅ |
| Dead code | bun run deadcode |
static |
knip | — |
| CI workflow lint | bun run workflow:check |
policy |
actionlint + zizmor | — |
| Secret scanning | bun run secrets:check |
policy |
gitleaks | — |
| Package validation | bun run package:check |
packages |
publint + attw | — |
| Tests | bun turbo test / bun run --cwd packages/harness test:ci |
suite-* |
One instrumented suite execution | — |
| Private HTTP browser smoke | bun run --cwd apps/web build && bun apps/web/script/private-http-smoke.ts |
web-integration |
Playwright Chromium | — |
| Desktop checks | bun run desktop:test |
desktop |
bun test + build | — |
| Server health smoke | — | smoke |
Synergy health check | — |
The pre-push hook runs these checks in sequence. If any fails, the push is blocked:
bun script/check-bun-version.ts— verify the local bun version matchespackage.jsonbun run format:check— verify all files are formattedbun run lint— run oxlint with deny-warningsbun run typecheck— type-check all packages via turbobun run monorepo:check— validate monorepo dependency consistencybun run doc:check— validate current documentation and generated referencesbun run decision:check— validate decision records
The pre-push hook is intentionally fast — it covers the most common issues but does not run tests, secret scans, or workflow validation. Those run in CI.
bun run quality:quick # format + lint + Skill/package-guide/test-layout checks + localization + typecheck + monorepo/package checksbun run quality # quality:quick + release contracts + workspace testsThis runs the full suite locally. CI runs the same checks in parallel jobs.
CI runs on every push to dev / main, pull requests targeting those branches, and the daily cold-cache validation of latest dev. CI verification owns the task catalog, dependency selection, runner limits, reports and rollout admission.
Package suites execute once with coverage and JUnit. Harness keeps four stable partitions and its isolated files. web-integration owns the production browser smoke and plugin UI contracts; root-tests owns script/release contracts; installed-runtime-core and installed-runtime-full own their compiled distributions and installed package verification on separate Linux workers in required plans. PostgreSQL 16/17/18, Windows, sandbox, Desktop, long rollout and benchmark scenarios remain explicit tasks. Type and package checks each execute once in the Linux graph.
All checks passed verifies every selected task, job outcome, exact commit and workflow attempt, report hash, complete test inventory and coverage floor. PR selection starts in shadow mode; dev/main pushes stay full. Diagnostics cannot satisfy the required check. Oryn's independent review queue retains its own governance.
| Tool | Responsibility | When to run |
|---|---|---|
| Prettier | Repository-wide formatting | Every change through bun run format:check; write fixes with bun run format or ./script/format.ts |
| oxlint | Fast JavaScript/TypeScript linting without style-heavy churn | Every change through bun run lint; auto-fix safe issues with bun run lint:fix |
| sherif | Workspace package and dependency consistency | Every change through bun run monorepo:check, especially package manifest edits |
| knip | Dead code, unused dependencies, unused scripts, unresolved entries, and catalog hygiene | CI and explicit local checks through bun run deadcode; configure precise entries/ignores for dynamic or generated code |
| publint | npm package manifest, exports, and publish-shape validation | Publishable package, release, SDK, plugin, or util changes through bun run package:check |
| attw | TypeScript package resolution validation for published tarballs | Same path as publint through bun run package:check |
| actionlint | GitHub Actions syntax and expression validation | Workflow changes through bun run workflow:check and CI policy |
| zizmor | GitHub Actions security analysis | Workflow changes through bun run workflow:check and CI policy |
| gitleaks | Secret and credential scanning | Auth/provider/channel/config example changes through bun run secrets:check; all PRs through CI policy |
| Localization gate | Catalog extraction drift, complete zh-CN coverage, strict ICU compilation, and App/UI source policy | Product copy, accessibility text, locale formatting, or shared UI changes through bun run localization:check |
| Browser crypto contract | Direct browser randomness under App/UI source must use the shared ordinary or strict utility boundary | Browser capability or identifier changes; affected Web suites and all full runs through suite-apps-web |
The package:check script validates every publishable npm package in the monorepo:
The check uses the same module packer as releases for every registry entry in script/release/shared/packages.ts, including Harness, Local Runtime and all optional components. Every archive runs publint. Node-compatible SDK, Util, Plugin, Plugin Kit, protocol and detector packages also run attw with the ESM profile (Link Protocol retains its existing exclusion). Bun runtime packages carry source types and compiled Bun modules; their executable and worker contracts are tested through installation into a separate directory, rather than treating Node resolution as evidence of Bun execution.
Static package checks omit native binary construction; platform release jobs build and validate those binaries and the complete installed graph. Tracked manifests are never rewritten by package checks. The product wrapper remains a separate compatibility distribution and also runs publint.
Run locally:
bun run package:checkThe workflow:check script uses an installed actionlint binary when available, otherwise downloads the pinned actionlint release, then runs zizmor for GitHub Actions security analysis.
Run locally:
bun run workflow:check # install actionlint locally to avoid the actionlint download fallbackThe secrets:check script scans a temporary snapshot of tracked and non-ignored untracked source files, omitting deleted paths and external symlinks. Generated build outputs and private ignored runtime homes are excluded from that snapshot. CI scans the checked-out source tree. Both use gitleaks with the default rules and explicit fixture/fake-token exceptions.
Run locally (requires gitleaks installed):
brew install gitleaks # macOS
bun run secrets:check| Failure | Likely cause | Fix |
|---|---|---|
| Formatting | Unformatted files | ./script/format.ts and re-stage |
| Lint | Code style violations | bun run lint:fix or fix manually |
| Localization | Catalog drift, missing translation, invalid ICU, or unclassified source copy | Re-extract and translate catalogs, or fix/classify the source violation |
| Typecheck | Type errors | Fix type errors in affected files |
| Monorepo check | Version mismatch across workspaces | Sync catalog versions in root package.json |
| Dead code | Unused dependencies or exports | Remove or export as needed |
| Workflow check | actionlint or zizmor violation | Fix workflow file syntax or security issue |
| Secret scan | Credential leaked in code | Rotate credential, rewrite history, update allowlist |
| Package check | publint or attw failure | Fix package.json exports or module resolution |
| Test failure | Runtime regression, leaked process state, or brittle isolation | Run the focused test, then bun run test:ci from packages/harness; inspect the uploaded per-shard JUnit reports |
bun dev prepare
bun run qualitybun run quality:quickFor a narrower edit loop before the full quick gate, run the relevant individual command such as bun run format:check, bun run lint, bun run localization:check, bun run typecheck, or a focused package test.
The pre-push hook runs automatically. If you want to verify first:
bun run quality:quick./script/generate.tsbun run package:checkbun run workflow:check # workflow syntax + security analysis
bun run secrets:check # requires local gitleaks; CI always runs secret-scanbun run package:checkcd packages/harness
bun test <relevant test files>
cd ../..
bun run quality:quickFor the complete core-runtime CI boundary, run bun run test:ci from packages/harness. It executes four shards sequentially in fresh Bun processes; CI uploads one JUnit report per attempted shard.
bun run --cwd apps/web test
bun run --cwd apps/web typecheck
bun run --cwd packages/ui test
bun run --cwd apps/web build
bun turbo test
bun run quality:quickBrowser capability or bootstrap changes also run the static boundary and genuine non-loopback HTTP smoke:
bun test --cwd apps/web test/testing/browser-crypto-contract.test.ts
bun run --cwd apps/web build
bun apps/web/script/private-http-smoke.tsFor product copy, accessibility text, or locale-sensitive formatting, update the catalogs before those package and root gates:
bun run --cwd apps/web i18n:extract
bun run localization:checkThe App and shared UI packages both expose standard test scripts, so bun turbo test includes their centralized test/ suites. The App runner isolates its production CSS build contract from the unit-test process; the UI runner isolates the session-turn timeline suite because its process-wide module mocks must not leak into other shared UI tests.
For theme or color-token work, regenerate and verify the checked-in artifacts before the package suites:
bun run --cwd packages/ui generate:theme
bun test --cwd packages/ui test/theme.test.ts test/theme-generation.test.ts
bun test --cwd apps/web test/testing/color-token-contract.test.tsWhen a change adds or modifies quality commands, scripts, CI tasks, or pre-push checks, update:
docs/operations/open-source-quality.md— quality model and command/CI tablesREADME.md— the### Quality commandssectionCONTRIBUTING.md— PR preflight quality flowAGENTS.md— "Testing/Verification" and "Documentation Sync Rules" sectionspackages/presets/AGENTS.md— scoped quality commands for core runtimeapps/web/AGENTS.md— scoped frontend/app verification.github/PULL_REQUEST_TEMPLATE.md— checklist entries.synergy/command/check.md— agent check command.husky/pre-push— hook content (verify the hook script itself)llms.txt— "Source Verification" section