agentleFS
Al-BaqshiAl-Baqshi/consistent.ceo/AGENTS.md

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.

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
  1. Distinctive:

    Run commands from repository root unless noted.

    line 76

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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) via config::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.
  • ServerState is 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 heartbeats table
    • 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_results for the entity, which the chat UI surfaces as tone:'heartbeat' bubbles.

Three-pillar foundation modules (added 2026-05-24)

  • Directors as data — director_store.rs (table directors), director_seed.rs (idempotent seed from agents_seed.json), director_lessons_store.rs (table director_lessons, HNSW recall, spliced into prompts).
  • Missions canonical — mission_store.rs (table missions with narrative + canonical_notes; pin_note / set_narrative / list_active_for_entity).
  • Heartbeats — heartbeat_store.rs (table heartbeats, HeartbeatStore + HeartbeatTicker), heartbeat_dispatcher.rs, heartbeat_results_store.rs (table heartbeat_results).
  • Prompt pipeline — prompt_assembly.rs (pure assemble_system_prompt(&CanonicalInputs); SOUL → director → entity → mission, with optional lessons). Wired into chat_agent.rs::build_initial_messages.
  • Hot-swap LLM — credentials_resolver.rs::resolve_llm_api_key re-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|traces renders 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=1 records every LLM exchange (wrapped in capture::build_llm_client) to ~/.consistent-world/training/traces/.
  • Python pipeline (scenario generation → teacher distillation → Unsloth LoRA → GGUF → Ollama consistent-gemma) is documented in training/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 MemoryStore trait:
    • SurrealMemoryStore supports semantic search + HNSW vector index.
    • SqliteMemoryStore is fallback/no-vector mode.

Common commands

Run commands from repository root unless noted.

Build and run

cargo build -p consistent-world-gateway --release
cargo run -p consistent-world-gateway
cargo run -p consistent-world-gateway -- start --open

Quality gates (same style as CI)

cargo check --workspace
cargo test --workspace
cargo clippy --workspace -- -D warnings
cargo fmt --all

Run tests for one crate or one test

cargo test -p consistent-world-gateway
cargo test -p consistent-world-gateway auth_context_uses_scoped_token_when_secret_matches_prefix

Configuration and credentials

cargo run -p consistent-world-gateway -- --onboard
cargo 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-run

WASM plugin build example

cargo build -p consistent-world-plugin-hello-world --target wasm32-wasip1 --release

Optional desktop shell workflow

From desktop/:

pnpm install
pnpm run build:sidecar
pnpm tauri dev

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.