Architecture
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. Scheduled agent loops went from 2.2 to about 35 merged pull requests per day (2610.36254). The simulator fires each schedule every `every` from `next_fire_at` and applies the trigger's policy: skip drops a firing while a run is going, queue holds it until a run ends, parallel overlaps up to `max_parallel` runs and refuses the rest. A run that finds nothing to take costs one model call. Tasks wait in the backlog between two ticks. The simulator does not model cron expressions or time zones (only a fixed interval), the restriction checks a schedule passes before it is enabled, nor what a sweep finds: a sweep is one task of the coding role, and triage does the tasks rather than sorting them.
Search result
A short run of the experiment scheduled-loops-tuning tried 108 variants of the marked places. Its fitness, the weighted sum of KPIs the experiment scores, is -25.249 as built and 164.1 for the best variant. How the run was made: Optimization.
Marked places
A marked place carries vary: the value as built and the values a search may try there. The best value is that of the best variant.
| place | as built | best value | the search may try |
|---|---|---|---|
parts.clock.every | 1h | 30m | 15m, 30m, 1h, 2h |
parts.triage.max_parallel | 1 | 8 | 1, 4, 8 |
parts.triage.policy | skip | parallel | skip, queue, parallel |
parts.triager.count | 2 | 8 | 2, 4, 8 |
More columns: swipe horizontally, or focus the table and use the arrow keys.
KPIs that moved
35 of 102 KPIs differ between the architecture as built and its best variant; the others are equal. A weight is what the experiment scores a KPI by: above 0 more is better, below 0 less is better.
| KPI | weight | as built | best variant | change |
|---|---|---|---|---|
false_completions_shipped | −5 | 10.500 | 89 | +747.6 %, worse |
backlog_wait_p90_seconds | −0.001 | 69457.1 | 12024.0 | −82.7 %, better |
cost_usd | −0.05 | 255.4 | 1641.2 | +542.5 %, worse |
owner_wait_share | −200 | 0.045 | 0.067 | +48.1 %, worse |
questions_defaulted | −1 | 11.500 | 43.500 | +278.3 %, worse |
tasks_correct | +10 | 13 | 76 | +484.6 %, better |
firing_failure_share | – | 0.667 | 0.875 | +31.3 % |
agents_total | – | 3 | 9 | +200.0 % |
task_completion | – | 0.114 | 0.803 | +601.7 % |
agent_time_cost_usd | – | 72 | 216 | +200.0 % |
backlog_wait_p50_seconds | – | 37371.4 | 5484.3 | −85.3 % |
capacity_ratio | – | 0.375 | 1.125 | +200.0 % |
cost_per_task_usd | – | 10.881 | 9.949 | −8.6 % |
firing_skip_share | – | 0.880 | 0.694 | −21.2 % |
firings | – | 25 | 49 | +96.0 % |
firings_empty | – | 1 | 2 | +100.0 % |
firings_skipped | – | 22 | 34 | +54.5 % |
firings_started | – | 3 | 15 | +400.0 % |
jobs | – | 87.500 | 638.5 | +629.7 % |
jobs_killed | – | 5.500 | 38.500 | +600.0 % |
pool_utilization | – | 0.020 | 0.143 | +606.6 % |
questions_asked | – | 15.500 | 90 | +480.6 % |
rework_turns | – | 762 | 6205 | +714.3 % |
steps | – | 238 | 1890.5 | +694.3 % |
steps_failed | – | 134 | 1145 | +754.5 % |
tasks_claimed_done | – | 23.500 | 165 | +602.1 % |
tasks_done | – | 23.500 | 165 | +602.1 % |
tasks_started | – | 24.500 | 173 | +606.1 % |
tokens_cache_read | – | 137580000 | 1068930000 | +677.0 % |
tokens_cache_write | – | 9172000 | 71262000 | +677.0 % |
tokens_input | – | 4586000 | 35631000 | +677.0 % |
tokens_output | – | 1375800 | 10689300 | +677.0 % |
turns | – | 2292 | 17813.5 | +677.2 % |
worker_busy_share | – | 0.289 | 0.725 | +151.4 % |
wrong_assumptions | – | 4.500 | 15.500 | +244.4 % |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Graph
Check
accepted 10 parts and 10 links; the structural check refuses nothing.
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.
| KPI | value | what it counts |
|---|---|---|
agents_total | 3 | Agent copies: the sum of count over the agent parts. |
principals_total | 1 | Principal parts. |
human_touchpoints | 2 | Links that end at a principal and carry a question or a proposal. |
autonomy_depth | 0 | Links in the longest chain of order and question links from agent to agent. |
model_call_paths | 2 | Distinct paths of model_call links from an agent part to a model part. |
ungated_model_calls | 0 | Paths of model_call links from an agent to a model that pass no gateway part. |
single_points | 2 (gateway, model) | Parts whose removal leaves some agent with no model_call path to a model. |
border_parts | 0 | Parts named in the border, the parts that take input from outside. |
egress_targets | 0 | Distinct parts and endpoints named in the egress of the sandbox parts. |
shared_workspaces | 0 | Workspace parts whose sharing is not exclusive. |
capacity_ratio | 0.375 | Agent copies that claim a pool divided by its capacity, the largest over the pools. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
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.
| port | kind | block | protocol | part | settings | instances |
|---|---|---|---|---|---|---|
resource.claim | Outbound | resource | Request | builds | capacity: 8, job_, kind: build_ | 1 |
trigger.schedule | Outbound | trigger | Enable | clock | every: 1h | 1 |
gateway.call | Outbound | gateway | Admit | gateway | rate_ | 1 |
model.inference | Outbound | model | Start | model | route: frontier | 1 |
trigger.schedule | Outbound | trigger | Enable | nightly | every: 24h, next_ | 1 |
question.question | Principal | question | Ask (Answer | Record | owner | kind: human | 1 |
trigger.firing | Outbound | trigger | Fire | sweep | kind: on_, max_, policy: skip, schedule: nightly | 1 |
harness.session | Outbound | harness | (Open | sweeper | harness: coding | 1 |
model.inference | Outbound | model | Start | sweeper | none | 1 |
question.question | Principal | question | Ask (Answer | Record | sweeper | none | 1 |
resource.claim | Outbound | resource | Request | sweeper | none | 1 |
trigger.firing | Outbound | trigger | Fire | triage | kind: on_, max_, policy: skip, schedule: clock | 1 |
harness.session | Outbound | harness | (Open | triager | harness: coding | 2 |
model.inference | Outbound | model | Start | triager | none | 2 |
question.question | Principal | question | Ask (Answer | Record | triager | none | 2 |
resource.claim | Outbound | resource | Request | triager | none | 2 |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Routing invariants, one per link whose value travels in a port:
sweep -> sweeper carries trigger:every trigger.firing@sweep to sweepertriage -> triager carries trigger:every trigger.firing@triage to triagertriager -> owner carries question:every question.question@triager to ownersweeper -> owner carries question:every question.question@sweeper to ownersweeper -> gateway carries model_call:every model.inference@sweeper inside gateway.call@gatewaytriager -> gateway carries model_call:every model.inference@triager inside gateway.call@gatewaygateway -> model carries model_call:every gateway.call@gateway to modelsweeper -> builds carries claim:every resource.claim@sweeper to buildstriager -> 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.
| ingress | audience | authenticated | exports | commands | views | feeds | metrics |
|---|---|---|---|---|---|---|---|
| metrics | control. | no | metrics_ | 0 | 0 | 0 | 9 |
| operator | control. | yes | http, event_, ui, tool | 8 | 29 | 73 | 0 |
More columns: swipe horizontally, or focus the table and use the arrow keys.
- 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
Parts
| part | block | settings |
|---|---|---|
owner | principal | kind human |
gateway | gateway | rate_limit_per_minute 120 |
model | model | route frontier |
sweeper | agent | harness coding |
triager | agent | count 2 marked: 2, 4, 8; harness coding |
sweep | trigger | kind on_schedule; max_parallel 1; policy skip; schedule nightly; task_template nightly-sweep |
triage | trigger | kind on_schedule; max_parallel 1 marked: 1, 4, 8; policy skip marked: skip, queue, parallel; schedule clock; takes all |
builds | pool | capacity 8; job_limit 10m; kind build_slots |
clock | schedule | every 1h marked: 15m, 30m, 1h, 2h |
nightly | schedule | every 24h; next_fire_at 2h |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Links
No link, no reach: a part reaches only what a link names.
- owner sends
promptto triager. - sweep sends
triggerto sweeper. - triage sends
triggerto triager. - triager sends
questionto owner. - sweeper sends
questionto owner. - sweeper sends
model_callto gateway. - triager sends
model_callto gateway. - gateway sends
model_callto model. - sweeper sends
claimto builds. - triager sends
claimto builds.
Policies
| policy | value |
|---|---|
question_default_after | 15m |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Optimization
The experiment scheduled-loops-tuning searches the marked places of this architecture under a behaviour profile. The figures on this page come from a short run of it: 24 evaluations of 2 seeds each. The experiment file asks for more; agenticspec sim run experiments/scheduled-loops-tuning.yaml runs it in full.
Every KPI of the architecture as built and of its best variant:
| KPI | kind | as built | best variant |
|---|---|---|---|
acts_for_not_principal | correctness | 0 | 0 |
acts_for_without_part | correctness | 0 | 0 |
agent_time_cost_usd | quality | 72 | 216 |
agent_without_model_path | correctness | 0 | 0 |
agents_total | completeness | 3 | 9 |
as_not_principal | correctness | 0 | 0 |
autonomy_depth | quality | 0 | 0 |
backlog_wait_p50_seconds | quality | 37371.4 | 5484.3 |
backlog_wait_p90_seconds | quality | 69457.1 | 12024.0 |
border_parts | quality | 0 | 0 |
border_without_part | correctness | 0 | 0 |
bus_reach_not_event | correctness | 0 | 0 |
capacity_ratio | quality | 0.375 | 1.125 |
claim_conflicts | quality | 0 | 0 |
coordination_calls | quality | 0 | 0 |
coordination_messages | quality | 0 | 0 |
cost_per_task_usd | quality | 10.881 | 9.949 |
cost_usd | quality | 255.4 | 1641.2 |
decision_kind_unknown | correctness | 0 | 0 |
duplicate_runs | quality | 0 | 0 |
egress_targets | quality | 0 | 0 |
egress_without_part | correctness | 0 | 0 |
empty_architecture | correctness | 0 | 0 |
endpoint_invalid | correctness | 0 | 0 |
external_store_not_in_egress | correctness | 0 | 0 |
false_completions_shipped | correctness | 10.500 | 89 |
firing_failure_share | correctness | 0.667 | 0.875 |
firing_skip_share | quality | 0.880 | 0.694 |
firing_start_wait_p90_seconds | quality | 0 | 0 |
firings | quality | 25 | 49 |
firings_empty | quality | 1 | 2 |
firings_queued | quality | 0 | 0 |
firings_skipped | quality | 22 | 34 |
firings_started | quality | 3 | 15 |
gateway_without_model | correctness | 0 | 0 |
human_touchpoints | quality | 2 | 2 |
invalid_concurrency | correctness | 0 | 0 |
invalid_schedule | correctness | 0 | 0 |
jobs | quality | 87.500 | 638.5 |
jobs_killed | quality | 5.500 | 38.500 |
link_exists | correctness | 0 | 0 |
link_grant_invalid | correctness | 0 | 0 |
merge_conflicts | quality | 0 | 0 |
model_call_paths | completeness | 2 | 2 |
module_link_cycles | correctness | 0 | 0 |
not_a_channel | correctness | 0 | 0 |
not_reached_by_principal | correctness | 0 | 0 |
operator_decided_owner_questions | quality | 0 | 0 |
operator_wait_share | quality | 0 | 0 |
owner_wait_share | quality | 0.045 | 0.067 |
per_without_part | correctness | 0 | 0 |
pool_utilization | quality | 0.020 | 0.143 |
posts | quality | 0 | 0 |
principals_total | completeness | 1 | 1 |
question_without_answerer | correctness | 0 | 0 |
questions_asked | quality | 15.500 | 90 |
questions_defaulted | quality | 11.500 | 43.500 |
questions_forwarded | quality | 0 | 0 |
queue_wait_p50_seconds | quality | 0 | 0 |
queue_wait_p90_seconds | quality | 0 | 0 |
rate_limited_seconds | quality | 0 | 0 |
review_calls | quality | 0 | 0 |
review_without_reviewer | correctness | 0 | 0 |
reviews | quality | 0 | 0 |
reviews_rejected | quality | 0 | 0 |
rework_turns | quality | 762 | 6205 |
self_reference | correctness | 0 | 0 |
semantic_store_without_model | correctness | 0 | 0 |
setting_invalid | correctness | 0 | 0 |
setting_unknown | correctness | 0 | 0 |
shared_workspaces | quality | 0 | 0 |
single_points | quality | 2 | 2 |
slot_wait_share | quality | 0 | 0 |
steps | quality | 238 | 1890.5 |
steps_failed | quality | 134 | 1145 |
store_reach_not_record_or_read | correctness | 0 | 0 |
swarm_needs_agent | correctness | 0 | 0 |
task_completion | completeness | 0.114 | 0.803 |
tasks_arrived | quality | 206 | 206 |
tasks_claimed_done | quality | 23.500 | 165 |
tasks_correct | quality | 13 | 76 |
tasks_done | quality | 23.500 | 165 |
tasks_started | quality | 24.500 | 173 |
tokens_cache_read | quality | 137580000 | 1068930000 |
tokens_cache_write | quality | 9172000 | 71262000 |
tokens_input | quality | 4586000 | 35631000 |
tokens_output | quality | 1375800 | 10689300 |
trigger_source_not_trigger | correctness | 0 | 0 |
trigger_target_not_agent | correctness | 0 | 0 |
trigger_without_source | correctness | 0 | 0 |
turns | quality | 2292 | 17813.5 |
under_not_authority | correctness | 0 | 0 |
ungated_model_calls | quality | 0 | 0 |
ungoverned_tool_call | correctness | 0 | 0 |
unknown_blocks | correctness | 0 | 0 |
unknown_carries | correctness | 0 | 0 |
unknown_link_parts | correctness | 0 | 0 |
unreachable_parts | correctness | 0 | 0 |
via_not_in_egress | correctness | 0 | 0 |
via_without_endpoint | correctness | 0 | 0 |
worker_busy_share | quality | 0.289 | 0.725 |
wrong_assumptions | quality | 4.500 | 15.500 |
More columns: swipe horizontally, or focus the table and use the arrow keys.