Repository navigation
feat: explain work-thread membership - #393
Conversation
Problem\n\nThe durable work-thread product grouped explicit continuation trees, but\nits public payload did not explain why individual sessions belonged to a\nthread. That made the product inspectable as an aggregate but weak as a\ncluster/work-thread substrate.\n\nWhat changed\n\nAdd typed per-member evidence for work-thread membership, deterministic\nthread support metadata, confidence, and support signals. Keep grouping\nconservative for this slice: explicit parent/continuation lineage remains\nthe only grouping authority. Bump the archive product contract and session\nproduct materializer version so stale rows are rebuilt with the expanded\npayload.\n\nCompatibility\n\nThe raw archive is unchanged. Existing product rows are treated as stale\nby the materializer-version bump and legacy payloads still validate with\ndefault weak support metadata.\n\nRef #313\nCo-Authored-By: Claude <[email protected]>
Problem Work-thread membership evidence needs regression coverage across the shared substrate and public product surfaces, not only the builder path. What changed Add core tests for explicit continuation evidence, obvious non-matches, and payload round-tripping. Extend CLI, facade, and MCP product contract tests to assert support metadata and member evidence appear in public work-thread payloads. Verification passes locally. Ref #313 Co-Authored-By: Claude <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR extends work-thread payloads with per-member evidence metadata and deterministic thread-level support metrics. New payload types capture conversation IDs, roles, depths, support signals, and confidence per member. Contract and schema versions are incremented, and thread construction logic is enhanced to compute evidence from session profiles and continuation lineage. Changes
Sequence DiagramsequenceDiagram
participant Sessions as Session Profiles
participant ThreadBuilder as build_session_threads
participant Evidence as Evidence Computation
participant WorkThread as WorkThread Object
participant Storage as Thread Storage
Sessions->>ThreadBuilder: Provide profiles with parent/continuation lineage
ThreadBuilder->>Evidence: Extract depths, roles, lineage info
Evidence->>Evidence: Compute support signals (session count, repos, bounds)
Evidence->>Evidence: Compute confidence & support level
Evidence->>ThreadBuilder: Return evidence data
ThreadBuilder->>WorkThread: Create thread with member evidence<br/>(role, depth, confidence, support signals)
WorkThread->>WorkThread: Serialize member_evidence tuples
WorkThread->>Storage: Store enriched thread payload<br/>(provider_breakdown, thread-level metadata, member evidence)
Storage->>Storage: Index support_level and support_signals<br/>for search coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary Add deterministic membership evidence to durable work-thread products. Work-thread grouping remains conservative for this slice: explicit parent/continuation lineage is the only grouping authority, but each member now carries auditable evidence and each thread exposes support level/signals/confidence through CLI, facade, and MCP product payloads. Problem #313 asked for session-cluster/work-thread semantics. The codebase already had a durable `work_threads` product, but it exposed aggregates without explaining why a session belonged to a thread. That made the product hard to audit and weak as a substrate for future clustering signals. Solution - extend the shared work-thread payload with per-member evidence, support level/signals, confidence, and provider breakdown - preserve conservative explicit lineage grouping for this issue - bump archive product contract version and session-product materializer version so stale rows rebuild with the expanded payload - include support/member signals in work-thread search text - cover substrate round-tripping plus CLI, facade, and MCP public product contracts Verification - `pytest -q tests/unit/core/test_threads_runtime.py tests/unit/cli/test_products.py::test_products_profiles_json tests/unit/cli/test_products.py::test_products_enrichments_json tests/unit/cli/test_products.py::test_products_threads_json tests/unit/core/test_facade_api.py::TestPolylogueArchiveProducts::test_durable_session_products_are_publicly_queryable tests/unit/mcp/test_tool_contracts.py::TestProductTools::test_product_list_tools_use_archive_queries` passed: 8 passed in 12.09s - `mypy --strict tests/unit/mcp/test_tool_contracts.py tests/unit/cli/test_products.py polylogue/archive_product_models.py polylogue/lib/threads.py` passed: Success, no issues found - `devtools render-all --check` passed - `devtools verify` passed: verify: all checks passed - `git push -u origin feature/feat/explain-work-thread-membership` passed pre-push quick verification: verify: all checks passed Closes #313
Summary
Add deterministic membership evidence to durable work-thread products. Work-thread grouping remains conservative for this slice: explicit parent/continuation lineage is the only grouping authority, but each member now carries auditable evidence and each thread exposes support level/signals/confidence through CLI, facade, and MCP product payloads.
Problem
#313 asked for session-cluster/work-thread semantics. The codebase already had a durable
work_threadsproduct, but it exposed aggregates without explaining why a session belonged to a thread. That made the product hard to audit and weak as a substrate for future clustering signals.Solution
Verification
pytest -q tests/unit/core/test_threads_runtime.py tests/unit/cli/test_products.py::test_products_profiles_json tests/unit/cli/test_products.py::test_products_enrichments_json tests/unit/cli/test_products.py::test_products_threads_json tests/unit/core/test_facade_api.py::TestPolylogueArchiveProducts::test_durable_session_products_are_publicly_queryable tests/unit/mcp/test_tool_contracts.py::TestProductTools::test_product_list_tools_use_archive_queriespassed: 8 passed in 12.09smypy --strict tests/unit/mcp/test_tool_contracts.py tests/unit/cli/test_products.py polylogue/archive_product_models.py polylogue/lib/threads.pypassed: Success, no issues founddevtools render-all --checkpasseddevtools verifypassed: verify: all checks passedgit push -u origin feature/feat/explain-work-thread-membershippassed pre-push quick verification: verify: all checks passedCloses #313
Summary by CodeRabbit
New Features
Tests
Chores