The snapshot phase cleanup introduced suppress_postflight_signals into _derive_display_phase, which breaks the clean delegation pattern. _derive_display_phase should be a thin bool(items) mapper with no conditionals — the suppression logic belongs in the caller _phase_for_snapshot. More fundamentally: the snapshot path needs mode-aware signal computation where _phase_for_snapshot zeros out item lists that shouldn't affect phase derivation BEFORE calling _derive_display_phase, rather than passing a flag that adds conditional logic inside the shared delegation layer. The goal: _derive_display_phase has no parameters beyond its item lists and scalars, and no conditional logic — it's purely items→bools→derive_display_phase(). All mode-specific signal shaping lives in _phase_for_snapshot.
Current state:snapshot.py:_derive_display_phase (line 302) accepts a suppress_postflight_signals bool and uses it to conditionally mask four has_* booleans before delegating to refresh_lifecycle.derive_display_phase. This conditional logic breaks the intended pattern: _derive_display_phase should be a thin items→bools mapper with no mode-awareness.
Goal:_phase_for_snapshot (line 264) performs signal zeroing before calling _derive_display_phase, so the latter has no parameters beyond item lists and scalars, and no conditional logic. refresh_lifecycle.derive_display_phase (the shared pure-bool function) is untouched.
Constraint:_resolve_reconcile_display_phase in pipeline.py already calls derive_display_phase directly with pre-computed bools — it has no suppression flag. The snapshot path should match this pattern.
Assistant
{"flags":[{"id":"missing-equivalence-validation","concern":"The validation section omits the repository's direct snapshot/pipeline equivalence test. That is the main regression guard for this refactor, because the whole change is about keeping snapshot._derive_display_phase behavior aligned with _resolve_reconcile_display_phase after moving suppression into the caller.","category":"correctness","severity_hint":"likely-significant","evidence":" defines , and plus both explicitly cite that test as the equivalence contract. The proposed validation only names , , and the full suite."},{"id":"missing-required-execution-order-heading","concern":"The plan still does not match the required structure. It needs or , but the plan uses instead.","category":"completeness","severity_hint":"likely-significant","evidence":"The submitted plan heading is , and the provided validator warning already reports: ## Execution Order\## Validation Order\"},{"id":"bad-pipeline-path","concern":"The plan references the wrong repository path for the shared comparator. is not in ; it lives under , so the plan's repository grounding is inaccurate at that point.","category":"correctness","severity_hint":"likely-minor","evidence":"The plan cites , but the repository defines at . There is no file in this checkout."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
Step 1: Refactor _phase_for_snapshot to zero out suppressed lists (snapshot.py:264-299)
Scope: Small
Move the suppress_postflight_signals computation and prefer_scan computation to stay in _phase_for_snapshot (they already are — no change there).
Replace the pass-through of suppress_postflight_signals with explicit list zeroing: when suppress_postflight_signals is true, pass empty lists [] for postflight_assessment_items, postflight_review_items, postflight_workflow_items, and triage_items to _derive_display_phase.
Removesuppress_postflight_signals from the _derive_display_phase call.
python
# In _phase_for_snapshot, BEFORE calling _derive_display_phase:
if suppress_postflight_signals:
postflight_assessment_items = []
postflight_review_items = []
postflight_workflow_items = []
triage_items = []
Runpython -m pytest desloppify/tests/plan/test_refresh_lifecycle.py -q — ensures derive_display_phase (the shared function) is untouched.
Runpython -m pytest desloppify/tests/review/test_work_queue_plan_order_and_triage.py -q — exercises build_queue_snapshot which calls the refactored path.
Runpython -m pytest desloppify/tests/ -q — full suite to catch any indirect breakage.
Execution & Validation Order
Steps 1 and 2 are a single atomic change in snapshot.py — implement together.
Run targeted tests (Step 3.1, 3.2) immediately after the edit for fast feedback.
Full suite last.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-23T22:36:50Z",
"hash": "sha256:8c2cffd09cc51b9b796a023256075025812b8a55806aa5dc1de37e7efefa8ae3",
"questions": [],
"success_criteria": [
"_derive_display_phase has no suppress_postflight_signals parameter",
"_derive_display_phase body contains no conditional logic \u2014 only bool() conversions and a single derive_display_phase() call",
"_phase_for_snapshot zeros out the four postflight item lists when suppression applies, BEFORE calling _derive_display_phase",
"All existing tests pass unchanged (no test modifications needed)",
"pipeline.py _resolve_reconcile_display_phase is not touched (already clean)"
],
"assumptions": [
"No callers of _derive_display_phase exist outside snapshot.py (it's a module-private function) \u2014 grep confirmed only _phase_for_snapshot calls it",
"The prefer_scan parameter is acceptable to keep since it's a pre-computed scalar from the caller, not a mode-flag that adds conditional logic inside the function",
"No tests directly reference the _derive_display_phase private function or its suppress_postflight_signals parameter \u2014 they go through build_queue_snapshot"
],
"structure_warnings": [
"Plan should include ## Execution Order or ## Validation Order."
]
}
code
Plan structure warnings from validator:
[
"Plan should include ## Execution Order or ## Validation Order."
]
code
Existing flags:
[]
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered `## Step N:` sections with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`. Missing structure should be flagged as category `completeness` with severity_hint `likely-significant`.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.