Fence
What it does
The fence45 is the compiler checks, lint rules, and hooks that reject prohibited code and shortcuts. The fence45 explains the idea. Effect describes work with typed failures39 and required services. A service is a named interface for one job.¶
XState defines state machines: named states and the events that permit movement between them. These checks enforce it today:¶
- Type-aware Oxlint runs Ultracite’s core rules and the repo’s plugins in
scripts/oxlint-plugin-*.ts. The plugins cover boundaries, patterns, no comments7, Effect tests, and XState with Effect. Vendored anti-slop rules also run. All useerrorseverity inoxlint.config.ts.¶ rat-stack-boundaries/no-core-adapterskeeps provider adapters out of core. An adapter implements an application-owned interface for a specific provider.¶- Ports, interfaces named for application jobs, stay in core. Fixture tests prove the import boundary.¶
- Effect language-service diagnostics, compiler messages about Effect code, are set to
errorintsconfig.base.json.effect-tsgo patchruns inprepare, so bothtscand the editor report failures.¶ @yielded/effect-tsrs0.2.2runs TypeScript and Effect diagnostics intypecheckandcheck. Every invocation uses--strict --type-check.--type-checkincludes ordinary TypeScript diagnostics;--strictmakes Effect warnings fail.¶- effect-tsrs bundles tsrs
8f135f106a63, contained in plain tsrs0.20.0.¶ - Plain tsrs
0.20.0-ts7.1.0-betastays intypecheck:fast, targeting TypeScript7.1.0-beta. It still has no Effect diagnostics; usetypecheckorcheckfor those.¶ - Patched TypeScript
7.0.2with@effect/tsgo0.55.0runs throughpnpm typecheck:tscat the switch and on checker bumps. CI does not run it.ignoreEffectWarningsInTscExitCodestays false.¶ - Report any checker disagreement.¶
- Lefthook runs
pnpm checkandpnpm testbefore every commit.¶ scripts/vcs-command-policy.jsblocksgit … --no-verify. The Pi extension, the Claude Code hook, and the Cursor hook all call that one file.¶- Continuous integration (CI) runs
pnpm turbo run check test buildafter a fresh dependency install.¶ - The install uses the exact versions in the lockfile; it cannot update that file.¶
The standard
- A commit runs check and test, and a failure stops it.¶
- No agent harness configured in the repo can bypass the hooks with
--no-verify.¶ - Effect diagnostics fail the typecheck.¶
pnpm bump:checkerscompares effect-tsrs and patchedtscerrors, including EffectTS377xxx, for every package and root scripts. It normalizes paths, ignores suggestions and messages, and compares exit verdicts.¶- The same command compares plain tsrs with patched
tsc, excluding Effect-only codes. Plain tsrs cannot emit those diagnostics.¶ - Code carries no prose comments. Tool directives need a reason after
--; type assertions need a one-lineSAFETY:statement of the condition that makes the assertion safe. Plain JS may keep type-only JSDoc. No comments7 and repo law give the full exception policy.¶ - Every lint or diagnostic override names its rule and gives a reason.¶
- The number of overrides only shrinks. The debt ledger, a report counting lint and diagnostic exceptions, publishes the count by kind.¶
- A new lint rule ships with a test that runs real Oxlint against fixtures.¶
- Loosening any of this needs the owner’s sign-off.¶
How to check
pnpm turbo run check test buildruns the main gate.¶pnpm typecheckruns strict effect-tsrs diagnostics.¶pnpm typecheck:tscruns the patched compiler.¶pnpm typecheck:paritycompares checker errors and exit verdicts.pnpm bump:checkersruns it on every bump.¶pnpm typecheck:fastruns plain tsrs for fast feedback without Effect diagnostics.¶echo '{"tool_name":"Bash","tool_input":{"command":"git commit --no-verify"}}' | node scripts/hooks/block-git-no-verify.mjsprints adenydecision with the reason.¶pnpm --filter @rat-stack/core testruns the fixture tests for the boundary, pattern, no-comment, and unknown-parameter rules, and the command policy test.¶- The boundary fixtures in
packages/core/test/boundaries-rule.test.tsreject adapter imports from core and accept composition outside it.¶ curl -sS https://ratstack.sh/debt.mdshows the current override count.¶
Sources
- rat-stack/oxlint.config.ts at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Lint configuration; used for the enforced rule groups. Accessed 2026-10-01.
- rat-stack/tsconfig.base.json at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Compiler configuration; used for Effect diagnostics at error severity. Accessed 2026-10-01.
- rat-stack/lefthook.yml at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Commit hooks; used for the pre-commit check and test gate. Accessed 2026-10-01.
- rat-stack/scripts/vcs-command-policy.js at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Command policy; used for the shared hook-bypass prohibition. Accessed 2026-10-01.
- rat-stack/scripts/hooks/block-git-no-verify.mjs at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Harness hook; used for the failing bypass check. Accessed 2026-10-01.
- rat-stack/.github/workflows/ci.yml at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. CI workflow; used for the cold-install validation gate. Accessed 2026-10-01.
Last changed 2026-10-26 in 2e9440e. Source on GitHub. Change log.
Linked from
- Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
Fence — Strict effect-tsrs diagnostics, lint, and hooks protect the gate; patched tsc checks compiler parity on checker bumps.
- Change log. What changed in the files served here, newest first.
Fence — edited: chore: align tsrs checker pins and preserve combined diagnostics
- Full agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
- Rat Stack systems | rat-stack. The systems rat-stack ships, the standard each keeps, and how to check it.
Fence — Strict effect-tsrs diagnostics, lint, and hooks protect the gate; patched tsc checks compiler parity on checker bumps.
- Source change history (log.md). The generated change log as Markdown.
Fence — edited: chore: align tsrs checker pins and preserve combined diagnostics