Skip to content

Route-smoke suite + coverage burn-down (query.py, component_engine.py into the 100% gate) - #231

Merged
robcohen merged 3 commits into
mainfrom
test/route-smoke
Jul 3, 2026
Merged

robcohen merged 3 commits into
mainfrom
test/route-smoke

Conversation

@robcohen

@robcohen robcohen commented Jul 3, 2026

Copy link
Copy Markdown
Member

Items 1+2 of the project-review action list: catch user-visible breakage before users do, and put the highest-risk files under the coverage gate.

1. Kitchen-sink route smoke (tests/test_smoke_routes.py, 29 tests)

Every page shell + server route, every no-arg API endpoint, and every BQL query embedded in the frontend report sources (extracted from the TS at test time, so a frontend query change can't silently drift out of coverage — the exact #190 failure shape), all × 9 corpus ledgers.

First run caught three engine bugs live in released v1.31.0, filed upstream:

  • rustledger#1699 — only()/abs() type-error on NULL instead of propagating it: the Holdings by currency page 500s on most real ledgers today. Excused via an error-body gap list; a guard test forces the list to shrink when the engine fix ships.
  • rustledger#1700 — {a # b} cost weight wrong in all three forms (valid ledgers rejected, invalid accepted).
  • rustledger#1701 — query column declared Amount carrying an Inventory-shaped payload; rustfava's row marshalling crashed on it (KeyError → HTTP 500 for the whole query). Fixed here: _convert_row_value now shape-sniffs and degrades gracefully.

2. Coverage burn-down

The rustledger/* omit glob becomes explicit per-file entries; the two files where every recent bug lived join the enforced gate:

  • query.py 53% → 100% — cursor protocol, every conversion branch, both engine styles through execute(), error mapping
  • component_engine.py 88% → 100% — download fallback, result<ok,err> lifting, _default_for, pair-list/variant tolerance branches, guest-path rewriting; every wasmtime type instance harvested from the real component, no fabricated WIT mocks
  • constants.py covered rather than omitted

Remaining exempt (documented in pyproject.toml): backend.py, engine.py, loader.py, options.py, types.py, __init__.py — next burn-down targets.

Validation

Full suite 629 passed, 100.00% under the tightened gate; ruff (pinned) + mypy clean.

🤖 Generated with Claude Code

robcohen added 3 commits July 3, 2026 17:53
Kitchen-sink route smoke motivated by #190/#191 — failures any user hit in
minutes that nothing exercised. Three layers, all run against the full
corpus fixture set: every page shell + server-rendered route returns 200;
every no-argument API endpoint returns 200; and every BQL query embedded in
the frontend report sources executes via /api/query. The queries are
extracted from frontend/src/reports at test time, so a frontend query change
cannot silently drift out of test coverage — the exact #190 failure shape.

First run caught three engine bugs in released v1.31.0, filed upstream:
- rustledger#1699: typed scalar functions (only, abs) type-error on NULL
  instead of propagating it — the Holdings by_currency page 500s on most
  real ledgers today. Excused via an error-body gap list that a guard test
  forces to shrink once the engine fix ships.
- rustledger#1700: {a # b} per-unit-from-total cost weight is wrong in all
  three forms (valid ledgers rejected, invalid accepted).
- rustledger#1701: a query column declared Amount can carry an
  Inventory-shaped payload; rustfava's row marshalling crashed on it
  (KeyError -> HTTP 500 for the whole query). FIXED here: _convert_row_value
  now shape-sniffs and flattens, with the inventory flattening extracted
  into a shared helper.
…gate

Burn-down of the rustledger/* coverage exemption — the omit glob becomes
explicit per-file entries, and the two highest-risk files join the enforced
gate:

- query.py 53% -> 100%: cursor protocol, every row-conversion branch (incl.
  the new Amount/Inventory shape-sniff), execute() through both engine
  styles (component query_entries + legacy source-text), parse/compilation
  error mapping, and source-serialization edges.
- component_engine.py 88% -> 100%: wasm-path env override, download
  fallback (success + no-partial-file-on-failure), query-value unwrapping,
  meta-value tagging, cost-number shapes both directions, result<ok,err>
  lifting via the component's real ResultType, _default_for across type
  classes harvested from real component signatures, pair-list/variant
  unmarshal tolerance branches, and guest-path rewriting edge shapes.
  No fabricated mocks for the WIT layer — every wasmtime type instance
  comes from the actual component.
- constants.py: covered rather than omitted (Missing sentinel).

Full suite: 629 passed, 100.00% under the tightened gate.
The component is gitignored, so CI checkouts lack it and the availability
gate (evaluated at import time, before any lazy download) silently skipped
the entire component suite on every runner — hidden until the coverage
burn-down made component_engine.py measured. Download the pinned release
asset in the test jobs so the suite actually runs on CI.

Also compute the guest-path-rewrite expectations via the same Path
arithmetic the code uses, so the assertion holds with Windows separators.
@robcohen
robcohen enabled auto-merge (squash) July 3, 2026 17:54
@robcohen
robcohen force-pushed the test/route-smoke branch from b3ebdef to 4fffc39 Compare July 3, 2026 17:54
@robcohen
robcohen merged commit 18dd823 into main Jul 3, 2026
27 of 28 checks passed
@robcohen
robcohen deleted the test/route-smoke branch July 3, 2026 18:01
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.

1 participant