Skip to main content

Catalog

scheduled-loops

Agents woken by schedules instead of a person: a nightly sweep that makes a fresh task from its template every 24 h at 02:00, and a triage loop that wakes on its own clock and works through the backlog until it is empty.

experiments/scheduled-loops-tuning.yaml

The architecture scheduled-loops, optimized by the experiment scheduled-loops-tuning: 108 variants of its marked places, each simulated for 24h with 8 seeds under the behaviour profile coding of the field coding.

Fitness -71.75 → 111.0 (+182.8), as written → optimized. Fitness is the weighted sum of the KPIs the experiment scores.

What the optimization changed​

4 of 4 marked places take another value; the others keep theirs.

marked placeas writtenoptimized
parts.clock.every1h15m
parts.triage.max_parallel18
parts.triage.policyskipparallel
parts.triager.count28

The weighted KPIs that moved, the largest change of the fitness first:

KPIweightas writtenoptimizedfitness
tasks_correct+109.8875.75+658.8
false_completions_shipped−514.1296.12−410
cost_usd−0.05266.31666.3−70.00
backlog_wait_p90_seconds−0.00169448.410808.1+58.64
questions_defaulted−19.3855.38−46
owner_wait_share−2000.0390.082−8.60

The architecture as a whole​

Read from the document alone, before any simulation: its size, autonomy, exposure, weak points and fixed limits. agenticspec sim check reports the same numbers; a marked place counts at its value as built. The KPIs are in the KPI catalogue under the block architecture.

KPIas writtenoptimizedwhat it counts
agents_total39Agent copies: the sum of count over the agent parts.
principals_total11Principal parts.
human_touchpoints22Links that end at a principal and carry a question or a proposal.
autonomy_depth00Links in the longest chain of order and question links from agent to agent.
model_call_paths22Distinct paths of model_call links from an agent part to a model part.
ungated_model_calls00Paths of model_call links from an agent to a model that pass no gateway part.
single_points2 (gateway, model)2Parts whose removal leaves some agent with no model_call path to a model.
border_parts00Parts named in the border, the parts that take input from outside.
egress_targets00Distinct parts and endpoints named in the egress of the sandbox parts.
shared_workspaces00Workspace parts whose sharing is not exclusive.
capacity_ratio0.3751.125Agent copies that claim a pool divided by its capacity, the largest over the pools.

Result​

The full result of scheduled-loops-tuning: objective, landscape, trade-offs, sensitivity, variants and timeline.Open full screen ↗

Contract​

The ports a runtime implements to run this architecture: each port's protocol, the part that uses it with the settings that narrow it, and how many instances run. Derived from the document and the ports of the building blocks; how. The contract file: scheduled-loops.contract.yaml.

portkindblockprotocolpartsettingsinstances
resource.claimOutboundresourceRequestClaim (ExpireWait | GrantClaim (ExpireClaim | KillClaim | ReleaseClaim) | WithdrawClaim)buildscapacity: 8, job_limit: 10m, kind: build_slots1
trigger.scheduleOutboundtriggerEnableSchedule AdvanceSchedule*clockevery: 1h1
gateway.callOutboundgatewayAdmitCall CompleteCallgatewayrate_limit_per_minute: 1201
model.inferenceOutboundmodelStartInference FinishInferencemodelroute: frontier1
trigger.scheduleOutboundtriggerEnableSchedule AdvanceSchedule*nightlyevery: 24h, next_fire_at: 2h1
question.questionPrincipalquestionAsk (Answer | RecordUnreadableAnswer | TakeDefault ReviseAnswer? | Withdraw)ownerkind: human1
trigger.firingOutboundtriggerFireTrigger (RecordFailure | RecordStart (RecordEnd | RecordReplaced) | SkipFiring)sweepkind: on_schedule, max_parallel: 1, policy: skip, schedule: nightly1
harness.sessionOutboundharness(OpenSession | SpawnSubAgent) (CompactContext | NameSession | RecordRestart | RecordTurn | RequestRoute)* EndSessionsweeperharness: coding1
model.inferenceOutboundmodelStartInference FinishInferencesweepernone1
question.questionPrincipalquestionAsk (Answer | RecordUnreadableAnswer | TakeDefault ReviseAnswer? | Withdraw)sweepernone1
resource.claimOutboundresourceRequestClaim (ExpireWait | GrantClaim (ExpireClaim | KillClaim | ReleaseClaim) | WithdrawClaim)sweepernone1
trigger.firingOutboundtriggerFireTrigger (RecordFailure | RecordStart (RecordEnd | RecordReplaced) | SkipFiring)triagekind: on_schedule, max_parallel: 1, policy: skip, schedule: clock1
harness.sessionOutboundharness(OpenSession | SpawnSubAgent) (CompactContext | NameSession | RecordRestart | RecordTurn | RequestRoute)* EndSessiontriagerharness: coding2
model.inferenceOutboundmodelStartInference FinishInferencetriagernone2
question.questionPrincipalquestionAsk (Answer | RecordUnreadableAnswer | TakeDefault ReviseAnswer? | Withdraw)triagernone2
resource.claimOutboundresourceRequestClaim (ExpireWait | GrantClaim (ExpireClaim | KillClaim | ReleaseClaim) | WithdrawClaim)triagernone2

