Skip to content

[ATT-04] Aggregate attention across connected environments #6

Closed

Description

@jdbencardinop

ID: ATT-04 (F-004). Priority: P0. Blocked by: #5. Backlog: #1.

Scope and reuse

Aggregate current attention in packages/client-runtime, reusing upstream
environment connection ownership and ScopedThreadRef. Do not open competing
connections or merge environments because they host the same repository.

Acceptance criteria

  • Key items by environment plus attention ID and threads by scoped thread ID.
    Identical local IDs on two environments never collide.
  • One bootstrap/cursor/cache per environment. A not-yet-complete snapshot stays
    explicitly loading/partial; the combined badge is not presented as complete.
  • After synchronization, aggregate by blocking/error, warning, time and stable
    tie-breakers. Keep unique actionable-thread count separate from item count:
    two approvals in one thread mean one badge thread and two actionable items.
  • Frontend connection loss marks retained rows stale; it creates no canonical
    failure. Reconnect atomically replaces/updates only that environment.
  • Direct state takes precedence over relay hints. Out-of-order/lower revisions
    cannot resurrect a resolved item. Do not merge a hint lacking matching scoped
    identity into an unrelated direct item.
  • Removing an environment or losing authorization evicts its inaccessible cache.
    One unavailable environment does not discard healthy environments.
  • Tests cover collisions, partial bootstraps, stale caches, reordering, counts,
    filtering, removal and direct/relay disagreement without full thread loads.

Coverage and non-goals

Shared state for web/desktop/mobile; provider-independent canonical events.
All existing connection modes; no coordinator or replacement connection
registry. No UI, synchronized seen state, OS notifications or polling.

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 29, 2026
  3. jdbencardinop commented on Sep 29, 2026

    @jdbencardinop
    Author

    ATT-04 completed locally

    Implemented on phase2/attention-aggregation:

    • Source: ddb58554bd50457be2a54345a413f3524244e834.
    • Complete Foundation attestation: 13fb9f08c3c50621fd8d6cedef604690859180e5.
    • Clean verified tip: c87189e978856b8fd6043f42e296d2cf312cb6cc.

    Behavior and approved decisions

    The shared client-runtime workspace observes the existing environment registry.
    It owns one attention subscription on each enabled environment's existing
    supervisor, never a competing connection or a full-thread hydration.
    Web/desktop and mobile export one lazy shared state instance for later UI use.

    Items are scoped by environment/attention ID; summaries, navigation references
    and unique-thread counts reuse ScopedThreadRef. Canonical repository grouping
    does not combine environment authority. Approval/input/failure share the
    blocking-error tier, followed by disconnect warnings; sorting is oldest-first
    with stable environment/thread/item tie-breakers. Scoped environment/project/
    thread, kind and priority filters use the same item versus thread-count rules.

    Only completed fences publish. Each environment retains its last complete
    snapshot as explicitly stale during disconnection or refresh, while healthy
    environments remain usable. Item/thread totals expose separate live/stale
    counts and remain incomplete until every selected enabled environment is live.
    Transport loss creates no canonical failure item.

    Disable/removal/target replacement cancels and evicts only the affected cache.
    Authorization loss clears inaccessible data and stops retrying. Unsupported
    capability, loading, syncing, stale and protocol errors stay explicit.
    Old-session frames and delayed configuration cannot overwrite replacement
    state. Complete same-session caches may resume; replacement RPC sessions use
    a fresh bootstrap because delivery tokens bind server authentication.

    Recoverable stream resets/unavailability/completion reuse the existing
    3/4/8/16-second capped retry timings on the same socket. Transport failure waits
    for the supervisor. Authorization, identity/protocol and oversized-message
    faults stop until connection/session renewal. No polling or socket retry loop
    was introduced.

    Existing relay rows lack canonical attention IDs/revisions. A separate
    validated advisory selector never creates items or changes counts and
    suppresses hints once a complete direct cache exists, including empty/stale
    caches. Unknown/unscoped hints are rejected. This does not add relay fetching
    or modify upstream mobile Live Activities.

    Evidence and boundaries

    • 90 tests passed across the aggregation, protocol reducer, registry, supervisor
      and RPC helper files. The new aggregation file contains 15 focused cases.
    • Client-runtime, web and mobile typechecks passed; targeted lint passed.
    • All five maintained tpatch roots verify; DAG has zero violations.
    • The Foundation canonical patch remains complete: 71 paths from the real
      7b5f4af3501d89b42b840f875917c09db4f786ce baseline, not just this increment.
    • Internal architecture docs and Foundation request/spec/exploration were updated.
    • No wire/server/provider/dependency-pin changes. Local, bearer, SSH, relay and
      tunnel transports keep existing ownership. Desktop shares the web export.
    • No inbox UI, notifications, seen state, browser/device use, live-state access,
      branch push or PR. The earlier packaged qualification still refers to its
      frozen product SHA, not this new implementation slice.

    #7 is now ready for the web/desktop inbox; #15 is unblocked but remains queued.

    Implemented with GPT-6 Astra through GitHub Copilot CLI; no delegated inference.

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