# ReplicaWeave — op-CRDT schema & TestCartridge spec (prototype) This repository provides a focused, well-tested Python prototype for two core pieces of the ReplicaWeave idea: - An op-based CRDT delta schema (op types, deterministic merge, compact merkle-style ops root). - A deterministic TestCartridge spec and small harness that runs cartridges with seeded inputs to produce reproducible TestReports and Scorecards. This prototype is intended as a solid chunk for the larger ReplicaWeave system (Genome Lab test cartridges, Scorecards, signed Manifests). It is intentionally minimal but production-minded: it includes a Python package layout, signing utilities, deterministic behavior, and tests. What you'll find here - src/idea189_replicaweave_safe_mutation/: core library - tests/: pytest test suite - test.sh: runs tests and builds the package - AGENTS.md: contributor instructions Quick usage (from repo root): 1. Install package in editable mode: python3 -m pip install -e . 2. Run tests: pytest 3. Build the package metadata and sdist/wheel: python3 -m build Core concepts implemented - Op-CRDT: op records, Delta merging with deterministic ordering and an ops_root function. - TestCartridge: small, composable cartridges that run deterministically from a seed and return TestReports (score, logs, counterexample seed). - Harness: deterministic runner that runs cartridges against deltas and emits signed Manifests. - Scorecard: JSON schema describing safety_score, resource impact, reproducible failures. - Simple signing (Ed25519) for Manifests / TestReports. This is a foundation — next agents can add a WASM runner, richer policy checks, marketplace UI, and certification pipeline.