feat(schemas): encode the wire protocol as Zod single-source-of-truth - #6
Merged
Merged
Conversation
pnpm's strict node_modules layout does not expose semantic-release's built-in plugin subpaths (semantic-release/commit-analyzer and semantic-release/release-notes-generator), so the release job failed with MODULE_NOT_FOUND. Install both plugins as devDependencies and reference them by package name instead.
Every verified protocol shape becomes a schema with an attached .is() guard (defineSchema): key files, registry entries, the envelope attribute grammar with its canonical order and charsets, auth lines, user frames with file attachments, and all control frames (peer_message_status receipts with the drop taxonomy, notify_when_idle / peer_idle_notice, the yield_artifact_replies family). Protocol limits live in limits.ts as named constants derived from the receiver's own grammar. Domain layer: envelope builder/parser mirroring the receiver's regex including the rebuild-and-compare round-trip invariant (bodies stay in escaped form; escaping is idempotent), hop-chain utilities replicating the admission guards (runaway > 28, loop at >= 10 own-token hits), and id generation. The envelope round-trip test fixture is a frame captured verbatim from live Claude Code 2.1.269 traffic. The JSON-Schema generator now emits draft-2020-12 documents for all eleven schemas, published as ./schemas/*.schema.json subpath exports.
docs/PROTOCOL.md carries the full verified wire reference: transport and identity, key-file auth classes, user and control frames, envelope grammar, the consent model, peer registration and roster admission, the receipt status table with the drop taxonomy, idle subscriptions, guard rails with hop-token derivation, artifact_yield, file transfer up to its upstream flag, cloud/bridge routing, and the daemon - with verification status separating live-confirmed behaviour from evidenced boundaries.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.is()guards: key files, registry entries, envelope grammar, auth lines, user frames, and every control frame (receipts with the drop taxonomy, idle subscriptions, the yield family)../schemas/*.schema.json.docs/PROTOCOL.md: the full implement-it-yourself reference.Test plan