Checkpoint executor: deterministic runner, sources, tests; definitions route to assembly-checkpoint
- checkpoints/run_checkpoint.py: window guard, web-fetcher fetch with
provenance, record + raw JSONL, optional llm-connect assessment rejected if
it contains numbers not in the fetched data
- checkpoints/sources.json: BTOS (US), Eurostat isoc_eb_ai (EU, DE), FRED
info-processing investment (US); manual entries for AR, usage indices,
sentiment, legislation
- activity definitions: label assembly-checkpoint (rein-aharness approach)
- PLAYBOOK: automated path + manual/agent path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 1494246@bnt-lap001
Assistant-Session: caf6de6f-f9e4-47ce-a584-49baa271fa4b
2026-10-12 18:45:12 +02:00
|
|
|
|
"""Tests for the checkpoint runner (offline). Usage:
|
|
|
|
|
|
python3 -B -m unittest discover -s checkpoints -p 'test_*.py'
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
from datetime import date
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
import run_checkpoint as rc
|
|
|
|
|
|
|
|
|
|
|
|
SCHEDULE = (Path(__file__).parent / "schedule.md").read_text()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestWindow(unittest.TestCase):
|
|
|
|
|
|
def test_monthly_and_steady_windows(self):
|
|
|
|
|
|
self.assertEqual(rc.active_phase(date(2026, 11, 15), "light", SCHEDULE), "transition")
|
|
|
|
|
|
self.assertEqual(rc.active_phase(date(2027, 4, 15), "light", SCHEDULE), "steady")
|
|
|
|
|
|
self.assertEqual(rc.active_phase(date(2027, 1, 20), "full", SCHEDULE), "steady")
|
|
|
|
|
|
|
|
|
|
|
|
def test_out_of_window(self):
|
|
|
|
|
|
self.assertIsNone(rc.active_phase(date(2026, 10, 1), "light", SCHEDULE))
|
|
|
|
|
|
self.assertIsNone(rc.active_phase(date(2026, 11, 15), "full", SCHEDULE))
|
|
|
|
|
|
|
|
|
|
|
|
def test_parser_handles_ranges(self):
|
|
|
|
|
|
sched = "| setup | `light` | 2026-10-14 – 2026-10-16 | daily | x |\n"
|
|
|
|
|
|
self.assertEqual(rc.active_phase(date(2026, 10, 15), "light", sched), "setup")
|
|
|
|
|
|
self.assertIsNone(rc.active_phase(date(2026, 10, 17), "light", sched))
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-10-13 16:01:15 +02:00
|
|
|
|
class TestPredictions(unittest.TestCase):
|
|
|
|
|
|
def test_registered_predictions_are_cited(self):
|
|
|
|
|
|
preds = rc.registered()
|
|
|
|
|
|
self.assertIn("P-2026-001", rc.band_position(preds, "L1", "US"))
|
|
|
|
|
|
self.assertIn("P-2026-002", rc.band_position(preds, "L2", "EU27_2020"))
|
|
|
|
|
|
self.assertEqual(rc.band_position(preds, "L9", "US"), "no prediction registered")
|
|
|
|
|
|
|
|
|
|
|
|
|
Checkpoint executor: deterministic runner, sources, tests; definitions route to assembly-checkpoint
- checkpoints/run_checkpoint.py: window guard, web-fetcher fetch with
provenance, record + raw JSONL, optional llm-connect assessment rejected if
it contains numbers not in the fetched data
- checkpoints/sources.json: BTOS (US), Eurostat isoc_eb_ai (EU, DE), FRED
info-processing investment (US); manual entries for AR, usage indices,
sentiment, legislation
- activity definitions: label assembly-checkpoint (rein-aharness approach)
- PLAYBOOK: automated path + manual/agent path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 1494246@bnt-lap001
Assistant-Session: caf6de6f-f9e4-47ce-a584-49baa271fa4b
2026-10-12 18:45:12 +02:00
|
|
|
|
class TestNumberGuard(unittest.TestCase):
|
|
|
|
|
|
def test_numbers_extraction(self):
|
|
|
|
|
|
self.assertEqual(rc._numbers("EU at 19.95 % in 2025, US 23.8."), {"19.95", "2025", "23.8"})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
|
unittest.main()
|