Skip to content

Add durable native-goal output, steering, replay, checklist, and statistics #2008

Closed as not planned

Description

@integry

Context

Part of #2003 and #2002. This consumes normalized events from the selected coding agent's native goal session.

Scope

Persist/replay provider output and status, carry ordered operator messages, project the provider's native plan/checklist, and aggregate basic statistics. Do not synthesize progress from a ProPR-authored issue hierarchy.

Requirements

  • Provider ingress accepts only provider output, assistant/tool, plan/todo, usage, checkpoint, and completion/status events.
  • Lifecycle and message-audit events use a separate trusted internal writer and source namespace.
  • Store bounded terminal chunks with stable provider occurrence identities and monotonic per-goal replay sequence.
  • Deduplicate retries, reject stale/cross-session writes, and validate provider/model attribution against the durable execution attempt from the first usage event.
  • Expose paginated replay and realtime tailing; compact output without losing status/checklist/usage/audit correctness.
  • Store free-form and predefined "what's done?" / "what's left?" messages in one FIFO inbox and send them to the same native session.
  • Claim steering with the provider's next accepted input sequence; acknowledge only after provider acceptance and recover unaccepted claims safely.
  • Provider replies are ordinary output. Project native plan/todo events as the only checklist.
  • Track native goal status, tokens by provider/model, elapsed/active/paused time, message lag, and passively associated issue/PR counts.
  • Authorize every HTTP/socket read and mutation; generation-fence concurrent replay/tail joins and in-flight poll replacement.
  • There is no scheduler/node event vocabulary in goal mode.

Acceptance

  • Restart/reconnect/compaction tests prove ordered gap-free replay from reopened WAL connections.
  • Hostile provider events cannot forge lifecycle, message, GitHub, CI, review, or Ultrafix evidence.
  • Same-lease stale attempts, wrong first usage attribution, FIFO takeover/sequence recovery, socket in-flight replacement, and exactly-page-limit replay are tested.
  • Checklist tests prove all items come from provider plan/todo events.
  • Production composition connects the native runtime adapter to the durable sink/inbox; repository-only mocks are insufficient.

