Resize notifications must integrate with fiber concurrency without OS-thread callbacks.
Contracts and edge cases
Platform spec article
Contracts and edge cases
Spec standingStandard
-
Cross-fiber resize uses Channel; same-fiber uses OnResize hub.
Context
Decision
Rule Detail Cross-fiber PollResize→Channel<ConsoleMessage>Same-fiber OnResizeevent hubConsequences
No separate OS-thread callback API in v1.
Verification anchors
ConsoleMessageChannelTests.bd. -
Env size parsing is best-effort discrete table in v1.
Context
Not all hosts expose Winsize ioctl; env vars are a portable fallback.
Decision
Rule Detail Order Winsize ioctl then COLUMNS/LINESParse Discrete table, not full integer grammar in v1 Consequences
Odd env values may clamp or ignore per contracts article.
Verification anchors
Platform/Terminal.bdtests. -
Failed resize Channel Send is silent in v1 poll loops.
Context
UI loops should not crash when consumers drop resize messages.
Decision
Rule Detail EVT-002 Failed Sendon resize is silent in v1Future May gain diagnostics in a later ADR Consequences
Poll loops continue after dropped resize notifications.
Verification anchors
ConsoleMessageChannelTests.bd; EVT-002 traceability.
- Contracts and edge cases Resize polling and delivery requirements.
- Design model ConsoleMessage variants and resize notification surfaces.
- Examples Subscribing to resize via channel or event hub.
- Flow and algorithm PollResize and RunTick integration.
- Verification and traceability Resize channel tests and platform extern anchors.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”Document contracts and edge cases for the Console Terminal Events feature: role-specific normative detail beyond the feature hub.
Canonical references
Section titled “Canonical references”- Feature hub: Console Terminal Events
- Sibling articles in this bundle (design model, contracts, flow, examples, verification)
Detailed behavior
Section titled “Detailed behavior”Normative requirements
Section titled “Normative requirements”| ID | Requirement |
|---|---|
| EVT-001 | PollResize must compare against lastSize and only send on change. |
| EVT-002 | Failed Channel.Send must be ignored silently in v1 poll loop (no panic). |
| EVT-003 | SubscribeOnResize must set hub.lastSize and raise OnResize immediately with QuerySize(). |
| EVT-004 | Default size when all probes fail should be 80×24 via env fallback. |
Edge cases
Section titled “Edge cases”- Non-TTY stdout:
QuerySizemay return env defaults; resize events may never fire. - Rapid resize: Coalescing is caller responsibility; each poll may emit at most one message.
- Closed channel:
Senderrors are dropped per EVT-002.
Verification
Section titled “Verification”See the verification and traceability article in this bundle and compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.
Related topics
Section titled “Related topics”- Parent feature hub and Terminal and console area