feat(runtime): reconcile ambiguous managed outcomes - #155
Merged
0YHR0 merged 7 commits intoAug 24, 2026
Conversation
0YHR0
marked this pull request as ready for review
August 24, 2026 02:51
0YHR0
deleted the
agent/control-plane-runtime-a4-outcome-reconcile-writer
branch
August 24, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n- add the privileged, evidence-driven managed DIRECT outcome reconciliation writer behind managed_agent_runtime and outcome_reconciliation gates\n- atomically converge RuntimeExecution, Task, Run, latest Attempt, immutable observation evidence, TaskResolution, Outbox, idempotency, and transactional memory capture\n- support SUCCEEDED, FAILED, CANCELED, and TIMED_OUT evidence without provider dispatch; require a persisted cancel intent for business cancellation\n- preserve deadline approval, conservative budget settlement, and released quota without a second settlement\n- normalize malformed Runtime contract input to a bounded HTTP 422 and reject unsafe terminal evidence shapes\n\n## Safety properties\n- strict same-tenant parked Task/Run/Attempt/Runtime quartet and fence validation\n- canonical observation digest and assignment identity binding\n- exact idempotent replay; changed request, conflicting evidence, stale fence, and competing conclusions fail closed\n- no provider call or redispatch in reconciliation\n- compatibility migration 0048 and enum/schema expansion remain in main from #153; this PR adds no migration or enum value\n- writer gate remains disabled by default and the deployed direct-cutover gate is unchanged\n\n## Verification\n- 112 directed unit tests passed locally across task, managed runtime, Runtime domain, reconciliation service, and HTTP routes\n- repository-wide Ruff and git diff --check passed locally\n- CI unit coverage, quality, dependency review, CodeQL, Compose E2E, and the full real PostgreSQL/Redis integration suite all pass\n- PostgreSQL coverage proves atomic success/replay, rollback, competing conclusions, all terminal mappings, persisted cancel intent, deadline/budget/quota preservation, pre-existing evidence, stale fencing, zero redispatch, and clean compatibility-test isolation\n\n## Follow-up\n- #154 tracks applying the same terminal observation invariants to ordinary managed DIRECT finalization\n- reviewed/coordinated authority and production durable reattach remain outside A4.1b.2b\n