Commit Graph
298 Commits
Author SHA1 Message Date
orchestrator-agent ad6f1768d7 Add the afternoon open-quests reminder blueprint
Lists only present children who still owe quests; sends nothing at
all when every present child is clear (a false template condition
stops the action). Blueprint test helpers move to a shared module.
2026-09-19 14:42:50 -04:00
orchestrator-agent fcc7a29f05 Add the morning summary blueprint 2026-09-19 14:31:02 -04:00
orchestrator-agent f31bda2714 Include collision-suffixed entity ids in the morning summary
Duplicate child names get HA registry suffixes (_2); the template now
iterates the due sensors (which carry present/child_id/child_name as
attributes) and pairs counts by child_id, so suffixed duplicates are
listed and the household rollup is excluded by the presence guard.
2026-09-19 14:31:00 -04:00
orchestrator-agent dc7a82f6e2 Add the morning summary blueprint
Iterates present children from the Feature 10 presence sensors, lists
what each owes today from the remaining sensor, omits absent children
entirely. Blueprint inputs (time, notify service, send toggle); the
notify target is the household's choice, never hard-coded. PyYAML and
Jinja2 join the dev-only dependencies for blueprint template tests.
2026-09-19 14:24:50 -04:00
orchestrator-agent 1d5143f850 Add the notification section to the options flow 2026-09-19 14:20:15 -04:00
orchestrator-agent fbde3eeaa1 Allow saving the empty default notify target
An empty target means notifications are not configured yet and is the
shipped default; only malformed strings (padded or whitespace-only)
reject.
2026-09-19 14:20:13 -04:00
orchestrator-agent 3c832c1cee Add the notification section to the options flow
Notify target (empty default, household fills their own service),
three strict HH:MM automation times (08:00/15:00/20:00 — the report
deliberately before the midnight sweep), and four independent enable
toggles, all leniently stored and round-tripped.
2026-09-19 14:18:18 -04:00
orchestrator-agent 8c421abeb2 Add the nightly missed-quest sweep 2026-09-19 14:16:51 -04:00
orchestrator-agent 8cd43141a9 Serialize the missed sweep's watermark claim
The whole watermark read-query-fire-write span runs under a
per-database sweep lock; a racing second sweep re-reads the watermark
inside the lock and announces nothing.
2026-09-19 14:16:50 -04:00
orchestrator-agent 3de9f4b970 Add the nightly missed-quest sweep
Fires one nestquest_quest_missed event per past-due open instance at
the configured rollover time and at startup, watermark-guarded in the
new nestquest_meta_state table (migration 7, strictly additive).
Read-only over the domain tables; never reports an instance that was
ever completed.
2026-09-19 14:15:21 -04:00
orchestrator-agent 25005cda77 Feature 10: Home Assistant Entity and Event Surface 2026-09-19 13:29:29 -04:00
orchestrator-agent 35e66bd9e6 Carry completion timing under the lock; shut down before close
The completed event's was_on_time travels on the CompletionResult
(decided with the write) instead of re-reading latest state a racing
reversal could replace; unload clears coordinator listeners before
the database close.
2026-09-19 13:29:25 -04:00
orchestrator-agent a65e32f577 Add the entity-and-event matrix test 2026-09-19 13:27:09 -04:00
orchestrator-agent 36263d3f19 Add the entity-and-event matrix test
One fixture drives every Feature 10 contract: all per-child sensors
and binary sensors, household rollups, the 255-character limit,
the three events exactly once with schema-valid payloads, the
missed-instance omission rule, and no entities for inactive children.
2026-09-19 13:26:51 -04:00
orchestrator-agent 58cd68354f Handle entity lifecycle for child add, deactivate, reactivate 2026-09-19 13:25:32 -04:00
orchestrator-agent a9d8f1d225 Handle entity lifecycle for child add, deactivate, reactivate
The harness tracks entities per entry so a platform unload removes
exactly that entry's entities; lifecycle tests prove deactivated
children drop out on reload, reactivation restores the original
unique_ids, new children appear without disturbing existing ones,
and the restart equivalent restores live states.
2026-09-19 13:23:35 -04:00
orchestrator-agent 933e29ae76 Refresh entities immediately after completion service calls 2026-09-19 13:21:55 -04:00
orchestrator-agent a5dbae5d50 Serialize forced coordinator refreshes per entry
NestQuestCoordinator.async_refresh holds a per-entry lock so
overlapping service-path refreshes never interleave; the queued pass
always publishes after the in-flight one.
2026-09-19 13:21:54 -04:00
orchestrator-agent ad56d13c6e Refresh entities immediately after completion service calls
complete_quest and uncomplete_quest force a coordinator refresh when
the call appended, so entity states land the moment the service call
returns; scheduled internals are unaffected.
2026-09-19 13:16:12 -04:00
orchestrator-agent b90f55f750 Fire the documented bus events from the completion service paths 2026-09-19 12:03:44 -04:00
orchestrator-agent 2a4eec658f Decide event transitions under the completion lock
complete/uncomplete return a CompletionResult str subclass carrying
appended (decided with the write under the lock), so duplicate
concurrent calls fire one transition event; day-complete only
evaluates for an instance due today.
2026-09-19 12:03:42 -04:00
orchestrator-agent fe38e5040e Fire the documented bus events from the completion service paths
quest_completed and quest_uncompleted fire on actual transitions with
documented payloads; child_day_complete fires when a completion clears
the child's day; quest_missed is defined as Feature 11's contract.
Payloads documented in the README for automation authors.
2026-09-19 12:01:05 -04:00
orchestrator-agent fa153059cb Add household rollup and cycle-day sensors 2026-09-19 11:59:14 -04:00
orchestrator-agent 5bca24910a Add household rollup and cycle-day sensors
Household quests due/completed today sum the active children's
snapshots; cycle day reports the first scheduled child's cycle
position (0 when nobody is scheduled), anchor-date arithmetic only.
2026-09-19 11:58:12 -04:00
orchestrator-agent 99a8a133e2 Add per-child all-done and present-today binary sensors 2026-09-19 11:57:15 -04:00
orchestrator-agent df4c9eb21a Add per-child all-done and present-today binary sensors
all_done is on exactly when the child owed quests today and owes none
remaining (a zero-quest day stays off so celebrations never fire on
an empty day); present_today mirrors the presence engine's answer
for the HA-local date.
2026-09-19 11:56:10 -04:00
orchestrator-agent 236e8f4adf Add the per-child next-quest sensor 2026-09-19 11:55:20 -04:00
orchestrator-agent 1f7a7ba46c Add the per-child next-quest sensor
State carries the earliest open quest's title truncated under the
255-character limit with the full shape in attributes; the documented
"none" sentinel is reported when the day is clear.
2026-09-19 11:54:19 -04:00
orchestrator-agent 813055a24c Add per-child daily count and percentage sensors 2026-09-19 11:53:28 -04:00
orchestrator-agent 7a0c8d1885 Honor failed platform unload; derive labels from the snapshot
A False platform unload now returns False and retains the runtime
record so live entities keep their database. Sensor names and device
labels re-derive from the current snapshot so child renames
propagate; unique_ids stay child-id based.
2026-09-19 11:53:27 -04:00
orchestrator-agent 00409a76db Add per-child daily count and percentage sensors
Four sensors per active child read the coordinator snapshot: quests
due today (carrying the panel payload that omits missed instances plus
the admin payload that includes them, D-009), completed, remaining, and
completion percentage (100 on a zero-quest day). Platform forwarding
wired through the harness's entity registry stand-ins.
2026-09-19 11:50:18 -04:00
orchestrator-agent 322038998b Add the shared NestQuest data update coordinator 2026-09-19 11:44:13 -04:00
orchestrator-agent 5c99987e7f Shut the coordinator down when first refresh fails setup
The setup except path closes the database; the coordinator created
above it now shuts down first so no listener can fire against the
closed connection. Regression test included.
2026-09-19 11:44:11 -04:00
orchestrator-agent 979eafc5a2 Add the shared NestQuest data update coordinator
One refresh pass builds the whole entity snapshot: active children,
today's instances with derived open/done/missed states, per-child
presence via the PresenceEngine (records converted to model objects),
rollup counts, and the custody cycle day. Interval configurable via
the new update_interval option, default five minutes.
2026-09-19 11:41:12 -04:00
orchestrator-agent 3ac1d32e1b Feature 09: Permission Enforcement Layer 2026-09-19 08:43:36 -04:00
orchestrator-agent fc81b4b813 Add the permission test matrix across every registered service 2026-09-19 08:40:25 -04:00
orchestrator-agent c1efd39ce3 Add the permission test matrix across every registered service
Admin succeeds on all ten admin-only services; a non-admin and a
no-context call are refused on each; complete_quest stays open; a
kiosk-style id is refused on uncomplete_quest and regenerate; the
registry coverage assertion fails the suite on any gap.
2026-09-19 08:40:20 -04:00
orchestrator-agent cf67e9bed9 Test the permission gate audit logging 2026-09-19 08:39:08 -04:00
orchestrator-agent b5058a3bed Test the permission gate's audit logging
Warning on denial and debug on success carry the service, the caller
user id (or none), and a UTC stamp; nothing beyond the user id leaks.
2026-09-19 08:39:02 -04:00
orchestrator-agent eb4de7b565 Cover fail-closed no-context behavior across admin-only services 2026-09-19 08:38:29 -04:00
orchestrator-agent d0f49b44b5 Cover fail-closed no-context behavior across admin-only services
Parametrised test denies no-context calls on every admin-only service;
complete_quest proceeds with no user; scheduled internals stay direct
function calls.
2026-09-19 08:38:24 -04:00
orchestrator-agent 2a0e568940 Gate every NestQuest service behind the admin permission check 2026-09-19 08:37:47 -04:00
orchestrator-agent 37d7b7e6c3 Gate every NestQuest service behind the admin permission check
permission_gate wraps all registered services at registration time:
admin-only policy reads call.context.user_id against admin_allowlist
is_admin (fail closed on no context); complete_quest stays open.
2026-09-19 08:36:14 -04:00
orchestrator-agent dd7ea10936 Add admin-only versus open service policy registry 2026-09-18 16:07:56 -04:00
orchestrator-agent 4281b9d01c Add admin-only versus open service policy registry
One mapping in service_policy.py: complete_quest is open, every other
registered nestquest service is admin_only.
2026-09-18 16:05:12 -04:00
orchestrator-agent a2e9bdffee Register canonical NestQuest HA services with schemas
Register canonical NestQuest HA services with schemas (#98)
2026-09-18 16:03:50 -04:00
orchestrator-agent b1c42f10d0 Regenerate child instances after presence service writes
Presence pattern and override handlers now call regenerate_for_child.
Definition edit/activate pass HA-local today and configured horizon.
2026-09-18 16:03:42 -04:00
orchestrator-agent 2d30f0ce77 Register canonical NestQuest HA services with schemas
Domain-global handlers for the ENTITIES-AND-SERVICES inventory plus
regenerate. No permission decorator yet.
2026-09-18 15:59:02 -04:00
overseer a6d9ec927b Merge pull request 'Release: Features 06, 07, 08 (2026-09-18)' (#97) from release/2026-09-18-f06-f07-f08 into main
Reviewed-on: #97
2026-09-18 14:54:48 -04:00
overseer bcdf03dac7 merge: origin/main into 0.5.0 release (keep 0.5.0 versions and notes) 2026-09-18 14:15:15 -04:00