Repository navigation
feat: run task automation sequences with durable waits - #194
efraespada wants to merge 3 commits into
Conversation
|
To preview the documentation for this pull request, visit the following URL:
|
There was a problem hiding this comment.
Current status: 3 findings originating in this review require attention.
Last reconciled one08a28d. 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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
Bugbot: 3 findings need attention
Findings |
Closes #164.
Household task sequences
Candidate and evidence
Edge.119 pins source
c307138e7c6a2c1180bbc74d7b078d46012591bb. The archive, compiled UI and wheel are recorded inaddon-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.