Skip to main content
The piloop package has one subpackage for each concern. Imports only point down this list:
  1. db/: storage, the SQL gate for agents, the events feed.
  2. mcp/, usage/, and config.py with harnesses.py: MCP servers, token usage, the project configuration.
  3. runtime/: where the agent processes run (a background process, or a Herdr pane).
  4. scoring/: the evaluate command, the ledger, the verdict.
  5. agents/: the roles and their prompts, the agent lifecycle, session capture.
  6. campaign/: projects, ideas, the inbox, stop conditions, the spend limit.
  7. reports/: status, history, the research pack.
  8. daemon/: the process, the scheduler, the run executor.
  9. watch/ and cli/.
The rule is also in CONTRIBUTING.md. When a module needs code from a higher layer, move that code down. The graph below is generated from the import statements in piloop/. An arrow points from the importer to what it imports. An arrow that a longer path already implies is left out, so the layers show. The table after the graph has every direct import. The graph leaves out the shared modules deprecated.py, git.py, otel.py, proc.py, settings.py, text.py. Every layer may import them.