Repository navigation
feat(term-state): implement bitty-term-state crate: Terminal Truth core - #13
Merged
Merged
Conversation
Implements CarryCtx task CTX-0010 (GitHub issue #11) against the accepted Terminal State RFC sections 'Grid and state invariants', 'Damage tracking model', and 'Deterministic replay guarantees', per ADR-0003 topology (workspace deps: bitty-vt only). - State::apply(&TerminalAction) transition API; exhaustive, total over all actions; Unknown/OscUnknown inert with telemetry outside the state hash. - Grid/cursor/modes/scrollback/damage/replies/charsets/tabs modules with all eight RFC invariants mechanically enforced and debug-asserted after every batch; check_invariants() exposed for embedders and tests. - Damage model: generation counter per processed batch, coarse rectangles for erase/scroll, print runs coalesced at a fixed point, bounded history window for damage_since. - Bounded scrollback (oldest-first pruning, monotonic ids), reply cap with drop-and-flag, hyperlink table and zone log caps. - Device-status replies synthesized and queued (DSR/CPR/DA1); no I/O. - Canonical FNV-1a state hash over fixed-order little-endian encoding; damage bookkeeping generation excluded from truth hash. - Image store/placement: typed stub referencing OQ-008 / RFC open items. - Tests: unit invariant tests, proptest action-sequence invariants, double-run replay determinism (byte-identical damage streams + hashes), bitty-vt seeds integration asserting totality. Proptest surfaced two wide-pair orphan bugs (print overwrite; DCH/ICH source-boundary split), fixed via boundary pre-clears plus deterministic repair_row backstop.
…unit tests Covers alt-screen full-set roundtrip (invariant 5), origin-mode addressing, invalid DECSTBM handling, scrollback capture only under screen-bottom regions (invariant 4), origin-aware CPR synthesis, DECSTR subset, and FullReset hash equality with a pristine state.
Xuepoo
force-pushed
the
ctx-0010/feat-bitty-term-state
branch
from
August 26, 2026 08:41
082a3fd to
db9f549
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements CarryCtx task CTX-0010 (GitHub issue #11) against the accepted
Terminal State RFC sections 'Grid and state invariants', 'Damage tracking
model', and 'Deterministic replay guarantees', per ADR-0003 topology
(workspace deps: bitty-vt only).
actions; Unknown/OscUnknown inert with telemetry outside the state hash.
all eight RFC invariants mechanically enforced and debug-asserted after
every batch; check_invariants() exposed for embedders and tests.
for erase/scroll, print runs coalesced at a fixed point, bounded history
window for damage_since.
drop-and-flag, hyperlink table and zone log caps.
damage bookkeeping generation excluded from truth hash.
double-run replay determinism (byte-identical damage streams + hashes),
bitty-vt seeds integration asserting totality. Proptest surfaced two
wide-pair orphan bugs (print overwrite; DCH/ICH source-boundary split),
fixed via boundary pre-clears plus deterministic repair_row backstop.
Evidence
core-implementer, session 01M0YAKE, worktree.worktrees/ctx-0010-feat-bitty-term-state, commit ed55a73)bitty-docs/docs/specifications/terminal-state-rfc.md(accepted sections), ADR-0003 dependency rowjust check): cargo fmt --check, clippy --workspace --all-targets --locked -D warnings, test --workspace --all-targets --locked, actionlint, markdownlint — all greenRefs: CTX-0010, #11