Skip to content

Latest commit

 

History

History
171 lines (134 loc) · 5.56 KB

File metadata and controls

171 lines (134 loc) · 5.56 KB

Architecture Directories Cleanup Analysis

Date: 2025-11-06 Total Files: 31 files (22 root + 9 two-branch) Target: Remove duplicates, outdated versions, and consolidate


📊 Current State

Root Architecture (/docs/architecture/) - 22 files

Most Recent:
- updated-architecture-document-v4.md (Oct 30, 2025)
- app-flow.md (Oct 4, 2025)
- UNIVERSAL_FRAMEWORK_ARCHITECTURE.md (Sep 10, 2025)
- SMART_FILE_SELECTION_GUIDE.md (Sep 10, 2025)

Older (Jul-Aug 2025):
- model-version-management.md
- dynamic-model-selection-architecture.md
- model-selection-architecture.md
- ai-location-finder-architecture.md
- architecture-addendum-2025-08-08.md
- comparison-agent-refactor-summary.md
- comparison-agent-architecture.md
- TOKEN_TRACKING_INTEGRATION.md
- tool-execution-flow.md
- cloud-deployment-risk-analysis.md
- repository-analysis-report-structure.md
- report-data-flow.md
- report-data-categorization.md
- AI-PROVIDERS-CLARIFICATION.md
- SIMPLIFIED_PR_ANALYSIS_FLOW.md
- PR_VS_REPO_ANALYSIS_SPLIT.md
- scheduling-strategy.md
- agent-architecture.md (Jun 9, 2025 - oldest)

Two-Branch Architecture (/packages/agents/src/two-branch/docs/architecture/) - 9 files

- AGENT_TOOL_LANGUAGE_MATRIX.md
- BUILD_TOOL_DETECTION_FLOW.md
- COMPILATION_STRATEGY.md
- DEPLOYMENT-ARCHITECTURE.md
- README.md
- TOOL-EXECUTION-PIPELINE.md
- UNIVERSAL_FRAMEWORK_ARCHITECTURE.md
- V9-SYSTEM-OVERVIEW.md (Sep 30, 2025)
- V9_WORKING_COMPONENTS.md

🔍 Duplicates Found

1. V9-SYSTEM-OVERVIEW.md (3 copies!)

Location 1: /V9-SYSTEM-OVERVIEW.md (Oct 31 12:09) Location 2: /packages/agents/src/two-branch/docs/next/V9-SYSTEM-OVERVIEW.md (Oct 31 12:58) ✅ NEWEST Location 3: /packages/agents/src/two-branch/docs/architecture/V9-SYSTEM-OVERVIEW.md (Sep 30 14:41)

Analysis:

  • Location 1 and 2 are identical (same MD5 hash)
  • Location 2 is the newest (Oct 31 12:58)
  • Location 3 is oldest and different content

Action:

  • ✅ KEEP: /packages/agents/src/two-branch/docs/next/V9-SYSTEM-OVERVIEW.md
  • ❌ DELETE: /V9-SYSTEM-OVERVIEW.md (duplicate)
  • ❌ DELETE: /packages/agents/src/two-branch/docs/architecture/V9-SYSTEM-OVERVIEW.md (outdated)

2. UNIVERSAL_FRAMEWORK_ARCHITECTURE.md (2 copies)

Location 1: /docs/architecture/UNIVERSAL_FRAMEWORK_ARCHITECTURE.md (Sep 10, 2025) Location 2: /packages/agents/src/two-branch/docs/architecture/UNIVERSAL_FRAMEWORK_ARCHITECTURE.md

Analysis: Different MD5 hashes (different content)

  • Root version: 906893cd1edde0270dd02a233dff445a
  • Two-branch version: b9df8dea3e3a335791808e1e5131d780

Action: Need to review both to determine which is canonical or if merge needed


📁 Outdated/Historical Files in Root

Likely Outdated (Jun-Jul 2025):

  1. agent-architecture.md (Jun 9) - Superseded by updated-architecture-document-v4.md?
  2. report-data-flow.md (Jun 23) - V9 report flow likely updated
  3. scheduling-strategy.md (Jun 23) - Likely superseded
  4. PR_VS_REPO_ANALYSIS_SPLIT.md (Jul 17) - V9 may have resolved this
  5. SIMPLIFIED_PR_ANALYSIS_FLOW.md (Jul 17) - Check if still relevant
  6. comparison-agent-architecture.md (Jul 29) - Check against V9
  7. comparison-agent-refactor-summary.md (Jul 30) - Refactor completed?
  8. tool-execution-flow.md (Jul 28) - Superseded by two-branch TOOL-EXECUTION-PIPELINE?

Potentially Consolidated:

  1. model-selection-architecture.md (Aug 13)
  2. dynamic-model-selection-architecture.md (Aug 13) - Merge these two?
  3. model-version-management.md (Aug 13)

🎯 Recommended Actions

Phase 1: Remove Duplicates (2 files)

# Delete root V9-SYSTEM-OVERVIEW duplicate
rm /Users/alpinro/Code\ Prjects/codequal/V9-SYSTEM-OVERVIEW.md

# Delete outdated two-branch architecture V9-SYSTEM-OVERVIEW
rm /Users/alpinro/Code\ Prjects/codequal/packages/agents/src/two-branch/docs/architecture/V9-SYSTEM-OVERVIEW.md

Phase 2: Archive Outdated Root Architecture (8 files)

Archive to /docs/architecture/archive/2025-q2-q3/:

1. agent-architecture.md (Jun 9)
2. report-data-flow.md (Jun 23)
3. scheduling-strategy.md (Jun 23)
4. PR_VS_REPO_ANALYSIS_SPLIT.md (Jul 17)
5. SIMPLIFIED_PR_ANALYSIS_FLOW.md (Jul 17)
6. comparison-agent-architecture.md (Jul 29)
7. comparison-agent-refactor-summary.md (Jul 30)
8. tool-execution-flow.md (Jul 28)

Phase 3: Consolidate Model Selection Docs (3→1)

Merge into MODEL_SELECTION_ARCHITECTURE.md:

  • model-selection-architecture.md
  • dynamic-model-selection-architecture.md
  • model-version-management.md

Phase 4: Resolve UNIVERSAL_FRAMEWORK_ARCHITECTURE

Need manual review: Determine which version is canonical or merge both


📊 Expected Impact

Before: 31 total architecture files

  • Root: 22 files
  • Two-branch architecture: 9 files

After Cleanup:

  • Root: 12 files (22 - 8 archived - 2 consolidated + 1 merged)
  • Two-branch architecture: 8 files (9 - 1 duplicate removed)
  • Total: 20 files (35% reduction)

Archived: 8 historical files → /docs/architecture/archive/2025-q2-q3/ Deleted: 2 duplicates Merged: 3 model selection docs → 1


⚠️ Manual Review Needed

  1. UNIVERSAL_FRAMEWORK_ARCHITECTURE.md - Which version is correct?
  2. tool-execution-flow.md vs TOOL-EXECUTION-PIPELINE.md - Are these same/different?
  3. architecture-addendum-2025-08-08.md - Still relevant or merged into v4?

✅ Next Steps

  1. Review this analysis
  2. Approve Phase 1 (remove duplicates)
  3. Approve Phase 2 (archive outdated)
  4. Manually review UNIVERSAL_FRAMEWORK_ARCHITECTURE versions
  5. Execute cleanup and commit

Status: Ready for Review