Expand description
Pattern-id inheritance per ADR-020 §3 + ADR-023 §3.6.
When an IndexEntry sets pattern_id, the linked entry in the
shared Catalogue supplies sensible defaults for fields the
entry left blank: the format regex, the retrieval URL, the rotation
cadence, the rotation method. This module is the wiring that turns
“entry references a pattern” into “entry has fully-resolved
metadata”.
§Inheritance is one-way
- Explicit fields on the entry always win.
- Pattern defaults fill in only when the corresponding entry
field is
None. - When
pattern_idreferences an id that does not exist in the catalogue, the entry is returned unchanged and anInheritanceWarningKind::UnknownPatternIdis recorded. Surfacing the missing id isdoctor’s job (epic phase P7.3); the resolver itself does not error.
§Field mapping
IndexEntry field | Pattern source |
|---|---|
format_regex | SecretPattern::format_regex().as_str() |
retrieval_url | SecretPattern::metadata()?.retrieval_url_template |
rotate_every_days | SecretPattern::metadata()?.default_expiry_days |
rotation_method | SecretPattern::rotation()?.method (mapped) |
Other entry fields (description, default_gate, expires_at,
last_rotated_at, required_scopes, env_var,
cache_ttl_seconds_max) are not pattern-driven and pass through
unchanged.
Structs§
- Inheritance
Warning - Non-fatal advisory about pattern-id inheritance, surfaced through
doctor(epic phase P7.3) so the user can fix manifest hygiene issues without the resolver itself failing.
Enums§
- Inheritance
Warning Kind - Categories of advisory warnings produced by
apply_pattern_inheritance.
Functions§
- apply_
pattern_ inheritance - Apply pattern-id inheritance to
entryand return the resolved entry plus any advisory warning.