consistent.ceo
AGENTS.md1 starsChanged 37 days agoMITView on GitHub
This file provides guidance to WARP (warp.dev) when working with code in this repository. This repository is a Rust workspace centered on the consistent-world-gateway binary. The gateway wires together: - inbound/outbound channel adapters (crates/channels) - agent runtime and tool-calling loop (crates/agents) - LLM providers and streaming (crates/llm) - persistent state + semantic memory (crates/memory) - built-in tools + WASM-backed plugin tools (crates/tools, crates/plugins) - credentials backends (crates/credentials) - shared types/capabilities/telemetry (crates/common) Cargo.toml at repo root defines all workspace members and…
- Installs packages
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 33,315 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 repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- repo-healthSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 76
Run commands from repository root unless noted.
≈ “Common” is an estimate: at least 1 in 5 of the 42,283 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
AGENTS.md
This file provides guidance to WARP (warp.dev) when working with code in this repository.
Project shape
This repository is a Rust workspace centered on the consistent-world-gateway binary. The gateway wires together:
- inbound/outbound channel adapters (
crates/channels) - agent runtime and tool-calling loop (
crates/agents) - LLM providers and streaming (
crates/llm) - persistent state + semantic memory (
crates/memory) - built-in tools + WASM-backed plugin tools (
crates/tools,crates/plugins) - credentials backends (
crates/credentials) - shared types/capabilities/telemetry (
crates/common)
Cargo.toml at repo root defines all workspace members and shared dependencies.
Runtime architecture (big picture)
Gateway startup and wiring
- Entry point:
crates/gateway/src/main.rs. - Config is loaded from
~/.consistent-world/consistent_world.toml(created automatically if missing) viaconfig::ensure_config_file+config::load. - Memory/schedule backend is created by
startup::create_memory_and_schedule:- prefers SurrealDB when configured
- falls back to SQLite automatically if SurrealDB is unavailable.
ServerStateis assembled with memory backend, control state, optional embedding provider, runtime status, and agent registry.
Two long-lived loops plus HTTP API
- HTTP server (
crates/gateway/src/server.rs) exposes/health, protected/api/*, and control routes. - Message routing loop (
crates/gateway/src/router.rs):- receives inbound channel messages
- resolves scope
- chooses runtime agent via routing rules
- executes
Agent::handle_message - sends adapter replies.
- Orchestrator loop (
crates/gateway/src/orchestrator.rs):- heartbeat-driven task pickup
- director/agent assignment
- mission follow-up and operator-feed updates.
- Heartbeat ticker (
crates/gateway/src/heartbeat_store.rs::HeartbeatTicker):- polls every ~30s, picks due rows from the
heartbeatstable - hands each to
ChatHeartbeatDispatcher(crates/gateway/src/heartbeat_dispatcher.rs) - dispatcher resolves the assigned director + active mission's pinned notes, persists a row in
heartbeat_resultsfor the entity, which the chat UI surfaces astone:'heartbeat'bubbles.
- polls every ~30s, picks due rows from the
Three-pillar foundation modules (added 2026-05-24)
- Directors as data —
director_store.rs(tabledirectors),director_seed.rs(idempotent seed fromagents_seed.json),director_lessons_store.rs(tabledirector_lessons, HNSW recall, spliced into prompts). - Missions canonical —
mission_store.rs(tablemissionswithnarrative+canonical_notes;pin_note/set_narrative/list_active_for_entity). - Heartbeats —
heartbeat_store.rs(tableheartbeats,HeartbeatStore+HeartbeatTicker),heartbeat_dispatcher.rs,heartbeat_results_store.rs(tableheartbeat_results). - Prompt pipeline —
prompt_assembly.rs(pureassemble_system_prompt(&CanonicalInputs); SOUL → director → entity → mission, with optional lessons). Wired intochat_agent.rs::build_initial_messages. - Hot-swap LLM —
credentials_resolver.rs::resolve_llm_api_keyre-reads env+keyring per turn; settings UI probes new keys before keyring write.
Local model training (training/, crates/gateway/src/training.rs)
consistent-world training context|render-beats|render-chats|tracesrenders fine-tuning prompts with the production prompt builders and live tool schemas; keep it that way so training data never drifts from runtime prompts.CONSISTENT_WORLD_TRAINING_TRACES=1records every LLM exchange (wrapped incapture::build_llm_client) to~/.consistent-world/training/traces/.- Python pipeline (scenario generation → teacher distillation → Unsloth LoRA → GGUF → Ollama
consistent-gemma) is documented intraining/README.md.
Agent execution model
- Core loop:
crates/agents/src/agent.rs. - For each message:
- recalls semantic memories (if embedding provider enabled),
- builds chat history from
MemoryStore, - sends completion request to LLM provider,
- executes tool calls through
ToolRegistry, - persists user/assistant/tool history.
- Tool arguments can be policy-enriched via
ToolPolicyProvider(gateway injects scope-aware policy hints).
State boundaries
ControlState(crates/gateway/src/state.rs) holds entities/tasks/missions/directors/approvals and is snapshotted to~/.consistent-world/control_state.json.- Session/message/memory persistence is via
MemoryStoretrait:SurrealMemoryStoresupports semantic search + HNSW vector index.SqliteMemoryStoreis fallback/no-vector mode.
Common commands
Run commands from repository root unless noted.
Build and run
cargo build -p consistent-world-gateway --releasecargo run -p consistent-world-gatewaycargo run -p consistent-world-gateway -- start --openQuality gates (same style as CI)
cargo check --workspacecargo test --workspacecargo clippy --workspace -- -D warningscargo fmt --allRun tests for one crate or one test
cargo test -p consistent-world-gatewaycargo test -p consistent-world-gateway auth_context_uses_scoped_token_when_secret_matches_prefixConfiguration and credentials
cargo run -p consistent-world-gateway -- --onboardcargo run -p consistent-world-gateway -- credentials set consistent_world.gateway.auth_token <token>Data migration utility
cargo run -p consistent-world-gateway --bin migrate_sqlite_to_surreal -- --dry-runWASM plugin build example
cargo build -p consistent-world-plugin-hello-world --target wasm32-wasip1 --releaseOptional desktop shell workflow
From desktop/:
pnpm install
pnpm run build:sidecar
pnpm tauri devDoes 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.

