Skip to content

v1.1: read-model 实时同步流(post-commit frames) #67

Open

Description

@DoodleBears

Code audit — 2026-10-08

Checked current main 006c0fa3d3cb690b1954338116f053c62620fdb6. Keep open: substantial live transport is delivered, but the complete multi-domain contract below is not.

Delivered baseline:

  • packages/core/src/channels/live.ts owns authenticated /api/botharness/stream Connection Fetch SSE scopes for Channel committed messages/admissions/read state, Activity snapshots and Roster invalidation. This is an existing transport, not the proposed DSH mode: stream remote.
  • packages/client/src/client/channel-live.ts and activity-live.ts consume those scopes, support Channel replay/reconnect and Activity restart baselines, and dispose subscriptions. packages/core/test/channel-live.test.ts, packages/client/test/channel-live.test.ts and activity-live.test.ts cover the delivered contracts.
  • Activity already coalesces under backpressure. Do not duplicate its authority or restart from zero.

Remaining acceptance:

  • Generic committed invalidation coverage for Bot/Human Attention and Assignment Directory, plus cross-domain baseline/cursor/envelope tests.
  • Bounded gap/overflow resync and backpressure across the generic stream; Activity's behavior does not prove Roster/Channel or missing domains meet that contract.
  • Migrate the remaining Inbox periodic refresh only when the generic invalidation path and fallback are verified (human-inbox-view.tsx and human-inbox-scope.ts still use timers).
  • Reconcile the historical mode: stream proposal with the real existing SSE seam before implementation; a transport API substitution alone is not a reason to close or create a second activity source.

Feature ownership — 2026-09-30

Project: https://github.com/orgs/BotHarness/projects/6. Historical umbrella #30 is retired. Existing implementation acceptance and active claims are preserved; this organization change does not claim the feature is complete.

Part of #30.

Goal

用一条 DSH mode: stream remote 向浏览器推送多个 BotHarness read model 的 committed invalidation frames,取代跨 Messaging、Attention、Roster 与 Assignment Directory 的高频 polling。它是 v1.1 的通用传输优化,不是第二套业务 authority。

V1 PersonaBot Activity 的最小实时闭环由 #121 独立交付;#121 不等待本票。本票未来可以复用或收敛该 transport,但不得反向扩大 #121 的依赖。

Scope

  • botharness namespace 提供通用 stream remote;Host 返回 AsyncIterable,Client 从 baseline cursor/revision 开始订阅。
  • 覆盖 PersonaBot roster、Messaging/Attention、Assignment Directory 等多个 committed read models;frames 可只携带 ids/revisions,Client 使用 unary query 补取。
  • 只从 database post-commit notifier 与 DSH Projection commit 后发送,不转发未提交事务或 raw domain payload。
  • abort/disconnect cleanup、cursor reconnect、gap/overflow resync、bounded fallback polling。
  • 背压、鉴权、订阅 scope 与 frame envelope 有独立 contract tests。

Acceptance criteria

  • 多域 baseline、incremental、reconnect 与 gap-resync contract tests。
  • rollback、duplicate 与 out-of-order frames 不制造 UI 假状态。
  • Client disconnect/Plugin disposal 后 Host subscription 无泄漏。
  • stream 不可用时 read models 最终一致,transport failure 不成为业务事实。
  • Bot activity: revisioned live sync and reconnect #121 已有 PersonaBot activity stream 可兼容迁移或复用,不出现两个同时生效的 activity authority。
  • Host/client architecture documentation 同步。

Blocked by

Related

Activity

  1. added this to the v1.1 milestone on Sep 19, 2026
  2. changed the title [-]v1.1: 实时同步流(stream remote:roster 排布 + channel 消息)[/-] [+]v1.1: read-model 实时同步流(post-commit frames)[/+] on Sep 19, 2026
  3. DoodleBears commented on Sep 20, 2026

    @DoodleBears
    ContributorAuthor

    This was generated by AI during triage.

    Triage result: keep this as the v1.1 multi-domain read-model stream under #30. It is no longer a blocker for #121; V1 PersonaBot Activity gets a narrow committed revision stream in #121 without waiting for Messaging or external IM providers.

  4. added
    V1.1Milestone v1.1; mirrors the GitHub milestone
    area:fullstackEnd-to-end Host and Client implementation
    feature:syncMemory sync or read-model synchronization
    scope:foundationFoundational authority, runtime, or infrastructure
    on Sep 22, 2026
  5. DoodleBears commented on Oct 8, 2026

    @DoodleBears
    ContributorAuthor

    Code audit — 2026-10-08

    Checked current main 006c0fa3d3cb690b1954338116f053c62620fdb6. Keep open: substantial live transport is delivered, but the complete multi-domain contract below is not.

    Delivered baseline:

    • packages/core/src/channels/live.ts owns authenticated /api/botharness/stream Connection Fetch SSE scopes for Channel committed messages/admissions/read state, Activity snapshots and Roster invalidation. This is an existing transport, not the proposed DSH mode: stream remote.
    • packages/client/src/client/channel-live.ts and activity-live.ts consume those scopes, support Channel replay/reconnect and Activity restart baselines, and dispose subscriptions. packages/core/test/channel-live.test.ts, packages/client/test/channel-live.test.ts and activity-live.test.ts cover the delivered contracts.
    • Activity already coalesces under backpressure. Do not duplicate its authority or restart from zero.

    Remaining acceptance:

    • Generic committed invalidation coverage for Bot/Human Attention and Assignment Directory, plus cross-domain baseline/cursor/envelope tests.
    • Bounded gap/overflow resync and backpressure across the generic stream; Activity's behavior does not prove Roster/Channel or missing domains meet that contract.
    • Migrate the remaining Inbox periodic refresh only when the generic invalidation path and fallback are verified (human-inbox-view.tsx and human-inbox-scope.ts still use timers).
    • Reconcile the historical mode: stream proposal with the real existing SSE seam before implementation; a transport API substitution alone is not a reason to close or create a second activity source.
  6. removed
    V1.1Milestone v1.1; mirrors the GitHub milestone
    on Oct 24, 2026
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

    area:fullstackEnd-to-end Host and Client implementationenhancementNew feature or requestfeature:syncMemory sync or read-model synchronizationneeds-triageMaintainer needs to evaluate this issuescope:foundationFoundational authority, runtime, or infrastructure

    Type

    No type

    Projects

    • Status
      Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions