Skip to content

feat(nucleus): ADR-010 §2 layer 5 — module config binding & validation#84

Merged
jcsvwinston merged 1 commit into
mainfrom
feat/adr010-layer5-module-config
May 29, 2026
Merged

feat(nucleus): ADR-010 §2 layer 5 — module config binding & validation#84
jcsvwinston merged 1 commit into
mainfrom
feat/adr010-layer5-module-config

Conversation

@jcsvwinston
Copy link
Copy Markdown
Owner

Summary

Implements ADR-010 §2 layer 5 — module-specific configuration binding & validation, the fifth and final layer of the fluent FromConfigFile validator.

  • Each mounted module's modules.<name>.* config subtree (YAML/TOML/JSON) is bound into its typed Module[C].Config.
  • default: struct tags fill unset fields (in-package reflection helper — no new dependency); validate: tags are enforced at boot via pkg/validate.
  • A misconfigured module fails fast with the new nucleus.ErrInvalidModuleConfig sentinel. Config for an unmounted module is a non-fatal WARN.
  • Runs on both surfaces (mirrors layers 3/4): builder path binds from the file subtree; direct-struct Run(App{}) applies defaults + validation only.
  • The modules.* namespace is now accepted by FromConfigFile (previously rejected as an unknown key) — exempted from the layer-2 guard in the nucleus loader, deliberately not added to app.ContractConfigKeyPatterns() (open-ended, module-owned schema).

Security

  • Module config is excluded from the /_/config effective-config snapshot (arbitrary module fields have no redaction contract).
  • The retained raw module subtree is released after binding so cleartext module secrets are GC'd, not held for the process lifetime.

Contract

Additive: +1 exported sentinel ErrInvalidModuleConfig (freeze baseline rebaselined via the sanctioned mechanism). No removed or renamed stable symbol. Semver: minor.

Iteration loop

architect-reviewer PASS · code-reviewer NITS (addressed) · security-auditor WARN (both SHOULDs fixed) · contract-guardian PASS · go test ./... + -race green · doc-updater + website-curator UPDATED (build + drift guard clean) · changelog-writer Added entry.

Test plan

  • CI Required Gate green (full matrix incl. live MSSQL/Oracle, contract freeze, Docusaurus build)

🤖 Generated with Claude Code

Bind each mounted module's modules.<name>.* config subtree into its typed
Module[C].Config, apply default: struct tags, and enforce validate: tags at
boot — on both the FromConfigFile builder path and the direct-struct Run path.
A misconfigured module fails fast with the new ErrInvalidModuleConfig sentinel;
config for an unmounted module is a non-fatal WARN. The modules.* namespace is
now accepted by FromConfigFile (exempt from the layer-2 unknown-key guard) and
excluded from the /_/config effective snapshot (module fields have no redaction
contract); the retained raw subtree is released after binding.

Closes the five-layer FromConfigFile validator (layer 4 shipped 2026-05-26).
Additive: +1 exported sentinel ErrInvalidModuleConfig (freeze rebaselined +1);
no removed or renamed stable symbol. Full iteration loop green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jcsvwinston jcsvwinston merged commit 765e486 into main May 29, 2026
12 checks passed
@jcsvwinston jcsvwinston deleted the feat/adr010-layer5-module-config branch May 29, 2026 18:51
jcsvwinston added a commit that referenced this pull request May 29, 2026
ADR-010 §2 layer 5 (module config binding/validation) merged to main as 765e486
(PR #84), completing the five-layer FromConfigFile validator. Archive the
iteration to docs/iterations/2026-05-29-adr010-layer5.md, reset
CURRENT_ITERATION.md to an awaiting-owner-direction stub (backlog carried
forward, incl. the new modules.* env-layer deferred item), and refresh
HANDOFF.md.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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