Skip to content

feat: run task automation sequences with durable waits - #194

Open
efraespada wants to merge 3 commits into
developfrom
feature/164-run-task-automation-sequences-with-durable-waits
Open

efraespada wants to merge 3 commits into
developfrom
feature/164-run-task-automation-sequences-with-durable-waits

Conversation

@efraespada

@efraespada efraespada commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

Closes #164.

Household task sequences

  • Add version 3 plans with ordered task creation and durable waits for Manual and Daily triggers.
  • Pin the enabled revision, task grant and original admission. Evaluate the condition once, serialize work per rule, and commit task creation with the sequence cursor.
  • Expose preview, explicit enablement and stopping, bounded history, and recovery of uncertain original requests in both household applications.
  • Migrate to schema 42 while preserving existing automation records and receipts. Checkpoint restoration respects retained terminal results.

Candidate and evidence

Edge.119 pins source c307138e7c6a2c1180bbc74d7b078d46012591bb. The archive, compiled UI and wheel are recorded in addon-edge/artifact.json.

Local qualification includes 100% frontend coverage, 100% coverage of the sequence modules in the focused backend campaign, real schema-41 and schema-20 migrations, and the English and Spanish browser journeys in Ingress and standalone. The qualification record links individual acceptance cases. Full CI, substantive review and installed Edge checks are merge gates.

@docs-page

docs-page Bot commented Dec 6, 2026

Copy link
Copy Markdown

To preview the documentation for this pull request, visit the following URL:

docs.page/vypdev/domus~194

Documentation is deployed and generated using docs.page

@vypbot vypbot added size: XXL Label to indicate a task of size XXL state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Dec 6, 2026
@vypbot
vypbot self-requested a review December 6, 2026 10:52
@vypbot vypbot added this to vypdev Dec 6, 2026
@vypbot vypbot moved this to In Progress in vypdev Dec 6, 2026
@vypbot
vypbot changed the base branch from develop to master December 6, 2026 10:53
@vypbot
vypbot changed the base branch from master to develop December 6, 2026 10:53
@vypbot vypbot added the 100% Progress: 100% label Dec 6, 2026

@vypbot vypbot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current status: 3 findings originating in this review require attention.
Last reconciled on e08a28d. See aggregate Bugbot status.

🤖 Bugbot review snapshot

Bugbot reported 3 potential problems when commit e08a28d was analyzed. This snapshot is historical; use the status block above for current state. 3 findings are linked to changed code.

Findings

  • medium: Update the actual-image journey count — .github/workflows/ci_check.yml:526
  • medium: Snapshot verification accepts failed runs without proving the failure transition — backend/src/domus/infrastructure/sqlite_automation_sequences.py:318
  • low: Step limit ignores condition nodes — frontend/src/presentation/domus-automation-sequences.ts:204

run: >-
lockf -k -t 600 "${HOME:?}/.cache/domus-ci/entry-browser.lock" pnpm --filter @domus/frontend exec playwright test
-c playwright.entry.config.ts tests/e2e/administration.spec.ts tests/e2e/tasks.spec.ts tests/e2e/workspace-navigation.spec.ts tests/e2e/shopping-annotations.spec.ts tests/e2e/shopping-workspace-navigation.spec.ts tests/e2e/shopping-free-units.spec.ts tests/e2e/sign-in-recovery.spec.ts tests/e2e/product-metadata.spec.ts tests/e2e/named-shopping-lists.spec.ts
-c playwright.entry.config.ts tests/e2e/administration.spec.ts tests/e2e/tasks.spec.ts tests/e2e/workspace-navigation.spec.ts tests/e2e/shopping-annotations.spec.ts tests/e2e/shopping-workspace-navigation.spec.ts tests/e2e/shopping-free-units.spec.ts tests/e2e/sign-in-recovery.spec.ts tests/e2e/product-metadata.spec.ts tests/e2e/named-shopping-lists.spec.ts tests/e2e/automation-sequences.spec.ts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the actual-image journey count

Severity: medium

Category: reliability · Confidence: 99%

