These are the golden principles for anyone β agent or human β working in this codebase. They encode architectural taste and are enforced mechanically where possible.
-
Kernel-first β all execution paths (MVP, spec, bench) route through the kernel's capability/policy/audit system. No shadow paths that bypass policy.
-
No breaking changes β new primitives are additive. Existing public APIs keep their signatures. Use
Option, defaults, and new methods instead of modifying existing ones. -
Capability-gated by default β every tool call, memory operation, and connector invocation requires a valid
CapabilityTokenwith matching capabilities granted by the pack manifest. -
Audit everything security-critical β policy denials, token lifecycle events, and plane invocations all emit structured audit events. Silent drops are bugs (see: NoopAuditSink incident).
-
7-crate DAG, no cycles β keep dependency direction strictly acyclic:
contracts -> kernel;app -> {contracts, kernel};protocolremains a foundation crate used byspec;spec -> {kernel, protocol};bench -> {kernel, spec};daemon -> all layers. There are currently no tracked dependency-graph deviations. Dependency direction is non-negotiable. See Layered Kernel Design. -
Tests are the contract β if a behavior isn't tested, it doesn't exist. All CI-parity tests pass at every commit, enforced by CI and checked locally by
scripts/pre-commitwhen installed. -
Boring technology preferred β choose well-understood, composable dependencies that agents can reason about from repo context alone. Reimplement small utilities rather than pulling in opaque upstream packages.
-
Repository is the system of record β design decisions, plans, and architectural context live in
docs/, not in chat threads or people's heads. If it's not in the repo, it doesn't exist for agents. -
Enforce mechanically, not manually β prefer linters, CI gates, and pre-commit hooks over code review comments. Encode taste into tooling. See
scripts/pre-commit. -
YAGNI ruthlessly β don't design for hypothetical future requirements. The minimum complexity for the current task is the right amount. Three similar lines of code is better than a premature abstraction.
-
Control complexity growth with explicit budgets β large hotspots should have line/function budget checks and boundary assertions (
scripts/check_architecture_boundaries.sh) so architecture drift is surfaced early in local verification and can be promoted into CI once the checks are stable.