still.fail / station
AGENTS.md69 starsChanged 16 days agoMITView on GitHub
Narrower rules:
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,117 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cloud/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- rules/AGENTS.mdAGENTS.md
- web/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cloud/CLAUDE.mdCLAUDE.md
- .github/CLAUDE.mdCLAUDE.md
- rules/CLAUDE.mdCLAUDE.md
- station/CLAUDE.mdCLAUDE.md
- web/CLAUDE.mdCLAUDE.md
- ste-writingSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Every read uses an index and a limit.
- Distinctive: line 42
No per-person or per-chat permission inside a workspace: every member and agent reads every chat (private too).
- Very specific: line 74
Wait on off-main-thread work with settle() (station/test/hub-fakes.ts), not turn counts.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Working on the station (for agents)
Narrower rules:
station/src/agents/AGENTS.md: runtime drivers, output parsers, MCP tools, silent subagents, bug-report replies, sandboxesstation/src/sessions/AGENTS.md: actors,--sessions#jobs/#remote/#live, turn states, cards, usage, cold storage, footprintstation/src/cloud/AGENTS.md: lock pinning, fork choice, moved workspaces, lock tests, cloud TCP entriesstation/src/mesh/AGENTS.md: mesh base, ways and relays, station name and iconstation/src/rig/AGENTS.md: task-only stations, ownership, signed grants, mode switch, devicesstation/src/share/AGENTS.md: shared agent memory, team skills, presets, starred models, profiles following the whiteliststation/src/ops/AGENTS.md: storage manifest, logs, background yielding, bounded walks, self-memory, stdin backpressurestation/src/move/AGENTS.md,station/src/replica/AGENTS.md: migration, chat handovers, backups, retirement (off)station/mb/src/station_main/AGENTS.md,station/docker/AGENTS.md: MoonBit station, Dockerstation/src/screens/AGENTS.md: clipboard privacy marks, pointer lock, gamepads
Its shape
- A release holds the TypeScript station on its own Node (
main.js,pnpm run build:node,NODE_VERSIONfromcloud/src/install.ts), the MoonBit reader/builder (stillfail-reader), the Pion reader/builder (stillfail-pion, default enginepiononbetaandstablefor every target andmbin checkouts without<app>/CHANNEL), the opt-in full Pion station (stillfail-station-pion; default engine remainsnode, enabled only whenconfig.jsonsets"engine": "pion"and its--versioncapability probe passes), launcher, runner, Helper (scripts/station-bundle.sh). - Pion station cutover sync rule: while cutting over to
pion/station-main/, do not land unilateral behavioral changes instation/src/. Any modification tostation/src/TypeScript files (outside legacystation/src/read/, V8-onlystation/src/ops/heap.ts, and*.test.ts) must include the matching.pion/.c/.hupdate underpion/station-main/in the same PR (scripts/station-pion-sync.ts, enforced in.githooks/commit-msgandscripts/check.sh). Only strictly Node-runtime-only fixes (V8/Node API quirks or emergency rollbacks with no Pion counterpart) may exempt with a specificNode-Station-Only: <reason>commit trailer. - The whole station in MoonBit (
station/mb/src/station_main) is frozen and detached from the shippedstillfail-readerbinary (kept only instillfail-reader-harnessfor frozen tests).station/native/launcher/src/main.rsstation_ofstarts Node directly whenconfig.jsonsets"engine": "moonbit"andmain.jsis present, andstillfail-readercarries a lightweightstation_shim(station/mb/src/reader/station_shim.mbt) thatexecvs Node in place for older launchers during live upgrades.station/test/mb-station-contracts.test.tschecks only thatstation_mainstays wired in itself. - By default,
betaandstablereleases runstillfail-pionbeside Node while dev checkouts without<app>/CHANNELrunstillfail-reader. Astation/src/change needs no change instation_mainand noStation-parity:trailer. No station test holdsstation_mainto the living TypeScript or the catalog any more: the side-by-side twin test is gone, andstation/test/mb-station-e2e.test.tsandstation/test/mb-station-contracts.test.tshold it only to itself, asstation/test/mb-cross-engine-handover.test.tsholds the launcher's handover Node ↔ MoonBit ↔ Node (how a station set to"engine": "moonbit"comes back to Node). So astation/src/or catalog change keeps only thereader↔ Node contract (station/test/mb-reader-contracts.test.ts, run for everystation/src/orstation/mb/change and in every station test run) and the existing tests, including thestation/test/mb-live-*.test.tsregressions not yet moved. Every station test runs in every slice run. - Processes:
- Launcher (
station/native/launcher, Rust) owns the pid, data-dir lock, ports; it starts the next station, then stops the old. - Runner (
station/native/runner) hosts each agent so turns survive restarts (station/src/agents/runner.ts,station/src/agents/mb-agents.tsHostedProcess.adopt); unowned runners end (ownedRunners,station/src/sessions/hub.tstakeUp,endOrphan). - The mesh front (
stillfail-pionby default onbetaandstable,station/mb/src/front/mesh.mbtin checkouts without<app>/CHANNEL, overridden bySTILLFAIL_READER_MESH>config.jsonreaders.mesh>config.jsonreaders["*"]>STILLFAIL_READER_ENGINE> default fromPION_DEFAULT_TARGETS_BY_CHANNEL, taking effect on startup,SIGUSR2handover, and launcherrenew) keeps iroh's endpoint over Node handovers (station/native/launcher/src/front.rs,station/src/mesh/front.ts). Under default-only rollout (source == default), an already-running healthy,STREAMS- and macOS-UUID-compatible MB front is kept across handover/renew whilestillfail-readerremains in the release (zero-disconnect gentle cutover; fresh starts,STREAMSbumps, macOS UUID changes, fronts of an olderGENERATION(fixes inside the front program, replaced once), explicit config/env overrides, and removal ofstillfail-readertransition to Pion, or fall back to direct bind with retry when Pion is temporarily unavailable). Without a front (Windows, some checkouts) Node binds iroh viastation/native/mesh(also image codecs). station/native/launcher/src/lifecycle.rsrestarts a Node silent on--launcher-heartbeator a dead front, and retries a given-up front later. It runs the updater when Node cannot (--launcher-installer,run.rsrun_installer; Windows: a scheduled task).stillfail statusreads Node's<data>/run/health.json(station/src/ops/health.ts).- The front routes device requests (
station/src/mesh/served.ts) to MoonBitreader --serve(Node gives member identity, core floor, idempotencyclaim, handleschanges/said), streams compressedGET /eventsviarelay. BackgroundPOST /batchreads stay on Node behind interactive ones (station/src/read/pool.ts). - Native parts are prebuilt (
scripts/native.ts): any edit, a comment too, rebuilds them everywhere, so change them only for function.
- Launcher (
- Helper UI (
station/native/helper) uses still.fail's design (web/ui/src/palette.ts, corners, capsule buttons,s.mark), not system controls. station/src/main.tsis the composition root: each part an Effect 4Layer(station/src/services.ts), no self-registration or globals; scoped fibers,Schedulebackoff, streams for pushes, plain functions.- Mesh wire and door (
station/src/mesh/AGENTS.md) stay independent of still.fail admission and routes (scripts/mesh-base.ts). - The main thread waits on nothing: no synchronous
node:fs,child_process, orzlibinstation/src/unless markedsync:with a reason (startup or atomic step), except*worker.ts, off-main-threadstation/src/read/,station/src/cli.ts,station/src/updates/command.ts(scripts/check.sh;station/test/main-thread-waits.test.tscounts only fall;station/test/src-sync-calls.test.ts, config writes viaupdateSoon, its list only shrinks). - Effect
Clock(TestClockin tests).Date.now,new Date(),setTimeout,setIntervalonly instation/src/ops/fibers.ts(wall: external mtimes, expiries, deadlines);scripts/check.shrejects them elsewhere.
Its data
- State is one SQLite file,
stillfail.db(station/src/store/store.ts,station/src/store/schema.ts), one writer on the main thread. Reads, card pages, checkpoints, backfills, replica export/restore run in MoonBit readers and builders (station/mb/,station/src/read/pool.ts,station/src/read/mb-reader.ts,station/src/replica/): no JS workers, no TypeScript fallback. Schema repairs (Readers.repairEdits) run on the writer, retrying on busy without blocking. Parity references:station/test/reference/,station/test/workers/. - Two processes open
stillfail.dbduring a handover: each connection sets a busy timeout, each writing transaction startsBEGIN IMMEDIATE(scripts/check.sh). - Station reads carry no UI words (the core's:
client/core-ts/src/chat-row.tsworded,entries.tsauthorNameOf, local pages,station.files.*refusals,inScript); only station notices and Comma messages do (station/src/read/pool.tsSAID). - Every read uses an index and a limit; a new read gets a bounded test (
station/test/*-bounded.test.ts). New indexes come from background backfills sharing one permit (station/src/read/*-builder.ts,station/src/store/backfill.ts); bound reads another way until then. - Threads are append-only logs (edits append, Slack deletes ignored, readers merge); migrations go forward only; every change is pushed on
GET /events(station/src/api/events.ts). - No per-person or per-chat permission inside a workspace: every member and agent reads every chat (private too); agents share one OS user and database. Only workspaces are isolated. Never propose or build per-chat visibility: it is by design unless the owner changes it.
Core invariants
- Subagents never speak in a chat; agent plain text is never forwarded; turns end with a state; bug-report replies never reach agents by themselves (
station/src/agents/AGENTS.md,station/src/sessions/AGENTS.md). - Workspace
MEMORY.mdand team skills sync to all stations by--builder memory3-way merges (engine resolved by the same policy table below); reader/builder engine selection (station/src/read/reader-select.ts,station/src/read/mb-reader.tsresolveReaderSelection,station/native/launcher/src/front.rs) followsSTILLFAIL_READER_<MODE> > config.readers[mode] > config.readers["*"] > STILLFAIL_READER_ENGINE > default(PION_DEFAULT_TARGETS_BY_CHANNELkeyed by installed<app>/CHANNEL, neverconfig.updateChannel, withbetaandstableenabling every target and missingCHANNELdefaulting to"mb", andconfig.readers["*"]outrankingSTILLFAIL_READER_ENGINEjust like per-mode config), hot-reloads from the liveReaderConfigsnapshot on each new spawn without disrupting in-flight work, gates Pion behindpionImplementedplus a non-blocking--versioncapability probe, and protects default-selected Pion with a process-attributed crash circuit breaker (station/src/read/pion-breaker.ts,<data>/run/pion-demoted.jsonl, 3 unexpected exits in 5 min; front uses<data>/run/front-pion-demoted.json). Emergency full-station rollback: atomically replaceconfig.jsonreaderswith{"*": "mb"}, clear anySTILLFAIL_READER_*env overrides, trigger a controlledSIGUSR2handover or platformrestarter, and verify the running reader/front engine and PID. Each person's devices carry presets and starred models (station/src/share/AGENTS.md). - Relays: kept on stations, added by agents without approval after a probe; disabled ones apply to stations too (
station/src/mesh/AGENTS.md). - Rigs run tasks only under owner-signed grants; a whole station becomes a rig by its adder or a workspace owner/admin, who then owns it, and only that owner makes it whole again (
station/src/rig/AGENTS.md). - Pinned locks are released only by
disableor the local CLI, follow fork choice, enforce moved-workspace build floors (station/src/cloud/AGENTS.md). - Heavy work goes to l4es
sandboxesviastation_task; no station or agent runs in one (station/src/agents/AGENTS.md).
Screens
- One view drives a screen; any number watch (
station/src/screens/hub.tsdrive). Taking control (控制 / 接管,taken) makes every other driver (the person's other devices too) watch, told who took it; reconnects and resizes never take it. - Agent input waits while a person drives (
station/src/tools/computer.ts); both sides are told.
Terminals
- Member terminals (
station/src/terminals/) run undernative/runner --pty(term-…, metadata in<data>/run/terminals/), adopted across restarts apart from agent runners (isTerminalRunner). - Members not read-only type (exclusive with 接管); read-only ones watch; each workspace sees its own. A new viewer gets the libghostty-vt screen (
native/runnerscreen), then live output. - Terminals are
beta(station/src/features.ts): new ones only on test-channel stations (overviewfeatures); old ones stay viewable and stoppable; none on rigs yet.
Devices (设备)
- Devices: USB, network, serial, AirPlay, or Android TV devices on a station (
station/src/devices/,connect.ts,airplay/,android-tv/), or a member's phone lent by its app (station/src/adb/). One list (device_list), one request flow (device_use), plusdevice_controlfor AirPlay and Android TV actions (Android TV multiplexes HTTP control and isolated ADB on the same forwarded port). A chat gets a127.0.0.1port for its processes alone (station/src/adb/door.ts), tunneled over the mesh (station/src/mesh/peer-http.ts). - A whole station's devices need no grant (all workspace chats share it); ones needing owner approval attach to a rig (
station/src/rig/AGENTS.md).
Tests
- Typecheck
pnpm exec tsgo --noEmit; one file:node ../scripts/native.ts run mesh runner archive-rs reader reader-harness launcher -- node --import ./test/setup-env.mjs --test test/<file>.test.ts(all:pnpm test). A package's harness (--builder harness-*, itsharness*.mbt) lives in the tests'stillfail-reader-harness(station/mb/src/reader_harness,station/test/mb-harness.ts), never the shipped reader. Fake agents onTestClock; real processes, signals, sockets instation/side/. - CI runs
station/test/on Linux, sliced (scripts/check.sh,station-tests). Tests pass on Linux and macOS or skip naming what is missing. File-backed vault tests usestation/test/vault-no-reader.tsunless testing the reader process. - The lock's and vault's rules come through
shared/rules-runtime.ts:pion(pion/rules) by default in Node whenpion-rules/orpion/rules/js/is present (rules/js/rules.jsin Workers or without the Pion build);STILLFAIL_RULES_MODE=moonbitrolls back immediately, andSTILLFAIL_RULES_MODE=shadow(withSTILLFAIL_RULES_SHADOW_STRICT=1to throw on a difference) diffs both ports. Tests that call the rules import that module, notrules/js/rules.js, exceptrules-fork-check.tswhenpion/rules/test/parity.test.mjsintercepts it via__PION_RULES_DUAL__. - Wait on off-main-thread work with
settle()(station/test/hub-fakes.ts), not turn counts. Guard events that may never come withgiven()to fail at once.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

