termigan 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/termigan.wasm +0 -0
- package/docs/architecture.md +8 -8
- package/package.json +1 -1
package/dist/termigan.wasm
CHANGED
|
Binary file
|
package/docs/architecture.md
CHANGED
|
@@ -76,7 +76,7 @@ Input and output `List(U8)` staging buffers are also allocated and freed inside
|
|
|
76
76
|
|
|
77
77
|
### Binary dirty-row projection instead of draw callbacks or JSON
|
|
78
78
|
|
|
79
|
-
As recorded in [
|
|
79
|
+
As recorded in [decisions/0001-roc-wasm-architecture.md](decisions/0001-roc-wasm-architecture.md), Termigan rejected two common WebAssembly renderer designs:
|
|
80
80
|
|
|
81
81
|
1. **Hosted canvas draw callbacks.** Importing JS fill and glyph callbacks into Roc would cross the WebAssembly boundary thousands of times when PTY output bursts. It would also tie stream parsing to browser paint timing and break pure `roc test` runs.
|
|
82
82
|
2. **JSON state serialization.** Encoding the active screen and up to 10,000 scrollback rows as JSON would allocate and copy megabytes of state on each chunk.
|
|
@@ -88,15 +88,15 @@ Instead, `FrameCodec.encode_frame` writes one compact little-endian byte array p
|
|
|
88
88
|
|
|
89
89
|
## Formally verified gateway models
|
|
90
90
|
|
|
91
|
-
Termigan models every component boundary as a state chart and verifies it in TLA+ with `everystate` before implementation crosses the boundary. All six formal models, their `.cfg` configurations, and their state charts live in [
|
|
91
|
+
Termigan models every component boundary as a state chart and verifies it in TLA+ with `everystate` before implementation crosses the boundary. All six formal models, their `.cfg` configurations, and their state charts live in [models/](../models/state-charts.md) and [PtySocketBridge.md](../models/PtySocketBridge.md). The verification summaries from `everystate 0.4.6` live in [models-2026-12-02.md](verification/models-2026-12-02.md) and [pty-socket-bridge-2026-12-02.md](verification/pty-socket-bridge-2026-12-02.md).
|
|
92
92
|
|
|
93
93
|
| Gateway | TLA+ model | Generated states | Distinct states | Max depth | Checked invariants |
|
|
94
94
|
|---|---|---:|---:|---:|---|
|
|
95
|
-
| Gateway 1, VT parser | [
|
|
96
|
-
| Gateway 2, Terminal screen | [
|
|
97
|
-
| Gateway 3, WASM memory bridge | [
|
|
98
|
-
| Gateway 4, Viewport display | [
|
|
99
|
-
| Gateway 5, Input routing | [
|
|
100
|
-
| Gateway 6, PTY socket bridge | [
|
|
95
|
+
| Gateway 1, VT parser | [models/VtParser.tla](../models/VtParser.tla) | 701 | 160 | 12 | `TypeOK`, `Utf8Consistency`, `GroundClearsBuffers`, `NoUnboundedAccumulation` |
|
|
96
|
+
| Gateway 2, Terminal screen | [models/TerminalScreen.tla](../models/TerminalScreen.tla) | 469,281 | 30,240 | 19 | `TypeOK`, `DimensionsPositive`, `CursorInBounds`, `ScrollRegionValid`, `ScrollbackBounded`, `AltPreservesNormal` |
|
|
97
|
+
| Gateway 3, WASM memory bridge | [models/WasmMemoryBridge.tla](../models/WasmMemoryBridge.tla) | 577 | 144 | 9 | `TypeOK`, `LiveBoxCountMatchesLifecycle`, `NoLeakedOutputAfterDispose` |
|
|
98
|
+
| Gateway 4, Viewport display | [models/ViewportDisplay.tla](../models/ViewportDisplay.tla) | 13,159 | 1,548 | 14 | `TypeOK`, `ScrollOffsetInRange`, `ExpandedNeverReconnects`, `MirrorNeverEmitsResize`, `AltScreenBlocksNormalScroll` |
|
|
99
|
+
| Gateway 5, Input routing | [models/InputRouting.tla](../models/InputRouting.tla) | 5,052 | 401 | 8 | `TypeOK`, `UnfocusedNeverCaptures`, `HostInterceptorWins`, `ComposingBlocksKeydown`, `SendKeyMatchesMode`, `PasteMatchesBracketedMode` |
|
|
100
|
+
| Gateway 6, PTY socket bridge | [models/PtySocketBridge.tla](../models/PtySocketBridge.tla) | 500 | 99 | 5 | `TypeOK`, `BridgeNeverClosesSocket`, `ListenersMatchState`, `NoEffectWhenDetached`, `SendRequiresOpenAndAttached`, `ReadOnlyNeverSends`, `ResizeDisabledNeverSendsResize` |
|
|
101
101
|
|
|
102
102
|
Run all six model checks locally with `make models`, which executes [scripts/verify-models.sh](../scripts/verify-models.sh).
|