-
Notifications
You must be signed in to change notification settings - Fork 350
Extract delivery hardening from #206 (without worker_events) #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
vsumner
wants to merge
23
commits into
spacedriveapp:main
from
vsumner:feat/pr-206-delivery-hardening
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3f6dd73
feat(worker): add durable terminal delivery, checkpoints, and resilience
vsumner c55a8b3
chore(api): trim worker progress interface surface
vsumner 267bfc3
Harden worker delivery contracts and persist worker events
vsumner 0111f4b
Fix clippy -Dwarnings violations in worker contract paths
vsumner 03b846e
Fix worker delivery contract edge cases and align docs
vsumner 05112f7
Harden worker contract semantics and deterministic status hashing
vsumner 8cfca95
Address follow-up reliability and docs findings
vsumner 15aa147
Harden outbound delivery paths and simplify routing flow
vsumner 2fe58fa
Extract delivery hardening and drop worker event journal
vsumner d99b46c
Add canonical worker timeline projection
vsumner 893dd4e
Fix cancel_worker race and convergence handling
vsumner ffd016d
Fix cancel responsiveness and emit receipt SSE events
vsumner 190b576
Fix clippy needless_return warnings
vsumner 8cdbdaa
Fix worker lag/flush races and gate outbound SSE emission
vsumner 0f07bf4
Apply follow-up review fixes for contracts, browser, and watcher loop
vsumner bed2251
Harden worker flush handling and add regression coverage
vsumner 7a0586c
Fix lagged worker convergence and flush panic cleanup
vsumner 16b3233
Fix routed delivery outcome and stabilize worker timeout test
vsumner 48367c9
Move main.rs tests to end for clippy lint
vsumner fb447d8
Restore stable 20260224 migration numbering
vsumner 9fc6c1d
Fix Z.AI Coding Plan model remap for chat completions
vsumner 1997e6c
Fix duplicate worker completion surfacing with tracked receipts
vsumner 9c6c066
Ensure retriggers relay worker results when reply is missing
vsumner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| -- Durable delivery receipts for terminal worker notifications. | ||
| -- | ||
| -- Tracks whether a terminal worker completion notice has been delivered to the | ||
| -- user-facing channel, with bounded retry metadata for transient adapter | ||
| -- failures. | ||
|
|
||
| CREATE TABLE IF NOT EXISTS worker_delivery_receipts ( | ||
| id TEXT PRIMARY KEY, | ||
| worker_id TEXT NOT NULL, | ||
| channel_id TEXT NOT NULL, | ||
| kind TEXT NOT NULL, | ||
| status TEXT NOT NULL DEFAULT 'pending', | ||
| terminal_state TEXT NOT NULL, | ||
| payload_text TEXT NOT NULL, | ||
| attempt_count INTEGER NOT NULL DEFAULT 0, | ||
| last_error TEXT, | ||
| next_attempt_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| acked_at TIMESTAMP, | ||
| created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| UNIQUE(worker_id, kind) | ||
| ); | ||
|
|
||
| CREATE INDEX idx_worker_delivery_receipts_due | ||
| ON worker_delivery_receipts(status, next_attempt_at); | ||
|
|
||
| CREATE INDEX idx_worker_delivery_receipts_channel | ||
| ON worker_delivery_receipts(channel_id, created_at); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| -- Deterministic worker task contracts. | ||
| -- | ||
| -- Tracks acknowledgement/progress/terminal guarantees for worker executions so | ||
| -- long-running tasks always provide bounded feedback and reach terminal states. | ||
|
|
||
| CREATE TABLE IF NOT EXISTS worker_task_contracts ( | ||
| id TEXT PRIMARY KEY, | ||
| agent_id TEXT NOT NULL, | ||
| channel_id TEXT NOT NULL, | ||
| worker_id TEXT NOT NULL UNIQUE, | ||
| task_summary TEXT NOT NULL, | ||
| state TEXT NOT NULL DEFAULT 'created', | ||
| ack_deadline_at TIMESTAMP NOT NULL, | ||
| progress_deadline_at TIMESTAMP NOT NULL, | ||
| terminal_deadline_at TIMESTAMP NOT NULL, | ||
| last_progress_at TIMESTAMP, | ||
| last_status_hash TEXT, | ||
| attempt_count INTEGER NOT NULL DEFAULT 0, | ||
| sla_nudge_sent INTEGER NOT NULL DEFAULT 0, | ||
| terminal_state TEXT, | ||
| created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
| ); | ||
|
|
||
| CREATE INDEX idx_worker_task_contracts_channel_state | ||
| ON worker_task_contracts(channel_id, state); | ||
|
|
||
| CREATE INDEX idx_worker_task_contracts_ack_due | ||
| ON worker_task_contracts(state, ack_deadline_at); | ||
|
|
||
| CREATE INDEX idx_worker_task_contracts_progress_due | ||
| ON worker_task_contracts(state, progress_deadline_at); | ||
|
|
||
| CREATE INDEX idx_worker_task_contracts_terminal_due | ||
| ON worker_task_contracts(state, terminal_deadline_at); |
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.