Ratchet yaml_subset coverage to >=90% (ADR 0004) #296

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

Stacked on #295 (base = ratchet-egress-addon-90). Second per-module ratchet under ADR 0004.

Summary

Adds a branch-coverage suite for the hand-rolled YAML-subset parser, exercising its reachable error/edge cases:

  • scalars/comments: literal #, blank-line skipping, unterminated/bad-escape quotes
  • inline list/dict: unterminated, empty, missing-:, non-bare key, quoted comma in flow
  • block mapping/list: missing : separator, single-quoted/non-bare keys, list item at mapping indent, empty block → None, bare-dash nested lists, quoted-colon list scalars, nested & empty list-item mappings, duplicate / non-bare sibling keys
  • document-level rejections: block scalars (|/>), anchors (&), tags (!!), non-column-0 top level, top-level list; ampersand inside a quoted value still allowed
  • empty frontmatter

Coverage

Module Before After
yaml_subset.py 82% 95%

Remaining misses are dead/defensive guards (the unreachable true/false-in-reserved-set branch, indent-mismatch raises the callers never trigger). 32 new tests; full suite (1376) passes; pyright clean; pylint 9.96.

Stacked on #295 (base = `ratchet-egress-addon-90`). Second per-module ratchet under ADR 0004. ## Summary Adds a branch-coverage suite for the hand-rolled YAML-subset parser, exercising its reachable error/edge cases: - scalars/comments: literal `#`, blank-line skipping, unterminated/bad-escape quotes - inline list/dict: unterminated, empty, missing-`:`, non-bare key, quoted comma in flow - block mapping/list: missing `:` separator, single-quoted/non-bare keys, list item at mapping indent, empty block → `None`, bare-dash nested lists, quoted-colon list scalars, nested & empty list-item mappings, duplicate / non-bare sibling keys - document-level rejections: block scalars (`|`/`>`), anchors (`&`), tags (`!!`), non-column-0 top level, top-level list; ampersand inside a quoted value still allowed - empty frontmatter ## Coverage | Module | Before | After | |---|---|---| | `yaml_subset.py` | 82% | **95%** | Remaining misses are dead/defensive guards (the unreachable `true`/`false`-in-reserved-set branch, indent-mismatch raises the callers never trigger). 32 new tests; full suite (1376) passes; pyright clean; pylint 9.96.
didericis-claude added 1 commit 2026-06-25 22:00:36 -04:00
test(yaml): ratchet yaml_subset coverage to >=90%
lint / lint (push) Successful in 1m51s
test / unit (pull_request) Successful in 45s
test / integration (pull_request) Successful in 16s
test / coverage (pull_request) Successful in 58s
3073230f58
Second per-module ratchet under ADR 0004. Add a branch-coverage suite
for the YAML-subset parser's reachable error/edge cases: literal `#`,
blank-line skipping, unterminated/empty/bad inline list+dict, quoted
commas in flow, missing `:` separators, non-bare keys, empty block ->
None, bare-dash nested lists, quoted-colon list scalars, nested/empty
list-item mappings, duplicate keys, document-level rejections
(block scalars, anchors, tags, non-column-0, top-level list), and
empty frontmatter.

yaml_subset.py: 82% -> 95%. The remaining misses are dead/defensive
guards (e.g. the unreachable bool branch, indent-mismatch raises that
the callers never trigger).

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 45s
test / integration (pull_request) Successful in 16s
test / coverage (pull_request) Successful in 58s
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-yaml-subset-90:ratchet-yaml-subset-90
git checkout ratchet-yaml-subset-90
Sign in to join this conversation.