Skip to content

feat: add console state reducer#274

Merged
spytensor merged 1 commit into
mainfrom
feat/v0.8-245-crep-console-reducer
May 23, 2026
Merged

feat: add console state reducer#274
spytensor merged 1 commit into
mainfrom
feat/v0.8-245-crep-console-reducer

Conversation

@spytensor
Copy link
Copy Markdown
Owner

Linked Issue

Closes #245

Scope

Implemented:

  • Added a pure console_state reducer that applies CREP events without printing.
  • Tracks role lanes, turn dispatch, role output streams, final role replies, tools, permission denials, phase changes/blocks, plan reviews, interruptions, and stops.
  • Builds a deterministic conversation viewport that keeps host/user public turns clean and routes host-managed role work to internal activity.
  • Added a CREP JSONL fixture with one malformed line; replay counts malformed lines without treating them as evidence.
  • Added tests for viewport output, stream folding, tool/permission activity, and internal delegation.

Not implemented:

  • No ratatui renderer.
  • No CREP wire-format changes.
  • No mutation actions from reducer output.

Acceptance Criteria

  • AC-1: Add a reducer that applies CREP events into console/conversation state without printing.
  • AC-2: Cover role started, turn dispatched, role spoke/output, tool events, permission denied/approved, phase advanced/blocked, and handoff-like events where supported.
  • AC-3: Replaying a fixture log yields deterministic conversation viewport output.
  • AC-4: Public transcript filtering respects the visibility model from the relevant v0.8 issue.
  • AC-5: Stream deltas can be folded or summarized for viewport rendering.
  • AC-6: Tests cover malformed/partial event replay behavior without treating skipped malformed lines as evidence.

Changed Files

  • src/console_state.rs
  • src/lib.rs
  • tests/console_state_test.rs
  • tests/fixtures/console_reducer_crep.jsonl

Validation

Local commands executed:

cargo fmt --all -- --check
cargo test --test console_state_test --quiet
cargo test --test conversation_visibility_test --quiet
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features --locked --quiet

Results:

  • format: pass
  • console reducer tests: pass, 3 tests
  • conversation visibility tests: pass, 4 tests
  • clippy: pass
  • full test suite: pass, ignored smoke tests unchanged

Evidence Packet

Tracker Update

Risk

Medium. This introduces the first console reducer state boundary. It is additive and not wired into live REPL rendering yet.

Rollback

Revert this PR. No state migration, CREP wire-format change, or runtime rendering change is included.

@spytensor spytensor merged commit 075196c into main May 23, 2026
5 checks passed
@spytensor spytensor deleted the feat/v0.8-245-crep-console-reducer branch May 23, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.8: Implement CREP to ConsoleState reducer and conversation viewport

1 participant