personal memory agent
0
fork

Configure Feed

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

decisionalizer: add pre-hook gate to skip days with no decision outputs

When no decisions.md activity files exist for the target day, the
pre-hook returns a skip_reason so the orchestrator bypasses the LLM
call entirely. Modeled on the documents.py pre-hook pattern.

+57 -1
+2 -1
talent/decisionalizer.md
··· 6 6 "color": "#c62828", 7 7 "schedule": "daily", 8 8 "priority": 60, 9 - "output": "md" 9 + "output": "md", 10 + "hook": {"pre": "decisionalizer"} 10 11 } 11 12 12 13 $sol_identity
+16
talent/decisionalizer.py
··· 1 + # SPDX-License-Identifier: AGPL-3.0-only 2 + # Copyright (c) 2026 sol pbc 3 + 4 + """Pre-hook for decisionalizer talent — skips days with no decision outputs.""" 5 + 6 + from pathlib import Path 7 + 8 + from think.utils import get_journal 9 + 10 + 11 + def pre_process(context: dict) -> dict | None: 12 + """Skip days that have no decision activity outputs.""" 13 + day = context["day"] 14 + if not any(Path(get_journal()).glob(f"facets/*/activities/{day}/*/decisions.md")): 15 + return {"skip_reason": "no decision outputs for day"} 16 + return {}
+39
tests/test_decisionalizer_hook.py
··· 1 + # SPDX-License-Identifier: AGPL-3.0-only 2 + # Copyright (c) 2026 sol pbc 3 + 4 + """Tests for decisionalizer pre-hook.""" 5 + 6 + from unittest.mock import patch 7 + 8 + from talent.decisionalizer import pre_process 9 + 10 + 11 + def test_skip_when_no_decisions(tmp_path): 12 + """Skip when no decisions.md files exist for the day.""" 13 + activities = tmp_path / "facets" / "somefacet" / "activities" / "20260410" 14 + activities.mkdir(parents=True) 15 + 16 + with patch("talent.decisionalizer.get_journal", return_value=str(tmp_path)): 17 + result = pre_process({"day": "20260410"}) 18 + 19 + assert result == {"skip_reason": "no decision outputs for day"} 20 + 21 + 22 + def test_proceed_when_decisions_exist(tmp_path): 23 + """Proceed when decisions.md files exist for the day.""" 24 + decisions = ( 25 + tmp_path 26 + / "facets" 27 + / "testfacet" 28 + / "activities" 29 + / "20260410" 30 + / "meeting_100000_300" 31 + / "decisions.md" 32 + ) 33 + decisions.parent.mkdir(parents=True) 34 + decisions.write_text("") 35 + 36 + with patch("talent.decisionalizer.get_journal", return_value=str(tmp_path)): 37 + result = pre_process({"day": "20260410"}) 38 + 39 + assert result == {}