merge: dev/2026-04-08 — Yonexus v1 implementation, docs, and integration tests #5

Closed
hzhang wants to merge 0 commits from dev/2026-04-08 into main
Contributor

Bring 36 commits of work from 2026-04-08 to 2026-04-10 into main:

Foundation (commits 1–16, 4-08)

YNX-0102 protocol codec, YNX-0401 server persistence, pairing flow (YNX-0603), auth handshake, rule messaging APIs (YNX-0903/0904/0905), transport hardening, server rewrite. Submodule pointers in this branch are slightly older than current main; git auto-fast-forwards them on merge (main's bump pointer wins, no regression).

Docs (5 new)

ACCEPTANCE.md, DEPLOYMENT.md, LESSONS_LEARNED.md, OPENCLAW_PLUGIN_DEV.md, OPERATIONS.md — plus expanded FEAT.md / PLAN.md / PROTOCOL.md / README.md / TASKLIST.md.

Integration tests (3863 LOC)

  • tests/docker/ — client/server Dockerfiles + compose + test plugin scaffolds
  • tests/integration/framework.test.ts (630 LOC)
  • tests/failure-path/pairing-failures.test.ts (666 LOC) + MATRIX.md (167 LOC) — pairing failure coverage incl. YNX-1104/1105 auth nonce collision/rate limit, CF-06, heartbeat failures, recovery paths
  • scripts/ — helper scripts

Cleanup

Last 3 commits (4-10): rule dispatch + cross-plugin API + Docker integration test, plugin startup guards moved to globalThis, fix.

Why merging now

Branch was stalled since 4-10 with no PR opened. Authors: hzhang (me) + nav. Verifies clean — git merge --no-commit reports no conflicts; submodule pointers auto-resolve to main's newer values. Content is purely additive (5 new docs + tests + scripts) on top of an additive base.

🤖 Generated with Claude Code

Bring 36 commits of work from 2026-04-08 to 2026-04-10 into main: ## Foundation (commits 1–16, 4-08) YNX-0102 protocol codec, YNX-0401 server persistence, pairing flow (YNX-0603), auth handshake, rule messaging APIs (YNX-0903/0904/0905), transport hardening, server rewrite. Submodule pointers in this branch are slightly older than current `main`; git auto-fast-forwards them on merge (main's bump pointer wins, no regression). ## Docs (5 new) `ACCEPTANCE.md`, `DEPLOYMENT.md`, `LESSONS_LEARNED.md`, `OPENCLAW_PLUGIN_DEV.md`, `OPERATIONS.md` — plus expanded `FEAT.md` / `PLAN.md` / `PROTOCOL.md` / `README.md` / `TASKLIST.md`. ## Integration tests (3863 LOC) - `tests/docker/` — client/server Dockerfiles + compose + test plugin scaffolds - `tests/integration/framework.test.ts` (630 LOC) - `tests/failure-path/pairing-failures.test.ts` (666 LOC) + `MATRIX.md` (167 LOC) — pairing failure coverage incl. YNX-1104/1105 auth nonce collision/rate limit, CF-06, heartbeat failures, recovery paths - `scripts/` — helper scripts ## Cleanup Last 3 commits (4-10): rule dispatch + cross-plugin API + Docker integration test, plugin startup guards moved to `globalThis`, fix. ## Why merging now Branch was stalled since 4-10 with no PR opened. Authors: hzhang (me) + nav. Verifies clean — `git merge --no-commit` reports no conflicts; submodule pointers auto-resolve to main's newer values. Content is purely additive (5 new docs + tests + scripts) on top of an additive base. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hzhang added 33 commits 2026-04-10 05:56:52 +00:00
- Add Yonexus.Protocol/src/codec.ts with encodeBuiltin/decodeBuiltin,
  rule message parsing, and type-safe envelope builders
- Add Yonexus.Server/plugin/core/persistence.ts with ClientRecord,
  ServerRegistry, and serialization helpers
- Update exports in both modules
- Yonexus.Protocol: add codec module with protocol encode/decode
- Yonexus.Server: add persistence types and ClientRecord structure
- Update TASKLIST.md to mark YNX-0102 and YNX-0401 complete
- YNX-0903: Add sendMessageToServer() and sendRuleMessage() to Client runtime
- YNX-0904: Add sendMessageToClient() and sendRuleMessageToClient() to Server runtime
- YNX-0905: Implement handleRuleMessage() for server-side message rewriting
  with sender identifier injection (::::)
- Update TASKLIST.md to mark all 3 tasks as completed
- YNX-1003: Single-identifier single-active-connection policy (completed)
- YNX-1004: Restart recovery strategy (completed with documentation)
- YNX-0603: Discord DM notification skeleton complete, real DM noted as needing discord.js
- YNX-1104a: Create Server-Client integration test framework
  - MockTransportPair for simulating network communication
  - createIntegrationTestContext() for test environment setup
  - First-time pairing flow integration tests
  - Reconnection flow tests

- YNX-1105a: Create failure path test matrix documentation
  - MATRIX.md with PF/AF/RP/CF/HF/SR categories
  - Priority marking for critical security paths

- YNX-1105b: Implement pairing failure path tests
  - PF-01: Invalid pairing code with retry
  - PF-02: Expired pairing code cleanup
  - PF-03: Unknown identifier rejection
  - PF-04: Admin notification failure handling
  - PF-05: Empty/whitespace code rejection
  - PF-06: Malformed payload handling
  - PF-07: Double pairing protection
  - Edge cases: concurrent pairing, state cleanup

- Update TASKLIST.md with completion status
hzhang added 1 commit 2026-04-10 19:18:29 +00:00
Wire rule registry and authenticated callbacks into both client and server
runtimes; expose __yonexusClient / __yonexusServer on globalThis for
cross-plugin communication. Add Docker-based integration test with
server-test-plugin (test_ping echo) and client-test-plugin (test_pong
receiver), plus docker-compose setup. Fix transport race condition where
a stale _connections entry caused promoteToAuthenticated to silently fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hzhang added 2 commits 2026-04-10 20:59:13 +00:00
Both Yonexus.Client and Yonexus.Server used module-level variables as
hot-reload guards, which reset on every hot-reload (new VM context).
Fix submodule pointers to the corrected plugin index.ts commits.

Also add LESSONS_LEARNED.md and OPENCLAW_PLUGIN_DEV.md (copied from
Dirigent) with three new lessons from this session (§11 connection-plugin
hot-reload trap, §12 transport message routing race, §13 re-hello on
session race) and updated plugin dev guide (§2.2 connection plugin entry
pattern, §6 state table, §9 checklist, §10 cross-plugin globalThis API).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hzhang closed this pull request 2026-05-20 15:07:14 +00:00
hzhang deleted branch dev/2026-04-08 2026-05-20 15:07:15 +00:00
hzhang changed title from dev/2026-04-08 to merge: dev/2026-04-08 — Yonexus v1 implementation, docs, and integration tests 2026-05-20 15:07:57 +00:00
hzhang reopened this pull request 2026-05-20 15:07:58 +00:00
hzhang closed this pull request 2026-05-20 15:15:37 +00:00
Author
Contributor

Merged into main via direct push as commit 0ec7bc3 after Gitea PR mergeable status got stuck on reopen race. Same content, same merge commit message. Closing PR ref.

Merged into main via direct push as commit `0ec7bc3` after Gitea PR mergeable status got stuck on reopen race. Same content, same merge commit message. Closing PR ref.

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nav/Yonexus#5