OpenAgentd / appv3
AGENTS.md217 starsChanged 28 days agoApache-2.0View on GitHub
appv3/ is the native agentd backend. It ships as the CLI release binary and as the desktop sidecar (desktop/sidecar-bundle/bin/agentd). It reads the database and config files of the end-of-life Python v2 backend, whose source is no longer in this tree. Its HTTP/SSE/WebSocket API started as v2's and now differs where REPORT.md says. - core: settings, XDG paths, auth policy (auth.rs), path safety (security.rs), errors, platform plumbing (which, home, proctree). - db: SQLite pool, queries (reading v2-era rows too), and the…
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 31,700 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 repository8 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- desktop/AGENTS.mdAGENTS.md
- documents/AGENTS.mdAGENTS.md
- mobile/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- web/AGENTS.mdAGENTS.md
- guidelinesSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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 36
Every service the server starts is a kernel module.
- Very specific: line 55
Test a module by booting a Kernel::new() with only the modules it needs (kernel/src/tests.rs).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Rust Backend (v3) Guide
appv3/ is the native agentd backend. It ships as the CLI release
binary and as the desktop sidecar (desktop/sidecar-bundle/bin/agentd).
It reads the database and config files of the end-of-life Python v2 backend,
whose source is no longer in this tree. Its HTTP/SSE/WebSocket API started as
v2's and now differs where REPORT.md says.
Crate map
core: settings, XDG paths, auth policy (auth.rs), path safety (security.rs), errors, platform plumbing (which,home,proctree).db: SQLite pool, queries (reading v2-era rows too), and the replayed Alembic chain.kernel: module lifecycle (start in dependency order, stop in reverse, per-module state) and typed contributions tagged with their module.api: axum routes, middleware (auth, Origin/Host guard, CORS, panic → 500), startup/shutdown through the kernel (modules.rs,plugins.rs).agent: turn loop, hooks, sessions, SSE broadcaster and stream store, snapshots, scheduler.providers,tools,mcp,memory,terminal,jsplugin,plugins: the model providers, built-in tools, MCP client, memory pages, PTY terminal, the QuickJS plugin host, and the plugin folder reader (manifest, skills, MCP servers, permissions).cli: theagentdbinary (server serveis the sidecar entry point).crates/*/data/: data each crate compiles in (tool definitions, prompts, the provider catalog, built-in skills and commands, MIME types).crates/agent/data/sse_events.jsonlists every SSE event type per stream and is shared with the web client. Rust checks each published event against it (agent/src/events.rs; debug builds panic), andweb/src/__tests__/api/sse-contract.test.tschecks the web unions. A new event needs the JSON entry, the Rust producer, and the web type/handler.
Modules
Every service the server starts is a kernel module; GET /api/modules and
agentd doctor show their state.
- Built-in modules are the
BUILTINtable inapi/src/modules.rs. Start order is dependency order, then table order; stop order is the reverse, andbuiltin_modules_stop_in_the_servers_shutdown_orderpins it. Place a new entry where its stop belongs, and update that test only for a deliberate change. depslists hard requirements only: a module whose dependency failed is blocked. Mark a modulecriticalonly when the server must not run without it; any other failure leaves the rest running.- A module hands out what it provides in
register(Registrar::add, no I/O there), and consumers read it withKernel::contributions::<C>(). Contributions are removed when their module stops, so restarting one replaces them (examples:agent::plugins::ExtraTool,agent::skills::PluginSkills,mcp::plugin::PluginServers). - Each plugin folder is a
plugin:<name>module added byapi::plugins::reload(). Start and stop hooks must not call kernel operations (add,restart,remove). - Test a module by booting a
Kernel::new()with only the modules it needs (kernel/src/tests.rs).
Safety constraints
- Validate externally supplied workspace roots with
agent::manager::validate_workspace(routes:validate_workspace_or_422) and resolve paths inside them with the existingsafe_join/safe_resolveroute helpers. Do not join untrusted paths by hand. - Compare secrets with
core::auth::constant_time_eq. - The network guard in
api/src/middleware.rsrefuses foreignHostheaders and cross-origin callers when no access key is set. Do not widen it, the auth exempt paths, or the CORS default without explicit approval. server serveremovescore::auth::CHILD_ENV_SECRETSfrom its own environment at startup, so no child process (shell tool, terminal, git, MCP, plugins) inherits the desktop token or access key. Add any new secret that arrives via the environment to that list.- Spawn processes with argument lists (
Command::new(..).args(..)), applyproctree::hide_window, and kill process trees throughproctree. - A panic inside a turn becomes an ordinary turn error, and a handler panic becomes a plain 500. Treat both as bugs, not error handling: return errors.
Checks
From the repository root:
make verify-v3 # cargo fmt --check, clippy -D warnings, all testsWhile iterating, run cargo fmt --all (see rustfmt.toml) and focused
crates, e.g. cargo test -p appv3-api, from this directory. Integration
tests that spawn server serve (crates/cli/tests/) build the binary and
use throw-away HOME/XDG roots; never point tests at real user data.
API or event changes also need make verify-web.
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.

