Skip to content

Add Clayterm current-state specification#5

Merged
cowboyd merged 3 commits into
mainfrom
docs/add-clayterm-spec
Apr 17, 2026
Merged

Add Clayterm current-state specification#5
cowboyd merged 3 commits into
mainfrom
docs/add-clayterm-spec

Conversation

@taras
Copy link
Copy Markdown
Contributor

@taras taras commented Apr 4, 2026

Summary

  • Adds a v0.1 draft specification (specs/clayterm-spec.md) documenting Clayterm's rendering contract, architectural model, core invariants, and public API surface
  • Normative sections cover the rendering pipeline, frame-snapshot model, descriptor pattern, identity semantics, and boundary responsibilities (zero IO, no terminal state management, no application lifecycle)
  • Non-normative sections describe settling surfaces (transfer encoding, descriptor property groups, input parsing, pointer events) separately from the stable core
  • Includes appendix on confidence levels and a list of open decisions intentionally left unresolved

Test plan

  • Review spec content for accuracy against current codebase
  • Verify normative sections (4–11) align with existing API behavior
  • Confirm non-normative sections (12–14) accurately describe current implementation surfaces
  • Check that open decisions list is complete and current

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/clayterm@5

commit: 04d4517

@taras taras force-pushed the docs/add-clayterm-spec branch from 4158ad1 to e31bd93 Compare April 10, 2026 20:41
Copy link
Copy Markdown
Contributor

@cowboyd cowboyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. Left the feedback, I think we need to use "directive" instead of "descriptor" because they are command-like open() / close()

Comment thread specs/clayterm-spec.md Outdated
Comment thread specs/renderer-spec.md
Comment thread specs/clayterm-spec.md Outdated
Comment thread specs/clayterm-spec.md Outdated
Comment thread specs/renderer-spec.md
Comment thread specs/clayterm-spec.md Outdated
Comment thread specs/clayterm-spec.md Outdated
Comment thread specs/clayterm-spec.md Outdated
Comment thread specs/clayterm-spec.md Outdated
Adds the v0.1 draft specification covering the architectural model,
core invariants, public rendering API, descriptor model, and boundary
responsibilities. Non-normative sections document settling surfaces
(transfer encoding, input parsing, pointer events) separately from
the stable rendering core.
- Replace "descriptor" terminology with "directive" throughout
- Rename open() `name` parameter to `id` in spec
- Fix buffer diffing description: cells are copied, not swapped
- Add note that pointer hit detection requires render loop participation
- Reframe border-layout interaction as Clay's intended behavior
- Update WASM loading to reflect inlined base64 binary
- Move output buffer lifetime guarantee to normative section
- Clarify pack() is internal, validate() is public API
@cowboyd cowboyd force-pushed the docs/add-clayterm-spec branch from c4bdca1 to 04d4517 Compare April 17, 2026 18:14
Separate the combined spec into two documents aligned with INV-8
(architectural independence of rendering and input parsing):

- renderer-spec.md: rendering contract, directive model, rendering
  modes (cursor update + line mode), pointer hit-testing
- input-spec.md: input parser API, scan model, InputEvent types

Also adds normative specification of cursor update mode (default)
and line mode with row offset to the renderer spec.
@cowboyd cowboyd merged commit 6c78677 into main Apr 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants