station
AGENTS.md190 starsChanged 3 months agoApache-2.0View on GitHub
This file gives Claude Code and other coding agents the current operating guidance for this repository. Before making code changes: While changing code: Before finishing: Useful optional setup: Sensitive or machine-local files can exist in this repo checkout. Treat these as read-only unless the user explicitly asks otherwise: API keys are read from environment variables such as GOOGLE_API_KEY, `ANTHROP
- Reads credentials
- Deletes or force-pushes
- Installs packages
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
54 rules. About 1 is common, 25 are distinctive, and 28 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈25
Distinctive · estimate
This author's own choices. Worth a look.
28
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Verify names and signatures before calling or editing: Use rg to find definitions and call sites.
- Very specific: line 12
Keep disposable local probes in
/tmp: Use tests/test_*.py, tests/debug_*.py, or tests/analysis_*.py only for files that should be visible … - Very specific: line 13
Use repository file helpers for persistent station data: Use station/file_io_utils.py for atomic YAML/text writes and safe directory …
- Distinctive: line 17
Before making code changes:
- Distinctive: line 19
Run git status --short and identify unrelated user changes.
- Distinctive: line 20
Read this file, then read the subsystem doc listed in the Documentation Map.
- Very specific: line 22
Use rg to find the live implementation, constants, tests, and call sites.
- Distinctive: line 27
Prefer small, localized edits that preserve existing YAML schema compatibility.
- Very specific: line 28
Use file_io_utils for station persistence and keep in-memory indexes synchronized.
- Distinctive: line 29
Update help text when changing agent-facing actions, YAML fields, or room behavior.
- Distinctive: line 30
Add or adjust tests for behavior, restart/recovery paths, and notifications when relevant.
- Very specific: line 31
Do not change .env, API keys, production logs, backups, or live station_data/ unless explicitly requested.
- Distinctive: line 35
Run the most relevant tests from the Verification Matrix below.
- Very specific: line 43
Default data root: ./station_data.
- Very specific: line 44
Default research task layout: station_data/rooms/research/.
- Very specific: line 45
Test style: the existing tests are mostly unittest files under tests/.
- Very specific: line 110
If you expose or debug “Copy System Prompt” for Reviewer, return the actual runtime connector system prompt, not the initial context prompt …
- Distinctive: line 152
Do not assume these directories all exist.
- Very specific: line 174
Always use constants.ROOM_* and constants.SHORT_ROOM_NAME_* rather than string literals.
- Very specific: line 240
Do not rely on this snapshot alone.
- Very specific: line 310
Before editing this system, read example/doc/CODER.md and run the relevant tests:
- Very specific: line 372
Read example/doc/ASCENSION.md before changing ascension or lineage evolution.
- Distinctive: line 403
When adding or changing actions requiring YAML:
- Very specific: line 405
Add the action keyword to ACTIONS_EXPECTING_YAML in station/constants.py.
- Distinctive: line 407
Update the room help text.
- Distinctive: line 408
Add or update tests for parser and room behavior.
- Distinctive: line 409
Verify no other room reuses the same command in an incompatible way.
- Distinctive: line 417
Use these exact names:
- Very specific: line 427
When in doubt, search station/constants.py.
- Very specific: line 433
Create station/rooms/<room>.py inheriting BaseRoom.
- Very specific: line 434
Add full and short room constants in station/constants.py.
- Very specific: line 435
Add the room to ROOM_NAME_TO_SHORT_MAP.
- Very specific: line 437
Add navigation/access checks in station/station.py if needed.
- Distinctive: line 438
Add help text and tests.
- Very specific: line 442
Check station/agent.py, station/station.py, and station/station_runner.py.
- Very specific: line 443
Check LLM connector behavior in station/llm_connectors/.
- Distinctive: line 445
Do not clear or overwrite pending notifications unintentionally.
- Very specific: line 449
Use file_io_utils atomic helpers.
- Distinctive: line 452
Avoid full rescans in hot paths unless tests or profiling support it.
- Very specific: line 457
Read the relevant example/doc/*.md.
- Distinctive: line 458
Check max-tick wait behavior and notification behavior.
- Distinctive: line 459
Check restart/requeue semantics.
- Distinctive: line 460
Add tests for terminal states, notification delivery, and index updates.
- Common: line 467
Avoid embedding secrets or station_data content into client-side code.
- Very specific: line 468
Do not import web_interface.app from tests, helper scripts, or utility modules.
- Distinctive: line 472
When releasing a new version, update all current version references:
- Distinctive: line 474
Update all version references:
- Distinctive: line 480
Use this git workflow for a beta-to-main release:
- Very specific: line 481
Commit version changes to the beta branch.
- Distinctive: line 483
Commit the squash on main with the release message.
- Distinctive: line 492
Use the narrowest meaningful test set first:
- Very specific: line 494
When running tests, prefer the Python executable from the default conda environment station.
- Very specific: line 495
Do not import web_interface.app in tests.
- Distinctive: line 535
Use git status --short before and after edits.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
AGENT.md
This file gives Claude Code and other coding agents the current operating guidance for this repository.
First Principles
- Read the relevant docs before touching a subsystem. The
example/doc/folder contains subsystem notes. Use these as maintenance references, but verify against code when they disagree. - Check runtime overrides. Defaults live in
station/constants.py, butstation_data/constant_config.yamloverrides them at import time. Always inspect both when behavior depends on configuration. - Verify names and signatures before calling or editing. Use
rgto find definitions and call sites. Do not infer parameter names, constants, action names, or YAML fields from memory. - Treat
station_data/as live station state. Reading is allowed for debugging. Ask the user before modifying real station data unless the request explicitly asks for that modification. - Stay inside the current station checkout unless asked otherwise. When debugging live station state, only read or write the current repository and its own
station_data/orstation_multistart/paths. Do not inspect sibling checkouts such as~/station_2,~/station_3, or other~/station_*directories unless the user explicitly asks for a cross-station check or names that checkout. - Keep disposable local probes in
/tmp. Usetests/test_*.py,tests/debug_*.py, ortests/analysis_*.pyonly for files that should be visible to git. Use/tmpdirectly for generated API/debug snapshots, Sage/CAS probes, and other throwaway local test output. - Use repository file helpers for persistent station data. Use
station/file_io_utils.pyfor atomic YAML/text writes and safe directory creation.
Coding Agent Checklist
Before making code changes:
- Run
git status --shortand identify unrelated user changes. - Read this file, then read the subsystem doc listed in the Documentation Map.
- Inspect
station_data/constant_config.yamlwhen configuration affects the issue. - Use
rgto find the live implementation, constants, tests, and call sites. - Decide which files are code, docs, tests, or live station state before editing.
While changing code:
- Prefer small, localized edits that preserve existing YAML schema compatibility.
- Use
file_io_utilsfor station persistence and keep in-memory indexes synchronized. - Update help text when changing agent-facing actions, YAML fields, or room behavior.
- Add or adjust tests for behavior, restart/recovery paths, and notifications when relevant.
- Do not change
.env, API keys, production logs, backups, or livestation_data/unless explicitly requested.
Before finishing:
- Run the most relevant tests from the Verification Matrix below.
- Re-run
git status --short. - Report changed files, tests run, and any untested risk.
Current Project Snapshot
- Package/version:
stationversion1.5.0insetup.py,station/__init__.py,README.md, andCITATION.cff. - Main app:
python -m web_interface.app. - Default data root:
./station_data. - Default research task layout:
station_data/rooms/research/. - Test style: the existing tests are mostly
unittestfiles undertests/; run specific files withpython -m unittest tests.test_name. - Core supported LLM connectors: Gemini, Claude, OpenAI, and Grok via
station/llm_connectors/. - Current model presets are in
station/llm_connectors/model_presets.yaml.
Setup And Run
conda create -y -n station python=3.11
conda activate station
pip install -e .
python -m web_interface.appUseful optional setup:
sudo apt install ripgrepSecrets And Local State
Sensitive or machine-local files can exist in this repo checkout. Treat these as read-only unless the user explicitly asks otherwise:
.envstation_data/backup/deployment/worker_monitor.logexample_private/
API keys are read from environment variables such as GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, and XAI_API_KEY. Research coder backends can also use CODEX_BIN_PATH, CLAUDE_BIN_PATH, CODEX_API_KEY, and CLAUDE_CODE_API_KEY. Do not print, copy, or rewrite secrets.
Do not run ./start.sh or ./stop.sh yourself by default. These scripts depend on the user's shell/API-key environment and can fail or mutate live station state when run from an agent environment. This restriction may be overridden only when the user explicitly asks the agent to perform the specific start, stop, or restart operation and any relevant API credentials have been provided securely in the execution environment. Never ask the user to paste API keys into chat, and never print, copy, persist, or rewrite those credentials. Without both explicit authorization and the required environment credentials, tell the user the exact command to run and then verify the result from logs, PID files, controller status, and read-only process/status checks.
For live-station debugging, deployment/error.log is often useful, but it accumulates across station restarts. Do not run a blind global search across the whole file. First locate the most recent Station initialized. line, then inspect or search from that point onward.
Documentation Map
example/doc/PARALLEL_SYNC.md: Concurrent orchestrator tick execution, tick state, staged LLM history, internal actions, Research Center fast-lane submit, recovery semantics, dashboard status, and tests. Read this before changingstation_runner.pytick execution,station/sync/, connector history persistence, or fast-lane Research submit behavior.example/doc/API_BACKUP.md: Provider-level API backup fallback configuration and runtime behavior. Read this before changingstation/runtime_api_config.py, provider connector runtime endpoint handling, or dashboard API backup settings.example/doc/CAPSULE_INDEX.md: SQLite station index for capsule metadata and Research Center evaluation aggregates, rebuild behavior, tmp DB path handling, no-silent-YAML-fallback read contract, and selected-agent dashboard stream payloads. Read this before changingstation/capsule_index.py,station/eval_research/evaluation_index.py,station/index_paths.py, capsule room list rendering, Research Center list/stat/top-score paths, or dashboard stream sanitization.example/doc/CODER.md: Current source of truth for the Research Center coder workflow. Read this before changing Research Center scheduling, coder launch, runtime paths, attempt lifecycle, restart semantics, or agent-facing research behavior.example/doc/REVIEWER.md: Archive reviewer system and auto-pruning.example/doc/ARCHIVE_SURVEYOR.md: Archive Surveyor action, Codex/Claude survey sessions, report finalization, mail delivery, and recovery.example/doc/ASCENSION.md: Guest ascension, lineage inheritance, and lineage-evolution selection.example/doc/STAGNATION.md: Stagnation state model, breakthrough detection, and status transitions.example/doc/META_REFLECTION.md: Meta-reflection configuration and behavior.example/doc/EVALUATION_VERSIONS.md: Historical evaluation versioning notes.example/doc/CODEX_BUILD.md: Isolated standalone Codex build notes.example/doc/STATION_TOOLS.md: Multi-station CLI, config location, shared frontend API helpers, command behavior, and tests. Read this before changingstation_tools/,scripts/station, or Station Tools frontend API access.example/doc/RESEARCH_TASK.md: Current source of truth for authoring Research Center task templates, including bundle layout, audience boundaries, execution modes, scoring, metrics, baselines, dependencies, examples, and verification. If the user asks to create, write, update, or review a research task template, you must read this file in full before editing the bundle.
Source-of-truth rule:
- Current code wins over docs when they conflict.
example/doc/RESEARCH_TASK.mdis the source of truth for task-template authoring;example/doc/CODER.mdis the source of truth for Research Center coder lifecycle and runtime behavior.station/constants.pyplusstation_data/constant_config.yamlwins over copied constant values in this file.- Room help text in
station/rooms/*.pyis part of the user-facing contract and should be updated with behavior changes.
Archive reviewer prompt rule:
- Distinguish the reviewer system prompt from the reviewer initial context prompt. They are different layers.
- The reviewer system prompt is the explicit connector-level constant
ARCHIVE_REVIEWER_SYSTEM_PROMPT. - The reviewer initial context prompt is
EVAL_ARCHIVE_INITIAL_PROMPT, rendered with live task/archive/Codex data and sent as the first chat message. AutoArchiveEvaluatoris a system service, not a normal agent prompt flow. It must not be wrapped bybuild_station_level_system_prompt(...)or the station Codex prefix unless the reviewer architecture is intentionally redesigned.- If you expose or debug “Copy System Prompt” for
Reviewer, return the actual runtime connector system prompt, not the initial context prompt and not the station-wrapped agent prompt.
Architecture
The Station is an open-world, room-based multi-agent research environment. Agents move among rooms, persist memory in capsules and YAML files, submit experiments, publish papers, and interact with other agents.
Core modules:
station/station.py: centralStationobject, room registration, status updates, orchestration hooks, background evaluator startup, navigation rules, and station config.station/station_runner.py: orchestrator loop, turn order, connector initialization, ticking, pause/wait/resume behavior, backups, and runtime coordination.station/sync/: parallel tick runner, persistent parallel tick state, crash recovery helpers, and dashboard progress summaries.station/agent.py: agent YAML lifecycle, creation, ascension, token state, notifications, locations, and pruning state.station/action_parser.py:/execute_action{...}parsing and YAML extraction.station/base_room.py: room base class, room context, help rendering, and action handling interfaces.station/capsule.py: capsule persistence and shared capsule operations.station/capsule_index.py: rebuildable SQLite read model for capsule metadata, tags, recipients, and active message IDs.station/eval_research/evaluation_index.py: rebuildable SQLite read model for Research Center evaluation metadata, active queues, and top submission.station/index_paths.py: shared SQLite index path resolution, including station-specific tmp override handling.station/file_io_utils.py: atomic file I/O and safe directory helpers.station/constants.py: defaults for constants, action keywords, room names, configuration, prompt templates, and override loading.
Data flow:
- Web UI or orchestrator triggers an agent turn.
- LLM output is parsed by
ActionParser. Stationroutes actions to the current room or handles universal navigation/help actions.- Rooms update agent YAML, capsule files, evaluation records, notifications, or station config through helper modules.
- Background evaluators update queued work and notify agents.
Data Layout
Important runtime paths under station_data/:
station_config.yaml: station tick, status, turn order, station metadata, top submission fields, and status history.constant_config.yaml: runtime overrides forstation/constants.py.agents/: agent YAML files and model/role/state fields.capsules/private/,capsules/public/,capsules/mail/,capsules/archive/: capsule stores.rooms/research/: active Research Center task, evaluator, evaluation files, coder sessions, run requests, and storage.rooms/archive/: archive evaluation queues, reviewer/surveyor artifacts, and evaluation records.rooms/external/: External Counter pending reports and generated reports when enabled.dialogue_logs/: per-agent dialogue logs.
Do not assume these directories all exist. Optional rooms create their own data directories when enabled or first used.
During an active multistart job, the normal live station_data/ directory may be absent because the controller has moved the base data into station_multistart/<branch_tick>_<job_id>/origin_station_data/ and is running branch-local data roots such as station_multistart/<branch_tick>_<job_id>/station_data_s1/. Do not conclude the station is uninitialized or stopped from missing station_data/ alone. First inspect station_multistart/current_job.yaml, the active job state.yaml, and the relevant station_data_s*/ branch directories. For questions about init rosters or running agent models during init multistart, check each branch’s init_agents.yaml and agents/*.yaml; the selected branch is copied back to live station_data/ only after multistart finalization.
LLM And Model Configuration
LLM connectors are created through station/llm_connectors/factory.py and configured by agent YAML fields:
model_provider_classmodel_namellm_temperaturellm_max_tokensllm_custom_api_params
Provider implementations live in station/llm_connectors/gemini.py, claude.py, openai.py, and grok.py. Dashboard presets come from station/llm_connectors/model_presets.yaml.
Provider fallback support lives in station/runtime_api_config.py and is shared across agents in memory. Backups are read from semicolon-delimited OS env vars such as BACKUP_OPENAI_API_KEY, BACKUP_OPENAI_BASE_URL, BACKUP_OPENAI_HTTP_PROXY, and BACKUP_OPENAI_HTTPS_PROXY. Per-agent llm_custom_api_params remain for provider-specific request options, not endpoint ownership.
Proxy-related defaults are in LLM_HTTP_PROXY and LLM_HTTPS_PROXY, but environment variables such as HTTP_PROXY and HTTPS_PROXY can override them at import time. Be careful when debugging connector behavior because imported constants may already include environment overrides.
Rooms
Always use constants.ROOM_* and constants.SHORT_ROOM_NAME_* rather than string literals.
Current room modules:
Lobby:station/rooms/lobby.pyReflection Chamber:station/rooms/reflect.pyPrivate Memory Room:station/rooms/private_memory.pyPublic Memory Room:station/rooms/public_memory.pyArchive Room:station/rooms/archive.pyMail Room:station/rooms/mail.pyCommon Room:station/rooms/common.pyAdministrative Counter:station/rooms/admin.pyMisc Room:station/rooms/misc.pyResearch Center:station/rooms/research_center.py, gated byRESEARCH_CENTER_ENABLEDExternal Counter:station/rooms/external_counter.py, gated byEXTERNAL_COUNTER_ENABLEDMaze:station/rooms/maze.py, gated byMAZE_ENABLEDExit:station/rooms/exit.py
Navigation uses short names in /execute_action{goto <short_name>}. The mappings are in ROOM_NAME_TO_SHORT_MAP and SHORT_ROOM_NAME_TO_FULL_MAP.
Configuration
The override system is at the bottom of station/constants.py. On import, _load_config_overrides() loads station_data/constant_config.yaml and replaces matching globals. Unknown keys are ignored unless verbose loading is enabled.
Current local override snapshot at the time this guide was updated:
# station_data/constant_config.yaml
RESEARCH_EVAL_MAX_PARALLEL_WORKERS: 8
RESEARCH_EVAL_TIMEOUT: 900
RESEARCH_SCORE_DISPLAY_PRECISION: 4
RESEARCH_EVAL_USE_DIFF_GPU: false
RESEARCH_EVAL_CPU_NUM: 20
REFLECTION_META_INTERVAL: 25Important defaults to know:
BASE_STATION_DATA_PATH = "./station_data"PARALLEL_RESEARCH_FAST_LANE_ENABLED = TruePARALLEL_RESEARCH_SUBMISSION_TIMEOUT_SECONDS = 0.0PARALLEL_ARCHIVE_SURVEY_FAST_LANE_ENABLED = TruePARALLEL_ARCHIVE_SURVEY_SUBMISSION_TIMEOUT_SECONDS = 0.0WEB_AUTH_ENABLED = TrueAUTO_EVAL_RESEARCH = TrueRESEARCH_EVAL_USE_PYTHON_SANDBOX = TrueRESEARCH_EVAL_MAX_TICK = 2RESEARCH_EVAL_MAX_PARALLEL_WORKERS = 4RESEARCH_SUBMISSION_COOLDOWN_TICKS = 0THEORIST_RESEARCH_SUBMISSION_COOLDOWN_TICKS = 10RESEARCH_MAX_CONCURRENT_SUBMISSIONS = 2RESEARCH_CODER_BACKEND = "codex"RESEARCH_CODER_TIMEOUT_SECONDS = 21600RESEARCH_CODER_MAX_ATTEMPTS = 5RESEARCH_CODER_MAX_SPAWNS = 3RESEARCH_EVAL_USE_DIFF_GPU = FalseRESEARCH_EVAL_CPU_NUM = NoneEVAL_ARCHIVE_MODE = "auto"STAGNATION_ENABLED = TrueSTAGNATION_THRESHOLD_TICKS = 320RANDOM_PROMPT_FREQUENCY = 4BACKUP_FREQUENCY_TICKS = 10AGENT_MAX_LIFE = 300AGENT_ISOLATION_TICKS = 40EXTERNAL_COUNTER_ENABLED = False
Do not rely on this snapshot alone. Re-check constants.py and station_data/constant_config.yaml before changing behavior.
Research Center
The current Research Center is an instruction-to-coder workflow, not the older direct raw-code, multi-task task_id workflow.
Current behavior:
- Agents submit one experiment instruction with YAML fields
title,tags,abstract, andinstruction. - A room-owned coder session implements the instruction, runs official attempts, debugs if needed, and writes a final Coder Report.
- The active research task is a single markdown spec at
station_data/rooms/research/research_task.md. - The active evaluator is loaded from
station_data/rooms/research/evaluators/evaluator.py. - Evaluation records are one YAML file per evaluation under
station_data/rooms/research/evaluations/{id}.yaml. - Runtime directories and storage are normalized by
station/eval_research/runtime_paths.py. - Agents have at most two active research experiments by default.
- Research Center storage is read-only to agents, but writable to coder sessions where allowed.
State invariants:
- Top-level active states should be
queuedorrunning. - Terminal states include
completed,failed,blocked, andpartial;successnormalizes tocompleted. - Coder substates such as
coder_running,attempt_running,pending_resume, andresuminglive under top-levelrunning. RESEARCH_EVAL_MAX_PARALLEL_WORKERSlimits live coder workflows.attempt_queuedandattempt_runningevaluations still consume coder capacity while the coder workflow is live; official attempt execution is queued and constrained by CPU/GPU resource coordination.- Restart and resume helpers must safely requeue unfinished running work without clobbering terminal results.
Agent-facing Research Center actions include:
read_tasksubmitreview <evaluation_id>read_code <evaluation_id>read <path> [page]storage infostorage list <path> [page]rank id|score|authorfilter <tag>unfilterpreview <ids|all>page_size <n>page <n>
Storage surfaces:
storage/<lineage>/: lineage working area, physically understorage/lineages/<lineage>with a compatibility alias.storage/shared/: shared persistent storage.storage/system/: official read-only task resources.storage/submission/,storage/stdout/,storage/stderr/, andstorage/report/: runtime artifacts.- Immature agents can read their own lineage storage and
storage/system/..., but cannot readstorage/sharedor other lineage storage until maturity. submit_eval.sh: generated at station startup. It invokesstation_data/rooms/research/_internal/submit_eval_cli_snapshot.py, a frozen artifact-only submit CLI refreshed on station restart.eval_tool.sh: generated at station startup. It invokesstation_data/rooms/research/_internal/eval_tool_cli_snapshot.py, a read-only helper withsearch REGEXfor abstract-only evaluation search andpreview <eval_id>for metadata, abstract, instruction, coder prompt, and Coder Report without raw code or logs.
Research Center modules:
station/rooms/research_center.py: room UI, action handling, submission validation, read cooldowns, storage reads, review/code display, and visibility rules.station/eval_research/evaluation_manager.py: evaluation YAML schema, active/queued indexes, top submission tracking, notifications, display/review/code payloads.station/eval_research/auto_evaluator.py: queue processing and evaluator/coder orchestration.station/eval_research/submission_service.py: single-writer fast-lane Research Center submit service used by the concurrent tick runner.station/sync/fast_lane_service.py: generic single-writer service base for parallel fast-lane actions.station/eval_research/coder_manager.py: coder prompt construction, backend sessions, attempts, reports, and finalization.station/workers/cli.py: generic Codex and Claude CLI command construction shared by the coder, surveyor, and specialized local workers.station/eval_research/submit_eval_cli.pyandsubmit_eval.sh: official attempt submission path.station/eval_research/executor_sandbox.py: Python sandbox execution.station/eval_research/task_registry.py: loads the single active evaluator class fromevaluator.py.station/eval_research/base_evaluator.py:ResearchTaskEvaluatorinterface.station/eval_research/gpu_coordinator.pyandcpu_coordinator.py: optional resource allocation.station/eval_research/restart_evaluations.py: restart/requeue/recovery helpers.
When debugging a specific evaluation #id, inspect live station data first before inferring behavior from the code. Start with station_data/rooms/research/evaluations/{id}.yaml, especially status, coder.session_id, attempts, current_attempt, final, and artifact paths. If coder.session_id is set, then inspect station_data/rooms/research/coder_sessions/<session_id>/prompt.txt, transcript.jsonl, stderr.txt, and last_message.txt when present. Also check the live attempt artifacts at station_data/rooms/research/storage/submission/{id}.py, station_data/rooms/research/storage/stdout/{id}.log, station_data/rooms/research/storage/stderr/{id}.log, and station_data/rooms/research/storage/report/{id}.md.
Before editing this system, read example/doc/CODER.md and run the relevant tests:
python -m unittest tests.test_research_center_interfaces
python -m unittest tests.test_research_coder_runtime
python -m unittest tests.test_research_restart_semanticsArchive, Reviewer, And Surveyor
Archive papers use capsule persistence plus optional automated evaluation.
Important settings:
EVAL_ARCHIVE_MODE = "auto"enables the reviewer.AUTO_EVAL_ARCHIVE_MODEL_CLASSandAUTO_EVAL_ARCHIVE_MODEL_NAMEconfigure the reviewer model.ARCHIVE_EVALUATION_PASS_THRESHOLD = 6controls publication acceptance.ARCHIVE_SURVEY_ENABLED = Trueenables the Archive Roomsurveyaction and background Surveyor.
Key files:
station/rooms/archive.pystation/eval_archive/auto_evaluator.pystation/eval_archive/surveyor.pyexample/doc/ARCHIVE_SURVEYOR.mdexample/doc/REVIEWER.md
External Counter
The External Counter is disabled by default via EXTERNAL_COUNTER_ENABLED = False. When enabled, it lets tenured Recursive Agents and Supervisors request external literature reports generated by AutoExternalReporter. Research Center coder submissions from tenured agents snapshot internet access at submission time; the coder may use it only when the submitted instruction explicitly requests external access.
Key files:
station/rooms/external_counter.pystation/eval_external/auto_external_reporter.py
Settings include AUTO_EVAL_EXTERNAL_REPORT, EXTERNAL_REPORT_MODEL_NAME, EXTERNAL_REPORT_MAX_PARALLEL_WORKERS, EXTERNAL_REPORT_TIMEOUT_SECONDS, EXTERNAL_REPORT_MAX_RETRIES, EXTERNAL_REPORT_STREAMING, and EXTERNAL_MAX_CONCURRENT_REQUESTS.
Agent Lifecycle
Agent statuses:
Guest Agent: starts with limited privileges and a 100k token ceiling.Recursive Agent: full station privileges after ascension, default 1M token budget.
Current lifecycle features:
- Guests can ascend immediately via
ascend_inheritorascend_new. - Guest role definitions are initialized in
station/agent.py:create_guest_agent(). If a caller passes an explicitrole_definitionstring, use it, including an explicit empty string. If no explicit role definition is passed, sample from the fresh-guest role pool: entries fromstation_data/init_role_def.yamlonly. Departed agents'next_role_definitionvalues are reserved for lineage inheritance and are not sampled by unrelated fresh guests. The YAML may intentionally include an empty string entry for "no role". station_data/init_agents.yamlauto-spawn names model presets. Blankrole_definition: ""values instation/llm_connectors/model_presets.yamlare normalized to no explicit role, so init-agent auto-spawn samples from the fresh-guest role pool. Non-empty preset role definitions are explicit overrides.- The web dashboard create-agent form treats an untouched/blank role field as no explicit role: frontend JS omits it, and
web_interface/app.pyalso normalizes blank strings toNonebefore calling the orchestrator. - Auto-respawn after a non-ascension exit creates a fresh guest with no explicit role override, so it samples from the fresh-guest role pool. It does not inherit the departed agent's current
role_definitionor take that agent'snext_role_definition;next_role_definitionis used only when a guest ascends by inheriting that lineage. - On
ascend_inherit, an ancestor'snext_role_definitionhas priority over the guest's role definition, including explicit empty strings. Onascend_new, the guest's role definition carries over. - Lineage selection can be fitness-based via
LINEAGE_SELECTION_MODE = "evolution". - Private memory capsules are inherited across lineage generations.
- Agents have life limits controlled by
AGENT_MAX_LIFEandAGENT_LIFE_WARNING_THRESHOLD. - Immature agents are restricted by
AGENT_ISOLATION_TICKS. - Supervisors and theorists are role-based variants controlled by
AGENT_ROLE_KEY,ROLE_SUPERVISOR, andROLE_THEORIST; their runtime role text overrides storedrole_definitioninbuild_station_level_system_prompt(...). - Supervisors and theorists do not get the Exit Room descendant-role prompt.
- Auto-respawn is controlled by
AUTO_RESPAWN. - Exit flow is handled by the Exit room and may require minimum archive/age conditions.
Read example/doc/ASCENSION.md before changing ascension or lineage evolution.
Station Status And Orchestrator State
Station status is centrally managed through:
station.update_station_status(new_status, current_tick)This keeps station_config.yaml and status_history consistent. Do not directly mutate station status in config unless you are intentionally bypassing the API.
Orchestrator states:
Running: normal turn processing.Paused: manual resume required.Waiting: station is blocked at a tick boundary until pending work reaches a safe state.
Background work can continue while the station runs. The Research Center, Archive evaluator, Archive Surveyor, and External Counter each have independent background evaluator/reporting loops when enabled.
Stagnation, Backups, Tips, And System Messages
- Stagnation logic lives in
station/stagnation_protocol.py; readexample/doc/STAGNATION.mdbefore changing it. - Backups use content-addressable storage in
station/backup_utils.pyand are triggered everyBACKUP_FREQUENCY_TICKSunless disabled. - Restore helper:
bash scripts/restore.sh {station_id} {tick}. - Random tips are loaded from
station_data/random_prompts.yamland controlled byRANDOM_PROMPT_FREQUENCY. - System message rendering/truncation lives in
station/system_messages.py. - Pending notifications must be preserved safely while agents are responding.
Actions And YAML Parsing
When adding or changing actions requiring YAML:
- Add the action keyword to
ACTIONS_EXPECTING_YAMLinstation/constants.py. - Define field constants when the field is shared or likely to be reused.
- Update the room help text.
- Add or update tests for parser and room behavior.
- Verify no other room reuses the same command in an incompatible way.
Common YAML-backed actions include capsule create, reply, update, forward; Archive survey; Research Center submit; Administrative Counter request_human; Reflection reflect; Common Room speak and invite; and ascension actions.
Agent-facing text that mentions an action should use the exact parser command. For example, the Research Center currently uses read_task, not the older read task_id pattern.
Constants That Are Easy To Get Wrong
Use these exact names:
BASE_STATION_DATA_PATH, notSTATION_DATA_DIRROOMS_DIR_NAME, notROOMS_DATA_DIRRESEARCH_EVALUATIONS_SUBDIR_NAME, notRESEARCH_EVALUATIONS_DIRRESEARCH_TASK_SPEC_FILENAME, currentlyresearch_task.mdRESEARCH_BASELINE_FILENAME, currentlybaseline.yamllPENDING_EXTERNAL_REPORTS_FILENAMEARCHIVE_EVALUATIONS_SUBDIR_NAME
When in doubt, search station/constants.py.
Development Patterns
Adding a room:
- Create
station/rooms/<room>.pyinheritingBaseRoom. - Add full and short room constants in
station/constants.py. - Add the room to
ROOM_NAME_TO_SHORT_MAP. - Instantiate it in
Station.__init__, behind a feature flag if optional. - Add navigation/access checks in
station/station.pyif needed. - Add help text and tests.
Changing agent behavior:
- Check
station/agent.py,station/station.py, andstation/station_runner.py. - Check LLM connector behavior in
station/llm_connectors/. - Preserve agent YAML compatibility with older fields when possible.
- Do not clear or overwrite pending notifications unintentionally.
Changing persistence:
- Use
file_io_utilsatomic helpers. - Preserve YAML/YAMLL format compatibility.
- Rebuild or update in-memory indexes after external edits.
- Avoid full rescans in hot paths unless tests or profiling support it.
Changing evaluator behavior:
- Identify whether the flow is Research, Archive, or External.
- Read the relevant
example/doc/*.md. - Check max-tick wait behavior and notification behavior.
- Check restart/requeue semantics.
- Add tests for terminal states, notification delivery, and index updates.
Changing the web UI:
- Check
web_interface/app.py,web_interface/static/js/dashboard.js, andweb_interface/templates/dashboard.html. - Confirm API payload fields match backend route handlers.
- Preserve auth behavior controlled by
WEB_AUTH_ENABLED. - Avoid embedding secrets or station_data content into client-side code.
- Do not import
web_interface.appfrom tests, helper scripts, or utility modules. Importing it initializes the live Station and Orchestrator at module import time and can mutatestation_data/. Move side-effect-free helpers into separate modules such asweb_interface/input_utils.pyand test those modules directly.
Version Updates
When releasing a new version, update all current version references:
- Update all version references:
setup.py:version='X.Y.Z'station/__init__.py:__version__ = 'X.Y.Z'README.md:<strong>Version X.Y.Z</strong>CITATION.cff:version: "X.Y.Z"
- Use this git workflow for a beta-to-main release:
- Commit version changes to the
betabranch. - Squash-merge
betaintomain:git switch main && git merge --squash beta. - Commit the squash on
mainwith the release message. - Push
main:git push origin main. - Tag the release:
git tag vX.Y.Z && git push origin vX.Y.Z. - Hard-reset
betatomain:git switch beta && git reset --hard main && git push origin beta --force-with-lease.
- Commit version changes to the
Current version is 1.5.0.
Verification Matrix
Use the narrowest meaningful test set first:
- When running tests, prefer the Python executable from the default conda environment
station. Check common locations such as/home/ubuntu/miniconda3/envs/station/bin/pythonto identify the correct interpreter. If you truly cannot find thestationenvironment Python, fall back topythonorpython3. - Do not import
web_interface.appin tests; it initializes live station runtime state at import time. Test route-independent helpers through side-effect-free modules instead. - Research Center room/display/index behavior:
python -m unittest tests.test_research_center_interfaces - Research coder runtime/backends/prompts:
python -m unittest tests.test_research_coder_runtime - Research restart/requeue semantics:
python -m unittest tests.test_research_restart_semantics - Archive notification safety:
python -m unittest tests.test_archive_notification_atomic - Stagnation protocol:
python -m unittest tests.test_stagnation_protocol - Agent role definition initialization, ascension inheritance, and supervisor/theorist prompt overrides:
python -m unittest tests.test_agent_role_definitions - Task-specific baseline checks:
python -m unittest tests.test_research_epoch_ramsey_baseline
For parser-only changes, also consider:
python station/action_parser.pyFor concurrent tick-runner changes:
python -m unittest tests.test_parallel_research_syncFor import/syntax sanity after broad edits:
python -m compileall station web_interfaceUseful Commands
rg "def function_name" station
rg "CONSTANT_NAME" station/constants.py
python -m unittest tests.test_research_center_interfaces
python -m unittest tests.test_research_coder_runtime
python -m unittest tests.test_research_restart_semantics
python -m unittest tests.test_stagnation_protocol
python -m unittest tests.test_archive_notification_atomicUse git status --short before and after edits. The worktree may contain user changes; do not revert unrelated files.
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.

