Metadata-Version: 2.4
Name: gitvouch
Version: 0.1.0
Summary: Zero-daemon, Git-native acceptance-criteria locking, evidence-gated verification, and auditable repo memory for AI coding agents.
Author: Jake Zhang
License-Expression: MIT
Project-URL: Homepage, https://github.com/JacobYZ/gitvouch
Project-URL: Repository, https://github.com/JacobYZ/gitvouch
Project-URL: Issues, https://github.com/JacobYZ/gitvouch/issues
Keywords: ai-agents,coding-agents,claude-code,codex,agents-md,verification,git,json-schema,governance
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jsonschema<5,>=4
Dynamic: license-file

# gitvouch

**Stop AI coding agents from marking tasks "done" without proof.**

`gitvouch` is a **zero-daemon, Git-native** CLI and GitHub Action for locking acceptance criteria, enforcing evidence-gated task verification, and maintaining auditable repository memory across Claude Code, Codex CLI, Cursor, and human sessions.

- **No local daemon, no hidden Git sync branch, no database, no SaaS dashboard, no LLM-as-judge.**
- **One runtime dependency (`jsonschema`).** Works cleanly inside every `git worktree` and CI runner.
- **Tamper-evident acceptance criteria:** transitioning a task to `ready` freezes an `acceptance_criteria_snapshot` into an append-only event file. If an agent quietly weakens a requirement later, `gitvouch check` fails closed.
- **Evidence-gated `verified`:** a task cannot enter `verified` unless every acceptance criterion has non-expired, applicable `pass` evidence with real provenance (`commit`, `command`, `exit_code`, `ci_job`, `artifact_sha256`).
- **Real `verification_debt`:** separates *implemented* work from *verified* work by replaying immutable events instead of trusting self-reported checkboxes.

---

## Why This Exists

After months of running Codex CLI and Claude Code on real infrastructure-as-code repositories, two failure modes kept repeating:

1. **The self-closing loop:** an agent implements a change, skips or partially runs checks, and marks the task `done`, gaslighting the next session into building on broken assumptions.
2. **Silent criteria drift & stale memory:** an agent edits `TASKS.md` to fit what it actually built, or updates prose docs while machine-readable state silently goes stale.

Markdown checklists don't enforce invariants. Heavy issue trackers with background sync daemons break across Git worktrees. `gitvouch` puts a thin, deterministic Draft 2020-12 JSON Schema + event-replay contract directly in `.gitvouch/`, verifiable offline in milliseconds.

---

## 60-Second Walkthrough

Requires **Python 3.11+**.

```bash
# 1. Initialize .gitvouch/ and add the governance block to AGENTS.md
uvx gitvouch init --profile infrastructure

# 2. Define a task with explicit acceptance criteria
uvx gitvouch task new \
  --title "Add read-only drift supervision" \
  --scope "Daily OpenTofu plan receipts + independent watchdog" \
  --weight 3 \
  --criterion "Unit tests cover missing-receipt and exit-2 alerts" \
  --criterion "Ruff lint passes with zero warnings"

# 3. Freeze acceptance criteria & weight into an immutable event snapshot
uvx gitvouch task ready T-001
uvx gitvouch task start T-001
uvx gitvouch task implement T-001

# 4. Try to mark verified WITHOUT proof -> REFUSED!
uvx gitvouch task verify T-001
# error: Verification gate REFUSED T-001 -> verified. Missing valid passing evidence:
#   - AC-1: Unit tests cover missing-receipt and exit-2 alerts (no evidence recorded)
#   - AC-2: Ruff lint passes with zero warnings (no evidence recorded)

# 5. Capture real execution proof (records exit code, git HEAD, dirty flag, output SHA-256)
uvx gitvouch evidence run T-001 --criterion AC-1 --cmd "python3 -m unittest discover -s tests"
uvx gitvouch evidence run T-001 --criterion AC-2 --cmd "uvx ruff check ."

# 6. Now verification passes, and CI can replay the entire history offline
uvx gitvouch task verify T-001
uvx gitvouch status
uvx gitvouch check
```

If anyone (human or agent) later edits `.gitvouch/control/tasks/T-001.json` to weaken `AC-1` or forge `state: "verified"` without valid events/evidence:

```text
gitvouch check FAILED:
  - Task T-001 acceptance criteria were modified after entering ready (tamper detected vs snapshot in EVT-002).
```

---

## Repository Layout

Everything lives inside `.gitvouch/` as plain, human-reviewable JSON and Markdown:

