personal memory agent
0
fork

Configure Feed

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

talents/daily_schedule: migrate to external daily_schedule.schema.json

Third structured-outputs L3 migration after talents/sense (8c952dc4)
and talents/story (50693752). Introduces talent/daily_schedule.schema.json —
Draft 2020-12, provider-intersection subset (type, pattern, required,
additionalProperties, properties) — two HH:MM-pattern string fields
{primary, fallback}.

talent/daily_schedule.py is unchanged — post_process's strptime("%H:%M")
remains the authoritative gate; schema enforcement is advisory via the
existing dispatcher plumbing (think/talent.py and think/talents.py) and
surfaces on the finish event's schema_validation.

Live validation deferred — GOOGLE_API_KEY not available in this worktree
environment. Following the sense+story precedent, dispatcher pass-through
coverage remains provided by tests/test_generate_full.py
(test_dispatcher_passes_json_schema and
test_finish_event_includes_schema_validation), and new unit tests assert
schema validity and pattern behavior end-to-end.

Tests:
- test_daily_schedule_schema_file_is_valid_draft_2020_12
- test_daily_schedule_loaded_json_schema_matches_on_disk_schema
- test_daily_schedule_pattern_accepts_and_rejects_expected_values

Stats API baseline refresh: one new `schema` field in the daily_schedule
generator block in tests/baselines/api/stats/stats.json.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+54
+1
talent/daily_schedule.md
··· 6 6 "schedule": "daily", 7 7 "priority": 10, 8 8 "output": "json", 9 + "schema": "daily_schedule.schema.json", 9 10 "hook": {"pre": "daily_schedule", "post": "daily_schedule"}, 10 11 "color": "#455a64", 11 12 "thinking_budget": 4096,
+16
talent/daily_schedule.schema.json
··· 1 + { 2 + "$schema": "https://json-schema.org/draft/2020-12/schema", 3 + "type": "object", 4 + "additionalProperties": false, 5 + "required": ["primary", "fallback"], 6 + "properties": { 7 + "primary": { 8 + "type": "string", 9 + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" 10 + }, 11 + "fallback": { 12 + "type": "string", 13 + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" 14 + } 15 + } 16 + }
+1
tests/baselines/api/stats/stats.json
··· 45 45 "path": "<PROJECT>/talent/daily_schedule.md", 46 46 "priority": 10, 47 47 "schedule": "daily", 48 + "schema": "daily_schedule.schema.json", 48 49 "source": "system", 49 50 "thinking_budget": 4096, 50 51 "title": "Maintenance Window",
+36
tests/test_daily_schedule_schema.py
··· 1 + # SPDX-License-Identifier: AGPL-3.0-only 2 + # Copyright (c) 2026 sol pbc 3 + 4 + import json 5 + from pathlib import Path 6 + 7 + from jsonschema import Draft202012Validator 8 + 9 + from think.talent import get_talent 10 + 11 + DAILY_SCHEDULE_SCHEMA_PATH = ( 12 + Path(__file__).resolve().parents[1] / "talent" / "daily_schedule.schema.json" 13 + ) 14 + 15 + 16 + def _load_daily_schedule_schema() -> dict: 17 + return json.loads(DAILY_SCHEDULE_SCHEMA_PATH.read_text(encoding="utf-8")) 18 + 19 + 20 + def test_daily_schedule_schema_file_is_valid_draft_2020_12(): 21 + Draft202012Validator.check_schema(_load_daily_schedule_schema()) 22 + 23 + 24 + def test_daily_schedule_loaded_json_schema_matches_on_disk_schema(): 25 + assert get_talent("daily_schedule")["json_schema"] == _load_daily_schedule_schema() 26 + 27 + 28 + def test_daily_schedule_pattern_accepts_and_rejects_expected_values(): 29 + schema = _load_daily_schedule_schema() 30 + validator = Draft202012Validator(schema) 31 + 32 + for value in ["00:00", "03:00", "09:00", "23:59"]: 33 + assert validator.is_valid({"primary": value, "fallback": "00:00"}) 34 + 35 + for value in ["9:00", "03:00:00", "24:00", "03:60", "", "ab:cd"]: 36 + assert not validator.is_valid({"primary": value, "fallback": "00:00"})