Skip to content

docs(architecture): define-once separation contract — positron lowers onto Commands/Events#4

Merged
joelteply merged 2 commits into
mainfrom
docs/define-once-separation
Jul 3, 2026
Merged

docs(architecture): define-once separation contract — positron lowers onto Commands/Events#4
joelteply merged 2 commits into
mainfrom
docs/define-once-separation

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

The first organizational unit for building positron out into the "define the app once for all environments" system Joel described. The four primitives (ViewState/Renderer/Host/Observer) already encode "define once, project many" — but the separation of concerns was never written down, and the load-bearing decision was unresolved: does positron's session.rs protocol compete with the substrate's own command/event wire (continuum ipc/ws.rs)? Left unpinned, that grows two dispatchers — the exact 2000-line-widget anti-pattern positron exists to kill.

The contract (docs/ARCHITECTURE.md)

  1. Define once, project many. One (ViewState, command-vocabulary) pair; the four environments (web/terminal/mobile/AI) collapse to two rolesRenderer (web/terminal/mobile) and Observer (AI persona → RAG, acts via CommandEnvelope). The persona is the fourth projection of the same ViewState, not a special case.
  2. positron lowers onto Commands/Events — never a second bus. CommandEnvelopeCommands.execute (one dispatch owner); StateEnvelope produced by a projector over Events; the ContinuumHost (already named in session.rs tests) is the single lowering seam. The two-wire overlap with ipc/ws.rs is resolved as layering, with the eventual merge flagged as an integration-time (O5) decision, not pre-decided.
  3. Constrains DESIGN.md open Qs feat(session): ServerMessage::CommandFailed + StateLayer Hash/Ord — v0.1.1 (card 1dbcefce) #3 (theming → renderer concern) and docs(architecture): define-once separation contract — positron lowers onto Commands/Events #4 (layout → semantic-only ViewState) from "lean" to "requirement" — one ViewState serving a terminal + DOM + AI observer cannot carry geometry or theme.
  4. O1..O6 roadmap, one PR per unit; O2 = examples/counter-cli is next and makes this doc non-vapor (one Counter, ≥2 renderers, 1 observer, in-process, zero transport).

Scope

Docs only — docs/ARCHITECTURE.md (new) + one cross-link each in README.md and DESIGN.md. No code, no wire changes, no ts-rs regen. Pins the boundary before any renderer is written.

🤖 Generated with Claude Code

joelteply and others added 2 commits July 2, 2026 21:37
… onto Commands/Events

The four primitives are the "define once, project many" mechanism, but the
separation of concerns was never written down — and the load-bearing decision
(positron's session protocol vs the substrate's own command/event wire) was
unresolved, risking two parallel dispatchers.

docs/ARCHITECTURE.md pins it:
- one (ViewState, command-vocabulary) definition → four surfaces collapse to two
  roles: Renderer (web/terminal/mobile) + Observer (AI persona → RAG/tool).
- positron owns the view/render/perceive contract + wire semantics + session;
  it does NOT own a second dispatch bus. CommandEnvelope LOWERS to
  Commands.execute; StateEnvelope is produced by a projector over Events; the
  ContinuumHost is the single lowering seam.
- constrains DESIGN.md open Qs #3/#4 to renderer-concern / semantic-only ViewState.
- O1..O6 roadmap, one PR per unit; O2 (counter-cli) is next and makes this
  non-vapor.

README + DESIGN cross-link the new doc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…uumHost phrasing, theming default

Review (APPROVE WITH NITS) fixes:
- use the established crate name `positron-lit` (not a new `positron-ts`); the
  npm types package stays `@positron/core`. Single name, one place.
- soften "ContinuumHost already named in session.rs tests" → "referenced by name
  in a session.rs test comment (not yet a wired symbol)" — it's a prose mention,
  not an exercised symbol.
- theming (open Q#3) framed as a strong default, not a primitive-enforced
  constraint: a theme token is arguably semantic, unlike layout geometry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply joelteply merged commit 171862b into main Jul 3, 2026
2 checks passed
@joelteply joelteply deleted the docs/define-once-separation branch July 3, 2026 02:40
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.

1 participant