```text
.gitvouch/
├── config.json                                   # Project contract, enabled layers, freshness threshold
├── control/
│   ├── project.json                              # Project metadata + milestone list
│   ├── milestones/M-001.json                     # Milestone membership & completion gate
│   ├── tasks/T-001.json                          # Current task state (must match event replay)
│   ├── events/T-001/20261204T120000Z--EVT-001.json  # Append-only immutable lifecycle events
│   └── evidence/T-001/E-001.json                 # Bounded verification evidence + provenance
└── memory/
    ├── state_snapshot.json                       # Machine-readable durable facts + last_reviewed
    ├── current_state.md                          # Human-readable current facts (synced with last_reviewed)
    ├── decisions.md                              # Architecture / operational decisions (ADRs)
    ├── operation_log.md                          # Append-only chronology (`## YYYY-MM-DD`)
    └── runbook.md                                # Repeatable operating procedures
AGENTS.md                                         # Canonical agent entrypoint
```

You can enable both layers (`--mode full`, default) or adopt either layer independently (`--mode control` or `--mode memory`).

---

## Enforce in CI (GitHub Actions)

Drop four lines into `.github/workflows/ci.yml` to block PRs with tampered criteria, unverified claims, broken event replays, or out-of-sync memory:

```yaml
- uses: actions/checkout@v4
- uses: JacobYZ/gitvouch@v0.1.0
  with:
    strict-warnings: "false"
```

---

## Agent Skill Integration

Copy [`skill/gitvouch/SKILL.md`](skill/gitvouch/SKILL.md) into your Claude Code, Codex CLI, Cursor, or Antigravity skills directory so agents automatically follow the startup, evidence-capture, and check loop.

---

## How `gitvouch` Compares

| Capability | `AGENTS.md` | `beads` (`bd`) | `spec-kit` | **`gitvouch`** |
| --- | --- | --- | --- | --- |
| Zero daemon / zero hidden sync branches | Yes | No (sync branch / DB) | Yes | **Yes** |
| Works out-of-the-box in Git worktrees | Yes | Needs workarounds | Yes | **Yes** |
| Immutable acceptance-criteria snapshot at `ready` | No | No | No | **Yes** |
| Evidence-gated `verified` with expiry & SHA-256 provenance | No | No | No | **Yes** |
| Deterministic `implemented` vs `verified` (`verification_debt`) | No | No | No | **Yes** |
| Durable operational memory with cross-file freshness sync | No | No | No | **Yes** |

### When NOT to Use `gitvouch`

Be honest about overhead:
- **Throwaway prototypes or 1-file scripts**: a Markdown checklist or GitHub Issue is faster.
- **Teams wanting a rich web UI / Kanban board**: `gitvouch` is deliberately a Git-native contract and CLI, not a Jira replacement.
- **Projects that want an LLM to judge whether code looks "good"**: `gitvouch` only performs deterministic, offline structural and provenance verification.

---

## Core Commands

| Command | Purpose |
| --- | --- |
| `gitvouch init` | Initialize `.gitvouch/` (`--mode full\|control\|memory`) and update `AGENTS.md` |
| `gitvouch milestone add` | Create a new milestone and register it in `project.json` |
| `gitvouch task new` | Create a `proposed` task with acceptance criteria and initial `task_created` event |
| `gitvouch task ready <ID>` | Validate verified deps & freeze `acceptance_criteria_snapshot` |
| `gitvouch task start\|implement\|verifying <ID>` | Advance task lifecycle via immutable events |
| `gitvouch task verify <ID>` | Evidence-gated transition to `verified` (fails closed if any criterion lacks valid proof) |
| `gitvouch task block\|unblock <ID>` | Add/resolve blockers (active blockers prevent forward transitions) |
| `gitvouch evidence run <ID> --criterion AC-1 --cmd "..."` | Run real command and store exit code, git SHA, dirty status, and output SHA-256 |
| `gitvouch evidence add <ID> ...` | Record external CI/manual provenance evidence with optional `--expires-days` |
| `gitvouch memory review --note "..."` | Atomically refresh `last_reviewed` across snapshot, `current_state.md`, and `operation_log.md` |
| `gitvouch status [--json]` | Show `implemented %`, `verified %`, `verification_debt`, and task evidence coverage |
| `gitvouch check [--strict-warnings] [--json]` | Full offline schema, replay, DAG, evidence-gate, and memory consistency check |

## Development

```bash
python3 -m pip install -e .
python3 -m unittest discover -s tests -v
uvx ruff check src tests
```

## License

[MIT](LICENSE)
