Repository navigation
v4 L0: one schema, generated TS + Go contracts, fixtures, preflight - #2977
Closed
lilyshen0722 wants to merge 1 commit into
Closed
lilyshen0722 wants to merge 1 commit into
lilyshen0722 wants to merge 1 commit into
Conversation
schema/ (7 files, drafted by the SWE session) is the only source of wire shapes. scripts/gen.mjs writes gen/ts/protocol.ts, gen/ts/schemas.json (ajv bundle), gen/ts/tools.json (MCP tools, refs inlined) and daemon/internal/protocol/gen.go (structs, enums, required-key checks, event decode). It rejects composition keywords and inline objects, and checks that x-variants covers EventType exactly. 71 fixtures under schema/fixtures/ are checked by ajv (valid pass, invalid fail) and by a Go round-trip test (valid re-encode to the same JSON, invalid-required rejected). CI runs make check-gen, test-ts and test-go, with Bun and Go installed by setup actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MDs9DS3E4dzoHKdxtgQqyz
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
5 tasks done
Contributor
Author
|
Moved to Team-Commonly/jellymoon#1 (v4 now lives in its own private repo, D187). The |
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.
L0 of the v4 build (spec §2–§3, board TASK-633). Every lane builds against what this lands.
What changed
schema/: seven JSON Schema files, drafted by the SWE session. They're the only definition of a wire shape: messages and receipts, socket events, the pod API, tokens and the six MCP tools.scripts/gen.mjs(Bun, no dependencies) generates:gen/ts/protocol.ts: types, enum value lists, the typed event union, andToolIO;gen/ts/schemas.json: one bundle for ajv in the Worker;gen/ts/tools.json: MCP tool definitions with refs inlined;daemon/internal/protocol/gen.go: structs, enums, required-key checks,RegistryandDecodeEventData.oneOf/anyOf/allOf/if/notand inline objects, and fails ifx-variantsandEventTypediffer.schema/fixtures/: 71 fixtures. Each message kind has three agent posts and three stored messages, plus a human post. Every event type has an envelope. Invalid cases cover a missing summary, an over-long summary, a newline in the summary, a client-sent receipt, a bad option id,needswith both targets, an http link, a v2 envelope and missing required keys.Makefile:gen,check-gen,test,preflight.AGENTS.mdis one page, withCLAUDE.mdas a symlink to it.gen-driftnow runsmake check-genandmake test-ts. Thegojob runsmake test-go. Bun 1.4.4 and Go come from the setup actions.e2e-previewacceptswrangler.jsoncas well aswrangler.toml.Done-test (spec §3 L0)
make genis idempotent: a second run leaves the tree clean.check-genfails whenschema/changes without a regenerate, and whengen/is edited by hand or has untracked files.go test -raceround-trips every valid fixture to identical JSON and rejects everyinvalid-required-*one.summaryfrom one valid message, and both the ajv check and the Go test failed, naming that fixture.make preflightis green locally on Go 1.27.3 and Bun 1.4.4.Protected paths (
schema/**,.github/workflows/**): this needs one OpusGATE: PASSat the PR head.Retro: main's husky pre-commit hook fires inside v4 worktrees, and with no lint-staged config on v4 it aborts the commit. Commit with
git -c core.hooksPath=/dev/nulluntil v4 has its own hook (§8.3make setup).🤖 Generated with Claude Code
https://claude.ai/code/session_01MDs9DS3E4dzoHKdxtgQqyz