feat(work): persist queued tasks before device acceptance
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# Work task dispatch and acceptance
|
||||
|
||||
The broker advertises `work-dispatch-v1` through signed Work status and uses it only for a paired capable client's private-chat assistant tasks. Older clients and direct read-only commands retain their existing path.
|
||||
|
||||
1. The connector atomically persists the original task identity, encrypted instruction and material assignments before it marks the event task as queued. Pending tasks are bounded per device (up to 20), subject to the original task deadline and binding generation.
|
||||
2. A signed `POST /work/v2/tasks/next` returns the oldest eligible task for that same binding. Reading repeatedly does not mark it as accepted. The queued record does not depend on a WebSocket packet or the original connector process.
|
||||
3. The client validates the task and digest and commits its encrypted local task record before signed `POST /work/v2/tasks/accept`. Identical acceptance retries return the original receipt. After acceptance the queue does not hand the task out again; the connector purges the queued body.
|
||||
4. Execution starts only after confirmation. A client recovering a known native run polls the original run. If starting the run had an ambiguous outcome and no run ID was stored, the client does not start it again. Revoked, unbound and expired queued records cannot be accepted.
|
||||
|
||||
The guarantee starts at **queue commit**. Platform acknowledgment before queue commit is a separate ingress task. This slice does not queue requests submitted while the device is offline, add cancellation, or promise automatic recovery from lost client storage after acceptance.
|
||||
Reference in New Issue
Block a user