feat(modules): module registry with metadata, dependencies, and defaults #96

Closed
opened 2026-02-14 19:45:56 +00:00 by forbes · 0 comments
Owner

Ref: docs/MODULES.md §2, §11 step 3

Implement the in-memory module registry as a Go package (e.g., internal/modules/).

Module definition struct:

  • ID, Name, Description
  • Required (bool) — cannot be disabled
  • DefaultEnabled (bool)
  • Dependencies ([]string) — other module IDs
  • Version (optional)

Registry (10 modules):

ID Name Required Default Depends On
core Core PDM yes
schemas Schemas yes
storage Storage yes
auth Authentication no true
projects Projects no true
audit Audit no true
odoo Odoo ERP no false auth
freecad Create Integration no true
jobs Job Queue no false auth
dag Dependency DAG no false jobs

Functions:

  • IsEnabled(id string) bool
  • SetEnabled(id string, enabled bool) error — validates dependencies
  • All() []ModuleInfo
  • Get(id string) *ModuleInfo
  • ValidateDependencies() error

The registry loads state from module_state table on startup and is updated at runtime via admin API.

Depends on #94, #95.

**Ref:** docs/MODULES.md §2, §11 step 3 Implement the in-memory module registry as a Go package (e.g., `internal/modules/`). **Module definition struct:** - ID, Name, Description - Required (bool) — cannot be disabled - DefaultEnabled (bool) - Dependencies ([]string) — other module IDs - Version (optional) **Registry (10 modules):** | ID | Name | Required | Default | Depends On | |----|------|----------|---------|------------| | `core` | Core PDM | yes | — | — | | `schemas` | Schemas | yes | — | — | | `storage` | Storage | yes | — | — | | `auth` | Authentication | no | true | — | | `projects` | Projects | no | true | — | | `audit` | Audit | no | true | — | | `odoo` | Odoo ERP | no | false | auth | | `freecad` | Create Integration | no | true | — | | `jobs` | Job Queue | no | false | auth | | `dag` | Dependency DAG | no | false | jobs | **Functions:** - `IsEnabled(id string) bool` - `SetEnabled(id string, enabled bool) error` — validates dependencies - `All() []ModuleInfo` - `Get(id string) *ModuleInfo` - `ValidateDependencies() error` The registry loads state from `module_state` table on startup and is updated at runtime via admin API. Depends on #94, #95.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#96