Skip to content

fix: preserve resource accounting on rejected allocations - #838

Merged
IanFrelinger merged 2 commits into
masterfrom
codex/fix-resource-arithmetic
Oct 23, 2026
Merged

IanFrelinger merged 2 commits into
masterfrom
codex/fix-resource-arithmetic

Conversation

@IanFrelinger

Copy link
Copy Markdown
Owner

Resource preemption could reject an affordable request after deleting another agent’s reservation. With a budget of 100 and 60 reserved, a higher-priority request for 70 needs 30 more; the allocator previously tried to free the full 70. Requests that could not fit all dimensions also removed reservations before failing. Plan victims against the remaining deficits and apply the plan only when every dimension fits.

Reject negative requirements without changing the ledger, reject negative budget maxima at construction, and report finite zero utilization for zero-capacity budgets. Existing null-budget behavior and run-scoped ownership remain intact. Rollback on rejection, invalid-budget rejection, and the zero-utilization convention are explicit integrator policies added by this repair, not prior documented guarantees or owner decisions. Preemption remains reservation bookkeeping and does not stop arbitrary agent code.

Validation:

  • Public API baseline: five expectation mismatches, zero probe errors, including negative capacity inflation and NaN JSON serialization failure.
  • Regression baseline: 14 failures, 1 pass, 0 skips across 15 cases.
  • Candidate validation: 348/348 orchestration tests, all five unchanged probes passed, and all five committed mutations KILLED with exact restoration, clean status and passing rebuilds. Per-case evidence is recorded in scripts/mutations/RESOURCE-ARITHMETIC-EVIDENCE.md.
  • Independent review found no actionable issue in arithmetic bounds, multidimensional atomicity, or scope/duplicate interactions.

@IanFrelinger
IanFrelinger merged commit c0c0287 into master Oct 23, 2026
21 checks passed
@IanFrelinger
IanFrelinger deleted the codex/fix-resource-arithmetic branch October 23, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant