test(cli): cover partial-batch --json, --apply-same and model-not-found paths (#468) - #503
Merged
Merged
Conversation
…nd paths (#468) `adjudicate`'s docstring claims every output mode processes `batch.results` as a complete run before reporting the failure, but only the default report and `--apply` had partial-batch tests. Two of the four modes carried the claim unproved, and `curate`'s `OllamaModelNotFound` re-raise arm was reached only through a sequencer-level fake that raises directly, never through a real partial `AdjudicationBatch`. Three tests close items 1-3 of #468. The docstring is left intact: these prove the claim rather than weaken it. - `--json` over a partial batch: stdout parses to exactly the completed verdict, stderr carries the completed-of-total line, exit 1. This is the RETURNED-batch path; the existing unavailable test covers the RAISE path, where stdout stays empty. - `--apply-same` over a partial batch: `Total:` and the `--confirm-count` gate reflect the COMPLETED eligible count, not the queued count; the merge really commits, and only afterwards does the failure set exit 1. This pins current behavior for #468 item 4 — at confirm time nothing discloses that another group was queued and failed. That disclosure decision stays open. - `OllamaModelNotFound` through `_identity_run`'s own returned-batch split, with a completed merge already applied before the failure surfaces. Each test was mutation-verified against the exact production line it covers and reverted: the `--json` payload call, `total = len(previewed_groups)`, and the `isinstance` arm of the re-raise split. No production code changed. Refs #468
This was referenced Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes items 1-3 of the partial-batch follow-up list. Refs #468, which stays open for items 4-5.
What was unproved
adjudicate's docstring states that every output mode (report,--json,--apply,--apply-same) processesbatch.resultsexactly as a complete run before reporting the failure. Only the default report and--applyhad partial-batch tests. Andcurate'sOllamaModelNotFoundre-raise arm was exercised only through a sequencer-level fake stage that raises directly — never through a real partialAdjudicationBatch.The docstring is left intact. These tests prove the claim rather than weaken it.
The three tests
test_adjudicate_json_partial_batch_emits_completed_verdicts_then_exits_one--json: stdout parses to exactly the completed verdict, stderr carries the completed-of-total line, exit 1test_adjudicate_apply_same_partial_batch_confirms_completed_count_only--apply-same:Total:and the confirm gate use the COMPLETED count; the merge commits; exit 1 followstest_identity_partial_batch_model_not_found_still_walks_then_skips_later_stagesOllamaModelNotFoundthrough_identity_run's returned-batch split, with a merge already appliedThe
--jsontest is the RETURNED-batch path; the pre-existing unavailable test covers the RAISE path, where stdout stays empty. That pairing is what makes a partial array distinguishable from the pre-#441 behavior.What item 4 looks like in practice
The
--apply-sametest pins current behavior rather than proposing a fix. Two groups queued, one adjudicated SAME: the operator is shownTotal: 1, types1, the merge commits — and only then does stderr reveal that a second group was queued and failed. The preview is accurate for what gets merged, but nothing at confirm time discloses the partial-ness. Whether it should is still open, and it now spans three surfaces (see below).Verification
uv run pytest -q→ 4035 passed, 1 skipped (the known darwin-gated test).uv run mypy .→ clean, 179 source files.uv run ruff check .andruff format --check .→ clean.git diff --stat -- src/is empty.--jsonpayload call,total = len(previewed_groups), and theisinstancearm of the re-raise split. Every mutation produced a failure naming the behavior under test.Disclosures
No review receipt. The lens review could not complete: the reviewer agents are provisioned with
Read, Grep, Globand no shell, while their protocol mandatesgentle-ai review inspect-candidateand forbids substituting live files. Three launches returnedinspection: incomplete. No PASS was authored in its place. This is a test-only change verified by the suite, lints and mutation testing above.Pre-existing defect found while writing test 3, not fixed here.
render_summaryatsrc/openkos/cli/curate.py:1217emitsf"{stage.name}: {outcome.notice}", but all six notices already embed the stage name (curate.py:467,654,854,1089,1148,1200). Every summary line the operator sees is double-prefixed —Identity: Identity: applied 1, skipped 0.Substring assertions in the existing tests hide it. Filed separately.