Skip to content

feat: scope controller registry by module#8

Merged
aryeko merged 2 commits intomainfrom
agent-1/kernel-docs
Feb 4, 2026
Merged

feat: scope controller registry by module#8
aryeko merged 2 commits intomainfrom
agent-1/kernel-docs

Conversation

@aryeko
Copy link
Collaborator

@aryeko aryeko commented Feb 4, 2026

Type

  • feat — New feature
  • fix — Bug fix
  • refactor — Code restructure (no behavior change)
  • docs — Documentation only
  • test — Test coverage
  • chore — Build, CI, tooling
  • perf — Performance improvement

Summary

This PR namespaces controller registry keys by module, enforces duplicate controller names only within a module, updates related errors/tests, and documents the new controller key format and App.Get access pattern.

Changes

  • Namespace controller keys as module:controller and track per-module duplicates
  • Include module name in DuplicateControllerNameError and expand bootstrap tests
  • Document namespaced controller keys and App.Get/App.Resolver in API docs

Breaking Changes

Controller keys in App.Controllers are now module:controller (was controller).

Validation

Installing development tools...
Done: All tools installed
gofmt -w .
/Users/aryekogan/go/bin/goimports -w .
/Users/aryekogan/go/bin/golangci-lint run
go test ./...
ok   	github.com/aryeko/modkit/modkit/http	(cached)
ok   	github.com/aryeko/modkit/modkit/kernel	(cached)
ok   	github.com/aryeko/modkit/modkit/logging	(cached)
ok   	github.com/aryeko/modkit/modkit/module	(cached)

Checklist

  • Code follows project style (make fmt passes)
  • Linter passes (make lint)
  • Tests pass (make test)
  • Tests added/updated for new functionality
  • Documentation updated (if applicable)
  • Commit messages follow Conventional Commits

Related Issues

Notes

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The changes refactor controller identification from simple names to module-namespaced keys in the format module:controller. The public API is updated by removing the App.Container field and introducing App.Get() and App.Resolver() methods. Duplicate controller validation moves from global to per-module scope.

Changes

Cohort / File(s) Summary
API Surface Updates
docs/reference/api.md
Removed App.Container field; updated App.Controllers description to reflect module-namespaced keys; added App.Get(token) and App.Resolver() methods for token resolution.
Controller Namespacing
modkit/kernel/bootstrap.go
Introduced controllerKey() helper to create composite keys; replaced global duplicate check with per-module tracking using perModule cache; store controllers using namespaced keys instead of plain names.
Error Type Enhancement
modkit/kernel/errors.go
Added public Module field to DuplicateControllerNameError; updated Error() method to include module name in error message format.
Test Coverage
modkit/kernel/bootstrap_test.go
Updated tests to verify namespaced controller key format (module:Controller); added test scenarios for same controller names across different modules; added assertions on new Module field in error type.
Documentation
docs/architecture.md
Updated Controllers section to document namespacing as module:controller with corresponding example output.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Controllers now wear module badges bright,
Keys are namespaced, keeping scopes just right,
A.Container's gone, Get() takes its place,
Per-module checks add structure and grace! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: introducing module-scoped controller registry keys in the format 'module:controller' and enforcing per-module duplicate detection.
Description check ✅ Passed The PR description follows the required template structure with all key sections completed, including type selection, clear summary, specific changes, breaking changes explicitly stated, validation commands with output, and all checklist items marked complete.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch agent-1/kernel-docs

Comment @coderabbitai help to get the list of available commands and usage tips.

@aryeko aryeko force-pushed the agent-1/kernel-docs branch from 5b88a1c to 32c11dc Compare February 4, 2026 23:37
@aryeko aryeko merged commit 99e1f43 into main Feb 4, 2026
6 checks passed
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.

1 participant