Activity

  1. added
    enhancement
    base-2003-epic-goal-control-plane
    and removed on Aug 31, 2026
  2. integry commented on Aug 31, 2026

    @integry
    OwnerAuthor

    Owner planning constraint carried forward from the #2006 foundation review (do not start until #2006 is merged):

    • Define shared, event-type-specific public payload schemas for the durable event types consumed by realtime/UI projection. Preserve the existing fail-closed/redaction boundary; unknown or invalid fields must not silently become an accidental public contract.
    • Long-running goal detail/output/message reads must be explicitly bounded and keyset-paginated. Do not load every durable event/message into a single response or require the UI to retain an unbounded history. Specify stable cursors, exclusive replay semantics, per-page and total in-memory limits, and tests with large histories plus concurrent append.

    These are acceptance constraints for #2008's event ingestion/query and replay work, not a request to modify the foundation PR.

  3. integry commented on Aug 31, 2026

    @integry
    OwnerAuthor

    Additional owner planning constraints from the latest foundation review (still do not start until #2006 merges):

    • When a newer model request supersedes an unapplied earlier request, project an explicit durable superseded outcome rather than leaving an indefinitely ambiguous applied = 0 row. Preserve ordered audit and idempotent retry semantics.
    • Assemble goal detail/read projections from a transaction-backed SQLite snapshot (or an equivalently documented consistency mechanism) so a response cannot mix goal/version, hierarchy, message, sequence, and statistics from different concurrent lifecycle moments. Add concurrent-write snapshot tests.
  4. integry commented on Aug 31, 2026

    @integry
    OwnerAuthor

    Owner planning addendum — treat these as acceptance criteria when this leaf is launched:

    • Define one closed shared discriminated goal-event registry used by core, API, realtime, and UI, with runtime schema validation, explicit schema/version evolution, and deterministic reject/quarantine behavior for unknown or malformed event kinds. Bind normalized source identity (session, turn, provider sequence/chunk) to the current durable execution/attempt/lease generation so stale providers cannot append.
    • Bound durable/output reads by both event count and serialized bytes. Use opaque filter-bound cursors, define the response for cursors expired by compaction, and make replay-to-live transition race-free with an atomic replay-high-watermark/socket-join handshake. Concurrent appends must produce no loss, duplication, or unbounded scan.
    • Do not return an unbounded message/event collection from goal detail. Omit it or page it separately, and expose asOfVersion/asOfSequence so stats, checklist, messages, lifecycle, and output have an explicit consistency point.
    • Build every authoritative goal-detail projection inside one SQLite read transaction threaded through all subqueries; add a forced concurrent-write test proving no mixed snapshots. Preserve authorization/non-enumeration, restart replay, byte-safe terminal chunks, usage accounting, and the existing normalized runtime seam.
  5. integry commented on Aug 31, 2026

    @integry
    OwnerAuthor

    Additional integration acceptance from the foundation Sol review: every goal list/event/message cursor emitted or accepted here must be canonical, not merely decodable. Require canonical unpadded base64url, the exact emitted version/schema, exact ISO timestamp/sequence spelling, filter/owner/repository binding, and reject alternate encodings or date spellings before lexicographic/database comparison. Add round-trip, forged/non-canonical, cross-filter, cross-owner, and compaction-boundary tests. This folds review suggestion S1 into the durable cursor implementation rather than expanding the isolated foundation patch.

  6. integry commented on Aug 31, 2026

    @integry
    OwnerAuthor

    Owner launch addendum — durable event/message/projection boundary

    Implementation remains blocked on #2006/#2018. Use Codex GPT-5.6 Sol only. #2008 is the single writer for goal events, operator messages, replay/cursors, projections/stats, and realtime delivery. It must not reconcile GitHub or mutate authoritative plan/node/attempt state; #2010 owns those transitions and emits typed events through this leafs port.

    Required contract details:

    • Make the event sequence the canonical total audit order. Message queue order may have its own ordinal, but enqueue/claim/deliver/ack/fail/cancel and the matching audit event must commit atomically with an explicit event sequence.
    • Replace the open predefinedKind string with a closed canned-action enum and persist author identity plus the resolved action. Add delivering, failed, and cancelled message semantics, durable claim/turn/lease generation, retry metadata, sanitized errors, and queued-only cancellation.
    • Delivery is effect-idempotent, keyed by messageId. Reconcile the crash window after provider acceptance but before local delivered/acknowledged commit; do not promise literal at-most-once network execution.
    • Projections/checklists/stats need durable watermarks and deterministic rebuild. Event append plus aggregate update is atomic or replayable; compaction retains a verifiable checkpoint.
    • Normalize usage to deduplicated deltas keyed by provider/model/session/execution/attempt/occurrence. If a provider reports cumulative values, persist its watermark and derive the delta transactionally.
    • Goal detail uses one read snapshot and returns asOfVersion/asOfSequence. Large events/messages/checklists are byte- and count-bounded and cursor-paged rather than embedded without bounds.
    • SQL is the source of truth for realtime: transactional high-watermark, replay-to-join handshake, bounded catch-up/backpressure, permission revalidation, and forced room eviction. Socket emission never acknowledges durability.
    • Preserve the canonical cursor addendum already recorded: unpadded base64url, schema/version, canonical UTC instant, sequence, and exact owner/repository/filter binding; reject alternate encodings and expired compacted cursors.

    Acceptance tests must cover append/projection/publish crash points, provider-accepted message crash recovery, failed/cancelled FIFO behavior, two WAL connections, byte-bounded large histories, compaction cursor expiry, replay/live cutover without gaps or duplicates, and permission loss after room join. Keep migrations and modules independent from #2010 so both serialized merge orders can be validated.

  7. propr-dev commented on Sep 1, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-5.6-sol
    • Branch: 2008/gpt-5.6-sol-add-durable-goal-output-s-20260901-2239-6aj
    • Base Branch: 2003-epic-goal-control-plane
    • Worktree: issue-2008-20260901-2239-gpt-5.6-sol-6aj

    🔍 Track Task Execution

  8. added a commit that references this issue on Sep 1, 2026
  9. changed the title [-]Add durable goal output, steering, realtime replay, and statistics[/-] [+]Add durable native-goal output, steering, replay, checklist, and statistics[/+] on Sep 2, 2026
  10. integry commented on Sep 2, 2026

    @integry
    OwnerAuthor

    Superseded by #2071 and the simplified task-backed native /goal architecture. The unreleased branch is retained only for reference.

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

    AIAI-donebase-2003-epic-goal-control-planeenhancementllm-codex-gpt56-solpropr-planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions