Skip to content

fix: apply 9 Shipwell refactor findings#60

Open
shipwellhq[bot] wants to merge 1 commit intomainfrom
shipwell/fix-refactor-1771247907776
Open

fix: apply 9 Shipwell refactor findings#60
shipwellhq[bot] wants to merge 1 commit intomainfrom
shipwell/fix-refactor-1771247907776

Conversation

@shipwellhq
Copy link
Copy Markdown

@shipwellhq shipwellhq bot commented Feb 16, 2026

🛠️ Shipwell Auto-Fix: refactor

Automated fixes generated by Shipwell analysis.

✅ Applied Fixes (9)

Severity Finding Files
⚪ info Massive JSON parsing/repair logic duplicated across Planner, GeminiPlanGenerator, and GeminiProvider src/planner/index.ts, src/planner/ai.ts
⚪ info validateFileStructure and validateNextSteps duplicated between Planner and GeminiPlanGenerator src/planner/index.ts, src/planner/ai.ts
⚪ info Dead code: entire GeminiPlanGenerator class (src/planner/ai.ts) is orphaned src/planner/ai.ts, src/planner/cache.ts, src/test/suite/ai.test.ts
⚪ info Naming collision: PlanTemplate interface defined in both interfaces.ts and builtinTemplates.ts with different shapes src/planner/interfaces.ts, src/templates/builtinTemplates.ts, src/planner/rules.ts
⚪ info Gemini safety settings configuration duplicated 3 times in ai.ts and once in gemini.ts src/planner/ai.ts, src/planner/providers/gemini.ts
⚪ info Unused RuleBasedPlanGenerator instantiation and dead loadConfig provider logic src/planner/index.ts
⚪ info Type safety gap: any types used in test files and mock configurations src/test/suite/planner.test.ts, src/test/suite/ollama.test.ts, tests/mocks/vscode.ts
⚪ info Configuration loading in Planner hardcodes Groq but retains multi-provider config interface src/planner/index.ts, package.json
⚪ info HistoryView and TemplateBrowser have HTML generation in TypeScript that should use a shared webview utility src/version-control/HistoryView.ts, src/templates/templateBrowser.ts
Finding details

⚪ Massive JSON parsing/repair logic duplicated across Planner, GeminiPlanGenerator, and GeminiProvider

Category: code-duplication
Files: src/planner/index.ts, src/planner/ai.ts

⚪ validateFileStructure and validateNextSteps duplicated between Planner and GeminiPlanGenerator

Category: code-duplication
Files: src/planner/index.ts, src/planner/ai.ts

⚪ Dead code: entire GeminiPlanGenerator class (src/planner/ai.ts) is orphaned

Category: dead-code
Files: src/planner/ai.ts, src/planner/cache.ts, src/test/suite/ai.test.ts

⚪ Naming collision: PlanTemplate interface defined in both interfaces.ts and builtinTemplates.ts with different shapes

Category: naming-inconsistency
Files: src/planner/interfaces.ts, src/templates/builtinTemplates.ts, src/planner/rules.ts

⚪ Gemini safety settings configuration duplicated 3 times in ai.ts and once in gemini.ts

Category: code-duplication
Files: src/planner/ai.ts, src/planner/providers/gemini.ts

⚪ Unused RuleBasedPlanGenerator instantiation and dead loadConfig provider logic

Category: dead-code
Files: src/planner/index.ts

⚪ Type safety gap: any types used in test files and mock configurations

Category: type-safety
Files: src/test/suite/planner.test.ts, src/test/suite/ollama.test.ts, tests/mocks/vscode.ts

⚪ Configuration loading in Planner hardcodes Groq but retains multi-provider config interface

Category: architecture
Files: src/planner/index.ts, package.json

⚪ HistoryView and TemplateBrowser have HTML generation in TypeScript that should use a shared webview utility

Category: security
Files: src/version-control/HistoryView.ts, src/templates/templateBrowser.ts

⏭️ Skipped (4) — no diff available

  • ⚪ Inconsistent naming: VersionManager.ts uses PascalCase filename while other files use camelCase
  • ⚪ Planner singleton exported at module level creates testing difficulties
  • ⚪ GeminiConfig interface unused by loadConfig - dead configuration path
  • ⚪ RuleBasedPlanGenerator is only used in tests - consider removing or documenting as test-only

❌ Failed (3)

  • ⚪ Duplicated system prompt for section refinement across OllamaProvider, GroqProvider, and GeminiProvider — Could not match hunk at line 3 in src/planner/providers/ollama.ts
  • ⚪ Dead code: parseAIPlan method in Planner class is never called — Could not match hunk at line 170 in src/planner/index.ts
  • ⚪ Repeated error handling pattern ("Show Logs" action) should be centralized — Could not match hunk at line 1 in src/utils/logger.ts

Generated by Shipwell 🚢

@shipwellhq shipwellhq bot requested a review from manasdutta04 as a code owner February 16, 2026 13:18
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
layr Ready Ready Preview, Comment Feb 16, 2026 1:18pm

@github-actions
Copy link
Copy Markdown

Hi @ShipwellHQ[bot]! 👋

Thanks for contributing to layr! 🎉
We appreciate your effort and will review your changes soon.


Please star the repo if you like it!
👤 Follow the owner for updates.

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.

0 participants