Location: .github/workflows/ci_check.yml:526

The workflow adds this spec to the Playwright run, but the following assertion still requires exactly 142 cases. The spec registers one test for each of two modes and two languages, adding four cases; a complete run therefore reports 146 expected cases and fails the count check.
Evidence:
At workflow line 526, the changed Playwright command adds tests/e2e/automation-sequences.spec.ts. In that spec, nested loops over native/standalone and en/es each register one test(), producing four additional cases. The subsequent assertion at line 531 still requires result['stats']['expected']==142, so it fails when all 146 cases are collected successfully.

Suggested fix:
Update the expected count in the following assertion from 142 to 146.

or original_sequence_admission(admission) != initial_run(run)
):
raise StorageFailure("invalid_automation_sequence_admission_proof")
if not run.progress.status.pending and run.progress.status is not SequenceStatus.FAILED:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot verification accepts failed runs without proving the failure transition

Severity: medium

Category: correctness · Confidence: 93%

Location: backend/src/domus/infrastructure/sqlite_automation_sequences.py:318

A schema-42 snapshot can mark a run failed even when that state cannot result from the run’s plan. For example, a run whose first step is a task can have condition_matched=true and halt_reason=failed while keeping index=0 and no results. The reader accepts this internally consistent state. The admission check compares against initial_run(run), which resets progress and results to the original queued state, and this condition skips terminal proof for failed runs. With no results, task receipt checks do not run. After restore, the worker returns immediately for this non-pending run, so the task is not executed unless someone explicitly retries it.
Evidence:
In changed fragment 2/2 for this file, whose added-file origin is line 1, the exact condition is at zero-based displayed-line offset 317: 1 + 317 = line 318. initial_run resets the run to its queued progress and clears results before comparison with the admission receipt. The failed-state guard then bypasses original_terminal; the subsequent task proof loop checks only existing results, so an index-0 run has no task effect to verify. The worker’s advance path returns immediately for any non-pending run. The only production path that sets SequenceHalt.FAILED is a failed wait-entry operation, so a failed run at a task step is not a reachable transition.

Suggested fix:
Validate failed snapshot records against the states reachable from the failed wait-entry path, or persist and verify durable proof for failure transitions.

return html`<p>${this.copy(value.kind)}</p><ul>${children.map(child => html`<li>${this.condition(child)}</li>`)}</ul>`;
}
private edit(blocked: boolean, canPreview: boolean) {
const full = this.edits.length >= 63;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step limit ignores condition nodes

Severity: low

Category: correctness · Confidence: 97%

Location: frontend/src/presentation/domus-automation-sequences.ts:204

The editor enables adding steps up to 63 without counting condition nodes. The backend requires the trigger, condition nodes, and executable steps together to fit within 64 nodes. For example, an existing valid rule with one condition node and 62 steps can add another step, but the resulting 65-node plan is rejected on save or preview. Count condition nodes when determining the editor's step capacity and validate the combined budget before submission.
Evidence:
full is based only on this.edits.length; getPlan() returns the condition separately and performs no combined node-budget check. The backend's AutomationSequence.__post_init__ enforces 1 + len(steps) + condition_nodes <= 64, so adding a step to a valid 62-step plan with one condition node produces a rejected plan.

Suggested fix:
Compute the available step count from the trigger and the number of nodes in the current condition, and reject over-budget plans before preview or save.

@vypbot

vypbot commented Dec 6, 2026

Copy link
Copy Markdown

Bugbot: 3 findings need attention

Current status: 3 findings require attention on e08a28d.

Action: Review the linked threads or comment /copilot fix all.

Findings

Pull request · Verified commit · Workflow run

@vypbot vypbot added state:changes-requested Review identified changes that are required. state:awaiting-issue-author The next action requires more information or changes from the issue author. and removed state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Dec 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

100% Progress: 100% size: XXL Label to indicate a task of size XXL state:awaiting-issue-author The next action requires more information or changes from the issue author. state:changes-requested Review identified changes that are required.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

✨ - Run task automation sequences with durable waits

2 participants