Overview
ModuleFingerprint is the structured description a module provides at registration time. It serves two purposes:
- Runtime routing: Tells Retina which directories and memory namespaces to watch, and tells Layer 3 which question template to use.
- Cold-start prior: Tells Layer 2 (Limbic) which feature vector slots matter for this module and what values to expect, so the cluster model starts with a meaningful bias instead of random weights.
Import
Class Definition
ModuleFingerprint is a dataclass defined in pulse/fingerprint.py:75. It should be constructed via parse_fingerprint(), not directly.
Attributes
Unique identifier for the module (e.g.,
"homework_watcher").Logical grouping for related modules (e.g.,
"homework").Semantic version string (e.g.,
"1.0.0").Template string for escalation questions. Must contain
{location} placeholder.Example: "Should I check the new file at {location}?"Default escalation threshold in range [0.0, 1.0]. Typically 0.65–0.75.
Filesystem-specific signal priors. Contains:
watch_directories(list[str]): Expanded absolute pathsrelevant_extensions(list[str]): e.g.,[".pdf", ".docx"]irrelevant_extensions(list[str]): e.g.,[".tmp", ".log"]
Memory-namespace-specific priors. Contains:
watch_namespaces(list[str]): e.g.,["/mem/homework/"]high_relevance_keys(list[str]): e.g.,["due_date"]
Time-based signal priors. Contains:
active_hours(tuple[int, int]): (start_hour, end_hour), both 0–23 inclusiveactive_days(list[int]): 0=Monday … 6=Sundaytypical_interval_hours(float): Expected gap between activations
Methods
watch_directories
watch_namespaces
slot_relevance_mask
FEATURE_DIM (16) where each value indicates how much this module cares about that feature slot.
Values:
1.0: Slot is directly relevant0.5: Slot is weakly relevant or context-dependent0.0: Slot is not relevant to this module
np.ndarray: float32 mask array of length 16
relevant_extension_hashes
irrelevant_extension_hashes
active_hour_range_encoded
(start_sin, start_cos, end_sin, end_cos) for the declared active hour window, or None if no time prior is set.
Parsing and Validation
parse_fingerprint
ModuleFingerprint object.
Raw fingerprint dictionary with required keys:
module_id(str)cluster(str)version(str)question_template(str): Must contain{location}placeholderdefault_threshold(float): Must be in [0.0, 1.0]signal_priors(dict, optional): Containsfilesystem,memory, and/ortimesub-dicts
ValueError: On any validation failure with a descriptive message
Feature Vector Slot Layout
The 16-dimensional feature vector used by Limbic models has the following layout:[0]: magnitude[1]: delta_type encoded[2]: source encoded[3]: hour_sin[4]: hour_cos[5]: dow_sin[6]: dow_cos[7]: minutes_since_last_activation[8]: size_bytes log-normalized[9]: directory_depth normalized[10]: file extension hash[11–15]: reserved (memory / network, future)
See Also
- PulseRegistry — Registers modules and fingerprints
- LimbicLayer — Uses fingerprints for cold-start weight biasing
- Retina — Uses watch_directories() to extend filesystem monitoring