Skip to content

[P0] Enforce terminal observation invariants in managed DIRECT finalization #154

Description

@0YHR0

A4.1b.1 ordinary managed DIRECT finalization currently treats SUCCEEDED observations as business success when output is a mapping and usage is empty, but it does not reject a simultaneous Runtime error, governed_action_requests, or wait_refs. Non-success terminal observations can also carry non-empty usage that is silently ignored while budget is settled with the existing empty usage path. This leaves the live finalization path weaker than the A4.1b.2 reconciliation writer.\n\nRequired follow-up:\n- Define one shared terminal-result validator for ordinary managed finalization and reconciliation.\n- Reject terminal observations that retain governed action or wait requests.\n- Reject SUCCEEDED plus error.\n- Fail closed on non-empty usage until trusted usage/pricing lineage and actual settlement are implemented.\n- Preserve OUTCOME_UNKNOWN/LOST parking semantics and do not turn contract rejection into redispatch.\n- Add unit and real PostgreSQL atomicity tests for all rejected shapes, including proof that Task/Run/Attempt/Runtime evidence/inbox/budget/quota remain consistent.\n\nThis is intentionally separate from the A4.1b.2 writer PR so its provider dispatch and retry semantics can receive focused review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions