MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _reset_to_stable_after_observing

Function _reset_to_stable_after_observing

scripts/drift_engine.py:362–388  ·  view source on GitHub ↗
(profile: Dict[str, Any], date: str)

Source from the content-addressed store, hash-verified

360
361def _reset_to_stable_after_observing(profile: Dict[str, Any], date: str) -> Dict[str, Any]:
362 updated = copy.deepcopy(profile)
363 drift_state = _ensure_anchor_state(updated)
364 failed_episode = int(drift_state.get("episode_index", 0) or 0)
365 drift_state["status"] = "stable"
366 drift_state["score"] = 0.0
367 drift_state["intent_score"] = 0.0
368 drift_state["hidden_anchor"] = None
369 drift_state["hidden_anchor_source"] = None
370 drift_state["anchor_topic"] = None
371 drift_state["anchor_topics"] = []
372 drift_state["anchor_source"] = None
373 drift_state["anchor_confidence"] = 0.0
374 drift_state["anchor_progress"] = 0.0
375 drift_state["anchor_set_date"] = None
376 drift_state["commitment_days_remaining"] = 0
377 drift_state["signal_window"] = []
378 drift_state["top_shift_topics"] = []
379 drift_state["trigger_source"] = None
380 drift_state["trigger_checkfile"] = None
381 drift_state["trigger_date"] = None
382 drift_state["suppressed_topics"] = []
383 drift_state["observing_started_episode"] = None
384 drift_state["last_observing_failure_episode"] = failed_episode
385 drift_state["last_drift_date"] = date
386 updated["drift_state"] = drift_state
387 return updated
388
389
390def _extract_anchor_signal(
391 profile: Dict[str, Any],

Callers 1

advance_anchor_driftFunction · 0.85

Calls 2

_ensure_anchor_stateFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected