I need you to evaluate whether various code issues detected by the desloppify tool are real problems worth fixing, or should be wontfixed. For each, I need your verdict and a suggested action_plan if it's worth keeping. DO NOT make any code changes.
The project is the desloppify tool itself (Python CLI). Key context:
No backward compatibility needed for import paths/APIs (internal tool, not library)
Data migration code should be kept
base/ imports nothing from engine/app/intelligence. engine/ imports from base/ only.
Here are the 26 open review issues. For each, look at the actual code and give me:
VERDICT: keep (with action_plan) or wontfix (with reason)
If keep: a clear, specific action_plan (1-3 sentences describing exactly what to do)
Issues to evaluate:
review::.::holistic::convention_outlier::mixed_command_entrypoint_layout - "Sibling CLI commands alternate between flat modules and package cmd.py entrypoints" - related: desloppify/app/commands/registry.py, commands/config.py, dev.py, viz.py, autofix/cmd.py
review::.::holistic::cross_module_architecture::state_facade_remains_primary_hub - "desloppify.state still acts as codebase-wide hub despite being marked compatibility-only" - related: desloppify/state.py
review::.::holistic::cross_module_architecture::review_workflow_guardrails_scattered_acros - "Review/triage lifecycle guardrails spread across multiple command modules" - medium confidence
review::.::holistic::high_level_elegance::review_domain_owned_by_cli_and_intelligence - "Review capability split between CLI orchestration and intelligence modules"
review::.::holistic::convention_outlier::triage_uses_two_competing_module_layouts - "plan/triage mixes subpackages with prefixed flat modules"
review::.::holistic::convention_outlier::language_scaffold_generates_old_plugin_shape - "Language scaffold template emits plugin structure that does not match current first-class plugins" - related: dev_scaffold_templates.py
review::.::holistic::convention_outlier::state_api_has_competing_root_facades - "Root state access split between overlapping facades" - medium confidence
review::.::holistic::naming_quality::issues_by_file_shadowing_hides_role - "issues_by_file reused as both helper name and local data name" - medium confidence
Assistant
I'll systematically evaluate each issue by examining the actual code. Let me start by reading the relevant files in parallel.
Assistant
Now let me check a few more items.
Assistant
Now let me check the last few items I need clarity on.
Assistant
User
Assistant
I'll research each issue systematically. Let me start by searching for the relevant code references across all 12 issues in parallel.
Assistant
Good, I have initial results. Now let me dig deeper into each issue.
Assistant
Now let me check the remaining issues.
Assistant
Let me find the observe_reflect_organize file and check the remaining details.
Assistant
Now let me check the remaining details I need.
Assistant
Let me check a few more things for completeness.
Assistant
Now let me check the scaffold template against the current Python plugin structure for issue 3.
review::.::holistic::incomplete_migration::plan_steps_still_accept_legacy_string_shape - "Plan step handling still supports pre-migration string steps alongside structured step objects" - medium confidence
review::.::holistic::package_organization::typescript_detectors_flat_overload - "languages/typescript/detectors/ too flat, mixes unrelated detector, CLI, and React subdomains"
review::.::holistic::initialization_coupling::global_plugin_bootstrap_state - "Language hook/config discovery depends on process-global registries"
review::.::holistic::initialization_coupling::php_resolver_cache_staleness - "PHP import resolver caches are module globals without invalidation"
review::.::holistic::initialization_coupling::no_color_import_snapshot - "Terminal color behavior is fixed at import time from NO_COLOR"
review::.::holistic::design_coherence::duplicated_triage_readiness_policy - "Enrich/sense-check readiness rules reimplemented across four surfaces"
review::.::holistic::design_coherence::observe_reflect_organize_god_flow - "One module owns three stage workflows plus shared lifecycle"
review::.::holistic::design_coherence::review_batch_orchestrator_overloaded - "Review batch orchestrator bundles packet strategy, execution wiring, and import validation" - medium confidence
review::.::holistic::contract_coherence::lang_specific_subjective_metadata_ignores_lang - "Language-specific subjective-dimension APIs ignore their language argument"
review::.::holistic::contract_coherence::display_order_export_breaks_live_registry_contrac - "Detector registry exports conflicting live vs static display-order contracts"
review::.::holistic::contract_coherence::engine_planning_read_only_contract_conflicts_with - "engine.planning claims to be read-only while exporting scan issue generation" - medium confidence
review::.::holistic::dependency_health::core_facade_import_knot - "Core plan/state/language facades participate in a large internal import cycle"
For each, check the actual source code before deciding. Be thorough but practical — this is an internal CLI tool, not a library. Some "problems" are fine for a tool of this nature.
I now have enough information to evaluate all 26 issues. Here is my assessment:
Issue Verdicts
1. mixed_command_entrypoint_layout
VERDICT: wontfix
Reason: The registry shows some commands are flat modules (config.py, dev.py, viz.py, zone.py, suppress.py, exclude.py) and others are packages (autofix/cmd.py, scan/cmd.py, etc.). This is a reasonable organic pattern: simple commands stay flat, complex commands that grew internal modules became packages. The flat modules are all short, self-contained commands. Converting them to packages would add boilerplate for no benefit. Internal tool, no public API concern.
2. state_facade_remains_primary_hub
VERDICT: keep
Action plan: The narrower facades state_io and state_scoring already exist and are documented. But desloppify.state still has 31 non-test importers (via from desloppify import state). Migrate those 31 production-code importers to use either state_io or state_scoring directly based on what they actually need, then delete state.py. The facade already has a 2026-06-30 removal target.
3. review_workflow_guardrails_scattered_across
VERDICT: wontfix
Reason: At medium confidence, and review lifecycle guard logic is naturally distributed across command modules that each own their respective entry point validation. Consolidating guardrails into a single module would create an awkward coupling where every review-related command imports from one gatekeeper. The current distribution is fine for an internal CLI.
4. review_domain_owned_by_cli_and_intelligence
VERDICT: wontfix
Reason: The split between app/commands/review/ (CLI orchestration) and intelligence/review/ (domain logic like prepare, context building, importing) is the correct layered architecture. CLI should not own domain logic, and domain logic should not own CLI concerns. This is a feature, not a problem.
5. triage_uses_two_competing_module_layouts
VERDICT: wontfix
Reason: The triage directory under plan/ uses a subpackage layout (stages/, runner/, display/, etc.) with some prefixed flat modules (stage_flow_enrich.py, stage_flow_observe_reflect_organize.py, etc.). The flat modules are large enough to justify being modules but not complex enough to need packages. This is fine for an internal tool.
6. language_scaffold_generates_old_plugin_shape
VERDICT: keep
Action plan: The scaffold template in dev_scaffold_templates.py generates imports like from ...utils import find_source_files and from ...policy.zones import COMMON_ZONE_RULES, which likely reference old module paths that no longer exist. Compare the scaffold template against the actual Python and TypeScript plugin structure (which are the "first-class" references) and update the template to emit the current plugin shape with correct import paths (e.g., from desloppify.languages._framework...).
7. state_api_has_competing_root_facades
VERDICT: keep
Action plan: This is the same issue as #2 from a different angle. There are three root facades: state.py (compatibility), state_io.py (persistence/schema), state_scoring.py (scores). The fix is the same: delete state.py after migrating its importers to the two narrower facades. No separate action needed beyond #2.
VERDICT: wontfix
Reason: The recovery code in engine/_state/persistence.py and engine/_state/recovery.py handles reconstructing state from a surviving plan when the state file is missing/corrupt. Silent recovery is the correct behavior for a CLI tool -- the alternative (crashing) is worse. The recovery module is well-scoped and documented. Data integrity is maintained.
9. issues_by_file_shadowing_hides_role
VERDICT: wontfix
Reason: issues_by_file is used as a local variable name in intelligence/review/importing/per_file.py (a dict[str, int]) and as a parameter name in cache.py. These are in different modules and the naming is descriptive of its content. No real shadowing occurs. Medium confidence issue, not worth the churn.
10. global_backlog_blocks_targeted_review_reruns
VERDICT: keep
Action plan: In review/preflight.py, review_rerun_preflight() computes _objective_and_subjective_backlog() which checks the global objective backlog even when the user is only re-running specific subjective dimensions. The gate should only check backlog relevant to the targeted dimensions, not the entire objective backlog. Scope _objective_and_subjective_backlog to filter by the targeted dimensions, so a user can rerun e.g. naming_quality without being blocked by unrelated objective issues.
11. complexity_factory_drops_threshold_override
VERDICT: keep
Action plan: The LangConfig exposes complexity_threshold and LangRuntimeState has large_threshold_override, but the detect commands don't wire through a CLI threshold override to the actual complexity detection. Trace the complexity_threshold from LangConfig through the detect command factory and ensure the CLI's threshold argument (if one exists) is actually threaded through to the detector. If the CLI arg doesn't exist yet, add it to the detect subparser.
12. triage_stage_wrapper_chain
VERDICT: keep
Action plan: In triage/stages/commands.py, every stage command is a trivial wrapper: cmd_stage_enrich calls _cmd_stage_enrich which calls run_stage_enrich with a Deps object. The public cmd_stage_* functions in stage_flow_observe_reflect_organize.py are also one-line wrappers around the private _cmd_stage_*. Collapse the wrapper chain: have the stage dispatch call the implementation functions directly with deps, removing the intermediate _cmd_stage_* wrappers.
13. lifecycle_start_wrapper_ceremony
VERDICT: keep
Action plan: triage/runner/orchestrator_common.py defines ensure_triage_started() that wraps lifecycle.ensure_triage_started by constructing a TriageStartRequest and calling through. This is a legitimate convenience adapter for the runner context. However, it could be simplified to just call the lifecycle function directly with keyword args rather than having a separate function. Low priority -- inline the runner's ensure_triage_started at its call sites if there are few callers, or mark wontfix if this wrapper is used in multiple runners.
14. legacy_epics_schema_leaks_into_current_triage
VERDICT: keep
Action plan: The plan schema uses epic_triage_meta and EPIC_PREFIX = "epic/" throughout the codebase (seen in schema/__init__.py, policy/stale.py, reconcile.py, workflow.py). These are naming remnants from a prior "epics" concept that was renamed to "clusters." Rename epic_triage_meta to triage_meta and EPIC_PREFIX to a neutral cluster prefix in the schema, with a data migration in schema/migrations.py to rename the key in existing plan files.
15. plan_steps_still_accept_legacy_string_shape
VERDICT: wontfix
Reason: The _migrate_action_steps_to_v8 function in schema/helpers.py converts flat string steps to structured {title, detail} dicts. This is data migration code, which per project policy should be kept. The isinstance(step, str) checks are correct defensive handling for plans saved in older versions. This is working as intended.
16. typescript_detectors_flat_overload
VERDICT: wontfix
Reason: The TS detectors directory has ~30 files mixing core smells, CLI patterns, React patterns, etc. While it could be organized into subdirectories, the files are already namespaced by prefix (react_*.py, _smell_*.py, patterns_*.py). Reorganizing would be pure churn for an internal tool with no confusion risk. The naming conventions make each file's domain clear.
17. global_plugin_bootstrap_state
VERDICT: wontfix
Reason: Process-global registries for language plugins (registry_state, hook_registry) are standard for CLI tools. The tool runs as a short-lived process, not a long-lived server. Global state with module-level registration via decorators is the conventional pattern for plugin systems. No real downside.
18. php_resolver_cache_staleness
VERDICT: wontfix
Reason: _PHP_FILE_CACHE and _PHP_COMPOSER_CACHE in resolvers_scripts.py are module-global dicts without invalidation. But desloppify runs as a short-lived CLI process -- the caches are correct for the lifetime of a single scan. There is no scenario where the filesystem changes mid-scan and stale caches matter.
19. no_color_import_snapshot
VERDICT: wontfix
Reason: NO_COLOR = os.environ.get("NO_COLOR") is not None at module level in terminal.py is the standard way to implement the NO_COLOR spec. Evaluating at import time is correct -- the environment variable should be read once at startup. Dynamic changes to NO_COLOR mid-process are not a supported use case.
20. duplicated_triage_readiness_policy
VERDICT: keep
Action plan: The stage_validation.py file in the runner imports validation functions from validation/core.py, and readiness checks (like _require_organize_stage_for_enrich, _require_enrich_stage_for_complete) are called from multiple surfaces (stage commands, stage completion, runner validation). Extract the stage-prerequisite readiness policy into a single function per stage in validation/core.py that returns a structured result, then have all four surfaces call that one function rather than reimplementing the checks.
21. observe_reflect_organize_god_flow
VERDICT: keep
Action plan: stage_flow_observe_reflect_organize.py is 621 lines owning three stage workflows (observe, reflect, organize) plus shared lifecycle helpers. Split it into three focused modules: stage_flow_observe.py, stage_flow_reflect.py, stage_flow_organize.py, extracting the shared helpers (like _validate_stage_report_length) into the existing helpers.py or a new stage_flow_shared.py.
22. review_batch_orchestrator_overloaded
VERDICT: wontfix
Reason: At 653 lines, review/batch/orchestrator.py handles batch execution orchestration. A batch orchestrator naturally owns packet strategy, execution wiring, and validation because these are tightly coupled steps in a single workflow. Splitting would scatter a coherent pipeline. Medium confidence, and the file is not unreasonably large.
VERDICT: keep
Action plan: load_subjective_dimension_metadata_for_lang() and default_dimension_keys_for_lang() in base/subjective_dimensions.py accept a lang_name parameter but ignore it -- they normalize it then return the same catalog-driven result regardless. Either remove the lang_name parameter and collapse these to the non-lang variants, or actually implement per-language dimension filtering if different languages should have different subjective dimensions. Given the docstring says "Language-specific filtering now happens in intelligence-layer metadata APIs," the correct fix is to remove these functions and have callers use the non-lang variants directly.
VERDICT: keep
Action plan: The registry exports both DISPLAY_ORDER (a frozen tuple from the catalog baseline) and _DISPLAY_ORDER (a live _DisplayOrderView that reads from _REGISTRY.display_order), plus a display_order() function. When plugins register new detectors at runtime, only _DISPLAY_ORDER and display_order() reflect the change, while DISPLAY_ORDER stays frozen. Remove the frozen DISPLAY_ORDER tuple export and make _DISPLAY_ORDER the only constant, or deprecate both constants in favor of the display_order() function.
VERDICT: wontfix
Reason: engine/planning/__init__.py explicitly documents itself as "read-only rendering/query helpers only." The scan.py module lives inside this package and generates issues as part of scan execution, which is arguably a "query" (generating findings from source). The package's ownership contract is clearly documented and the scan.py module is appropriately placed next to the rendering/selection logic it feeds into. Medium confidence, not a real contract violation.
26. core_facade_import_knot
VERDICT: wontfix
Reason: Import cycles between plan/state/language facades are managed with lazy imports and TYPE_CHECKING guards throughout the codebase (visible in the multiple "avoid import cycles" comments). This is a natural consequence of the tool's architecture where state, planning, and language systems are interdependent. The lazy-import strategy is working and the cycles are not causing runtime issues. Untangling would require a major restructuring with minimal benefit for an internal tool.
Summary
Verdict
Count
Issue Numbers
keep
10
2, 6, 7, 10, 11, 12, 13, 14, 20, 21, 23, 24
wontfix
14
1, 3, 4, 5, 8, 9, 15, 16, 17, 18, 19, 22, 25, 26
(Note: #7 is a duplicate of #2 and can share the same action.)
The issues worth keeping fall into a few themes:
State facade cleanup (#2, #7): migrate importers off state.py to narrower facades
Naming/schema debt (#14): rename legacy "epic" naming to "cluster/triage"
I need you to check 12 review issue descriptions in the desloppify project to see if they're specific enough for someone unfamiliar with the codebase to execute without confusion. For each, look at the actual code referenced and tell me:
Is the description specific enough? (file paths, function names, what to do)
If not, give me a BETTER description with exact file paths, function names, and concrete steps.
DO NOT make any changes. Just research and report back.
Here are the 12 issues and their current descriptions:
state_facade_remains_primary_hub: "Migrate all ~31 production importers of desloppify.state to use state_io or state_scoring directly based on what they need, then delete state.py."
Check: does state_io.py and state_scoring.py actually exist? How many importers does state.py have?
state_api_has_competing_root_facades: "Same fix as state_facade_remains_primary_hub: delete state.py after migrating importers to state_io/state_scoring."
Is this truly a duplicate of #1?
language_scaffold_generates_old_plugin_shape: "Compare dev_scaffold_templates.py against actual Python/TypeScript plugin structure and update the template to emit current plugin shape with correct import paths."
Check: what does the scaffold actually generate vs what current plugins look like?
global_backlog_blocks_targeted_review_reruns: "In review/preflight.py, scope _objective_and_subjective_backlog to filter by targeted dimensions only."
Check: does review/preflight.py exist? Is the function named correctly?
complexity_factory_drops_threshold_override: "Trace complexity_threshold from LangConfig through the detect command factory and wire the CLI threshold argument through to the actual detector."
Check: does LangConfig have complexity_threshold? Where is the factory?
triage_stage_wrapper_chain: "Collapse the wrapper chain in triage/stages/commands.py: have stage dispatch call implementation functions directly with deps, removing intermediate cmd_stage* one-line wrappers."
Check: what does commands.py look like? What are the actual wrapper functions?
lifecycle_start_wrapper_ceremony: "Inline the runner ensure_triage_started at its call sites if few callers, or simplify to call lifecycle function directly with keyword args instead of constructing a TriageStartRequest wrapper."
Check: where is this function? How many callers?
legacy_epics_schema_leaks_into_current_triage_r: "Rename epic_triage_meta to triage_meta and EPIC_PREFIX to a neutral cluster prefix in the schema. Add data migration."
Check: where are these names used? How many references?
duplicated_triage_readiness_policy: "Extract stage-prerequisite readiness policy into a single function per stage in validation/core.py."
Check: does validation/core.py exist? What are the four surfaces?
observe_reflect_organize_god_flow: "Split stage_flow_observe_reflect_organize.py (621 lines) into three modules."
Check: how many lines is it actually? Is it cleanly splittable?
lang_specific_subjective_metadata_ignores_lang: "Remove lang_name parameter from load_subjective_dimension_metadata_for_lang() and default_dimension_keys_for_lang() in base/subjective_dimensions.py."
Check: do these functions exist? How many callers?
display_order_export_breaks_live_registry_contrac: "Remove the frozen DISPLAY_ORDER tuple export from registry.py."
Check: does DISPLAY_ORDER exist as a frozen tuple? What uses it?
For each, give me: CURRENT DESCRIPTION, VERDICT (specific enough / needs improvement), and if needed, IMPROVED DESCRIPTION with exact paths and steps.
Now I have all the data I need. Here's my complete report:
Issue-by-Issue Audit
1. state_facade_remains_primary_hub
CURRENT DESCRIPTION: "Migrate all ~31 production importers of desloppify.state to use state_io or state_scoring directly based on what they need, then delete state.py."
FINDINGS:state_io.py and state_scoring.py both exist. There are exactly 33 production import sites (not ~31) and 71 total including tests. state.py is a pure re-export facade (imports from engine/_state/ submodules). The description's count is close enough and the plan is accurate.
VERDICT: Specific enough. The count is slightly off (33 not 31) but the task is clear: each importer needs to be repointed to state_io or state_scoring depending on what symbols it uses. One minor improvement: mention the 38 test importers that also need migration.
IMPROVED DESCRIPTION: "Migrate all 33 production importers and ~38 test importers of desloppify.state (at desloppify/state.py) to import from desloppify.state_io (persistence/schema symbols) or desloppify.state_scoring (score accessors) directly. Then delete desloppify/state.py. Production importers are in app/commands/, intelligence/review/importing/holistic.py, and engine/_work_queue/synthetic_workflow.py."
2. state_api_has_competing_root_facades
CURRENT DESCRIPTION: "Same fix as state_facade_remains_primary_hub: delete state.py after migrating importers to state_io/state_scoring."
VERDICT: Needs improvement. If this is truly a duplicate, it should just say "duplicate of #1, close this." But the issue name hints at a different concern: that there are competing root facades (state.py, state_io.py, state_scoring.py all exist at the package root simultaneously). The fix is indeed the same -- delete state.py -- but the description should clarify whether this is a distinct tracking issue or a deliberate duplicate.
IMPROVED DESCRIPTION: "This is a duplicate of state_facade_remains_primary_hub. The competing-facades problem (three root modules: desloppify/state.py, desloppify/state_io.py, desloppify/state_scoring.py) is resolved by the same migration: delete state.py once importers are migrated. Close this as duplicate, or merge into issue #1."
3. language_scaffold_generates_old_plugin_shape
CURRENT DESCRIPTION: "Compare dev_scaffold_templates.py against actual Python/TypeScript plugin structure and update the template to emit current plugin shape with correct import paths."
FINDINGS: The scaffold template at desloppify/app/commands/dev_scaffold_templates.py generates stale import paths that no actual plugin uses:
Template emits from .. import register_lang -- real plugins use from desloppify.languages._framework.registration import register_full_plugin
Template emits from ...utils import find_source_files -- no language plugin imports from desloppify.utils; real plugins use from desloppify.base.discovery.source import find_py_files (Python) or equivalent
Template emits from ...policy.zones import COMMON_ZONE_RULES -- real plugins use from desloppify.engine.policy.zones import COMMON_ZONE_RULES
Template emits from ..base.types import DetectorPhase, LangConfig -- real plugins use from desloppify.languages._framework.base.types import ...
Template emits from ..base.phase_builders import ... -- real plugins use from desloppify.languages._framework.base.phase_builders import ...
Real Python plugin has files the template doesn't generate: _helpers.py, _security.py, _zones.py, phases_quality.py, phases_runtime.py, extractors_classes.py, extractors_shared.py
VERDICT: Needs improvement. The description is vague ("compare and update"). Someone unfamiliar wouldn't know which import paths are wrong.
IMPROVED DESCRIPTION: "Fix stale import paths and structure in desloppify/app/commands/dev_scaffold_templates.py. The _init_template() function generates broken imports:
from .. import register_lang should be from desloppify.languages._framework.registration import register_full_plugin
from ...utils import find_source_files should use from desloppify.base.discovery.source import ...
from ...policy.zones import COMMON_ZONE_RULES should be from desloppify.engine.policy.zones import COMMON_ZONE_RULES
from ..base.types import ... should be from desloppify.languages._framework.base.types import ...
from ..base.phase_builders import ... should be from desloppify.languages._framework.base.phase_builders import ...
Compare the generated __init__.py against a working plugin like desloppify/languages/go/__init__.py (simplest real plugin) to validate the fix."
4. global_backlog_blocks_targeted_review_reruns
CURRENT DESCRIPTION: "In review/preflight.py, scope _objective_and_subjective_backlog to filter by targeted dimensions only."
FINDINGS: The file exists at desloppify/app/commands/review/preflight.py. The function _objective_and_subjective_backlog() is at line 124. Looking at the code, objective_total at line 130 uses ctx.policy.objective_count which is a global count, not scoped to the targeted dimensions. The subjective count IS already filtered by normalized_blocking_dims (lines 134-163). So the issue is specifically that the objective count is unscoped.
VERDICT: Needs improvement. The description says "scope ... to filter by targeted dimensions" but doesn't clarify that the subjective part is already scoped -- only the objective count is the problem.
IMPROVED DESCRIPTION: "In desloppify/app/commands/review/preflight.py, function _objective_and_subjective_backlog() (line 124): the objective_total at line 130 uses ctx.policy.objective_count which is a global count across all dimensions. When a user runs review --dimensions X,Y, this global count blocks the rerun even if the open objective issues belong to unrelated dimensions. Fix: filter the objective count to only issues whose dimension matches the targeted review dimensions (the blocking_dims parameter). The subjective filtering (lines 134-163) is already correctly scoped."
5. complexity_factory_drops_threshold_override
CURRENT DESCRIPTION: "Trace complexity_threshold from LangConfig through the detect command factory and wire the CLI threshold argument through to the actual detector."
FINDINGS:LangConfig does have complexity_threshold (defined in desloppify/languages/_framework/base/types.py line 76/137, default 15). The "factory" is the cmd_detect() function in desloppify/app/commands/detect.py. Looking at cmd_detect() lines 62-67: it sets args.threshold for large and dupes detectors but NOT for complexity. The complexity detector gets its threshold from lang.complexity_threshold inside the phase runner (e.g., languages/python/phases_runtime.py line 65), but the detect command doesn't pass CLI --threshold through as an override.
VERDICT: Needs improvement. The description is vague about "factory" location. Someone unfamiliar wouldn't know where to look.
IMPROVED DESCRIPTION: "In desloppify/app/commands/detect.py, function cmd_detect() (line 40): the threshold-defaulting block (lines 62-67) handles large and dupes but ignores complexity. When a user runs desloppify detect complexity --threshold 20, the CLI threshold is never wired to the actual detector. The complexity detector reads its threshold from lang.complexity_threshold (set on LangConfig in desloppify/languages/_framework/base/types.py line 137). Fix: either (a) add a complexity case to the threshold block that sets lang.complexity_threshold from args.threshold, or (b) pass args.threshold through to the phase runner. Check how the phase runners consume the threshold: languages/python/phases_runtime.py line 65, languages/typescript/phases_structural.py line 52, languages/_framework/base/shared_phases_structural.py line 73."
6. triage_stage_wrapper_chain
CURRENT DESCRIPTION: "Collapse the wrapper chain in triage/stages/commands.py: have stage dispatch call implementation functions directly with deps, removing intermediate cmd_stage* one-line wrappers."
FINDINGS: The file is at desloppify/app/commands/plan/triage/stages/commands.py (59 lines). Lines 24-28 define aliases:
These are literally _alias = original assignments, not even wrapper functions. They're re-exported in __all__. The STAGE_COMMAND_HANDLERS dict on lines 16-22 already uses the originals directly, and run_stage_command() dispatches through it.
VERDICT: Needs improvement. The description says "one-line wrappers" but they're actually bare alias assignments, not functions. The fix is just to delete the aliases and remove them from __all__.
IMPROVED DESCRIPTION: "In desloppify/app/commands/plan/triage/stages/commands.py (lines 24-28): five bare alias assignments (_cmd_stage_observe = cmd_stage_observe, etc.) exist alongside the originals already in STAGE_COMMAND_HANDLERS. These aliases add no logic -- they're identity assignments. Delete lines 24-28 and remove the five _cmd_stage_* entries from __all__ (lines 47-51). Then grep for any importers of these aliases and repoint them to the originals (check desloppify/tests/commands/plan/test_triage_tooling_fixes.py)."
7. lifecycle_start_wrapper_ceremony
CURRENT DESCRIPTION: "Inline the runner ensure_triage_started at its call sites if few callers, or simplify to call lifecycle function directly with keyword args instead of constructing a TriageStartRequest wrapper."
FINDINGS:ensure_triage_started is defined in desloppify/app/commands/plan/triage/lifecycle.py (line 83). It has 4 callers:
stages/observe_reflect_organize.py line 336
runner/orchestrator_claude.py line 29
runner/orchestrator_codex_pipeline.py line 353
workflow.py line 63
All 4 construct a TriageStartRequest dataclass. The function itself is 53 lines with real logic (checking queue state, calling decide_triage_start, injecting stages, logging). It's not a trivial wrapper.
VERDICT: Needs improvement. The description suggests inlining or removing the function, but with 4 callers and 53 lines of real logic, inlining would be wrong. The actual issue is the TriageStartRequest ceremony -- callers construct a dataclass just to pass keyword args. The fix should focus on the dataclass overhead, not the function itself.
IMPROVED DESCRIPTION: "In desloppify/app/commands/plan/triage/lifecycle.py: the TriageStartRequest dataclass (line 33) adds ceremony -- all 4 callers construct it just to pass optional kwargs. Consider replacing the request: TriageStartRequest parameter with direct keyword arguments (state, attestation, log_action, log_actor, log_detail, start_message, start_message_style) on ensure_triage_started() itself (line 83). Callers to update: stages/observe_reflect_organize.py:336, runner/orchestrator_claude.py:29, runner/orchestrator_codex_pipeline.py:353, workflow.py:63. Do NOT inline the function -- it has real logic (53 lines, 4 callers). Delete TriageStartRequest from exports and update the test at tests/commands/plan/test_triage_split_modules_direct.py."
CURRENT DESCRIPTION: "Rename epic_triage_meta to triage_meta and EPIC_PREFIX to a neutral cluster prefix in the schema. Add data migration."
FINDINGS: There are 76 production references to epic_triage_meta or EPIC_PREFIX across the codebase. EPIC_PREFIX is imported in desloppify/engine/plan_state.py line 34. epic_triage_meta is a key in the plan JSON schema, used throughout engine and app layers. This is a large, mechanical rename that touches many files and requires a data migration to rename the key in persisted .desloppify/plan-*.json files.
VERDICT: Needs improvement. The description is too terse for a rename of this scale. It doesn't mention the scope (76+ production references), the persisted data format, or where EPIC_PREFIX is defined.
IMPROVED DESCRIPTION: "Rename the legacy 'epic' naming throughout the triage schema: (1) Rename the JSON key epic_triage_meta to triage_meta in the plan schema. This key appears in ~76 production sites across engine/plan_state.py, engine/plan_triage.py, engine/_plan/ subpackages, engine/_work_queue/, and app/commands/plan/triage/. (2) Rename EPIC_PREFIX (defined in engine/_plan/schema/__init__.py, imported in engine/plan_state.py:34) to a neutral cluster prefix. (3) Add a data migration in engine/_plan/schema/migrations.py to rename the key in existing .desloppify/plan-*.json files. (4) Update the PlanTriageInput.epic_triage_meta field in engine/_work_queue/types.py:101. Grep for epic_triage_meta and EPIC_PREFIX to find all sites; there are also ~100+ test references."
9. duplicated_triage_readiness_policy
CURRENT DESCRIPTION: "Extract stage-prerequisite readiness policy into a single function per stage in validation/core.py."
FINDINGS:desloppify/app/commands/plan/triage/validation/core.py exists (450 lines). It's a large file that re-exports from multiple sub-modules: completion_policy.py, completion_stages.py, enrich_checks.py. It contains functions like _require_reflect_stage_for_organize, _clusters_enriched_or_error, _unclustered_review_issues_or_error. The description says "four surfaces" but doesn't specify what they are. The readiness checks are scattered across validation/core.py, validation/completion_stages.py, validation/enrich_checks.py, and also in the runner at runner/stage_validation.py and runner/orchestrator_codex_pipeline_execution.py:179.
VERDICT: Needs improvement. The description doesn't identify what the "duplicated" surfaces are or where the duplication lives.
IMPROVED DESCRIPTION: "Stage-prerequisite readiness checks are duplicated across multiple surfaces: (1) validation/core.py has _require_reflect_stage_for_organize() (line 273); (2) validation/completion_stages.py has _require_organize_stage_for_complete(), _require_enrich_stage_for_complete(), _require_sense_check_stage_for_complete(); (3) validation/enrich_checks.py has _require_organize_stage_for_enrich(); (4) runner/orchestrator_codex_pipeline_execution.py:179 has its own prerequisite checks. These are all variations of 'does stage X exist before allowing stage Y'. Extract a single stage_prerequisites: dict[str, list[str]] mapping and a single require_stage_prerequisite(stages, target_stage) function in validation/core.py. All four surfaces should call through it. Full paths: desloppify/app/commands/plan/triage/validation/core.py, desloppify/app/commands/plan/triage/validation/completion_stages.py, desloppify/app/commands/plan/triage/validation/enrich_checks.py, desloppify/app/commands/plan/triage/runner/orchestrator_codex_pipeline_execution.py."
10. observe_reflect_organize_god_flow
CURRENT DESCRIPTION: "Split stage_flow_observe_reflect_organize.py (621 lines) into three modules."
FINDINGS: The file previously at stage_flow_observe_reflect_organize.py has been moved to desloppify/app/commands/plan/triage/stages/observe_reflect_organize.py -- and it is exactly 621 lines. It exports cmd_stage_observe, cmd_stage_reflect, cmd_stage_organize (imported in stages/commands.py). The three stages are naturally separable since each has its own entry point function.
VERDICT: Needs improvement. The file path in the description is wrong (old location). The line count is accurate.
IMPROVED DESCRIPTION: "Split desloppify/app/commands/plan/triage/stages/observe_reflect_organize.py (621 lines) into three modules: stages/observe.py, stages/reflect.py, stages/organize.py. Each module should contain one cmd_stage_* entry point and its private helpers. Update the imports in stages/commands.py (lines 9-13) to import from the new modules. The file exports cmd_stage_observe, cmd_stage_reflect, cmd_stage_organize -- these are the natural split boundaries. Also update tests/commands/plan/test_triage_stage_flow_observe_reflect_organize_direct.py."
CURRENT DESCRIPTION: "Remove lang_name parameter from load_subjective_dimension_metadata_for_lang() and default_dimension_keys_for_lang() in base/subjective_dimensions.py."
FINDINGS: Both functions exist in desloppify/base/subjective_dimensions.py. Looking at the code:
default_dimension_keys_for_lang(lang_name) (line 78): normalizes lang_name then throws it away, calling default_dimension_keys() which ignores language entirely.
load_subjective_dimension_metadata_for_lang(lang_name) (line 106): normalizes lang_name then throws it away, calling _build_metadata_registry() which ignores language.
desloppify/tests/review/policy/test_review_dimensions_direct.py uses both (lines 447, 466)
The functions are also called internally by _metadata_registry() in the same file.
VERDICT: Needs improvement. The description says "remove lang_name parameter" but doesn't explain the downstream plan. These functions exist as compatibility shims. Simply removing the parameter would break callers. The fix should either (a) deprecate these functions and have callers use the non-lang variants, or (b) remove them and update callers.
IMPROVED DESCRIPTION: "In desloppify/base/subjective_dimensions.py: default_dimension_keys_for_lang(lang_name) (line 78) and load_subjective_dimension_metadata_for_lang(lang_name) (line 106) both ignore their lang_name parameter -- they normalize it then discard it. Replace callers with the lang-agnostic equivalents: (1) intelligence/review/dimensions/metadata.py:19 imports load_subjective_dimension_metadata_for_lang -- switch to load_subjective_dimension_metadata. (2) Internal call in _metadata_registry() (line 114-117) -- simplify to always call load_subjective_dimension_metadata(). (3) Update tests in tests/review/policy/test_review_dimensions_direct.py (lines 447, 466). Then delete both *_for_lang functions, remove from __all__ (lines 173, 179), and remove from _clear_subjective_dimension_caches() (line 37)."
CURRENT DESCRIPTION: "Remove the frozen DISPLAY_ORDER tuple export from registry.py."
FINDINGS: In desloppify/base/registry.py line 28: DISPLAY_ORDER: tuple[str, ...] = tuple(_BASE_DISPLAY_ORDER). This is a frozen snapshot computed at import time. The live registry (_REGISTRY.display_order) can be mutated by register_detector(). So DISPLAY_ORDER is stale after any runtime registration. However, it has consumers:
Note: _DISPLAY_ORDER (with underscore) is a separate object -- a _DisplayOrderView (line 76) that IS a live proxy into _REGISTRY.display_order. The frozen DISPLAY_ORDER tuple (line 28, no underscore) is the problematic one.
The source list lives in desloppify/base/registry_catalog_models.py (line 7) as a plain list.
VERDICT: Needs improvement. The description says "remove the frozen tuple" but doesn't mention that _DISPLAY_ORDER (the live view) should be kept, or that scope.py needs updating.
IMPROVED DESCRIPTION: "In desloppify/base/registry.py: remove the frozen DISPLAY_ORDER tuple (line 28) which is a stale snapshot that breaks the live registry contract. Keep _DISPLAY_ORDER (line 76, a _DisplayOrderView that proxies the live _REGISTRY.display_order). Update the one production consumer: app/commands/show/scope.py:167 which reads DISPLAY_ORDER -- switch it to use _DISPLAY_ORDER or the registry's display_order accessor. Remove DISPLAY_ORDER from __all__ (line 189). Also remove it from registry_catalog_models.py's __all__ if appropriate, or keep it there as the canonical static catalog. Test consumers already use _DISPLAY_ORDER (the live view), so they need no changes."