Routing invariants, one per link whose value travels in a port:

  • sweep -> sweeper carries trigger: every trigger.firing@sweep to sweeper
  • triage -> triager carries trigger: every trigger.firing@triage to triager
  • triager -> owner carries question: every question.question@triager to owner
  • sweeper -> owner carries question: every question.question@sweeper to owner
  • sweeper -> gateway carries model_call: every model.inference@sweeper inside gateway.call@gateway
  • triager -> gateway carries model_call: every model.inference@triager inside gateway.call@gateway
  • gateway -> model carries model_call: every gateway.call@gateway to model
  • sweeper -> builds carries claim: every resource.claim@sweeper to builds
  • triager -> builds carries claim: every resource.claim@triager to builds

Border: none.

Ingresses: who reaches the architecture from outside, what each audience may use, and over which protocols.

ingressaudienceauthenticatedexportscommandsviewsfeedsmetrics
metricscontrol.monitornometrics_scrape0009
operatorcontrol.operatoryeshttp, event_stream, ui, tool829730
  • metrics: cache_bust_count, cache_hit_share, context_size_p90_tokens, cost_usd, human_prompt_share, owner_wait_share, priced_message_share, sub_agents_started, subagent_cost_share
  • operator: agentic.gateway.DetachUpstream, agentic.gateway.DrainGateway, agentic.gateway.StopGateway, agentic.question.Answer, agentic.trigger.DisableSchedule, agentic.trigger.DisableTrigger, agentic.trigger.EnableTrigger, agentic.trigger.PassScheduleChecks

Download​

  • Architecture as writtenscheduled-loops.yamlthe parts, links and policies, with the marked places at their values as written
  • Contractscheduled-loops.contract.yamlthe ports a runtime implements to run the architecture as written, with their protocols, settings, instances and routing invariants
  • Optimized architecturescheduled-loops.best.yamlevery marked place at the value of the best variant; its vary ranges are kept, so it can be searched again
  • Experimentscheduled-loops-tuning.yamlseeds, horizon, faults, the search and its weights; it names the two files beside it
  • Behaviour profilecoding.yamlhow long turns, builds and answers take, and what model calls cost
  • Resultresult.jsonevery variant with its KPIs, the best one and the timeline, as the result page draws it

Run it​

Put the downloaded files in one directory and run the experiment with agenticspec sim. agenticspec is the binary of every release; a checkout of the repository builds it with cargo build --release -p agenticspec. The same seeds give the same result.json.

agenticspec sim run scheduled-loops-tuning.yaml --out out/

agenticspec sim check scheduled-loops.best.yaml accepts the optimized architecture. To search on from it, set architecture: scheduled-loops.best.yaml in the experiment; its fitness as written is then the best fitness above.

In a checkout, the same run is agenticspec sim run experiments/scheduled-loops-tuning.yaml --out out/.

With --events, the run also writes out/events.jsonl: the run of the result's timeline as an event log, one line per building-block event (agentic.work.TaskCreated, agentic.resource.ClaimQueued, ...) with its sequence number, time, part, copy and subject key (task-3). The same seed writes the same lines, and result.json does not change.

It also writes out/replay.json, and out/index.html plays it back over the graph: the baseline and the best variant at every seed, each part's waiting and busy items and its spend over simulated time, and the links that carry an item at the time shown. Play, pause, a speed, a scrubber and a choice of run and seed move it; open the page from the directory, it needs no server.

With --live, the run streams to that page while it runs: the first line it prints is the address, agenticspec sim: live on http://127.0.0.1:<port>/, on this machine only. The baseline at the first seed is streamed before the search and the shown run after it, paced in simulated time (--pace, simulated seconds per second, 60 by default), each event as events.jsonl writes it, and the graph moves as the events arrive; the scrubber ends at the last one. When both are sent the command ends once the last page closes its connection, or after --linger seconds (0 by default) when none is open. The files it writes are the same bytes.

Deploy​

Later. An entry runs in the simulator today; the agent runtime and the compute that implement the building blocks come later, and with them a way to deploy an entry.