Notify subscribers after a subject change, within their declared subscription lifetime. An unsubscribed observer must not receive later notifications.subject_change_notificationRECORD STATUSCandidate · v0.1.0UML class view
The proposed contract drawn as participant roles, received calls, and numbered dependencies.
Object interactions
The same roles and calls as a class collaboration and a numbered message sequence.
Pointcut
Where the mechanism applies. All four dimensions belong to the proposed match, not just its vocabulary.
- Context
- A subject changes state or emits lifecycle information.
- Trigger
- The subject publishes a change notification.
- Structure
- Subscription registry, event payload, and observer callbacks.
- Effect
- Currently registered observers are notified under declared ordering semantics.
Protected contract
The obligation that clients, operators, and auditors should be able to rely on.
- Requires
- Observer identity and subscription lifetime are defined.
- Ensures
- Notification follows the event and unsubscribed observers no longer receive it.
- Invariant
- Observer failure does not corrupt subject state.
- Violation
- Callback errors and cascades are isolated or propagated by explicit policy.
Negative control
Polling the subject rather than notification is not the observer pointcut.
Variation & lifecycle
The hot spot is admitted only where the protected semantics survive.
Permitted variation
Event emitter, listener, hooks, and stream observers.
Test obligation
Test subscribe, unsubscribe, ordering, callback error, and reentrancy.
Evolution question
Did observer callbacks gain event schemas and lifecycle controls?
Prompt + code design
An illustrative prompt and a small design sketch for the proposed contract. Names and APIs are invented; this is not a repository excerpt.
class Subject:
def __init__(self):
self.observers = {}
def subscribe(self, observer):
self.observers[observer.id] = observer
def unsubscribe(self, observer_id):
self.observers.pop(observer_id, None)
def publish(self, event):
for observer in list(self.observers.values()):
observer.notify(event)Illustrative design sketch. Subscription lifetime is the contract; notification order is secondary. This example is a teaching aid, not implementation evidence or a conformance claim.
Detection & matching
The frozen rule that retrieves this record, the canonical source exemplar, and the control that should stay unmatched.
- Join point
subject_change_notification- Source locator
- Sarkar and Sarkar
- Lexical cue
(?i)\b(?:Observer|observer|add[_-]?listener|register[_-]?(?:listener|observer))\bFrozen expression, v0.1.0. A match is a retrieval cue, not a confirmed implementation.- Aliases
- None
- Canonical exemplar
- mastra-ai/mastra
packages/core/src/events/event-emitter/index.ts:21Support: packages/core/src/events/unix-socket-pubsub-solo.test.ts:54 - Negative control
- Polling the subject rather than notification is not the observer pointcut.
Scope-anchored review. pohe-agent analyze <repo> --pattern C02 anchors the cue to its enclosing declaration and checks a separate operational signature for all four pointcut dimensions. Missing roles and negative-control risks remain visible; a structural match is not E2/E3. Calibration report ↗
Repository files
Up to five public files retrieved by the frozen cue and pinned to the audited commit. A match is a place to inspect, not a confirmed implementation.
packages/core/src/events/event-emitter/index.ts:21CANONICAL SOURCE02aaif-goose/goosecrates/goose-mcp/src/autovisualiser/templates/assets/leaflet.min.js:5RETRIEVAL CUE03affaan-m/ECCskills/continuous-learning-v2/scripts/instinct-cli.py:307RETRIEVAL CUE04agno-agi/agnolibs/agno/agno/knowledge/knowledge.py:366RETRIEVAL CUE05anomalyco/opencodepackages/ai/src/protocols/open-responses-channel.ts:51RETRIEVAL CUEEvidence & provenance
Each layer answers a different question. Do not substitute retrieval for review.
Source-located exemplar
A concrete source anchor is available for this proposed record. It is one exemplar, not evidence that all repositories—or every contract field—conform.
Review boundary: this candidate and its specification come from an AI-assisted study. Independent human validation remains open.
80.6% of repository families in the frozen panel have at least one current cue, historical cue, or canonical source layer. This is not confirmed prevalence.
Current lexical-cue repositories: 32 / 41899383db98e0packages/core/src/events/event-emitter/index.ts:21packages/core/src/events/unix-socket-pubsub-solo.test.ts:54Registered subscribers receive event notifications.
Exploratory retrieval cue Regex / v0.1.0
(?i)\b(?:Observer|observer|add[_-]?listener|register[_-]?(?:listener|observer))\bThis expression is a discovery instrument only. A match is a retrieval cue—not a confirmed implementation, pointcut match, or contract proof.