Quickstart / Validation — ScopeSource gate follow-up
How to prove the mission is done. All commands use PYTHONPATH=$(pwd)/src. Base: merged main eb06ca176.
0. Baseline-red-gotcha check (before attributing any failure)
Confirm the gate-family tests are green (or record their pre-existing red) on the merge-base, so a failure isn't misattributed to this mission's diff (#2825):
PYTHONPATH=$(pwd)/src python -m pytest \
tests/architectural/test_no_dead_symbols.py \
tests/architectural/test_golden_count_ban.py \
tests/specify_cli/cli/commands/agent/test_tasks_compat_surface.py -q -p no:cacheprovider
1. WP-C correctness — the reason the mission exists (US1 / SC-001 / SC-004)
The dual-impl / dual-parse-mode parity test (IC-12, FR-010) is the headline proof:
# Must NOT raise NEW_FAILURES in any of the 4 combinations
# {GateCoverageScopeSource, DeclaredCommandScopeSource} × {worktree-relative JUnit, FAIL-text}
# and a deliberately mismatched pair MUST raise GateOutcome.SOURCE_MISMATCH (warn, fail-open)
PYTHONPATH=$(pwd)/src python -m pytest tests/review/ -k "parity or source_mismatch or teardown" -q -p no:cacheprovider
- SC-001: a repo with a non-pytest (worktree-relative-artifact)
review.test_commandruns the gate over a zero-new-failure change without a falseNEW_FAILURESblock. - SC-004: a source/parse-mode mismatch surfaces
GateOutcome.SOURCE_MISMATCH(never a silent block, neverNO_COVERAGE). - FR-008 (B1): the baseline artifact is read/relocated before worktree teardown — the regression test reproduces the pre-fix disjoint-namespace bug red-first.
- FR-009: mismatched parse-mode (same class, same command) triggers the identity check; a legacy artifact without
source_identitydegrades toUNVERIFIED_BASELINE, neverKeyError; the read goes through #2874's_resolve_workflow_read_dir(kind=WORK_PACKAGE_TASK)seam. - FR-012: the anti-narrowing guard asserts baseline runs the whole command (no head per-file targets appended).
2. WP-A cleanup — behavior-preserving (US2 / SC-002 / SC-003)
# Behaviour-preservation goldens (captured pre-mission, replayed) over BOTH paths:
PYTHONPATH=$(pwd)/src python -m pytest tests/review/ tests/specify_cli/cli/commands/agent/ -k "golden or override_tier or compat_surface" -q -p no:cacheprovider
- SC-002: the live
for_reviewgate AND the override tier produce byte-identical verdicts + metadata before/after (NFR-001 registry golden + NFR-006 override-tier golden, non-circular). - SC-003: ~450 LoC of dead duplicate removed; the compat golden is 157→156; the 8 verdict-diff tests are migrated (not lost); dead-symbol / compat-surface / census-parity / ratchet gates green.
- IC-01: the pre-deletion audit proves the census branch is the sole live
scope_source=Nonecaller.
3. WP-B contract — internal hygiene (US3 / SC-005)
PYTHONPATH=$(pwd)/src python -m pytest tests/review/test_scope_source.py -q -p no:cacheprovider
- SC-005:
GateCoverageScopeSourceimplements exactly one narrowing method (scope_breakdown, inheritingfile_to_scopefromScopeBreakdownMixin); the two decisions are separate predicates backed by different signals — a synthetic source satisfiesexposes_scope_breakdownXORempty_scope_is_coverage_gap(proves the weld is gone, not renamed).
4. Whole-suite gates
PYTHONPATH=$(pwd)/src ruff check src/ && PYTHONPATH=$(pwd)/src python -m mypy src/specify_cli/review src/specify_cli/cli/commands/agent
PYTHONPATH=$(pwd):$(pwd)/src python scripts/generate_contextive_glossaries.py check # if any prose edited
Zero ruff/mypy issues, ≥90% new-code coverage, complexity ≤15/function (NFR-002/003).