Skip to content

feat(term-state): implement bitty-term-state crate: Terminal Truth core #11

Closed

Description

@Xuepoo

Implements CarryCtx task CTX-0010.

Scope

  • New workspace crate crates/bitty-term-state: grid, cursor, modes, scrollback, damage tracking, replies, image store/placement stub — the Terminal Truth core per ADR-0003 (depends only on bitty-vt).
  • Transition API State::apply(&TerminalAction) consuming the typed action stream from bitty-vt; exhaustive, total over all actions; semantically inert handling for Unknown/OscUnknown.
  • Grid and state invariants per accepted RFC sections "Grid and state invariants", "Damage tracking model", "Deterministic replay guarantees" (bitty-docs/docs/specifications/terminal-state-rfc.md): geometry/cursor bounds, cell totality incl. wide-char spacers, scrollback monotonicity with bounded pruning, mode consistency on alt-screen, tab-stop lattice, reply byte cap with drop-and-flag.
  • Damage stream: generation counter, coarse rectangles for erase/scroll, coalesced runs for print; deterministic ordering.
  • Deterministic replay: canonical state hash (fixed field order, little-endian) stable across platforms; no wall-clock/randomness in transitions.
  • Device status replies synthesized and queued (returned to caller, no I/O).
  • Image store/placement: typed stub module referencing OQ-008 / RFC open items.
  • Config-free bounded constants recorded in module docs with RFC references.

Acceptance

  • Unit tests for grid/cursor/mode/tab invariants; proptest property tests over random action sequences asserting invariants; replay tests applying a sequence twice produce byte-identical damage streams and equal state hashes; integration test driving bitty-vt::Parser over crates/bitty-vt/seeds/ fixtures asserting totality (no panic, invariants hold).
  • \#![forbid(unsafe_code)], no TODO/FIXME/unimplemented!().
  • just check green locally (fmt, clippy -D warnings --locked, test --locked, actionlint, markdownlint); CI green.

Refs: CTX-0010

Activity

  1. Xuepoo commented on Aug 27, 2026

    @Xuepoo
    ContributorAuthor

    Implemented via PR #13 (bitty-term-state, 59 tests, deterministic replay, FNV-1a state_hash) and subsequent headless integration spine #60. Workspace now 15 crates with spine complete. Closing per workflow: merge -> close Issue -> record evidence. Evidence in CTX-0010 checkpoint 01M0YKE3 and final integration PR #60.

  2. added
    feat
    area:package
    area:term
    P0
    on Aug 29, 2026
  3. added this to the v0.0.1 milestone on Aug 29, 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

    P0area:packagearea:termfeat

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions