Allocation-free PTY lifecycle, terminal mode, event and trusted-control contracts for EriX.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Erik Inkinen 4317aaebcd
All checks were successful
CI / markdown (push) Successful in 8s
CI / rust (push) Successful in 46s
chore: Merge native CLI development into main
Merge the selected feature/native-cli history with an explicit two-parent commit so main retains the development lineage and the validated source snapshot. The resulting tree is identical to the selected feature commit; no dependency pins or runtime behavior are changed by this merge.

Previous main: 2a162a861b
Selected feature: 26a979afd1

Publish this integration point following the requested cross-repository merge. Preserve the feature branch and immutable dependency objects for reproducibility; do not squash, rebase or rewrite existing commits.
2026-09-12 08:28:49 +03:00
.github build: Pin dependency and CI helper source commits 2026-09-12 07:32:25 +03:00
src Align PTY events with canonical signals 2026-08-16 12:23:55 +03:00
.editorconfig Initial commit 2026-08-05 19:46:55 +02:00
.gitignore Initial commit 2026-08-05 19:46:55 +02:00
.markdownlint-cli2.yaml Initial commit 2026-08-05 19:46:55 +02:00
ARCHITECTURE.md build: Pin dependency and CI helper source commits 2026-09-12 07:32:25 +03:00
Cargo.toml build: Pin dependency and CI helper source commits 2026-09-12 07:32:25 +03:00
CODE_OF_CONDUCT.md docs: Synchronize shared contribution and review policies 2026-09-12 06:38:19 +03:00
CONTRIBUTING.md build: Pin dependency and CI helper source commits 2026-09-12 07:32:25 +03:00
LICENSE Initial commit 2026-08-05 19:46:55 +02:00
README.md build: Pin dependency and CI helper source commits 2026-09-12 07:32:25 +03:00
ROADMAP.md build: Pin dependency and CI helper source commits 2026-09-12 07:32:25 +03:00
rustfmt.toml Initial commit 2026-08-05 19:46:55 +02:00
SECURITY.md docs: Synchronize shared contribution and review policies 2026-09-12 06:38:19 +03:00

lib-tty

lib-tty defines allocation-free PTY lifecycle, terminal mode, ordinary event, and trusted-control contracts for native EriX programs and services.

EriX is a clean-room, capability-based microkernel operating system written entirely in Rust.

See:

  • docs for system architecture and the technical manual
  • lib-ipc for terminal wire bodies
  • lib-stdio for ordered byte-stream semantics

Purpose of This Repository

This repository separates PTY state and control from the byte streams carried by PTY endpoints. Callers provide event storage, name endpoint roles explicitly, and preserve the authenticated route used for trusted control.

The maintained responsibilities are:

  • validate terminal modes and cell or pixel dimensions
  • model master and slave lifecycle with monotonic state generations
  • enforce role-specific mode, resize, close, and hangup transitions
  • define the exact master-to-slave input and slave-to-master output roles
  • retain ordinary or trusted events in caller-provided lossless queues
  • expose explicit queue backpressure and replay-resistant cursors
  • adapt ordinary PTY state and events to exact receipt-free lib-ipc terminal bodies with canonical signal identities and consecutive cursors
  • correlate trusted-control responses with request, session, and cursor identity
  • keep trusted-control types structurally separate from ordinary PTY events

Clean-Room Policy

EriX follows a strict clean-room philosophy:

  • No external source code may be copied.
  • No external Rust crates are allowed.
  • No code generation tools that embed third-party code.
  • All code must be authored within the project.

Violations will result in rejection of the contribution.

License

All EriX repositories are licensed under the ISC License.

Development Model

The crate is no_std, forbids unsafe code, and denies missing public documentation. PtyPair owns semantic state but no capability; the service that holds authenticated master or slave endpoints supplies the requesting role.

EventQueue uses the complete caller-provided slice as bounded retention. A full queue returns the event unchanged, allowing the producer to apply backpressure without data loss. Queue capacity is deployment policy, not a private protocol limit.

Status

Implemented:

  • validated interactive and raw terminal modes
  • master/slave role-specific mode and resize operations
  • endpoint close, terminal hangup, and monotonic state snapshots
  • lossless caller-buffered event queues with exact cursors
  • ordinary PTY wire event and state adapters
  • exact resize, mode-change, hangup, and interrupt wire values using the shared signal catalog rather than host-native codes or duplicated state payloads
  • direction-specific PTY input and output stream roles
  • trusted session-control response correlation
  • structural separation of ordinary and trusted event paths

Governance Principles

lib-tty governs PTY semantics, not endpoint ownership, display routing, input policy, or process scheduling.

  • A role value is accepted only from a caller that already authenticated its endpoint route.
  • Ordinary bytes and events cannot produce a trusted-control value.
  • Ordinary event values are descriptive only: they convey canonical signals, state generations, or hangup reasons and cannot select a process or job.
  • Trusted decisions remain tied to a nonzero authenticated session, exact request, and monotonic cursor.
  • Full caller storage causes explicit backpressure, never silent event loss.
  • Git dependencies use full 40-character commit rev pins. Integration source revisions and CI caches preserve those identities, with no branch-head or synthetic-commit substitution.

Library Boundaries

  • The crate holds no endpoint, allocator, VFS, input, display, process, or discovery authority.
  • It performs no syscall, allocation, polling, or logging.
  • Stream bytes belong to lib-stdio; endpoint and trusted-route ownership belong to ttyd and its service peers.

Contact

Development occurs in the EriX organization. Decisions and rationale are recorded in issues and design documents.

Maintainers can be reached at admin@erikinkinen.fi.