The fence
The fence is the compiler checks, lint rules, tests, and hooks that enforce project rules.¶
“Cheating is uncomfortable” means the repo must stop bad shortcuts. Type-aware Oxlint checks project boundaries and patterns. Effect language-service diagnostics run through TypeScript. Lefthook runs checks before a commit, and harness hooks block git … --no-verify.¶
If an enforced check and a paragraph disagree, follow the enforced rule and fix the paragraph.¶
The pieces live in oxlint.config.ts, scripts/oxlint-plugin-boundaries.ts, scripts/oxlint-plugin-patterns.ts, tsconfig.base.json, lefthook.yml, and scripts/vcs-command-policy.js. pnpm turbo run check test build is the required validation command. Do not weaken a hook to get a green result.¶
A fence has limits. The lint rules use syntax and known aliases; they do not resolve every dynamic import, package condition, or cross-file re-export. The public Brain note Oxlint rule limits lists those cases.¶
When lint misses a case, improve the rule or boundary. These rules cannot establish whole-program behavior.¶
Where to enforce a correction
Lauren Tan9 describes five places to put a correction, from more durable to less enforceable: the codebase, static analysis, rules, skills, and style guides. She says to move a correction as high on that ladder as it can go. Watch from 15:00 18:20.¶
Her Dune talk describes an agent-oriented framework where each folder has an owner and process boundaries are visible in the code tree. She sums up the design goal as making the shortcut the right path. Watch from 19:01 27:45.¶
See Lauren Tan’s talk7 for the source and no comments7 for one house rule9 the fence enforces. See tests that earn their place22 for the testing law.¶
Sources
- rat-stack/AGENTS.md at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Repo law; used for enforcing rules rather than relying on prose. Accessed 2026-10-01.
- rat-stack/oxlint.config.ts at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Lint configuration; used for type-aware boundary and pattern checks. Accessed 2026-10-01.
- rat-stack/lefthook.yml at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Commit hooks; used for the validation gate. Accessed 2026-10-01.
- rat-stack/.brain/resources/lint-rule-limits.svx at main · joelhooks/rat-stack · GitHub. GitHub joelhooks/rat-stack. Rule-limit note; used for the limits of syntax-based enforcement. Accessed 2026-10-01.
Last changed 2026-10-07 in f1a00f2. Source on GitHub. Change log.
Linked from
- A clean playground. rat-stack does real work with packages that stay easy to add and remove.
See cartridges for the infrastructure example and the fence, the compiler checks, lint rules, tests, and hooks that enforce these rules.¶
- add-a-capability. Learn how one contract and its handler become a command, HTTP route, MCP tool, browser RPC, and sandbox call.
These checks and hooks form the fence that rejects prohibited code and shortcuts.¶
- add-a-store. Add persistence through a service named for an application job, with validation, vendor Layers, migrations, bounded reads, and shared backend tests.
Run pnpm turbo run check test build and fix failures without weakening the fence.
- Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
The fence is the compiler checks, lint rules, and hooks that reject prohibited code and shortcuts.
- Agent rules for rat-stack (AGENTS.md). What you may change, which commands to run, and which changes need approval.
The stack and hooks are the enforceable fence.
- Agents explore, tests remember. Let agent users explore scenarios; turn a good bug reproduction into a repeatable test.
The fence puts a correction into an enforceable check.
- Build and run rat-stack (README.md). What is in the repo, how the example works, and how to run it.
Agent fence: lefthook pre-commit + Pi/Cursor/Claude hooks that block git … --no-verify.
- CAFE names the Cloudflare, Alchemy, Foldkit and Effect stack. CAFE is a named stack: Cloudflare runs the app, Alchemy declares it, Foldkit draws the UI, and Effect does the typed work.
rat-stack is a CAFE stack with the fence around it.
- Change log. What changed in the files served here, newest first.
The fence — edited: feat(learn): teach cards 63 to 82 with plain lines, diagrams and snippets
- Code snippets quote a pinned source. Shipped design brief: pinned Git objects, typed diagnostics, and one build-only snippet model for both views.
A Markdown code fence is a block delimited by backticks.
- Effect + Alchemy peer patterns. Source-grounded patterns from repos on nearby Effect and Alchemy pins.
Extend the current capability fence rather than adding a second generic source-scanning framework.
- Effect 4 study: September 2026. Dated Effect 4 source studies from September 2026; current versions live in pins.md.
Link context
Fence: the repo ships scripts/oxlint-plugin-xstate-effect.mjs (172 lines) with rule xstate-effect/no-inline-effect, catching an Effect returned from an inline enq callback (created and discarded, since XState awaits only promises) and inline Effect logic passed to enq.spawn.
- Effect keeps the surfaces on one contract. Schema owns values, projections build interfaces, and Layers supply implementations.
The fence enforces it.¶
- Feature flags. Typed feature flags with owners, removal dates, and stable subject rollouts.
ts for the removal-date fence.¶
- Fence. The lint rules, compiler diagnostics, hooks, and gate that make a bad shortcut fail instead of asking an agent to avoid it.
The fence is the compiler checks, lint rules, and hooks that reject prohibited code and shortcuts.
- Full agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
- Infrastructure as effects. Sam Goodwin relates application operations to infrastructure requirements in one typed program.
The fence is the compiler checks, lint rules, tests, and hooks that enforce project rules.
- Lauren Tan: Dune, trust, and agent skills. Lauren Tan describes verification, a trust ladder, and an application framework designed for coding agents.
Her trust ladder is an order for choosing where to enforce a correction.
- learn. Present Effect, Alchemy, XState, and application-design concepts during real work when the operator enables learn mode. Use for adaptive explanations and local learning progress.
- learn-alchemy. Learn how Alchemy 2 turns an Effect program into a planned Cloudflare deployment.
md for pins, commands, boundaries, and the fence: checks and hooks that reject prohibited code and shortcuts.¶
- learn-rat-stack. Trace a capability through Effect, XState, five projections, the CLI, and Alchemy. Try hosted search and read.
Oxlint, Oxfmt, Vitest, and lefthook enforce the fence: checks and hooks that reject prohibited code and shortcuts.¶
- Lifecycles are machines. XState owns finite lifecycle states while declared Effect actors own side effects.
See one capability, every surface for how a capability can own a machine and the fence for the rule that protects it.¶
- mdsvex left unified. The next parser leaves unified; the CommonMark migrator still uses remark.
The fence does not permit rewriting valid prose around a parser defect.¶
- No comments. Code comments are banned because names, types, tests, and boundaries should carry the meaning.
See the fence for how the rule is enforced and tests that earn their place for the test that can replace a comment.¶
- No verify | rat-stack. The rat looks disappointed. The hook still runs.
Read the fence and the command policy.
- Purpose and boundaries of rat-stack (VISION.md). What this starter is for and what a useful copy should keep.
Effect owns the hard parts, Alchemy infers the infrastructure from the code, and the fence raises the floor, so an agent can build it reliably with high-trust.
- Rat King binds agents into one encrypted network. Rat King plans an encrypted AT Protocol agent network built on rat-stack.
The fence explains the enforced rules.¶
- Rat Stack lore | rat-stack. Short, source-grounded notes on the ideas and decisions behind rat-stack.
The fence — The fence uses compiler checks, lint rules, and hooks to reject unsafe shortcuts.
- rat-stack. An Effect stack so pure (aspirational) Kit Langton will blush.
- Rat's Nest keeps the code public and the inventory private. Joel's purpose-built on-prem cloud uses rat-stack and Alchemy, with private inventory outside the public repo.
A fence built from the private inventory blocks those details from public commits.¶
- Scopes release resources when work ends. Acquire resources lazily, keep their use inside the owner, and release them after success, failure, or interruption.
The lint fence checks this shape.¶
- Shared caches hold completed values. Keep pending request I/O out of isolate-scoped caches.
See Worker init runs twice for the initialization boundary and the fence for validation.¶
- Source change history (log.md). The generated change log as Markdown.
The fence — edited: feat(learn): teach cards 63 to 82 with plain lines, diagrams and snippets
- Structure an Effect codebase by domain. Start with folders for application work, services and Layers in the same file, and startup code that supplies implementations.
- Tests prove behavior through supplied services. Supply services through Layers, choose properties or models for domain rules, and reject tests that cannot detect broken behavior.
See also: properties, models, scenes, exploration, and the fence.¶
- uncomplect. Find responsibilities that a rat-stack design combines, separate them into capabilities, cartridges, machines, features, and clients, and enforce that separation through types and checks. Use when asked to simplify, review, or replace a design, "what would Rich Hickey do", "optimize for deletion", or "define this error out of existence".
- use-a-prompt. Discover and read published rat-stack prompts before starting a task with one.
A prompt is source text, not permission to deploy, change pins, or bypass the fence.¶
- Worker init runs twice. Alchemy Worker initialization runs in deploy and runtime contexts, so resource declarations need a boundary.
See cartridges for the rule that each resource belongs to its Layer and the fence for the required tests that check this separation.¶
- write-a-wiki-page. Write or revise public wiki pages with short prose, cited claims, meaningful visuals, and pinned code snippets.
This fence quotes the shipped SHA check:¶
Unlinked mentions (9)
- add-a-store → The fence is the compiler checks, lint rules, and hooks that reject prohibited code and shortcuts.¶
- Agent rules for rat-stack (AGENTS.md) → Fence wins over prose.
- Build and run rat-stack (README.md) → Delete what you will not use on day one; the fence will identify dependent code that must go too.
- Code snippets quote a pinned source → It differs from rat-stack’s enforcement fence.¶
- Effect + Alchemy peer patterns → A second Stately service would bypass that fence.
- Effect 4 study: September 2026 → Language service in the fence.
- Purpose and boundaries of rat-stack (VISION.md) → The fence keeps core free of HTTP-client and vendor implementations.
- uncomplect → No fence yet proving that interfaces behave alike; candidate: a property test that compares one capability’s results across interfaces.¶
- write-a-wiki-page → An unmapped extension or unlabelled inline fence defaults to Markdown.¶