NS1 slice: Implement headless session state and UTF-8 buffer basics #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
OBJECTIVE: Add a testable session core with buffers, cursor/selection state, command dispatch, and UTF-8 boundary/cell-width policy.
AUTHORITY: Parent #1
NS1: Minimal protocol-first mim-min editor; PRODUCT.md; REQUIREMENTS.md (PRODUCT.md; req: session/001-004; req: coding/001; req: governance/001; req: governance/003).AGENT AUTHORITY:
PARENT: #1 via explicit issue link and parent checklist.
SCOPE: The smallest source/docs/tests needed to make this behavior real and verified.
BOUNDARIES: No terminal UI, socket, LSP, or Tree-sitter.
ACCEPTANCE: Unit tests open a fixture, move/edit/delete around multibyte text, inspect state, and preserve bytes except intentional edits.
VERIFICATION: Run the cheapest command that proves acceptance. Include regular tests for the intended payoff and adversarial tests for realistic failure, boundary, or regression cases. If no implementation test command exists yet, create/record the canonical command in AGENTS.md as part of the slice.
BLOCKERS: none
GOAL: Implement this vertical slice to the ACCEPTANCE above, keep the repo clean, cite relevant
req:anchors in code/tests where applicable, and close only after verification passes.Implemented in commit
108c0533a8(Add headless session and UTF-8 buffer core).Verification:
Regular tests: session opens fixture, dispatches multibyte edits, deletes a whole UTF-8 codepoint, and computes cell widths for combining/wide glyphs.
Adversarial tests: cursor movement never lands inside multibyte codepoints, invalid UTF-8 insertion is rejected while preserving existing bytes, and dispatch/snapshot fail clearly when no buffer is open.