Skip to main content

Module pattern_resolution

Module pattern_resolution 

Source
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_id references an id that does not exist in the catalogue, the entry is returned unchanged and an InheritanceWarningKind::UnknownPatternId is recorded. Surfacing the missing id is doctor’s job (epic phase P7.3); the resolver itself does not error.

§Field mapping

IndexEntry fieldPattern source
format_regexSecretPattern::format_regex().as_str()
retrieval_urlSecretPattern::metadata()?.retrieval_url_template
rotate_every_daysSecretPattern::metadata()?.default_expiry_days
rotation_methodSecretPattern::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§

InheritanceWarning
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§

InheritanceWarningKind
Categories of advisory warnings produced by apply_pattern_inheritance.

Functions§

apply_pattern_inheritance
Apply pattern-id inheritance to entry and return the resolved entry plus any advisory warning.