Skip to content

Dead-code pruning report — comprehensive analysis of ~7,800 removable lines - #1302

Draft
akashgit wants to merge 1 commit into
mainfrom
factory/run-28fae87c
Draft

Dead-code pruning report — comprehensive analysis of ~7,800 removable lines#1302
akashgit wants to merge 1 commit into
mainfrom
factory/run-28fae87c

Conversation

@akashgit

Copy link
Copy Markdown
Owner

Closes #1301

Changes

  • Added docs/pruning-report.md — a comprehensive 10-section dead-code analysis consolidating three parallel researcher reports
  • Report only — no code changes, no file deletions

Report Contents

  1. Executive Summary — ~7,800 total removable lines across all confidence tiers
  2. Dead Runner Code — codex.py (219), bob.py (316), opencode.py (353) + all cross-references, env vars, config entries
  3. Dead Agent Prompts — evolver.md (38 lines, zero references anywhere)
  4. Dead/Uncertain Workflow Modes — founder, study, refine, parallel-improve (safe to remove); build/improve (keep function, remove registry); frontend-design variants (needs user confirmation)
  5. Contributed Workflows — 11 benchmark modes (4,201 lines), recommend keeping as plugins
  6. Additional Dead Code Candidates — Corrected false positives: refactory.py and cycle_analyzer.py are actively used
  7. Verification Evidence — All grep/git-log commands run with actual output included
  8. Dead Test Code — Complete inventory: 1,960 HIGH-confidence dead test lines across 9 files
  9. Safe Deletion Order — 9-phase plan from runner isolation through final doc cleanup
  10. Risk Assessment — Per-category risk rating with justification

Key Finding

build_workflow is the structural base for design_workflow (the primary active mode). improve_workflow is the base for research_workflow. Neither function can be deleted — only their direct invocation via --mode build/--mode improve can be removed from the registry.

Consolidates three parallel researcher analyses into an actionable
pruning plan at docs/pruning-report.md. All verification commands
run with actual output included.

Key findings: ~2,944 lines confirmed dead (3 runners + tests + evolver.md),
~4,378 lines pending user confirmation (9 workflow modes). Corrected
false positives: refactory.py and cycle_analyzer.py are actively used.

Closes #1301

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Sentrux Quality Report

Absolute

Scanning ....
[scan] git ls-files: 655 total, 643 kept, 12 dropped (ext:12, meta:0, big:0)
[build_project_map] 643 files, 106 unique dirs, 98 cache misses, 6.0ms
[resolve] 1221 resolved, 1636 unresolved (of 2857 total specs)
[resolve_imports] project_map 6.2ms, suffix_idx 1.1ms, suffix_resolve 18.6ms, total 25.9ms
[build_graphs] 643 files | maps 2.4ms, imports 26.1ms, calls+inherit 8.6ms, total 37.1ms | 1220 import, 9834 call, 11 inherit edges
sentrux check — 3 rules checked

Quality: 4492

✗ [Error] max_cc: 3 function(s) exceed max cyclomatic complexity of 30
    factory/cli/_ceo_helpers.py:_validate_ceo_flags (cc=43)
    factory/cli/_ceo_helpers.py:_execute_ceo (cc=43)
    factory/cli/run.py:cmd_run (cc=32)

✗ 1 violation(s) found

Diff (vs base branch)

Scanning ....
[scan] git ls-files: 655 total, 643 kept, 12 dropped (ext:12, meta:0, big:0)
[build_project_map] 643 files, 106 unique dirs, 98 cache misses, 6.1ms
[resolve] 1221 resolved, 1636 unresolved (of 2857 total specs)
[resolve_imports] project_map 6.2ms, suffix_idx 1.1ms, suffix_resolve 24.9ms, total 32.3ms
[build_graphs] 643 files | maps 2.4ms, imports 32.4ms, calls+inherit 8.1ms, total 42.9ms | 1220 import, 9834 call, 11 inherit edges
sentrux gate — structural regression check

Quality:      4492 -> 4492
Coupling:     0.79 → 0.79
Cycles:       4 → 4
God files:    3 → 3

Distance from Main Sequence: 0.36

✓ No degradation detected

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.86%. Comparing base (ecee3d9) to head (7941746).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1302      +/-   ##
==========================================
+ Coverage   84.83%   84.86%   +0.02%     
==========================================
  Files         231      231              
  Lines       25740    25740              
  Branches     4111     4111              
==========================================
+ Hits        21836    21843       +7     
+ Misses       2926     2921       -5     
+ Partials      978      976       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dead-code pruning report — comprehensive analysis of ~7,800 removable lines

1 participant