Fence
What it does
The fence39 is the compiler checks, lint rules, and hooks that reject prohibited code and shortcuts. The fence39 explains the idea. Effect describes work with typed failures36 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.¶ - 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.¶
- 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 everything CI runs.¶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-07 in f77853d. Source on GitHub. Change log.
Linked from
- Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
Fence — The lint rules, compiler diagnostics, hooks, and gate that make a bad shortcut fail instead of asking an agent to avoid it.
- Change log. What changed in the files served here, newest first.
Fence — edited: feat(learn): teach cards 83 to 111 and finish the deck’s plain lines
- 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 — The lint rules, compiler diagnostics, hooks, and gate that make a bad shortcut fail instead of asking an agent to avoid it.
- Source change history (log.md). The generated change log as Markdown.
Fence — edited: feat(learn): teach cards 83 to 111 and finish the deck’s plain lines