cotcodec / harness/capsules
Purpose
Capsules package declared orchestration inputs, memory graphs, receipts, and verification metadata so an execution can be checked outside its source runtime.
Mental model & key files
schema.pydefines the wire contract.runtime.pyexecutes admitted capsule operations.verification.pyvalidates hashes, signatures, and declared capabilities.memory_graph.pyhandles capsule-local memory topology.
Patterns to follow / invariants
- Fail closed on unknown fields, algorithms, identities, capabilities, or hashes.
- Bind every decision to canonical serialized bytes and explicit versioning.
- Treat capsules as instrumentation after a real agent loop exists, not as a universal orchestration protocol or a scientific result by themselves.
Common tasks → first action
- Schema change: add a new version plus conformance/tamper vectors.
- Runtime change: update capability declarations and negative verification tests.
- Evidence export: run capsule conformance before referencing the artifact.
Gotchas
- Never accept a trust key shipped inside the artifact it authenticates.
- Hash-valid structure does not establish semantic correctness or model quality.