Skip to content

fix(arch): remove barrel import from controller.ts (#201) - #219

Merged
pajoma merged 1 commit into
developfrom
feat/201-fix-circular-dep-controller
May 18, 2026
Merged

fix(arch): remove barrel import from controller.ts (#201)#219
pajoma merged 1 commit into
developfrom
feat/201-fix-circular-dep-controller

Conversation

@pajoma

@pajoma pajoma commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove import * as J from '../.' barrel import from src/util/controller.ts
  • Add direct imports for Configuration (from ../vscode/conf) and isNullOrUndefined (from ./util)
  • Retype _logger field and logger getter as ILogger; remove unsafe as Logger cast
  • Update all 15 J.VSCode.* / J.Journal.* / J.Util.* type annotations to use direct names

Related

Test plan

  • npm run compile — clean
  • npm run compile-tests (tsc) — clean
  • npm run lint — clean
  • npm test — requires display (xvfb); run in CI
  • No import * as J remains in controller.ts
  • No J. references remain in controller.ts

🤖 Generated with Claude Code

Replace `import * as J from '../.'` with direct relative imports.
Type `_logger`/`logger` getter as ILogger, removing unsafe cast.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pajoma

pajoma commented May 18, 2026

Copy link
Copy Markdown
Owner Author

Architecture Review: Final Approval (PR #219)

I have performed a critical architectural and technical review of this PR. The implementation rigorously adheres to the mandates set during the planning phase and represents the definitive fix for our direct circular dependency risk.

Key Achievements:

  • Barrel Cycle Broken: The root barrel import (import * as J) has been completely removed from controller.ts, eliminating the initialization-order fragility.
  • Improved Type Safety: Retyping the logger as ILogger and removing the unsafe as Logger cast is a major win for contract integrity.
  • Strategic Alignment: Correctly sequenced after Arch: Decompose God Object Controller into Focused Dependencies #208, ensuring the barrel removal was performed on the final, decoupled version of the controller.
  • Clean Hygiene: The removal of outdated and incorrect JSDoc annotations improves the file's maintainability and signal-to-noise ratio.

Final Verification:

The 21 line additions and 48 deletions successfully replace the global namespace with explicit, stable imports. The clean tsc and esbuild runs confirm that the refactor is functionally complete.

This successfully concludes the Phase 2.3 tactical cleanup for the controller. LGTM.


Note: Gemini was involved in creating this comment (but not without consulting me).

@pajoma
pajoma merged commit 8071990 into develop May 18, 2026
2 checks passed
@pajoma
pajoma deleted the feat/201-fix-circular-dep-controller branch May 18, 2026 09:29
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.

Fix: Resolve circular dependency in util/controller.ts (R5)

1 participant