Skip to content

[ATT-02] Project thread awareness and lifecycle failures #4

Closed

Description

@jdbencardinop

ID: ATT-02 (F-002). Priority: P0. Dependency: #3 (complete). Backlog: #1.

Implemented locally on phase2/thread-awareness: source
21de9d720132e7f62051f26a52162a61593cd08f, complete Foundation attestation
ddd548eeee6c49e30afd4596a75369d079f73515, clean verified tip
d701ac195d8f7eb35f750e47747bebc073dac545. No push or PR.

The existing Foundation root carries optional bounded lifecycle evidence,
fork migration 47, static failure/disconnect items and saturated summary counts.
Matching turn recovery/completion, intentional stop, revert/delete, late
events and message-mode question preservation are explicit in the source and
the result comment. Legacy/turnless observations without authority stay unknown.
No RPC, client UI or notification delivery is included.

Problem and scope

An approval-only view cannot distinguish running, successful completion,
failure and provider disconnection. Extend the current projection with thread
awareness and authoritative failure/disconnect items, using upstream lifecycle
and awareness events rather than prompt classification.

Decisions and acceptance criteria

  • Thread phase covers starting/running/waiting-for-approval/waiting-for-input/
    completed/failed/stale. Use bounded counts, not an unbounded array of attention
    IDs, in the thread summary. Detail queries enumerate the actual items.
  • Completion is awareness, not a new unresolved request. It resolves only
    obsolete request/disconnect items for the completed turn.
  • A failed turn opens a failure item; matching authoritative retry/recovery
    resolves it. Seen/dismissed state and unrelated turns never silently resolve
    another active failure. Define each resolving transition in a table.
  • Only an environment-observed provider/runtime disconnect during active work
    opens canonical disconnect attention. Losing a frontend WebSocket merely
    makes that client's cached state stale.
  • Reconnect resolves a canonical disconnect only when provider/runtime evidence
    establishes recovery; lack of an update is not completion.
  • Reason codes and static/redacted titles are bounded. No prompt-derived truth,
    raw errors or commands in awareness payloads.
  • Tests cover completion, retry, response failure, late/out-of-order events,
    actual provider loss, client-only network loss, replay and rebuild.

Coverage and non-goals

Map signals explicitly for Codex, Claude, Cursor, Grok, OpenCode, Antigravity and Copilot.
Keep unsupported observations unknown and reuse current upstream mappings.
All clients and connection modes consume the same environment authority.

No inbox, notification sink, generic polling monitor or relay-owned resolution.

