Responsible agent operations
A queue is stored demand, not permission to execute
Treat enqueue as storage evidence, then decide execution from current intent, lifetime, capacity, effect safety, and ownership.
A durable queue can answer a narrow question: did the system retain this request for later consideration? It cannot, by itself, answer whether the request is still wanted, safe to repeat, eligible to run, likely to finish in time, owned by one current worker, or complete.
That distinction matters because queue vocabulary often promotes intermediate states into promises:
accepted -> queued -> processing -> done
The labels look like a progression, but they hide independent decisions. “Accepted” may mean only that an API parsed the request. “Queued” may mean only that bytes were stored. “Processing” may mean a worker obtained a message, not that it still owns the effect. “Done” may mean the handler returned, not that the durable or external result was reconciled.
The safer model is to treat a queue as stored demand plus an admission contract. Store the request if the storage boundary allows it. Separately decide whether current evidence permits execution. Then record terminal evidence without translating uncertainty into success or failure.
This note presents an original operational review method and synthetic examples from Alfred. It does not describe a customer system, production incident, measured performance result, or completed deployment.
The original queue admission contract decision card condenses the method into six checks. It is a hand-authored companion to this note, not evidence that a real queue or worker enforced the contract.
For a reusable working record, use the original queue admission contract worksheet. It keeps the decision envelope, intent and effect identities, state boundaries, capacity evidence, replay classification, ownership, execution-time recheck, and terminal observations separate. A blank or completed worksheet is not proof by itself; its authority depends on the identified artifacts, observations, and decision rules.
The original queue admission contract worked examples fill the method twice with explicitly synthetic evidence. One trace keeps stale capacity evidence as BLOCKED, holds admission, then expires the request after a fresh lifetime comparison. The other keeps a lost destination response UNCERTAIN, holds retry pending authoritative reconciliation, and compares an exact-match completion branch with an unavailable-observation branch. The traces demonstrate decision logic; they do not report a real queue, worker, destination, execution, or result.
Keep five states separate
A useful queue model starts by refusing to collapse these states:
- STORED — the request and its identity crossed the declared durable-storage boundary;
- VALID — required structure and immutable constraints were checked under an identified rule revision;
- ELIGIBLE — current policy, intent, dependencies, and useful lifetime permit an execution attempt;
- LEASED — one current attempt holds time-bounded, fenced authority to work; and
- COMPLETED — the required durable and external effects were observed under the declared completion test.
A request can be stored but invalid. It can be valid but no longer useful. It can be eligible but not yet assigned. It can be leased while its effect remains incomplete. It can also lose a lease after creating an external effect but before recording completion, leaving the outcome uncertain.
This is not a universal queue protocol. Different systems may use transactions, logs, brokers, schedulers, outboxes, workflows, or destination-specific deduplication. The product requirement is smaller: name the boundary each state proves, and do not let one state impersonate another.
Give queued work an intent envelope
A queue item needs more than a payload. Before admission, preserve an intent envelope that makes the decision reviewable:
work_id:
operation_identity:
requested_at:
not_before:
deadline:
minimum_completion_margin:
cancellation_identity:
priority_class:
policy_revision:
dependency_revisions:
effect_identity:
replay_class:
completion_test:
operation_identity says what effect is requested, not merely which handler should run. deadline says when the result stops being useful or allowed. minimum_completion_margin prevents starting work that is still technically before its deadline but cannot reasonably satisfy its own completion contract in the remaining budget.
cancellation_identity matters because removing a visible queue row is not necessarily cancellation. The item may already be leased, copied to another stage, or waiting on an external destination. Cancellation needs a state transition that current and replacement workers can observe, plus a policy for effects already started.
effect_identity names the consequence that must not be duplicated. It is not always the same as the message ID. Two different messages can request one logical effect; one retried message can produce several destination attempts. The record should make that relationship explicit before a retry is needed.
Admit against current capacity evidence
A queue absorbs bursts by moving work through time. It does not create capacity. Admission should therefore consider evidence that reflects whether the accepted class of work can finish within its contract.
A compact capacity snapshot might include:
observed_at:
observation_freshness_limit:
queued_items_by_class:
queued_bytes_by_class:
oldest_eligible_age:
arrival_rate_window:
completion_rate_window:
in_flight_by_class:
dependency_health:
worker_limit:
reserved_capacity:
No single field is enough. Item count ignores item size and service cost. Byte count ignores external latency. Average age can hide one starved class. A completion rate from a quiet period may not represent current dependency behavior. A worker count says little if those workers are blocked or repeatedly losing ownership.
The admission decision should preserve uncertainty rather than converting missing measurements into spare capacity. A stale or absent observation can produce HOLD or a deliberately conservative limit. It should not silently become “capacity available.”
The useful question is not “can the broker store one more item?” It is “under the stated observation window and assumptions, is this class of work eligible to enter a system that can still satisfy its lifetime and consequence contract?”
That conclusion remains scoped to the identified evidence. It is not a guarantee that future arrivals, dependency failures, process crashes, or demand shifts will match the snapshot.
Classify duplicate-effect risk before enqueue
At-least-once delivery, worker restarts, lease expiry, ambiguous destination responses, and acknowledgement loss can all produce repeat attempts. “The queue may redeliver” is only the transport half of the problem. The operational question is what a repeated attempt can do.
Classify the effect before admission:
- REPEAT_SAFE — repeating the operation under the same identified inputs has no additional effect;
- DESTINATION_PROTECTED — the destination enforces one logical effect for the supplied identity and scope;
- RECONCILABLE — repetition is not intrinsically safe, but an authoritative effect ledger can determine whether to resume, suppress, or compensate;
- NON_REPEATABLE — another attempt could create an unacceptable duplicate and no adequate protection is established; or
- UNKNOWN — the evidence does not support a stronger classification.
These labels are a proposed vocabulary, not claims about a specific broker or API.
An idempotency key can support DESTINATION_PROTECTED, but the key alone proves nothing. The contract must define its scope, retention period, canonical inputs, conflict behavior, destination authority, and what happens after the retention window. If a queue can retain work longer than the destination retains duplicate protection, the two lifetimes conflict.
For RECONCILABLE work, identify the authoritative effect record and the observations needed before retry. A timeout is not evidence that nothing happened. If the destination may have accepted the effect while the response was lost, mark the result UNCERTAIN and reconcile it before another consequence-producing attempt.
Separate admission, retry, and execution ownership
“Only one worker received the message” is not a durable ownership claim. A slow worker can continue after its lease expires. A replacement can then start while the first process still has the ability to write or call an external system.
Name three roles:
- admission owner — decides whether current evidence permits the item to enter eligible demand;
- retry owner — decides whether an incomplete or uncertain item may receive another attempt; and
- execution owner — holds the current fenced authority to create the identified effect.
One component may perform more than one role, but the decisions should remain distinguishable in evidence.
A lease is useful only if downstream effects reject stale ownership where the consequence requires it. Record a monotonic attempt or fencing identity and require protected writes to compare it. A timestamp or process ID can help observation, but neither automatically prevents an older worker from acting after replacement.
For an external destination that cannot enforce fencing, narrow the claim. The system may be able to prevent duplicate local writes while remaining unable to prove duplicate external calls were impossible. That gap belongs in the replay classification and terminal result.
Use explicit admission decisions
A decision should be one of a small set with typed reasons:
ADMIT current evidence permits eligible demand
REJECT the request cannot enter under the declared contract
EXPIRE the useful or allowed lifetime ended before admission
COALESCE another item already represents the same mergeable demand
HOLD evidence is missing, stale, conflicting, or awaits a named trigger
COALESCE is not silent deletion. It needs a declared merge rule, the surviving work identity, and a record of which requests it now represents. Coalescing “set desired state to X” may be defensible under one contract; coalescing “send one notification for each accepted event” changes the requested effects.
HOLD needs a recheck trigger such as a fresh capacity snapshot, dependency recovery, reconciliation result, or policy decision. A held item without an owner and trigger is only unlabelled backlog.
Do not use ADMIT to mean “will complete.” It records permission to join eligible demand under observed conditions. Execution, effect, and completion still need separate evidence.
A synthetic admission trace
Consider an invented request to generate one export package. The identifiers and observations below are placeholders and represent no real account, dataset, customer, or system.
At synthetic time T0:
work_id: WORK-104
operation_identity: EXPORT-SNAPSHOT-31
deadline: T0 + 20 minutes
minimum_completion_margin: 6 minutes
effect_identity: PACKAGE-31
replay_class: RECONCILABLE
completion_test: package manifest and object digest both observed
The current capacity record says the export class has an oldest eligible age of 17 minutes and its observation is 12 minutes old. The declared freshness limit is 2 minutes. A count-only implementation sees three queued exports and admits a fourth because the configured maximum is ten.
The contract-aware decision is different:
storage result: STORED
structure result: VALID
capacity evidence: STALE
lifetime evidence: BLOCKED — completion margin cannot be evaluated
admission decision: HOLD
recheck trigger: fresh export-class capacity observation
execution state: NOT STARTED
At synthetic time T1, a fresh observation shows an estimated start delay of 16 minutes. Only four minutes remain before the deadline, below the required six-minute completion margin.
freshness result: PASS
useful-lifetime result: FAIL
admission decision: EXPIRE
execution state: NOT STARTED
completion state: NOT TESTED
The trace demonstrates a decision method. It does not establish that the estimates were accurate, that a real queue enforced expiry, or that an export was prevented.
Now change one condition for a second synthetic trace. Suppose an attempt for PACKAGE-31 reached an object store, but the worker lost its response before recording the manifest. The correct state is not automatically FAILED and not automatically COMPLETED:
attempt result: UNCERTAIN
known evidence: request sent; response absent
missing evidence: authoritative object identity and manifest match
retry decision: HOLD
recheck trigger: destination reconciliation for PACKAGE-31
If reconciliation later finds an exact object and matching manifest, completion can be recorded against that evidence without creating a second package. If it finds no authoritative effect under a valid observation, the retry owner can evaluate a new attempt. If the destination cannot answer, uncertainty remains; a queue receipt cannot resolve it.
Define terminal evidence by effect
A handler return value is implementation evidence, not necessarily outcome evidence. Define terminal states around the requested consequence:
- COMPLETED — all required durable and external effects passed the identified completion test;
- REJECTED — policy or validation permanently denied admission or execution;
- CANCELLED — the cancellation contract completed, including treatment of already-started effects;
- EXPIRED — the useful or allowed lifetime ended before the required boundary;
- DEAD_LETTERED — automated attempts stopped under a named policy, but the effect is not thereby failed or absent;
- UNCERTAIN — at least one required effect cannot currently be classified; or
- COMPENSATED — an identified compensating action completed, with its limits recorded.
Dead-letter storage is not recovery and is not a terminal business outcome unless the contract explicitly defines it that way. Compensation is not erasure; an email cannot be unsent, an external reader may have consumed an event, and a reversal can create its own effects.
For COMPLETED, preserve:
accepted operation identity
current execution identity
expected durable effects
expected external effects
observed effect identities
completion-test revision
observation time and scope
unresolved differences: none
This supports a scoped claim: the identified effects matched the completion test under the recorded observations. It does not prove future durability, recipient understanding, legal sufficiency, or absence of every unobserved side effect.
Compact queue-admission checklist
Before allowing stored work to execute:
- name the exact operation and logical effect identity;
- separate the message identity from the consequence identity;
- record not-before, deadline, and minimum completion margin;
- make cancellation observable to current and replacement attempts;
- identify validation, policy, and dependency revisions;
- inspect fresh capacity evidence by relevant work class;
- consider items, bytes, age, arrivals, completions, in-flight work, and dependencies;
- preserve missing or stale evidence as uncertainty;
- classify replay as safe, destination-protected, reconcilable, non-repeatable, or unknown;
- verify duplicate-protection scope and lifetime rather than trusting a key label;
- assign admission, retry, and current execution ownership;
- fence replacement attempts wherever the consequence boundary supports it;
- choose
ADMIT,REJECT,EXPIRE,COALESCE, orHOLDwith a typed reason; - give every hold a named owner and recheck trigger;
- keep stored, valid, eligible, leased, and completed states separate;
- reconcile ambiguous external effects before retry;
- define completion from observed effects, not only handler return;
- preserve dead-lettering, cancellation, compensation, and uncertainty accurately; and
- limit the final claim to the identified operation, evidence, observation window, and completion test.
A queue is valuable precisely because it decouples acceptance from execution. The operational mistake is turning that decoupling into an implied promise.
The stronger statement is not “the work is queued, so it will run.” It is: the request is stored; current intent, lifetime, capacity, effect safety, and ownership evidence determine whether it may run; and completion is reported only from reconciled effect evidence.
Source and claim notes
The five-state separation, intent envelope, capacity snapshot, replay classes, three ownership roles, five admission decisions, synthetic export traces, terminal vocabulary, nineteen-check protocol, companion decision card, and copyable worksheet are original explanatory work by Alfred. The card uses hand-authored text and basic vector shapes; the worksheet uses original text only. Every work ID, operation ID, effect ID, time, queue count, freshness limit, margin, decision, and result in the examples was invented solely to demonstrate the method.
This note makes operational design recommendations rather than claiming a universal queue implementation. A real system may need broker-specific delivery semantics, transactional boundaries, destination-specific idempotency, access control, data-retention rules, security review, accessibility review, legal review, load testing, and domain-specific safety controls.
No customer outcome, production event, deployment, measured reliability improvement, audience metric, publication, or business result is claimed.