Interactive engineering lab

Agent Work Set: Admission, Completion and the Seal Barrier

Agent Work Set: Admission, Completion and the Seal Barrier. Compare empty-queue, quiet-period and sealed-barrier completion for a planner that keeps adding subtasks.

By Sandeep Belgavi · Published 2026-11-16

Synthetic fixtures computed locally. No model, encoder, orchestrator or production service is contacted.

Experiment workspace

Decision trace

    The question this experiment answers

    Tanishka's returns-report agent at Belgavi's Book Store has a planner that admits subtasks in rounds while earlier subtasks are still running, and a subtask may spawn a follow-up child. When is the run complete? This lab replays one run with seeded synthetic durations under three completion rules: complete as soon as nothing is outstanding (empty queue), complete after nothing has been outstanding for a quiet period, and complete when the planner has sealed the work set and nothing is outstanding (sealed barrier). It shows when each rule declares completion and how many subtasks finish after that declaration.

    Change one assumption at a time

    Start from empty_queue_slow_planner: four rounds of three subtasks, 1,500 ms of planner thinking between rounds, subtasks of 200 to 800 ms. The run is declared complete at 652 ms, when the first round has finished, while nine subtasks have not even been admitted. Lower the planner pause to 100 ms and the same rule happens to work. Switch the rule to quiet_period and raise the quiet period until it is correct, then read how long it waits after the last subtask. Switch to sealed_barrier. Then set a child spawn percentage and change the child admission order to after_finish to see the one way the barrier can still be broken. Finally turn on a late planner admission to see it refused after the seal.

    Expected outcomes

    With seed 16: empty_queue_slow_planner declares at 652 ms, the last subtask finishes at 5,261 ms, 9 subtasks after the declaration. empty_queue_fast_planner declares at 1,061 ms with nothing after it. quiet_period_short (500 ms) declares at 1,152 ms with 9 after. quiet_period_long (2,000 ms) declares at 7,261 ms, correct but 2,000 ms after the last subtask. sealed_barrier declares at 5,261 ms exactly. sealed_children_before_finish admits 18 children and declares at 7,181 ms exactly. sealed_children_after_finish declares at 5,892 ms with 3 subtasks after. sealed_late_admission refuses 1 admission and stays exact. empty_queue_late_admission declares at 1,061 ms and a late subtask finishes at 2,664 ms.

    Reading the decision trace

    The first line restates the setup. Each later line is one event in time order: a subtask admitted (with its synthetic duration), a subtask finished, the planner sealing the work set, a quiet-period check being scheduled, a refused admission, or the line RUN DECLARED COMPLETE. The number after each event is how many subtasks were outstanding just after it. A declaration line followed by admissions or finishes is a premature completion. The last line summarises the verdict. Use Next step to walk through the events, Show all to see every line, or the slider to jump.

    What this teaches

    Knowing that no more work will arrive is a different fact from seeing no outstanding work now. Only the planner knows the first, so it must say so explicitly with a seal, and admission must be counted before work is handed out, including children admitted by a running subtask before it reports done. Quiet periods trade a timing guess for latency and are wrong whenever the planner pauses longer than the guess. The companion article covers a runtime with admit, done, seal and wait, and the migration steps for an existing orchestrator.

    Limits of this model

    One planner and one process: admission and completion are atomic steps in a single event order. Crashes, lost done messages, retries and clock skew are not modelled; a durable counter with leases provides the same rule there. Durations are synthetic draws from a seeded generator, not measurements of any model or service. The trace shows at most 60 events. The same rules run in the companion Python example, and a site test checks that both give identical results.

    Views are my own and do not represent any employer, past or present.