Adversarial Common is a shared foundation for adversarial pipelines — gate enforcement, watchdog monitoring, quota tracking, and consensus evaluation across independent AI models.
Shared engine for multi-persona adversarial pipelines on Hermes Agent / Claude Code / Codex / any LLM CLI.
Powers adversarial-spec, adversarial-plan, adversarial-code-loop, and adversarial-code-review.
Philosophy first. The process is the product, agents are interchangeable workers. Read PHILOSOPHY.md before building on this package — it explains why the primitives exist and how to compose them into new adversarial skills.
A Python package providing the hardened infra that all adversarial skills share:
runner.py— subprocess execution with temp-file IO, process-group kill on timeout, non-UTF-8 toleranceproviders.py— CLI provider detection (Claude, Codex, pi, agy, …), persona injection, role-based command resolutionjsonio.py— 3-strategy JSON extraction (markdown fences,{…}extraction,[…]extraction), artifact persistencegitops.py— git workflow: init, branch, commit, diff, stash, squash-merge, tag, reject-markersnapshot.py— dirty-tree baseline for sandbox write detectionreadgate.py— proof-of-read enforcement: READ-marker/read_filesclaim matching (basename-tolerant), optional transcript-aware verdict (transcript=kwarg: pass additionally requires tool-call evidence naming the gated path; wired + unit-tested, not yet passed by production call sites — see module docstring)personas/— 15+ adversarial persona files (builder, critic, fixer, verifier, judge, architect, inspector, synthesis, …) + canonicalgit-workflow.md(single source for the Git workflow rules and the Fake-Done Shortcuts checklist;inject_personasplices it into every prompt that carries the reference line)
| Feature | adversarial-common | standalone MAD libs |
|---|---|---|
| Git-native isolation | ✅ Branch-per-loop | ❌ |
| Multi-provider | ✅ Claude, Codex, pi, agy, … | ❌ One provider |
| Persona injection | ✅ Provider-aware (pi gets tool-based personas) | ❌ |
| JSON robustness | ✅ 3-strategy parser | ❌ Strict json.loads |
| Subprocess hardening | ✅ tempfile IO, killpg, UTF-8 replace | ❌ |
- Python ≥ 3.11
- PyYAML (for frontmatter parsing)
- Git ≥ 2.5 (for worktree support)
0BSD — see LICENSE.