Skip to content

feat(adapters): human-readable frame v2 with fenced verbatim envelope (#105) - #109

Merged
OBenner merged 1 commit into
mainfrom
feat/105-frame-v2
Nov 17, 2026
Merged

OBenner merged 1 commit into
mainfrom
feat/105-frame-v2

Conversation

@OBenner

@OBenner OBenner commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Fixes #105.

What

Frame formatting v2 per arch's brief (PROPOSAL 26a7fb8c), on all hosts (frameMessage is the shared builder):

📬 Synloq · {from} → {to} · thread {threadId[0:8]} · expectsReply: {bool}

{body}

<synloq project from message thread [registration]>…verbatim…

  • Envelope verbatim: frameEnvelope produces the exact pre-v1 string; v2 embeds it byte-identical inside the fence. extractEnvelope pulls it back out of any variant.
  • Rolling upgrade (CTO point 1): findMatchingVisibleTurns now matches on the envelope, not the full frame — a new build reconciles history admitted by an old build and vice versa (both directions pinned by tests). The OpenCode admission equality check is same-process and self-consistent.
  • Compact instructions replace the wall of text; locales en/ru updated in sync (parity test green); +N more pending backlog hint preserved.
  • Role instructions: generated instructions render from locales, so they ship in this commit as required.

Deploy note (CTO point 2)

The visible frame changes only for deliveries made by new-dist channels. Plan with the operator: after deploying, re-init the stand's channels (regenerate plugin/config so every channel runs the new dist) — mixed-format stands work by design, but a single-format stand needs one re-init pass. This item goes into the deploy checklist; I will schedule the window with the operator after merge.

Verification

  • New tests: v2 header/fence/verbatim round-trip, no-generation compatibility, legacy-frame matching in both directions, compact instructions (en + ru), backlog hint behavior.
  • Updated: provenance contract now asserts envelope preservation via extractEnvelope (was exact-equality on the flat frame).
  • Full pnpm verify: 108 files / 953 tests PASS.

Review

Author: dev. Optional dev2 glance welcome (wire-format change); CTO final after.

…#105)

Delivered messages now render a header (from/to/thread/expectsReply),
the body, and the machine envelope in a fenced code block. The envelope
bytes stay verbatim inside the frame, so envelope extraction works across
mixed-version stands and legacy flat frames keep parsing.

- frameEnvelope/extractEnvelope in reference.ts; frameMessage becomes v2
- findMatchingVisibleTurns matches on the envelope, not the full frame,
  so v1-admitted history reconciles after upgrade (both directions)
- compact delivery instructions replace the instruction wall (locales
  en/ru in sync); '+N more pending' backlog hint preserved
- provenance contract asserts envelope preservation via extraction
@OBenner
OBenner merged commit e8843cb into main Nov 17, 2026
5 checks passed
@OBenner
OBenner deleted the feat/105-frame-v2 branch November 17, 2026 06:13
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.

[P2] Frame formatting v2: human-readable header + fenced machine envelope

1 participant