Skip to content

test: dispatch every command, pin catalog/parser/dispatch agreement (WI-P8)#98

Merged
tjdwls101010 merged 1 commit into
mainfrom
wi-p8-command-smoke
Jul 19, 2026
Merged

test: dispatch every command, pin catalog/parser/dispatch agreement (WI-P8)#98
tjdwls101010 merged 1 commit into
mainfrom
wi-p8-command-smoke

Conversation

@tjdwls101010

Copy link
Copy Markdown
Owner

Why

The 0.2.3 file-split refactor dropped three imports that are only referenced inside command paths:

Regression Fixed in Caught by CI?
institutional dispatch (_statute_args) 50169cf no
constitutional disposition 41bcd43 no
unwrap failure path (ParseFailureError) #96 no — shipped in 0.2.4 and stayed live on PyPI

All three passed CI. The suite imported the modules and exercised the SDK, but nothing ran a subcommand end to end — and a name that is only looked up when a branch executes stays invisible until that branch executes.

What

Whole-surface dispatch smoke. Every subcommand runs through main() against a fake source. Almost nothing is asserted about the answers; the claim is that each command survives its own dispatch path and emits a well-formed envelope rather than an interpreter traceback. Argv is derived from the parser, not hand-listed, so a command added later is covered the day it is added rather than the day someone remembers this file.

Three source modes, because the failures hide at different depths:

  • empty{}, what law.go.kr actually returns for a bad identifier
  • shallow{target: {}}, unwraps cleanly and reaches normalization
  • unrecognized → a populated payload matching no known shape — the only mode that reaches the ParseFailureError branch

The third mode was added after the first two were found to sail past a removed ParseFailureError import. A smoke that never enters the error branch is green for the same reason the old suite was.

Catalog / parser / dispatch agreement. Nothing advertised that cannot be parsed, nothing parsable that is undocumented, nothing parsable that is never dispatched, no dispatch branch the parser cannot reach.

Verification (acceptance spot-check)

Both regressions re-applied, then reverted:

  • remove 50169cf's from .data import _statute_args2 failures (load-institutional-system, both modes)
  • remove ParseFailureError from unwrap.py14 failures across command paths

441 deterministic tests pass with the code restored. ci.yml needs no change — it already runs pytest -m "not live", which collects these.

🤖 Generated with Claude Code

The 0.2.3 file-split refactor dropped three imports referenced only inside
command paths: institutional dispatch (50169cf), constitutional disposition
(41bcd43), and the unwrap failure path — the last of which had been
shipping a NameError traceback since 0.2.4 and was found only while fixing
something else. All three passed CI. The suite imported the modules and
exercised the SDK, but never ran a subcommand end to end, and a name looked
up only when a branch executes stays invisible until that branch executes.

So walk the whole surface. Almost nothing is asserted about the answers —
the claim is that every command survives its own dispatch path and emits a
well-formed envelope rather than an interpreter traceback. Argv is derived
from the parser, so a command added later is covered the day it is added.

Three fake-source modes, because the failures hide at different depths. The
third one, `unrecognized`, was added after the first two sailed past a
removed `ParseFailureError` import: neither reached the error branch, so
the smoke was green for exactly the reason the old suite was. It now fails
across 14 command paths when that import is missing.

Also pins catalog/parser/dispatch three-way agreement: nothing advertised
that cannot be parsed, nothing parsable that is undocumented, nothing
parsable that is never dispatched, no dispatch branch the parser cannot
reach.

Spot-checked by re-applying both regressions: removing 50169cf's import
fails 2 cases, removing the unwrap import fails 14. ci.yml needs no change
— it already runs `pytest -m "not live"`, which collects these.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tjdwls101010
tjdwls101010 merged commit 5f355be into main Jul 19, 2026
5 checks passed
@tjdwls101010
tjdwls101010 deleted the wi-p8-command-smoke branch July 19, 2026 13:35
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