G46 — Comparison scope and completeness (vision workstream A, ADR-065)¶
Registry: UC-WF-scope-completeness (partial) · Owner ADR: ADR-065 · Source: vision workstream A
Problem¶
A release or multi-member comparison can read cleaner than its evidence supports. A member that was never selected, a member that was expected but not produced, a member whose extraction failed, and a member deliberately retired all used to look alike: each was an absence from one side, and an unmatched name could be reported as a removal. A run that completed zero comparisons could exit as a clean pass. ADR-065 separates these states; this plan tracks what has landed and what remains.
Goal & acceptance criteria¶
Goal. Every comparison run states which members it was asked to compare, which it compared, and why any member was not compared. Absence is never read as removal without inventory evidence, and a run with zero completed comparisons never reads as a pass.
Acceptance criteria.
- A declared selection (
--select/--select-required) is visible in the--dry-runplan before anything runs, naming what would be compared and which members are required versus optional. - An unmatched member is reported as unmatched, not as removed, unless a
complete inventory proves its removal (
proven_removed_members). - A declared component whose content cannot be reached is reported as
expected_not_produced(an acquisition failure), distinct from a removal. --on-incomplete-scope blockfails the run when a required member is missing, and the Action and aggregate report show the same completeness state (SCOPE_INCOMPLETEverdict tier,scope_completenessaxis).- A run that completed zero comparisons is an incomplete outcome, never a clean pass (see Remaining steps, item 3).
- Invocations without a selection behave as before: the narrow current-artifact inference remains the default.
Current state (landed slices)¶
The vision defines slices S0-S4; its assessment records them as follows.
- S0 — scenario table. Executable scenario catalogue under
tests/scenarios/. - S1 — selection and dry-run plan (landed 2026-09-06).
abicheck/model/release_selection.py(ReleaseSelection),--select/--select-requiredon the directory and package fan-out,abicheck/workflows/release_plan.py(declared-selection record and release plan), andabicheck/frontends/cli/release_dry_run.py(the "Comparison plan" preview).MemberAcquisition.requiredis the one schema addition (schema 1.1, additive). - S2 — acquisition states and the completeness axis (landed 2026-09-05).
abicheck/model/scope_acquisition.py,abicheck/policy/scope_completeness.py,abicheck/workflows/release_scope.py,abicheck/report/comparison_scope.py, and--on-incomplete-scope warn|block.BundleFacts.degraded_membersmarks stranded-library snapshots. - S3 — package component inventories (landed 2026-09-06).
abicheck/model/package_inventory.py(PackageInventory, which keeps declared, complete and unproduced components apart), built byabicheck/extract/packages.py'spackage_component_inventoryfromExtractResult.container_complete.abicheck/policy/support_promise.pyadds the--support-promise off|declaredfield and the twoSUPPORT_PROMISE_COMPONENT_*kinds, derived only from proven membership;abicheck/workflows/release_support_promise.pyplaces them in the fan-out'slibrary_results. - S4 — parity and deletion (landed 2026-09-06, except two items).
_match_release_keysreturns only matched keys and maps; the set difference that once produced removals is deleted; the JSONunmatched_old/unmatched_newkeys read the scope record. The silent canonical fallback went withabicheck/product_baseline.py. Action and aggregate parity came with S2.
Tests that pin this behaviour include tests/test_release_scope_completeness.py,
tests/test_release_scope_bundle.py, tests/test_aggregate_scope_completeness.py,
tests/test_action_scope_verdict.py and tests/unit/workflows/test_consumer_scope.py.
Remaining steps¶
- Scalar and bundle operand convergence. One live/stored driver and one
evaluation, gate, report and dry-run path across all four operand shapes.
The vision assigns this to
cli-cleanup-phase-two.md(PR I); that plan is retired and its PR I remainder is re-homed (see plans index). The engine-side half is ADR-061 gap D, re-homed asone-comparison-product.mdPhase 7d. - Typed selection. Carry the selection and expected inventory as fields of
CompareRequest/BundleCompareRequest; today they reach the engine as CLI parameters. ADR-061 closure package 4 owns where the fields live; this workstream owns only what the states mean. - Zero-comparison outcome. Confirm the S2 "no comparison completed" outcome is reachable and rendered in JSON, Markdown and the Action verdict, with a test that a zero-comparison run is not a pass. The vision lists it under S2, but its S4 assessment does not record it as closed.
- Partial-directory guard. Keep the rule that a populated directory is not
a completeness proof (
ExtractResult.container_completeis set only by archive extractors) covered by a test whenever the fan-out changes.
Files & surfaces¶
abicheck/model/release_selection.py,abicheck/model/scope_acquisition.py,abicheck/model/package_inventory.pyabicheck/policy/scope_completeness.py,abicheck/policy/support_promise.pyabicheck/workflows/release_scope.py,abicheck/workflows/release_plan.py,abicheck/workflows/release_support_promise.pyabicheck/report/comparison_scope.py,abicheck/frontends/cli/release_dry_run.pyabicheck/policy/outcome.py,abicheck/policy/exit_decision.py- CLI:
comparedirectory/package fan-out (--select,--select-required,--on-incomplete-scope,--support-promise,--dry-run)
Tests¶
- Existing: the files listed under "Current state".
- New for remaining step 3: a zero-comparison fan-out run asserting a non-pass outcome in JSON and the Action verdict.
- New for remaining step 2: a typed-request round trip of the selection field, once the field exists.
Effort & risk¶
Effort: L. Risk: medium. The largest open piece is operand convergence,
which touches every comparison entry point. The schema is additive so far; any
new field must keep MemberAcquisition.required=True as the default for
producers that predate the selection.