Skip to content

feat(lynx): define typed slot-delta protocol (issue-66 A1) - #67

Merged
Huxpro merged 1 commit into
new-lynxfrom
feat/lynx-delta-protocol
Aug 19, 2026
Merged

Huxpro merged 1 commit into
new-lynxfrom
feat/lynx-delta-protocol

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #65; Phase A1 of #66. This adds the standalone typed delta protocol that the specialized Lynx background driver and main-thread applier will consume in later slices:

  • versioned, flat, self-delimiting frames for RUN, SET, REMOVE, MOVE, and BRANCH
  • explicit instance/range removal addresses and member/value counts for variable tails
  • envelope/version/opcode/arity/header validation only; slot values remain opaque and are not recursively walked
  • patch changeset and living-spec §8 status

The protocol is deliberately not wired into the runtime in this slice, keeping the operational risk and behavior delta at zero.

Differential evidence / measurement

  • Red: the focused suite failed because delta-protocol.js did not exist.
  • Deliberate break: after implementation, changing nullable MOVE.before decoding to require an integer failed the round-trip test; restoring it returned the suite to green.
  • Same-window deterministic node benchmarks/lynx-table/run.mjs 2, feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65 baseline then candidate: identical at both 1k and 10k across create, update10th, select, swap, update storm, and select storm. At 10k both reported create=1, update10th=1000, select=2/225B, swap=2/368B, updateStorm=50 commits/50000 commands, selectStorm=30/60. Runtime wall-clock is not measured because A1 has no runtime consumer.

Validation

  • pnpm sync
  • pnpm format:files:check packages/lynx/src/core/delta-protocol.ts packages/lynx/tests/delta-protocol.test.ts docs/lynx-specialized-target-l0.md .changeset/lynx-delta-protocol.md
  • pnpm typecheck:files packages/lynx/src/core/delta-protocol.ts packages/lynx/tests/delta-protocol.test.ts
  • ./node_modules/.bin/vitest run --project lynx --reporter=dot — 27 files / 359 tests
  • focused delta suite — 15 tests
  • pnpm typecheck / package-wide legacy tsc: inherited feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65 error at packages/lynx/src/main-thread.ts:2246 where the conditional acknowledgement object widens adoption to string; touched files pass scoped tsgo.
  • pnpm test (full repository; Lynx owning project is green)

Risk / follow-ups

  • The protocol is internal and has no runtime caller yet. A4 must prove emitted delta application equivalent to command-batch application before cutover.
  • Value stride/type semantics remain compiler/slot-table owned by design; this module validates only transport framing as required by spec §3.4.

Provenance

  • An agent produced this diff (agent-authored)

Add the versioned flat RUN/SET/REMOVE/MOVE/BRANCH encoding with self-delimiting operation frames, instance/range removal addresses, header-only validation, opaque slot values, malformed-input coverage, and the living-spec status entry.

Agent-Authored-By: TraeCode <[email protected]>

Trae-Session: 01a015c8-dc52-71b3-b929-2b5d818926bf
@Huxpro
Huxpro changed the base branch from claude/octane-issue-58-l3-direct-first-screen to new-lynx August 19, 2026 18:27
@Huxpro
Huxpro marked this pull request as ready for review August 19, 2026 18:27
@Huxpro
Huxpro merged commit e94741d into new-lynx Aug 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant