Skip to content

ci: close CI hardening gaps — root monitor matrix coverage, classified json smoke, coverage gate, pinned actions, constraints - #233

Merged
tcconnally merged 2 commits into
mainfrom
ci/229-231-232
Aug 12, 2026
Merged

ci: close CI hardening gaps — root monitor matrix coverage, classified json smoke, coverage gate, pinned actions, constraints#233
tcconnally merged 2 commits into
mainfrom
ci/229-231-232

Conversation

@tcconnally

Copy link
Copy Markdown
Contributor

Resolves #229, #231, #232 (filed from the 2026-08-11 test-suite + CI audit).

#229 — root monitor suite now has full matrix coverage. The engine matrix
ran pytest tests/ explicitly, so the root test_ledger.py monitor suite
(17 tests) only ran on the lint-and-smoke leg. The matrix now runs the default
pytest invocation (testpaths from pyproject.toml: tests + test_ledger.py)
on every leg — Linux 3.10/3.11/3.12/3.13, Windows 3.12, macOS 3.12.
tests/test_discovery_contract.py asserts the default collection includes
test_ledger.py, so reverting to pytest tests/ fails CI.

#231 — JSON smoke failures are no longer masked. The old step
ledger.py --json || echo "(state.db unavailable — expected in CI)" converted
every nonzero exit into an "expected" message. New tools/json_smoke.py
classifies the result: exit 0 + valid JSON with providers/generated_at
passes; the specifically recognized (state.db not found) stderr case is the
only tolerated nonzero exit; anything else fails loudly. Regression tests
cover every branch (tests/test_json_smoke_classifier.py), including an
end-to-end subprocess run.

#232 — coverage gate, SHA-pinned actions, constraints.

  • Engine leg gates coverage: --cov-fail-under=65 (baseline 70.7% on
    2026-08-12, 697→711 tests).
  • All actions pinned to immutable commit SHAs: checkout, setup-python,
    docker login/metadata/build-push, pypi-publish (release/v1).
  • New constraints.txt pins direct dependencies to exact versions (respecting
    pyproject.toml upper bounds: stripe<14, reportlab<5, pytest<10); every
    workflow installs with -c constraints.txt.
  • concurrency: cancel-in-progress added so superseded commits stop burning
    runners.

Local verification: pytest --cov=ledger_agent --cov=ledger --cov-fail-under=65711 passed, 70.69% coverage. tools/json_smoke.py
against the real ledger.py → PASS (valid JSON with providers/generated_at).

Thomas Connally added 2 commits August 11, 2026 17:39
…ONPATH (#227)

_spawn_server() ran the child from a tmp cwd outside the checkout, so
`python -m ledger_agent.mcp_server` died with ModuleNotFoundError when
the package was not pip-installed into that interpreter; the failure
surfaced as a misleading KeyError: 1 from _exchange(). Prepend the repo
root to PYTHONPATH for the child, and turn blank-stdout EOF into an
AssertionError carrying the child return code and stderr.

Verified: 8/8 MCP tests; full suite 697 passed / 0 failed / 0 skipped.
…d json smoke, coverage gate, pinned actions, constraints (#229 #231 #232)

#229: engine matrix now runs the default pytest invocation (testpaths:
tests/ + root test_ledger.py), so the 17-test root monitor suite runs on
every leg (Linux 3.10-3.13, Windows 3.12, macOS 3.12) instead of only
lint-and-smoke. New tests/test_discovery_contract.py asserts the default
collection includes test_ledger.py — a revert to 'pytest tests/' fails CI.

#231: the old 'ledger.py --json || echo expected' step absorbed EVERY
nonzero exit. New tools/json_smoke.py classifies: exit 0 + valid JSON with
providers/generated_at passes; the specifically recognized
'(state.db not found)' stderr case is the only tolerated nonzero exit;
anything else fails loudly. Regression tests cover all branches
(tests/test_json_smoke_classifier.py).

#232: engine leg now gates coverage (--cov-fail-under=65; baseline 70.7%
2026-08-12). All actions pinned to commit SHAs (checkout, setup-python,
docker login/metadata/build-push, pypi-publish). New constraints.txt pins
direct deps (respecting pyproject upper bounds); all workflows install
with -c constraints.txt. Added concurrency cancel-in-progress.
@tcconnally
tcconnally merged commit 8dc8d14 into main Aug 12, 2026
11 checks passed
@tcconnally
tcconnally deleted the ci/229-231-232 branch August 12, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: root test_ledger.py monitor suite has no matrix coverage (lint-and-smoke leg only)

1 participant