personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(talents): remove agent.* chronicle read-shim

The talents-rename lode (commit 0050be8c) left a read-side shim
accepting legacy agent.* chronicle event names through a stated
2026-05-01 sunset. That sunset assumed chronicle JSONL would be
purged by think/retention.py before the cutoff — not true.
Chronicle events are retained indefinitely, so the shim would
have lived forever as-is. Removing it now as a clean break
rather than carrying dead code.

think/pipeline_health.py and apps/home/routes.py drop the
dual-value set-membership checks against {"agent.X", "talent.X"}
in favor of single-value == comparisons on talent.* — idiomatic
with the surrounding branches in each file.

scripts/gate_agents_rename.py drops its SHIM_FILES / SHIM_WINDOW
suppression for those two files; iter_lines() collapses to a
plain enumerate. The gate now scans them as ordinary production
code with zero new allowlist entries.

Three tests that existed solely to enforce the shim (and whose
names announced as much) are deleted:
- test_newsletter_attempts_accept_legacy_agent_fail
- test_failure_reader_accepts_legacy_and_new_names
- test_reader_accepts_legacy_and_new_event_names

Pre-rename agent.* chronicle events on disk become ignored —
acceptable per founder decision.

Co-authored-by: Codex <codex@openai.com>

+6 -74
+1 -2
apps/home/routes.py
··· 584 584 record = json.loads(line) 585 585 except json.JSONDecodeError: 586 586 continue 587 - # HISTORICAL SHIM: accept legacy agent.* chronicle event names from before 2026-04-17; sunset 2026-05-01 588 587 if ( 589 - record.get("event") in {"agent.fail", "talent.fail"} 588 + record.get("event") == "talent.fail" 590 589 and record.get("facet") 591 590 and record.get("name") == "facet_newsletter" 592 591 ):
+1 -18
scripts/gate_agents_rename.py
··· 9 9 from pathlib import Path 10 10 11 11 ROOT = Path(__file__).resolve().parent.parent 12 - SHIM_FILES = { 13 - Path("think/pipeline_health.py"), 14 - Path("apps/home/routes.py"), 15 - } 16 12 ALLOWLIST_RE = re.compile(r"^apps/sol/maint/00[0-4]_.+\.py$") 17 13 PRODUCTION_PREFIXES = ("think/", "apps/", "talent/", "convey/", "observe/") 18 - SHIM_WINDOW = 20 19 14 20 15 RULES = [ 21 16 ( ··· 73 68 74 69 def iter_lines(path: Path) -> list[tuple[int, str]]: 75 70 lines = (ROOT / path).read_text(encoding="utf-8").splitlines() 76 - if path not in SHIM_FILES: 77 - return list(enumerate(lines, start=1)) 78 - 79 - visible: list[tuple[int, str]] = [] 80 - suppress_until = 0 81 - for line_no, line in enumerate(lines, start=1): 82 - if line_no <= suppress_until: 83 - continue 84 - if "HISTORICAL SHIM:" in line: 85 - suppress_until = line_no + SHIM_WINDOW 86 - continue 87 - visible.append((line_no, line)) 88 - return visible 71 + return list(enumerate(lines, start=1)) 89 72 90 73 91 74 def main() -> int:
-13
tests/test_home_yesterdays_processing.py
··· 476 476 assert _newsletter_attempts_from_dream_logs("20260415") == (2, 3) 477 477 478 478 479 - def test_newsletter_attempts_accept_legacy_agent_fail(tmp_path, monkeypatch): 480 - journal = _seed_journal(tmp_path, monkeypatch) 481 - _append_dream_log( 482 - journal, 483 - "20260415", 484 - "facet_newsletter", 485 - facet="work", 486 - event="agent.fail", 487 - ) 488 - 489 - assert _newsletter_attempts_from_dream_logs("20260415") == (2, 3) 490 - 491 - 492 479 def test_build_pulse_context_includes_yesterday_processing(monkeypatch): 493 480 monkeypatch.setattr( 494 481 "apps.home.routes.get_capture_health",
-36
tests/test_pipeline_health.py
··· 137 137 ] 138 138 139 139 140 - @pytest.mark.parametrize("event_name", ["agent.fail", "talent.fail"]) 141 - def test_failure_reader_accepts_legacy_and_new_names(pipeline_journal, event_name): 142 - day = "20990107" 143 - _write_jsonl( 144 - pipeline_journal / "chronicle" / day / "health" / "1_segment_dream.jsonl", 145 - [{"event": event_name, "mode": "segment", "name": "screen", "use_id": "u-1"}], 146 - ) 147 - 148 - summary = summarize_pipeline_day(day) 149 - 150 - assert summary["talents"]["failed"] == 1 151 - 152 - 153 - @pytest.mark.parametrize( 154 - ("event_name", "field"), 155 - [ 156 - ("agent.dispatch", "dispatched"), 157 - ("talent.dispatch", "dispatched"), 158 - ("agent.complete", "completed"), 159 - ("talent.complete", "completed"), 160 - ("agent.skip", "skipped"), 161 - ("talent.skip", "skipped"), 162 - ], 163 - ) 164 - def test_reader_accepts_legacy_and_new_event_names(pipeline_journal, event_name, field): 165 - day = "20990108" 166 - _write_jsonl( 167 - pipeline_journal / "chronicle" / day / "health" / "1_segment_dream.jsonl", 168 - [{"event": event_name, "mode": "segment"}], 169 - ) 170 - 171 - summary = summarize_pipeline_day(day) 172 - 173 - assert summary["talents"][field] == 1 174 - 175 - 176 140 def test_failed_list_truncates_at_20(pipeline_journal): 177 141 day = "20990103" 178 142 events = [
+4 -5
think/pipeline_health.py
··· 78 78 continue 79 79 80 80 event = rec["event"] 81 - # HISTORICAL SHIM: accept legacy agent.* chronicle event names from before 2026-04-17; sunset 2026-05-01 82 - if event in {"agent.dispatch", "talent.dispatch"}: 81 + if event == "talent.dispatch": 83 82 summary["talents"]["dispatched"] += 1 84 - elif event in {"agent.complete", "talent.complete"}: 83 + elif event == "talent.complete": 85 84 summary["talents"]["completed"] += 1 86 - elif event in {"agent.fail", "talent.fail"}: 85 + elif event == "talent.fail": 87 86 summary["talents"]["failed"] += 1 88 87 if len(summary["talents"]["failed_list"]) < _FAILED_LIST_CAP: 89 88 summary["talents"]["failed_list"].append( ··· 96 95 ) 97 96 else: 98 97 summary["talents"]["failed_list_truncated"] = True 99 - elif event in {"agent.skip", "talent.skip"}: 98 + elif event == "talent.skip": 100 99 summary["talents"]["skipped"] += 1 101 100 elif event == "activity.detected": 102 101 summary["activities"]["detected"] += 1