diff --git a/scripts/ab-replay.py b/scripts/ab-replay.py index 5545691..23e7c47 100644 --- a/scripts/ab-replay.py +++ b/scripts/ab-replay.py @@ -102,6 +102,8 @@ def main(): today = datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d") daily = os.path.join(USER_DIR, "workspace", "memory", today + ".md") before = open(daily, "rb").read() if os.path.exists(daily) else None + notes = os.path.join(USER_DIR, "workspace", "memory", today + "-intraday-notes.md") + notes_before = open(notes, "rb").read() if os.path.exists(notes) else None # 모델이 write_note로 남긴 흔적 정리용 token = login() if not token: @@ -116,6 +118,12 @@ def main(): for p in glob.glob(os.path.join(USER_DIR, "**", "ab_*.json"), recursive=True): try: os.remove(p) except OSError: pass + if os.path.exists(notes): + cur = open(notes, "rb").read() + if notes_before is None: + os.remove(notes) + elif cur.startswith(notes_before): + open(notes, "wb").write(notes_before) if before is not None and os.path.exists(daily): now = open(daily, "rb").read() if now.startswith(before):