Activity

  1. added
    fork-backlogMaintainer backlog for the multi-machine fork
    status:blockedRelease or dependency gate remains; no implementation yet
    priority:P0Stable reconciliation and attention core
    on Sep 14, 2026
  2. added
    status:readyScope ready and all implementation gates satisfied
    status:in-progressActively implementing the scoped issue
    and removed
    status:blockedRelease or dependency gate remains; no implementation yet
    status:readyScope ready and all implementation gates satisfied
    on Sep 27, 2026
  3. jdbencardinop commented on Sep 28, 2026

    @jdbencardinop
    Author

    ATT-02 implemented locally

    • Branch: phase2/thread-awareness
    • Source landing: 21de9d720132e7f62051f26a52162a61593cd08f
    • Complete Foundation attestation: ddd548eeee6c49e30afd4596a75369d079f73515
    • Clean verified tip: d701ac195d8f7eb35f750e47747bebc073dac545
    • Base: ATT-01 at 6cc650d507d3ff80e23919d687fbc2920497da5f

    The existing phase1-foundation root retains the complete 48-path intent,
    including earlier audit, TWS, work-item contracts, migration bridge and current
    request state. No second overlapping maintenance root was added.

    Delivered

    Accepted provider lifecycle evidence now travels through the existing
    server-only session-set command and durable event. It preserves provider
    event/instance identity and the originating turn before the ordinary session
    snapshot clears that turn. The evidence contains bounded transitions/reasons,
    not raw errors, commands or prompts.

    The current projector now maintains static failure/disconnect items and
    thread-awareness summaries. Summary counts are capped at 999 per kind
    with an overflow flag; detail reads remain independently paginated. The
    queries inspect at most 1000 open rows per kind instead of enumerating
    unbounded attention-ID arrays. Summary revisions change only when visible
    summary values change.

    Approved resolving transitions

    Observation Result
    Starting/running evidence Update phase when consistent with current turn scope
    Matching same-provider/same-turn running recovery Resolve failure/disconnect as provider_recovered
    Matching turn completion Resolve that turn's obsolete callback requests and failure/disconnect; create no completion item
    Matching failed turn/runtime error Close obsolete callbacks and open/update a static failure item
    Provider exit or transport loss during an attributed running turn Open disconnect and mark stale
    Explicit stop/interruption followed by provider exit Do not create disconnect; close matching callbacks/disconnect without inventing successful completion
    Ready or reconnect without attributable running evidence Do not resolve an item
    Unrelated turn, client seen/ack or frontend-only network loss Do not resolve another turn's failure/disconnect
    Revert, delete, recreation Revert resolves open items; delete purges derived state; recreation starts a new incarnation

    Message-mode questions intentionally outlive a native turn. They remain
    actionable until canonical answer/dismissal or explicit revert/delete, unlike
    obsolete callback requests. This preserves upstream's async-question behavior.

    Provider observations are deduplicated transactionally even when separately
    persisted events repeat the same originating provider event. Late pre-recovery
    timestamps and historical terminal-turn reopens are ignored. Legacy events
    without explicit evidence, and observations without enough turn identity,
    remain unknown rather than treating generic ready as success or stopped
    as disconnection.

    Coverage and migration

    Codex, Claude, Cursor, Grok, OpenCode, Antigravity and Copilot reuse the same
    canonical ingestion boundary. Their existing normalized turn/session/error
    signals are mapped explicitly; absent capabilities produce no fabricated
    observation. Adapter implementations and existing relay/client awareness
    behavior were not replaced. The shared phase type is reused.

    Fork migration 47 adds lifecycle rows, summaries, turn tombstones and
    compact provider-observation identities, plus the private callback-resolution
    policy. It resets only derived current attention and its cursor, then normal
    bootstrap replays persisted events. The immutable audit, original migrations
    44/45/46, other cursors and original migration history remain intact.
    Failure during upgrade rolls schema changes and reset back together.

    258 focused tests passed across nine files, including:

    • the real ingestion -> decider -> persisted projection path with worker drains;
    • all seven normalized provider mappings and client-command rejection;
    • completion, retries, response failure, delayed/duplicate observations,
      provider loss versus client-only network events and intentional stop;
    • callback versus message-mode input, saturated counts and bounded details;
    • deletion/recreation, deterministic rebuild, file-backed reopen/recovery;
    • ATT-01 upgrade rollback/retry and existing engine/pipeline regressions.

    Server/contracts/shared typechecks, changed-source lint and the server bundle
    passed. All five maintained tpatch roots verify; the DAG has zero violations.

    Boundaries

    No RPC/subscription, inbox UI, notification sink, generic polling monitor,
    relay-owned state, native model inference or live-state migration was added.
    The tests do not claim a new packaged-platform or live-provider qualification.
    The previously qualified stable source and Windows handoff are untouched.
    No push or PR was created.

    ATT-03 / #5 is next: bounded snapshot/delta synchronization with its own client
    delivery cursors, continuity fence and reset rules. It is now unblocked by #3
    and #4.

    Model/harness: GPT-6 Astra (gpt-6-astra), GitHub Copilot CLI. No subagents or
    tpatch provider inference were used.

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

    fork-backlogMaintainer backlog for the multi-machine forkpriority:P0Stable reconciliation and attention core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions