Skip to content

✨🧑‍💻 - Save and reopen household automation drafts #118

Description

@efraespada

Is there an existing issue or feature request for this?

  • I have searched the existing issues and feature requests.

What area does this improvement affect?

New Feature

What actions does this improvement affect?

No response

Description of the idea or improvement

Let authorized household administrators save a draft of the manual task automation they can already preview in Household settings. List saved drafts, reopen one in the existing editor, preview its current condition, and explicitly save a new revision. Keep a stable rule identity with immutable revisions. The editor should preserve the exact typed manual trigger, task proposal and optional stock condition across saves, reloads and a process restart.

Current limitations or challenges

The manual preview from #98 evaluates the rule against current household facts. Closing or reloading the editor loses the draft. The automation roadmap needs protected rule storage and revision checks before the engine can admit runs against a pinned revision.

Expected impact

  • An authorized administrator can save the supported draft, leave the workspace and reopen exactly what was saved. A subsequent edit creates a new revision and preserves the prior one.
  • Drafts remain inactive. Saving, editing and previewing perform no task, inventory, notification or Home Assistant action.
  • List, read and save requests use current household authority. A revoked or foreign membership cannot disclose or alter a draft. Validate the same closed rule schema and bounds as the preview.
  • A repeated original save returns the same result. Concurrent edits from the same revision cannot silently overwrite one another. Keep the user's input and explain how to review the newer version or recover a save whose response was lost.
  • Localize the editor, list, states and recovery in English and Spanish. Exercise keyboard and touch in both HTTP compositions, both image architectures and a disposable Edge installation. Verify representative migrations from the previous schema and version 20, plus restart and restoration.

Alternatives considered

No response

Version of copilot

No response

Additional context or comments

Owning specification: specs/household-automation.md. Extend the existing household-automation capability and the version-one manual preview. This increment covers the storage and editing parts of R1, R2, R5, R7, R8 and R9. Activation, live triggers, execution, traces and advanced editing follow in subsequent increments.

Draft requirements and acceptance traceability

Preserve the existing requirements and case inventory in the owning specification. Add the following requirement rows to this increment’s section 4 and carry the same mappings into the case inventory and section 17.

Requirement Behavior Acceptance cases
automation-drafts-R01 Let a currently authorized household administrator save and reopen the exact validated manual rule under a stable identity. Saving and previewing leave execution inactive. automation-drafts-C01, automation-drafts-C02, automation-drafts-C04
automation-drafts-R02 Keep immutable revisions, require the expected revision on replacement and recover the result of the original save without duplicating a draft or a revision. automation-drafts-C03
automation-drafts-R03 Provide protected draft listing, editing and recoverable errors with English and Spanish keyboard and touch navigation. automation-drafts-C05, automation-drafts-C07
automation-drafts-R04 Preserve existing data through migration and verify draft revisions and receipts through restart and restoration in the supported deployments. automation-drafts-C06, automation-drafts-C07
Acceptance case Requirements Observable outcome
automation-drafts-C01 automation-drafts-R01 Save the current manual rule, reload the workspace, reopen the recorded rule and compare the exact task proposal and stock predicate to the original input. The draft is inactive.
automation-drafts-C02 automation-drafts-R01 A revoked member or foreign household cannot list, read or save the draft. A malformed rule or foreign stock reference cannot replace a prior revision.
automation-drafts-C03 automation-drafts-R02 Two saves with the same expected revision yield one new revision and a conflict. Replaying an original request after a lost response returns its recorded result. Both immutable revisions remain available to storage verification.
automation-drafts-C04 automation-drafts-R01 Preview a reopened draft using the current stock facts. Compare task, inventory, notification and outbox state before and after save and preview.
automation-drafts-C05 automation-drafts-R03 Use English desktop keyboard and Spanish narrow touch controls to save and reopen. A conflict or recoverable failure keeps the unsaved input and identifies the next action.
automation-drafts-C06 automation-drafts-R04 Upgrade representative schema 31 and 20 data, then verify a saved draft, exact revisions and its original receipt after restart and snapshot restoration.
automation-drafts-C07 automation-drafts-R03, automation-drafts-R04 Prove the browser journey in Ingress and standalone, CI images for both architectures and an installed Edge candidate. Clean the disposable installation and data.

Save and reopen household automation drafts

  • Status: Draft
  • Date: 2026-11-18
  • Catalog capability ID: household-automation
  • Owners: Domus maintainers
  • Scope: Durable inactive drafts for the existing manual task rule editor
  • Related issue: Domus #118
  • Required review gates: product UX, architecture, testing, documentation, security/operations
  • Open decisions blocking readiness: none within the supported manual rule scope

1. Executive summary

A household administrator can save the manual rule they already preview, leave
Household settings and reopen the saved definition with its exact values.
An explicit edit adds a revision under the same rule identity. A saved draft
cannot admit a run.

2. Problem, current behavior, and evidence

The manual preview delivered by issue #98
uses the current authorized stock facts. The current editor holds the draft in
browser memory, which is lost after reload. The product roadmap requires a
durable versioned definition before activation and execution can pin a revision.

The selected base preserves the preview qualifier in
docs/evidence/automation-preview-qualification.md, the closed rule model in
backend/src/domus/domain/automation.py, and the UI state in
frontend/src/application/automation-preview.ts. This is a prospective delta.

3. Actors, surfaces, and terminology

Actor Goal Entry point Visible surfaces
Household administrator with current configuration and task creation grants Save, reopen, edit and preview the supported manual rule Household settings Draft list, editor and save status
Household member without current grants Use only permitted household views Household settings Permission feedback without rule details

A rule ID identifies the draft within one installation, channel and household.
A revision is the immutable typed definition saved at a particular point.
An original save receipt identifies the result of one scoped request.
An inactive draft has no execution authority.

4. Goals, non-goals, and fixed invariants

Requirement Behavior
automation-drafts-R01 Let a currently authorized household administrator save and reopen the exact validated manual rule under a stable identity. Saving and previewing leave execution inactive.
automation-drafts-R02 Keep immutable revisions, require the expected revision on replacement and recover the result of the original save without duplicating a draft or a revision.
automation-drafts-R03 Provide protected draft listing, editing and recoverable errors with English and Spanish keyboard and touch navigation.
automation-drafts-R04 Preserve existing data through migration and verify draft revisions and receipts through restart and restoration in the supported deployments.

Activation, live triggers, runs, advanced editing, external effects and
distribution have separate acceptance. The server owns scope, resulting
revision and status. No draft input grants permission or starts an effect.

5. Current versus proposed product journey

Stage Current Proposed User effect
Edit Manual task rule exists only in the editor Reuse the same editor and form values The task title and optional stock predicate stay recognizable
Save Refresh loses the editor draft Explicit save returns a revision The notice identifies what was saved
Reopen Start over after leaving the view Select a current draft in Household settings Reopen the exact recorded data
Edit again Existing data is ephemeral Save against the reopened revision Preserve the old revision and show conflicts clearly

Text equivalent: edit and preview as needed, save the inactive rule, reopen it
from the list, then explicitly save later changes as a new revision.

6. Functional behavior and state model

The first save records one stable identity and revision one. Reopening a saved
item loads its latest authorized revision in the same editor. An edit uses
the expected revision and appends one immutable revision. Creation and edit
produce exactly one original-operation receipt. An identical replay returns
the recorded result. Reusing a request identity for different input fails
without writing. Conflicting edits preserve the draft and both users' results.

The version-one definition carries one explicit manual trigger, one task
proposal and the existing supported optional stock predicate. Save validation
uses the existing typed rule and closed-schema policy. Older or unsupported
content cannot be silently replaced by the simple form. Preview evaluates the
loaded definition against current stock and remains available before saving.

7. User-facing configuration

The existing manual task title limit and product selection apply. The stock
predicate is optional. Scope and enabled state come from the server.
There is no new installation configuration. The draft list is bounded and a
member can request the next page when more authorized drafts exist.

8. Clean Architecture design

The domain owns typed validation and immutable rule data. The application uses
the existing household authorization and transaction boundaries to admit a
save, validate owned product references, persist the revision and record the
original result atomically. Protected read queries return only the current
member's allowed drafts. SQLite implements storage and snapshot verification.
The existing HTTP compositions map the same validated DTOs and safe outcomes.
The browser owns the draft editor, localized view and exact original-request
recovery. Keep storage and transport dependencies outside domain and
application policy.

9. UI/UX and content contract

Show the draft list next to the existing editor in Household settings. An
empty list invites the administrator to save the first draft. Saving shows a
pending state and the resulting revision when confirmed. Treat a lost
response as a recoverable original save. A revision conflict explains how
to review the newer version and preserves unsaved input. A permission loss
retires the user's saved data and editor. Localize list, states and recovery
copy in English and Spanish. Provide visible focus, accessible controls and
a readable narrow layout in light and dark modes.

10. Failure, recovery, and cleanup

Invalid input preserves the last valid revision. A failed or conflicting
operation preserves the form and explains the next step. An uncertain save
recovers through its original request identity. Revocation blocks recovery
disclosure. Removing a disposable test installation removes only its own
data and temporary repository source.

11. Security, permissions, and privacy

Resolve trusted installation, channel, household and member on the server.
Apply current household read and automation configuration authority to list
and reopen. Apply current write and relevant task permissions to saves.
Reject foreign products without disclosing their data. A draft carries
declarative data, with no raw command, URL, credential or principal override.
Stable and Edge storage remain isolated.

12. Observability and operational UX

Show authoritative empty, pending, saved, conflict, denied and unavailable
states. An operation reference supports original-save recovery. Diagnostics
use safe codes and correlation identifiers without private rule data.
Application and UI render exact saved revision and inactivity.

13. Compatibility, migration, rollout, and rollback

The storage change upgrades representative schema 31 and schema 20 data.
Verify that existing household records, original-operation receipts and
authorization remain consistent after migration. Verify restart and
snapshot restoration of a saved rule and its immutable revisions. Preserve
the earlier compatible image and data backup for rollback. Exercise Ingress,
standalone, both architectures and a separately installed Edge candidate.

14. Testing strategy and numeric budget

Area Minimum distinct cases Behaviors/risks covered
Managing drafts 2 Exact round trip, revision conflicts and original replay
Permission boundary 1 Current grants and owned references
Preview 1 Current facts and inactive saves
Interaction 1 Localized editor and recoverable conflicts
Storage lifecycle 1 Migration, restart and restoration
Deployment evidence 1 Both compositions and architectures plus installed Edge
Total 7 Independently observable cases
Case ID Area Requirements Scenario
automation-drafts-C01 Managing drafts automation-drafts-R01 Save the current manual rule, reload the workspace, reopen the recorded rule and compare the exact task proposal and stock predicate to the original input. The draft is inactive.
automation-drafts-C02 Permission boundary automation-drafts-R01 A revoked member or foreign household cannot list, read or save the draft. A malformed rule or foreign stock reference cannot replace a prior revision.
automation-drafts-C03 Managing drafts automation-drafts-R02 Two saves with the same expected revision yield one new revision and a conflict. Replaying an original request after a lost response returns its recorded result. Both immutable revisions remain available to storage verification.
automation-drafts-C04 Preview automation-drafts-R01 Preview a reopened draft using the current stock facts. Compare task, inventory, notification and outbox state before and after save and preview.
automation-drafts-C05 Interaction automation-drafts-R03 Use English desktop keyboard and Spanish narrow touch controls to save and reopen. A conflict or recoverable failure keeps the unsaved input and identifies the next action.
automation-drafts-C06 Storage lifecycle automation-drafts-R04 Upgrade representative schema 31 and 20 data, then verify a saved draft, exact revisions and its original receipt after restart and snapshot restoration.
automation-drafts-C07 Deployment evidence automation-drafts-R03, automation-drafts-R04 Prove the browser journey in Ingress and standalone, CI images for both architectures and an installed Edge candidate. Clean the disposable installation and data.

15. Documentation and discoverability

Path Change
specs/household-automation.md update
docs/roadmap.md update
docs/user-guide.md update
docs/contracts/household-api.openapi.json update
docs/contracts/native-household-api.openapi.json update
docs/evidence/automation-preview-qualification.md reference

Keep the catalog under the existing household-automation capability and
record exact validation evidence in the contributing PR.

16. Acceptance scenarios

The seven scenarios in the section 14 inventory define acceptance for this
increment. Existing automation engine and preview cases retain their scope.
Validate the protected reads and same-key write recovery through both HTTP
compositions. Run the browser cases in both languages and verify installed
Edge behavior and scoped cleanup before merge.

17. Requirements traceability

Requirement Cases
automation-drafts-R01 automation-drafts-C01, automation-drafts-C02, automation-drafts-C04
automation-drafts-R02 automation-drafts-C03
automation-drafts-R03 automation-drafts-C05, automation-drafts-C07
automation-drafts-R04 automation-drafts-C06, automation-drafts-C07

18. Implementation sequence

Reuse the typed rule and protected access boundary. Add durable rule identity,
immutable revisions and the original save receipt. Connect the existing
editor and draft list. Exercise the storage migrations, original save
recovery, browser journey and installed Edge candidate. Update the catalog
and the user guide with verified evidence.

19. Definition of Done

  • The seven acceptance cases pass.
  • Existing records, access and read-only preview behavior pass regression checks.
  • Authored runtime files retain complete coverage and architecture checks.
  • Both compositions and architectures pass and the installed Edge test is recorded with scoped cleanup.
  • Requirements, case mappings and catalog agree with the implemented increment.

20. References and decisions

Domus #118 defines the draft
increment. The existing capability owns the rule model and later execution.
The selected base is d18391736d425fb7c6a80e44e30371fe12124ad1.

Activity

  1. added
    enhancementNew feature or request
    featureLabel to manage feature branches
    priority: lowLabel to indicate a priority low
    on Nov 18, 2026
  2. added
    state:ai-processingA Copilot agent is analyzing or working on the issue or change.
    on Nov 18, 2026
  3. moved this to Todo in vypdevon Nov 18, 2026
  4. changed the title [-]Save and reopen household automation drafts[/-] [+]✨ - Save and reopen household automation drafts[/+] on Nov 18, 2026
  5. removed
    state:ai-processingA Copilot agent is analyzing or working on the issue or change.
    on Nov 18, 2026
  6. vypbot commented on Nov 18, 2026

    @vypbot

    Hi! I’m @vypbot, the Copilot assistant for this repository.

    I can answer questions, explain the codebase, propose implementation and test plans, review issues and pull requests for potential bugs or security problems, and help authorized maintainers apply changes.

    Try /copilot help to see the available commands, or mention @vypbot with your question.

  7. added
    SDDAn SDD update is required before branch work.
    on Nov 18, 2026
  8. vypbot commented on Nov 18, 2026

    @vypbot

    SDD preparation status

    The specification publication was verified on the linked branch. Branch readiness remains subject to its separate checks.

  9. 36 remaining items

  10. added
    state:ai-processingA Copilot agent is analyzing or working on the issue or change.
    80%Progress: 80%
    55%Progress: 55%
    and removed
    75%Progress: 75%
    state:ai-processingA Copilot agent is analyzing or working on the issue or change.
    80%Progress: 80%
    on Nov 18, 2026
  11. added a commit that references this issue on Nov 18, 2026
  12. moved this from In Progress to Done in vypdevon Nov 18, 2026
  13. added
    100%Progress: 100%
    and removed
    state:workingWork can proceed on the verified branch or without a branch.
    55%Progress: 55%
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

100%Progress: 100%SDDAn SDD update is required before branch work.branchedThe linked branch and required SDD commit are verified.enhancementNew feature or requestfeatureLabel to manage feature branchespriority: lowLabel to indicate a priority lowsize: XXLLabel to indicate a task of size XXL

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions