feat: implement dcy-007 contract governance and ci gates

This commit is contained in:
Jarca
2026-06-30 20:06:39 +09:00
parent 26b815d723
commit 7fd1b45bd5
20 changed files with 1038 additions and 22 deletions
@@ -0,0 +1,48 @@
# BAT-007 Verification
## Verification summary
Status: PASS
REQ-007 and REQ-008 have sufficient repository evidence to move from Approved to Implemented.
Evidence commands executed from `/root/projects/jarca-ledger-mcp`:
| Command | Result |
| --- | --- |
| `uv sync --extra dev --extra dashboard` | PASS; `ruff==0.15.20` installed and lockfile updated. |
| `uv run pytest tests/test_contract_regression.py` | PASS; `3 passed in 0.99s`. |
| `uv run ruff check .` | PASS; `All checks passed!`. |
| `uv run pytest --ignore=tests/test_dashboard_app.py` | PASS; `33 passed, 4 skipped in 29.37s`. |
| `uv run python scripts/ci_db_safety_smoke.py --timeout 45` | PASS; JSON `success: true`, `fixture: synthetic`, `operating_db_used: false`. |
| `uv run python scripts/ci_dashboard_http_smoke.py --host 127.0.0.1 --port 18501 --timeout 45` | PASS; JSON `success: true`, `fixture: synthetic`, `http_status: 200`. |
## Acceptance criteria mapping
### REQ-007
- AC-1: PASS. `docs/interface-contract.md` defines `major.minor` and initial `1.0` contract version.
- AC-2: PASS. Breaking vs additive rules cover key removal, type changes, nested structure changes, and optional field additions.
- AC-3: PASS. `docs/interface-contract.md` contains source-of-truth rules and a version log linking dcy-007/REQ-007/BAT-007.
- AC-4: PASS. Runtime `contract_version` exposure is explicitly unexposed for `1.0`.
- AC-5: PASS. Response-shape-changing REQ/BAT work must state contract impact: none, additive minor, or breaking major.
- AC-6: PASS. Runtime success payloads were not changed; contract tests assert existing representative shapes.
### REQ-008
- AC-1: PASS. `tests/test_contract_regression.py` covers health/status, list, report, and mutation success envelope representative scopes.
- AC-2: PASS. The checker fails on missing required keys, required type changes, and required nested structure changes; additive fields are allowed.
- AC-3: PASS. Tests use pytest `tmp_path` synthetic SQLite DBs and committed schema metadata only. Smoke evidence also reports `fixture: synthetic` and `operating_db_used: false` where applicable.
- AC-4: PASS. `.github/workflows/ci.yml` includes a `lint` job running `uv run ruff check .`; local ruff verification passed.
- AC-5: PASS. Required-check job names are documented and existing BAT-006 job names are preserved.
- AC-6: PASS. `docs/interface-contract.md`, `docs/project-structure.md`, and `docs/runtime-flows.md` reflect contract-regression/lint/required-check/synthetic-only boundaries.
- AC-7: PASS. Baseline docs state actual branch protection toggles are external operator-managed GitHub repository settings.
## Requirement state decision
- REQ-007: Implemented.
- REQ-008: Implemented.
## Blockers
None.