The scenario: two offline actions refer to the same logical slot
An offline queue needs to know whether a later item repeats an existing request, expresses a new intention for the same logical object or represents an independent event. Those meanings can differ between workflows even when both implementations are called an outbox. A shared data structure should not silently choose the product policy.
The reviewed Movo-X portable code preserves original AI turns by client identifier and replaces selected pending schedule-slot actions by their logical slot. Two selected slot-outbox and action-rule tests passed on Linux; the programme separately ran the AI-outbox case earlier. No actual clinical action or server correction was performed.
Give request identity and logical identity separate names
The inspected pending slot action has a request identifier as well as person, item, request date and slot. The request identifier denotes one submitted intention; the person/item/date/slot tuple identifies the logical place that intention concerns. Those keys serve different purposes.
The outbox first ignores a duplicate request identifier. For a different request identifier targeting the same tuple, it removes the previous pending entry and retains the newly enqueued one. The selected fixture exercises both cases and checks the retained identifier. This is a client queue policy, not proof that the authoritative record was updated or that the earlier request never reached the server.
Preserve the original payload for an existing AI-turn identifier
The separately reviewed AI outbox keeps the original turn when the same client identifier is enqueued again with edited text. Retrying that identifier retains the intended original question and attachment references rather than substituting whatever is currently in the composer.
The difference is domain meaning: a new question and a pending decision for one slot are not interchangeable events. A useful architecture review records that policy explicitly. It should not impose latest-wins or original-wins on every queue simply because one implementation already has a familiar persistence interface.
Treat a replaced pending action differently from a server correction
Replacing a local queue entry does not undo an action already accepted remotely. A transport failure can leave the earlier outcome uncertain, so pending should not be interpreted as guaranteed unsent. The responsible service must decide what a later request means against current state.
The selected action-rule fixture checks a scheduled-state correction path and refusal of selected ordinary repeats. It also contains a separate as-needed branch, so its broad final-state description cannot be applied universally. These are local rule examples; actual record finality, correction permissions and persistence require authoritative acceptance. This chapter does not prescribe a clinical outcome.
Classify retry according to the operation contract
The inspected slot outbox retries selected network, rate-limit and server-failure conditions. Its fixture checks a refused conflict as a terminal local retry classification. The AI outbox separately recognizes its in-progress conflict condition as retryable. The same HTTP status family therefore cannot be assigned one universal queue response.
A handover should name the code, state and operation semantics behind the retry decision. Retrying an in-progress lease and repeatedly submitting a refused recorded action are different behaviours. The selected tests establish local classifications, while actual server responses and user-visible recovery remain separate integration work.
Keep the chosen request identity through serialization
The slot fixture saves the outbox to an injected in-memory data store and loads it again, checking the retained request identifier. That demonstrates model serialization for the selected entry, so the intended retry representation can be reconstructed from the stored bytes.
It does not demonstrate an actual process restart, protected disk write or storage-failure recovery. The data-store interface and platform adapter need their own operating acceptance. A test assertion mentioning restart should not be expanded beyond the fixture’s in-memory save/load operation. The earlier AI-outbox chapter records the same persistence boundary for its own workflow.
Define capacity, attempts and age as explicit queue policies
The inspected slot queue has item and attempt bounds and an elapsed-age expiry operation. Its test checks removal after exhausted attempts and after a synthetic expired age. These are selected client retention decisions, distinct from the service’s calendar-date acceptance rules.
A bounded queue can remove pending work before a later successful delivery, so the interface needs an accepted way to explain what remains unresolved. The tests do not exercise queue overflow or every boundary time. Do not describe local retention as an indefinite delivery promise or infer that an elapsed-age constant exactly reproduces the server’s date policy.
A practical offline-command handover
Deliver request identity, logical identity, duplicate handling, supersession, retry classification and authoritative correction rules for each workflow. Attach same-request and same-slot fixtures, then add uncertain-success, real persistence, overflow and service read-back cases in an approved synthetic environment.
For a CTO, this produces an offline design that preserves meaning as well as bytes. The client can retain or replace pending intentions deliberately while leaving accepted record state with the responsible service. The pinned Movo-X implementations and scoped tests explain those choices without claiming universal outbox semantics, durable delivery or real clinical outcomes.
Compare the reviewed boundaries
Reviewed queue decisions use different identity keys
On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.
| Case | Local decision | Authority still required |
|---|---|---|
| AI turn: same client identifier, edited text | Keep original pending turn | Server replay/identity contract |
| Slot action: same request identifier again | Ignore duplicate enqueue | Server idempotency acceptance |
| Slot action: new identifier, same logical slot | Replace previous pending entry | Current record and correction policy |
| Earlier request may already have succeeded | Local replacement cannot establish remote undo | Authoritative response and read-back |
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
if same_request_identity_is_pending():
preserve_defined_duplicate_policy()
elif workflow_allows_superseding_same_logical_slot():
replace_pending_intention_with_new_request_identity()
else:
retain_independent_operation()
retry_only_under_the_operation_error_contract()
# Replacing local pending work does not reverse an accepted remote record.About this engineering series
Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.
Explore the Movo-X engineering series → · Related implementation experience →
Discuss a similar engineering problem
Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.
Discuss your project on WhatsApp ↗