Skip to content

Design docs: engine spec and decision record - #1

Merged
leiklier merged 4 commits into
mainfrom
docs/design
Jul 23, 2026
Merged

Design docs: engine spec and decision record#1
leiklier merged 4 commits into
mainfrom
docs/design

Conversation

@leiklier

Copy link
Copy Markdown
Owner

What

The normative contract for the new integration, before any code:

  • docs/ENGINE_SPEC.md — numbered rules (§1 visibility, §2 plant-day budget, §3 decisions/timing, §4 enforcement, §5 persistence, §6 tunables) that code and tests cite verbatim.
  • docs/DECISION.md — the ADR: why plant-day instead of rolling 24 h, why one unified visibility model (analysis showed the legacy weekday template's is_morning_routine and arrival_cutoff clauses were redundant — awake+home already forced off), why the weekend after-wake latch is deliberately dropped, refuge zones instead of workday-calendar guessing, greedy scheduling with hysteresis only, fail-safe direction unknown ⇒ observed ⇒ light off, and truth-based budget accounting.

Review focus

The behavioral deltas vs. the live templates are all in DECISION.md §2–§3: no weekend latch, away schedule = anchor+budget instead of the fixed 22:00–14:00 window, workday/vacation inputs dropped. If any of those should be preserved instead, this is the PR to say so.

Part 1 of 3 (docs → core → adapter).

🤖 Generated with Claude Code

leiklier and others added 2 commits July 22, 2026 05:50
pytest, hassfest and the HACS action skip while the tree does not yet
contain tests or a manifest, so the stacked bring-up PRs stay green.
No-ops on a complete tree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ENGINE_SPEC.md is the normative contract (numbered rules, cited by code
and tests). DECISION.md records why: plant-day budget over rolling 24h,
one unified visibility model (the legacy weekday morning/arrival clauses
were provably redundant; the weekend latch is dropped deliberately),
refuge zones instead of workday-calendar guessing, greedy scheduling
with hysteresis, fail-safe toward light-off, truth-based accounting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Momentary movement signals (bedroom door contact) whose transitions
pulse the viewer-activity clock without sustaining it. Instant cut on
door-open during sleep, normal relight after clear_hold — while a door
left open all day can never block the schedule, unlike a viewer zone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leiklier

Copy link
Copy Markdown
Owner Author

Added rule 1.3b (trigger entities) to the spec: momentary movement signals (the bedroom door contact) whose transitions pulse the viewer-activity clock without sustaining it — instant cut on door-open during sleep, normal clear-hold relight, and a door left open can never block the schedule (its level is never read).

Owner decision (DECISION.md 8): during confirmed refuge, continuity
beats absolute invisibility. Viewer activity cuts only once sustained
for exposure_grace (300 s); shorter episodes and trigger pulses neither
cut nor impose a hold. Confirmed refuge persists across evidence gaps
up to refuge_hold (600 s), so office-sensor decay during a coffee run
does not release it. Asleep/away contexts unchanged: instant cut.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leiklier

Copy link
Copy Markdown
Owner Author

Second refinement (owner decision, now DECISION.md §8): refuge continuity over absolute invisibility. Rule 1.3c — during confirmed refuge, viewer activity cuts only once continuously active for exposure_grace (300 s); shorter episodes and trigger pulses neither cut nor impose a hold. Rule 1.7 — confirmed refuge is held across evidence gaps up to refuge_hold (600 s), so office-sensor decay during a coffee run doesn't release the block. Asleep/away contexts unchanged: every blip still cuts instantly.

@leiklier
leiklier merged commit f63127a into main Jul 23, 2026
4 checks passed
@leiklier
leiklier deleted the docs/design branch July 23, 2026 19:34
@leiklier
leiklier restored the docs/design branch July 23, 2026 19:35
@leiklier
leiklier deleted the docs/design branch July 23, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant