Skip to content

[research] Session-cluster / work-thread concept — group conversations on same task #313

Closed

Description

@Sinity

Problem

Conversation-level indexing is not the same as task-level user work.
Coding-agent workflows routinely fork one task across multiple conversations,
so the archive's unit of storage is finer-grained than the user's unit of
thinking.

Polylogue already has a durable work_threads session product, but the current
first version is too implicit: it groups explicit continuation trees and exposes
counts, repos, and timing, yet does not make membership reasoning auditable as a
first-class contract. Users can see that sessions are grouped, but not clearly
why each member belongs or how conservative the grouping was.

Strengthened scope

This issue should complete the first executable work-thread substrate by making
cluster membership explainable, typed, and inspectable in the durable product
payload.

Required outcomes:

  • keep the first implementation conservative: explicit parent/continuation
    lineage remains the only grouping authority for this issue
  • add per-member membership evidence so every session in a thread carries a
    reason such as root, parent_continuation, shared root id, depth, and
    supporting signals
  • add thread-level support metadata: support level, support signals, and a
    confidence value derived from deterministic evidence rather than embeddings
  • expose that metadata through the existing durable product, CLI JSON output,
    facade product methods, and MCP product surfaces by extending the shared
    product payload rather than adding a parallel report
  • keep room for later signals (time proximity, repo/file overlap, semantic
    similarity, explicit markers), but do not silently activate them without
    their own issue and evidence trail

Design requirements

  • Clustering must be explainable. A user should be able to see why two
    conversations were grouped.
  • The first implementation should prefer conservative, high-signal grouping over
    aggressive fuzzy magic.
  • The design must align with session products, wallclock-time semantics, and
    tail-ahead-of-archive query behavior.
  • Avoid turning this into a hidden embedding-only system with no durable
    reasoning trail.
  • The raw archive remains unchanged; work-thread evidence is a derived product
    payload.

Acceptance criteria

  • Durable work_threads payloads include per-member evidence for root and child
    sessions.
  • Thread payloads include deterministic support level/signals/confidence.
  • Users can inspect that evidence through polylogue products threads --json
    and the existing facade/MCP product contract.
  • Tests cover obvious same-task continuation forks and obvious non-matches.
  • Tests verify that public product JSON includes the membership evidence rather
    than only aggregate counts.

Deferred by design

Later issues may add additional grouping authorities such as time proximity,
repo/file overlap, explicit task markers, or semantic similarity. Those should
arrive with visible evidence fields and thresholds. This issue should not hide
fuzzy grouping behind the existing thread product.

Dependency value

This follows #311 and #308: wallclock session timing exists, and
TAIL-ahead-of-archive query behavior is now explicitly not a separate live
ontology. Work threads should therefore stay a normal durable product over the
stable archive.

Source

Thoughtspace: crystal/plans/roadmap-polylogue.md §Open design questions and
seed/2026-04-18-220000-polylogue-mining-findings.md.

Activity

  1. added
    type:research
    on Apr 21, 2026
  2. Sinity commented on Apr 23, 2026

    @Sinity
    OwnerAuthor

    Execution update for #313:

    I strengthened the issue around the concrete gap in the already-landed work_threads product: membership explainability. The implementation in progress keeps grouping conservative and deterministic for this slice: explicit parent/continuation lineage is the grouping authority, and the durable product payload gains per-member evidence plus thread-level support metadata.

    Current local verification:

    • focused substrate/CLI/facade/MCP tests pass for explainable work-thread membership
    • targeted strict mypy passes for the changed product/model modules

    Next: generated-surface check, full devtools verify, atomic commits, PR, and merge.

  3. Sinity commented on Apr 24, 2026

    @Sinity
    OwnerAuthor

    Execution log for the expanded #313 slice:

    • PR: feat: explain work-thread membership #393
    • Merge commit: d095414
    • Scope delivered: conservative work-thread membership explainability on top of the existing durable work_threads product. Explicit parent/continuation lineage remains the grouping authority for this issue; the product now explains that decision per member and at thread level.
    • Product contract changes: added per-member evidence, support level, support signals, confidence, and provider breakdown; bumped archive product contract and session-product materializer versions so stale durable rows rebuild.
    • Surface coverage: CLI JSON, facade archive-product queries, and MCP product tools now preserve and test the expanded work-thread payload.
    • Verification run locally:
      • focused pytest product/surface tests: 8 passed in 12.09s
      • targeted strict mypy over touched product/test files: passed
      • devtools render-all --check: passed
      • devtools verify: passed
      • pre-push quick verification: passed

    CI was still queued at merge time, consistent with the current quota constraint; merge was based on local full verification and successful push hooks.

  4. added a commit that references this issue on May 7, 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:cliarea:schematype:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions