Ratchet egress_addon_core coverage to >=90% (ADR 0004) #297

Open
didericis-claude wants to merge 1 commits from ratchet-egress-core-90 into ratchet-yaml-subset-90
Collaborator

Stacked on #296 (base = ratchet-yaml-subset-90). Third per-module ratchet under ADR 0004.

Summary

Adds a parsing/serialization/evaluation suite for egress_addon_core — the heart of the egress engine:

  • Validation rejections — payload/route shape, missing host, auth scheme/token_env pairing, the git block, every matches sub-field (paths/methods/headers including type checks, regex-compile failures, unknown keys), and the dlp block (detector type/name, outbound_on_match, unknown key).
  • Valid round-trip — a fully-populated route parses; outbound_detectors: false disables.
  • parse_config log-level validation + load_config invalid-YAML.
  • route_to_yaml_dict — minimal / auth / git / dlp / matches with default-omission.
  • evaluate_matches — exact/prefix/regex paths, method filter, exact + regex header matching (match and non-match).

Coverage

Module Before After
egress_addon_core.py 84% 99%

The two remaining missed statements are defensive guards (an unreachable separator-return, a no-matching-path-type fallthrough). 53 new tests; full suite (1429) passes; pyright clean; pylint 9.81.

Stacked on #296 (base = `ratchet-yaml-subset-90`). Third per-module ratchet under ADR 0004. ## Summary Adds a parsing/serialization/evaluation suite for `egress_addon_core` — the heart of the egress engine: - **Validation rejections** — payload/route shape, missing host, auth `scheme`/`token_env` pairing, the `git` block, every `matches` sub-field (paths/methods/headers including type checks, regex-compile failures, unknown keys), and the `dlp` block (detector type/name, `outbound_on_match`, unknown key). - **Valid round-trip** — a fully-populated route parses; `outbound_detectors: false` disables. - **`parse_config`** log-level validation + **`load_config`** invalid-YAML. - **`route_to_yaml_dict`** — minimal / auth / git / dlp / matches with default-omission. - **`evaluate_matches`** — exact/prefix/regex paths, method filter, exact + regex header matching (match and non-match). ## Coverage | Module | Before | After | |---|---|---| | `egress_addon_core.py` | 84% | **99%** | The two remaining missed statements are defensive guards (an unreachable separator-return, a no-matching-path-type fallthrough). 53 new tests; full suite (1429) passes; pyright clean; pylint 9.81.
didericis-claude added 1 commit 2026-06-25 22:04:45 -04:00
test(egress): ratchet egress_addon_core coverage to >=90%
lint / lint (push) Successful in 1m51s
test / unit (pull_request) Successful in 44s
test / integration (pull_request) Successful in 16s
test / coverage (pull_request) Successful in 57s
f289b6382c
Third per-module ratchet under ADR 0004. Add a parsing/serialization
suite for the egress engine's core:

- route validation rejections: payload/route shape, host, auth pairing,
  git block, every matches sub-field (paths/methods/headers type +
  regex-compile + unknown-key), and the dlp block (detector type/name,
  outbound_on_match, unknown key)
- a full valid route round-trips; detectors:false disables
- parse_config log-level validation + load_config invalid-YAML
- route_to_yaml_dict: minimal/auth/git/dlp/matches with default-omission
- evaluate_matches: exact/prefix/regex paths, method filter, exact +
  regex header matching (match and non-match)

egress_addon_core.py: 84% -> 99%. The two remaining missed statements
are defensive guards (an unreachable separator-return and a
no-matching-path-type fallthrough).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkwFXLFff9PYPy4wgVBJp9
Some checks are pending
lint / lint (push) Successful in 1m51s
test / unit (pull_request) Successful in 44s
test / integration (pull_request) Successful in 16s
test / coverage (pull_request) Successful in 57s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ratchet-egress-core-90:ratchet-egress-core-90
git checkout ratchet-egress-core-90
Sign in to join this conversation.