3.4 KiB
3.4 KiB
BAT-007 Implementation
Changed files
.github/workflows/ci.yml- Added stable required-check candidate jobs:
contract-regression,lint.
- Added stable required-check candidate jobs:
pyproject.toml,uv.lock- Added
ruffto dev dependencies and conservativeE9/Finitial lint config.
- Added
tests/test_contract_regression.py- Added representative MCP response contract regression tests.
tests/contract_snapshots/response_contract_v1_0.json- Added contract
1.0metadata and required-subset schemas for health/status, list, report, and mutation success envelope scopes.
- Added contract
docs/interface-contract.md- Added MCP response contract
1.0governance, breaking/additive classification, runtime exposure policy, version log, and CI required-check contract.
- Added MCP response contract
docs/project-structure.md,docs/runtime-flows.md- Updated baseline structure/flow docs for contract snapshots/tests,
contract-regression,lint, branch-protection boundary, and synthetic-only invariant.
- Updated baseline structure/flow docs for contract snapshots/tests,
docs/batches/index.md- Registered BAT-007.
docs/batches/bat-007_20260630_mcp-response-contract-ci-versioning/{index,planning,design,implementation,verification}.md- Added standard batch delivery docs.
docs/srs/Interface/req-007_mcp-response-contract-versioning-governance.mddocs/srs/Testing/req-008_ci-contract-regression-and-lint-required-checks.mddocs/srs/index.md- Updated REQ state to Implemented after verification evidence.
Implementation notes
- Runtime MCP success payloads were not changed.
- Contract version
1.0is documented indocs/interface-contract.mdand mirrored intests/contract_snapshots/response_contract_v1_0.json. - Contract regression is representative, not exhaustive.
- Lint gate uses conservative
ruffrules:E9,F. - All new test data uses pytest temp DBs and synthetic names/amounts only.
Verification command log
Executed from /root/projects/jarca-ledger-mcp.
uv sync --extra dev --extra dashboard
Result:
Resolved 72 packages in 1.37s
Building jarca-ledger-mcp @ file:///root/projects/jarca-ledger-mcp
Downloading ruff (11.0MiB)
Downloaded ruff
Built jarca-ledger-mcp @ file:///root/projects/jarca-ledger-mcp
Prepared 3 packages in 2.94s
Uninstalled 2 packages in 18ms
Installed 3 packages in 338ms
~ jarca-ledger-mcp==0.1.0 (from file:///root/projects/jarca-ledger-mcp)
- pytest==9.1.0
+ pytest==9.1.1
+ ruff==0.15.20
uv run pytest tests/test_contract_regression.py
Result:
... [100%]
3 passed in 0.99s
uv run ruff check .
Result:
All checks passed!
uv run pytest --ignore=tests/test_dashboard_app.py
Result:
...............ss...............ss... [100%]
33 passed, 4 skipped in 29.37s
uv run python scripts/ci_db_safety_smoke.py --timeout 45
Result:
{
"success": true,
"gate": "db-safety-smoke",
"fixture": "synthetic",
"fixture_integrity": "ok",
"restore_smoke_exit_code": 0,
"restored_exists": true,
"restored_integrity": "ok",
"health_success": true,
"operating_db_used": false
}
uv run python scripts/ci_dashboard_http_smoke.py --host 127.0.0.1 --port 18501 --timeout 45
Result:
{
"success": true,
"gate": "dashboard-http-smoke",
"fixture": "synthetic",
"fixture_integrity": "ok",
"http_status": 200,
"attempts": 4,
"cleanup": "terminated"
}