Skip to content

A child that overspends its reservation is settled down after its artifact exists; the artifact is dropped #1206

Description

@drewstone

Version checked

@tangle-network/agent-runtime 0.219.0 (605374f6), the version discovery-lab installs. Lines below are origin/main at that commit.

Defect

pool.reconcile (src/runtime/supervise/budget.ts:678) commits the child's actual spend to the pool and then throws when it exceeds the reservation. The child settle path calls it at src/runtime/supervise/scope.ts:2778 after the executor has returned its artifact, and rethrows at :2831 / :2842 before :2870 content-addresses and stores artifact.out. The child settles down, infra: true, with no outRef. The pool's totals were already correct before the throw, so the throw changes no accounting; it discards a finished, paid-for result and hands the director a dead child.

This is the executor-side twin of #1164 (driver side: charge a turn, then throw supervisor budget exhausted).

The runtime cannot enforce the cap in flight with this executor: the progress fold at scope.ts:2809 sees usage only when the provider reports it, and the Tangle sandbox executor reports zero until its terminal receipt (see the exhibit; filed separately at the provider).

Measured

Run mech-interp-foundations-astra-b-20260912a (discovery-lab), 2026-09-12, both children runtime: tangle-sandbox, GLM-5.3:

child reservation progress events first non-zero usage execution-result settled
s0 (enumerate:mi-open-problems) { maxIterations: 16, maxTokens: 800000 } 159 over 15m05s, events 0–156 all { input: 0, output: 0 } event 157 at 23:38:02.373Z: { input: 1871225, output: 46902 } 23:38:05.618Z 23:38:08.422Z down, infra: true, budget pool: ticket 0 spent 1918127 tokens > reserved 800000, outRef absent
s3 (Check sheaf-source scope and gauge assumptions) { maxIterations: 10, maxTokens: 70000 } 44 over 4m11s, events 0–41 zero event 42 at 23:31:17.952Z: { input: 566461, output: 26159 } 23:31:20.640Z 23:31:23.588Z down, infra: true, budget pool: ticket 3 spent 592620 tokens > reserved 70000

Journal: pursuits/mech-interp-foundations-astra-b-20260912a/spawn-journal.jsonl in the Lab checkout (retained on request). Cost of the two children is unknown to the meter (usdKnown: false, router-served GLM); the tokens are 2.51M input.

What the settle should do

Keep the artifact. Settle done with the violation on the record (a budgetViolation field, and a journal event), so the director and the ledger see the overspend and the pool's free balance, which is already reduced by the true spend, refuses the next reservation on its own. down with infra: true for a child that completed is the wrong verdict twice: it was not infrastructure, and it did not fail.

When an executor does report usage in flight, the progress fold is the place to abort at the reservation; that is the cap the director asked for.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions