Fence
What it does
The fence50 is the compiler checks, lint rules, and hooks that reject prohibited code and shortcuts. The fence50 explains the idea. Effect describes work with typed failures38 and required services. A service is a named interface for one job.¶
XState 6.0.0-beta.1 defines state machines: named states and the events that permit movement between them. @xstate/effect 1.0.0-beta.0 runs them as scoped Effects and supplies the compiled inline-Effect lint rule.
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 comments11, 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.3runs 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.23.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.67.5runs 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.jsblocks every way an agent command could skip or disable the hooks:--no-verifyand its abbreviations,git commit -n(including flag clusters such as-nm),LEFTHOOK=0,LEFTHOOK_EXCLUDE,HUSKY=0, acore.hooksPathoverride,lefthook uninstall, and writes under.git/hooks, also insidebash -corsh -c. It reads the command with shell quoting, so a commit message that mentions-nstill passes. The Amp plugin, the Claude Code hook, the Pi extension, and the Cursor hook all call that one file.¶- The pre-commit hook is the CI. GitHub Actions workflows run only on manual dispatch. Turbo’s
testdepends onbuild, so every commit also builds every package.¶
The standard
- A commit runs check and test, and a failure stops it.¶
- No agent harness configured in the repo can skip or disable the hooks, with
--no-verifyor any other bypass.¶ - 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 comments11 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-11-11 in 08d6482. 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: fence: block every hook bypass and add the Amp hook
- 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: fence: block every hook bypass and add the Amp hook