feat(memory,jobs): replies and curator runs go to daily files

This commit is contained in:
hh committed 2026-10-13 01:23:20 +02:00
1 parent 0273f29589
commit dea793dbd7
6 files changed
+47 -16

No files matched your search

+7 -1
View File
@@ -25,7 +25,10 @@ def test_briefing_lists_new_replies_and_changed_files_or_nothing(
notes = beaver / "наблюдения"
replies.mkdir(parents=True)
notes.mkdir()
(replies / "2026-09.md").write_text(
(replies / "2026-08-31.md").write_text(
"# реплики\n\n- 2026-08-31 23:50 · мастер · вчерашнее\n", encoding="utf-8"
)
(replies / "2026-09-01.md").write_text(
"# реплики\n\n- 2026-09-01 12:00 · мастер · старое\n- 2026-09-01 19:30 · мастер · новое сообщение\n",
encoding="utf-8",
)
@@ -49,6 +52,7 @@ def test_briefing_lists_new_replies_and_changed_files_or_nothing(
text = briefing(
vault=vault,
journal=journal,
runs=beaver / "куратор",
replies_dir=replies,
watched=[Watched("наблюдения", notes)],
tz="Europe/Warsaw",
@@ -63,6 +67,7 @@ def test_briefing_lists_new_replies_and_changed_files_or_nothing(
assert "наблюдения: `мета/бобер/наблюдения/Зина - наблюдения.md`" in text
assert "Глафира" not in text
assert "последний прогон: 2026-09-01T22:00:00+02:00" in text
assert "запись о прогоне - в `мета/бобер/куратор/2026-09-01.md`" in text
journal.write_text(f"последний прогон: {now.isoformat()}\n", encoding="utf-8")
assert new_replies(replies, now, "Europe/Warsaw") == []
@@ -71,6 +76,7 @@ def test_briefing_lists_new_replies_and_changed_files_or_nothing(
briefing(
vault=vault,
journal=journal,
runs=beaver / "куратор",
replies_dir=replies,
watched=[Watched("наблюдения", notes)],
tz="Europe/Warsaw",
+12 -3
View File
@@ -168,8 +168,8 @@ def test_reply_log_appends_one_line_per_message_and_strips_seed(tmp_path: Path)
at=at,
)
)
text = (tmp_path / "реплики" / "2026-09.md").read_text(encoding="utf-8")
assert text.startswith("# реплики Бобра, 2026-09\n")
text = (tmp_path / "реплики" / "2026-09-01.md").read_text(encoding="utf-8")
assert text.startswith("# реплики Бобра, 2026-09-01\n")
assert text.endswith(
"- 2026-09-01 14:04 · мастер · привет ⏎ ты меня любишь\n"
"- 2026-09-01 14:04 · ветка «крипто-карта» (бриф) · "
@@ -180,7 +180,16 @@ def test_reply_log_appends_one_line_per_message_and_strips_seed(tmp_path: Path)
assert new_replies(tmp_path / "реплики", since, "Europe/Warsaw") == [
line for line in text.splitlines() if line.startswith("- ")
]
assert date.fromisoformat("2026-09-01") # tz shift stays inside the month here
late = datetime(2026, 9, 1, 22, 30, tzinfo=UTC)
log.write(
UserSaid(conversation_id="c1", kind="master", title=None, text="ночь", at=late)
)
night = (tmp_path / "реплики" / "2026-09-02.md").read_text(encoding="utf-8")
assert night.endswith("- 2026-09-02 00:30 · мастер · ночь\n")
assert new_replies(tmp_path / "реплики", late, "Europe/Warsaw") == []
assert new_replies(
tmp_path / "реплики", datetime(2026, 9, 1, 13, tzinfo=UTC), "Europe/Warsaw"
) == ["- 2026-09-02 00:30 · мастер · ночь"]
def test_notes_head_picks_sections_for_the_seed(tmp_path: Path) -> None: