Skip to content

OSSS.ai.orchestration.pattern_service

OSSS.ai.orchestration.pattern_service

PatternService

Option A (strict, no back-compat):

  • Single source of truth is cfg.patterns_path (GraphFactory decides the path).
  • load() is STRICT:
    • file must exist
    • file must be non-empty (after stripping whitespace)
    • registry.load_from_file() must succeed
  • get() is STRICT (normalized lowercase names)
  • require() is STRICT (unknown => raises)
  • fingerprint() is deterministic and safe (returns "nohash" on failure)

require(pattern_name)

Option A strict helper: unknown patterns are fatal.

Prefer this over get() at compile boundaries where a pattern must exist.

list_patterns()

Best-effort list of loaded pattern names for logging/diagnostics.

fingerprint()

Option A: fingerprint the current file contents.

If load() succeeded, we return the loaded fingerprint when possible.