已关闭
[SESSION-05] Materialize stateless worker context from events and snapshots #24
urandon创建于  8月3日关闭于  28 天前
urandon
urandon成员
8月3日 创建

Parent and architecture

Outcome

Make every worker invocation reconstruct bounded context from canonical events and immutable snapshots instead of relying on a frontend transcript or harness-local session database.

Estimate

  • 8 SP / 5 engineering days
  • Risk: high

Scope

  • Extend worker jobs with session_id, trigger_event_id, optional snapshot version and bounded event range.
  • Load the newest compatible snapshot at or before the trigger sequence, then page and verify subsequent canonical events.
  • Materialize referenced message, tool and attachment payloads into a fresh tenant/run-scoped workspace.
  • Add immutable, content-addressed compressed transcript snapshot support under:
    tenants/<tenant-id>/sessions/<session-id>/snapshots/<version>.jsonl.zst.
  • Persist snapshot manifests, digest, covered event sequence and format version in YDB.
  • Fall back to an earlier snapshot or bounded event replay when a snapshot is missing, corrupt or incompatible.
  • Keep Codex/OpenCode/Claude/Hermes native session IDs as attempt/checkpoint metadata only.
  • Remove context assembly from Telegram-history and context_epoch assumptions.
  • Enforce context byte/event/tool limits before launching a harness.
  • Update worker/context contracts and operational documentation.

Non-goals

  • Semantic summaries or search.
  • Permanent worker filesystem.
  • Harness-specific session restore as the correctness path.
  • Archive/listing HTTP endpoints.

Verification

  • A stateless deterministic worker reproduces the same materialized context from events alone and from snapshot-plus-tail.
  • Corrupt/mismatched snapshots are detected by digest/version and do not silently alter context.
  • Tenant/session mismatches fail before any payload is materialized.
  • Warm worker reuse cannot see a prior session workspace or harness home.
  • Context bounds fail predictably without partial execution.
  • Retry/checkpoint paths retain canonical session/event linkage.

Acceptance criteria

  • Deleting all worker-local state does not remove or corrupt product history.
  • Canonical event replay is the correctness baseline.
  • Snapshot creation and selection are deterministic, immutable and tenant scoped.
  • A harness adapter cannot promote its native session ID to product identity.
  • Context materialization tests include images/files and tool payload references.
likedislike
urandonurandon成员
29 天前 关联了pull request:[SESSION-05] Materialize stateless worker context
urandon
urandon成员
28 天前 评论:

SESSION-05 завершена и вошла в main через MR #31. Merge commit: 25871b3. Реализованы canonical bounded context windows, deterministic JSONL/Zstandard snapshots, snapshot-plus-tail и replay fallback, tenant/session/blob verification, attachments/tool bounds и production snapshot maintenance в reconciler. Проверки: make test, make ydb-integration, make compose-config, make e2e-local, make ci, make terraform-ci.

likedislike
urandonurandon成员
28 天前 关闭了 issue
urandonurandon成员
21 天前 添加了label:mvpsessionworker
urandonurandon成员
21 天前 关联了里程碑:MVP — Core platform (#6)