Skip to content

feat(tui): add recursive grouping tree - #48394

Merged
jlongster merged 3 commits into
v2from
grouping-engine
Sep 11, 2026
Merged

feat(tui): add recursive grouping tree#48394
jlongster merged 3 commits into
v2from
grouping-engine

Conversation

@jlongster

@jlongster jlongster commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Base

Rebased onto v2 after #48393 merged. This PR contains only the grouping-engine increment.

Summary

Add the pure grouping engine before connecting it to the production session projection.

  • Generic entries with configurable nesting paths, including activity -> exploration/reasoning/instructions.
  • Ordered construction and associative recursive seam merges.
  • Split by depth-first leaf count using cached subtree sizes; group headers count as zero.
  • Readonly trees, immutable operations, and retained identity for untouched subtrees.

The current session projection and rendering are unchanged. This module has no runtime dependencies and is not wired in yet. The next integration step owns replay/overlapping-page deduplication and stable disclosure keys; seam merging explicitly concatenates disjoint ordered chunks.

Verification

  • TUI bun typecheck: passed
  • New module Prettier and staged whitespace checks: passed
  • Local deterministic suite: 18 tests passed, 161215 assertions
  • Exhaustively checked all 2801 sequences of up to four entries over seven grouping paths: every split and three-page partition, fresh/incremental equivalence, associativity, leaf counts and split/merge round trips
  • Additional cases cover nested activity structure, native PartRef payloads, immutable inputs, unchanged subtree identity, invalid offsets, replacements/deletions and deeper nesting

The PR now includes six basic tests covering grouping, direct-child boundaries, recursive merging, splitting, empty chunks and invalid offsets (all passing; TUI typecheck also passes). The exhaustive diagnostic suite remains local at /tmp/opencode/grouping-tree.test.ts; the work log remains local too. No screenshot replay for this unwired pure module; production integration will repeat visual parity checks.

Base automatically changed from session-renderers to v2 September 10, 2026 22:07
@jlongster
jlongster merged commit 1c723c5 into v2 Sep 11, 2026
10 checks passed
@jlongster
jlongster deleted the grouping-engine branch September 11, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant