Imported from baxter-barlow/cairnvm (
AGENTS.md). Install upstream withnpx skills add baxter-barlow/cairnvm. Copyright stays with the author.
Agent Guide
Scope and authority
These rules apply repository-wide; a deeper AGENTS.md may add stricter rules.
Docs/Architecture-Spec.md is the normative design authority. Treat
Docs/Architecture-Draft.md as historical context only. If code and the
normative specification disagree, stop and resolve the discrepancy explicitly.
The repository is a Phase 0 scaffold. Do not describe Drive persistence, encryption, checkpointing, recovery, or verified bootstrap as implemented until their roadmap gates have passed.
Required workflow
- Write or update a failing test before behavior changes.
- Make the smallest change that passes it.
- Run
make lint typecheck test; runmake securitywhen dependencies change. - Stage only the intended files after reviewing the exact diff.
- Run
make checkagainst that exact staged candidate; it rejects tracked drift and nonignored untracked files. Then runmake scan-stagedbefore every commit. If either requires a correction, restage the exact files and repeat both staged gates. - For architecture, trust-boundary, durable-format, recovery, security, or agent- guidance changes, obtain an independent adversarial subagent review of the exact staged candidate. Approval means the reviewer reports no negative finding. Otherwise revise, then repeat the local checks, staging, both staged gates, and review until it does.
- Commit the tested and, when required, reviewed implementation. When a Phase 0
gate is exercised, create a single-parent follow-up evidence/status commit that
adds exactly one new complete Phase 0 evaluation TOML file and changes
ROADMAP.mdonly when the aggregate phase status changes. It may change no other path. Repeat both staged gates, then obtain an independent review of the exact staged evidence/status candidate. The reviewer must manually confirm the tested implementation commit's full SHA, that the evaluation'stested_commitandexact_parentboth equal the candidate's sole parent, publication-branch binding, allowed-path scope, append-only history, timestamp and trusted-clock ordering, completeness, aggregation, redaction, and no negative finding. Confirm that the publication branch blocks force pushes and deletion before publishing the record; do not claim protected or immutable history until that remote setting is verified. Evidence must never claim to describe its own commit.
Keep commits narrow. Do not claim a test passed if its required runtime or external service was unavailable; record it as blocked. After two failed correction cycles on one design, stop patching it and restart from a simpler design in a fresh task.
Safety invariants
- Fail closed on malformed, unauthenticated, ambiguous, or unsupported state.
- Treat every Drive object and repository identifier as untrusted input.
- Never log passphrases, OAuth tokens, plaintext guest data, derived keys, or secret envelopes.
- Never upload plaintext guest blocks or credentials.
- Never select a concurrent-writer branch silently.
- Do not implement destructive remote garbage collection in v1.
- Preserve the launcher as an independent trust boundary. It must not import or
depend on
cairnvm-runtime. - Keep tests offline and deterministic by default. Use synthetic data and fake services for protocol tests.
Repository conventions
- Python 3.11+; use
uvand the committed lockfile. - Format and lint with Ruff, type-check with strict mypy, and test with pytest.
- Put normative protocol behavior in
Docs/Architecture-Spec.md. Keep selected constants, limits, transitions, and recovery contracts that the specification explicitly mirrors inDocs/architecture-state-model.tomlsynchronized with the normative prose and exact contract tests. Put durable decisions inDocs/ADRs/and execution status inROADMAP.md. - Update
README.mdandOVERVIEW.mdwhen user-visible scope changes. UpdateROADMAP.mdwhen execution or phase status changes.