Optional ReadonlyabsenceDeclared-absence policies for optional keys (#363). A key listed here
stays optional to wire but not optional to decide: when nothing
fills the slot, the config must carry the policy's declared-absent
value or boot refuses (component-absence-undeclared).
Keys are typed against O for authoring ergonomics, but that alone is
not an enforcement: defineModule's const O inference unifies over
every position, so a policy key can widen O instead of being
checked against it. The declared-absence guard therefore verifies at
stage 1 that every policy key appears in this module's requires or
optional, and refuses boot when one does not — a policy on a slot
its module never reads is an authoring bug, not a rule. See
manifest/absence-policy.mts for what a policy is and why it is data.
Optional ReadonlyconfigOptional Zod schema declaring this module's config slice.
Optional ReadonlycontributesProtocol-level features this module adds (grants, routes, federations, etc.). Per A2-α §4.
Optional ReadonlylifecyclePer-component lifecycle hooks. Each key K in this map MUST also
appear in provides; the boot planner's validate-manifests stage
throws "lifecycle-without-provides" for any orphaned lifecycle entry
(Phase 4 §6.1).
The absence of this field is valid — all existing (deps) => value
provider forms remain unaffected.
Per A2-β §4.1.
ReadonlynameModule identity — unique across all modules in a single createApp call.
Optional ReadonlyoptionalComponent keys this module reads opportunistically. Optional keys
appear as readonly K?: ComponentMap[K] on the typed deps.
Optional ReadonlyoverridesProtocol-level features this module REPLACES on an already-registered
key. Mirrors contributes shape. Missing target key throws at boot.
Per A2-α §5.
Optional ReadonlyprovidesComponent values this module materialises into the DI graph. Each
value is (deps) => ComponentMap[K] | Promise<ComponentMap[K]>.
Optional ReadonlyrequiresComponent keys this module reads from DI. Required keys appear as
readonly K: ComponentMap[K] on the typed deps object passed to
every provider in provides and every factory in contributes.
Parameterised manifest type. The R / O generics are inferred at the call site of
defineModule(...)and carry the literal key sets declared inrequires/optionalso providers and contribution factories receive a typed deps object.Per A2-α §2.1, §3.1.