Skip to content

feat: add WASM ABI codec generation to generator-echo - #402

Merged
flyingrobots merged 3 commits into
mainfrom
echo-raw-lb
Mar 9, 2026
Merged

flyingrobots merged 3 commits into
mainfrom
echo-raw-lb

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Mar 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add deterministic binary codec generation for Echo's WASM FFI boundary response types, replacing CBOR encoding with Wesley-generated raw LE codecs
  • New Rust emitter (emitWasmAbiCodec.mjs) generates struct definitions, encode/decode impls, and binary envelope helpers (encode_ok/encode_err/decode_envelope)
  • New TypeScript emitter (emitWasmAbiCodecTs.mjs) generates matching byte-identical codecs with AbiResult<T> discriminated union and per-response-type convenience decoders
  • Canonical ABI schema at schemas/echo-wasm-abi.graphql with custom scalars: Hash32 (raw 32 bytes, no length prefix), Bytes (u32 LE length-prefixed), U32/U64 (unsigned LE integers)
  • CONTRACT_VERSION bumped 1.1.0 → 1.2.0 (new artifact files = minor bump per versioning policy)

Test plan

  • 30 Rust codec tests covering struct generation, scalar encoding, envelope functions, optional/nested/list handling, field ordering, schema drift
  • 23 TypeScript codec tests covering interfaces, type mappings, helpers, envelope, convenience decoders
  • Integration tests verifying generateEcho() produces both wasm_abi_codec.generated.rs and .ts
  • All 344 existing tests pass (golden fixtures updated for contract version bump)
  • Manual review of generated Rust output for drop-in compatibility with warp-wasm/src/lib.rs

Replace CBOR encoding at the Echo WASM FFI boundary with Wesley-generated
deterministic binary codecs. The new emitters produce byte-exact Rust and
TypeScript encode/decode functions for all ABI response types, using a
binary envelope format (0x01 success / 0x00 error) instead of CBOR.

New files:
- schemas/echo-wasm-abi.graphql — canonical ABI response type definitions
  with custom scalars (Hash32, Bytes, U32, U64)
- emitWasmAbiCodec.mjs — Rust codec generator (structs + encode/decode +
  envelope helpers)
- emitWasmAbiCodecTs.mjs — TypeScript codec generator (interfaces +
  encode/decode + AbiResult<T> + envelope decoders)
- 50 tests (28 Rust, 22 TypeScript)

Key design decisions:
- Hash32 fields encode as raw 32 bytes (no length prefix) since the
  schema knows the fixed size — critical for BLAKE3 hash determinism
- CONTRACT_VERSION bumped 1.1.0 → 1.2.0 (new artifact files = minor bump)
- ABI SDL embedded in index.mjs; schemas/ file is canonical reference
@coderabbitai

coderabbitai Bot commented Mar 9, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@flyingrobots has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7cdf458b-7265-4c26-adcd-e0bd17f4a7df

📥 Commits

Reviewing files that changed from the base of the PR and between 8693ff8 and e47a7e0.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/wesley-generator-echo/README.md
  • packages/wesley-generator-echo/src/index.mjs

Walkthrough

This PR adds WASM ABI codec generation to the Echo generator: new Rust and TypeScript emitters that produce deterministic encode/decode and envelope helpers from a GraphQL SDL, a canonical ABI schema, expanded tests, and a contract version bump to 1.2.0.

Changes

Cohort / File(s) Summary
WASM ABI Codec Generators
packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs, packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs
New exported modules that parse an ABI SDL and emit deterministic Rust and TypeScript codecs (per-type encode/decode, primitive helpers, option/list handling, envelope encode/decode, AbiError, ordering rules).
Generator Integration
packages/wesley-generator-echo/src/index.mjs, packages/wesley-generator-echo/src/EchoPlugin.mjs, packages/wesley-generator-echo/README.md
Imports new emitters, adds WASM_ABI_SDL const, emits wasm_abi_codec.generated.rs and wasm_abi_codec.generated.ts unconditionally, bumps CONTRACT_VERSION to 1.2.0, and extends generateEcho signature with queryNamespace. EchoPlugin.plan now lists 10 artifacts.
Canonical Schema
schemas/echo-wasm-abi.graphql
New GraphQL schema declaring scalars Hash32, Bytes, U32, U64 and response/envelope types (DispatchResponse, HeadInfo, StepResponse, ChannelData, DrainResponse, RegistryInfo, AbiError).
Tests
packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs, packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs
Extensive Rust/TS generator tests added covering generation presence, helpers (Hash32/Bytes/U32/U64), envelope behavior, optional/list/nested handling, alphabetical field ordering, and integration with generateEcho.
Fixtures / Metadata
packages/wesley-generator-echo/test/fixtures/wasm-abi-sdl.mjs, packages/wesley-generator-echo/test/fixtures/basic-v2.ir.json, packages/wesley-generator-echo/test/fixtures/joins-v2.ir.json
New ABI SDL fixture exported; test IR fixtures updated to contract_version 1.2.0.
Docs
packages/wesley-generator-echo/README.md
Documentation updated to document the two new always-emitted WASM ABI codec artifacts and updated artifact counts.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Generator as Generator (Echo)
  participant SDL as ABI SDL
  participant Rust as wasm_abi_codec.generated.rs
  participant TS as wasm_abi_codec.generated.ts
  participant Host as Host (JS/Rust runtime)

  Generator->>SDL: read canonical ABI SDL
  Generator->>Rust: emit Rust codec (encode/decode, envelope)
  Generator->>TS: emit TypeScript codec (encode/decode, envelope)
  Host->>Rust: call encode_ok / encode_err (WASM boundary)
  Rust->>Host: produce deterministic wire bytes (Hash32/Bytes/U32/U64 formats)
  Host->>TS: use TS decodeEnvelope to parse wire bytes (match Rust format)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🦀 Rust and TS compose a binary song,
Fields sorted tidy, errors typed strong.
Envelopes whisper tags precise and small —
Version bumped, artifacts answer the call. ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 54.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description covers summary, test plan, and contract version rationale but omits required template sections: Why (rationale/alternatives), Risk, Backout, EvidenceMap, and Merge Strategy. Add missing sections: Why (alternatives considered, trade-offs), Risk (user-facing/CI risks, mitigations), Backout (revert procedure, cleanup), and Merge Strategy confirmation. Optional: EvidenceMap if schema mapping applies.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding WASM ABI codec generation capabilities to the Echo generator, which is the core focus of this changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch echo-raw-lb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 9, 2026 •

Copy link
Copy Markdown

🚢 SHIPME

[REALM] PASS — sha 9eedb59

@github-actions

github-actions Bot commented Mar 9, 2026 •

Copy link
Copy Markdown

🔍 The Case of Pull Request #402

🕵️ SHA-lock HOLMES's Investigation (click to expand)

🕵️ SHA-lock HOLMES Investigation

  • Generated: 2026-03-09T06:40:29.382Z
  • Commit SHA: 9eedb59
  • Bundle Version: 2.0.0

⚠️ Evidence valid only for commit 9eedb59

🔍 Executive Deduction

"Watson, after careful examination of the evidence, I deduce..."

Weighted Completion: ██████░░░░ 60.0%
Scores: SCS 60.0% · TCI 70.0% · MRI 20.0%
Verification Status: 2 claims verified
Ship Verdict: REQUIRES INVESTIGATION

🧩 SCS Breakdown

Component Score Coverage
Sql 60.0% 0.60/1.00
Types 60.0% 0.60/1.00
Validation 60.0% 0.60/1.00
Tests 70.0% 0.70/1.00

🧪 TCI Breakdown

Component Score Coverage Note
Unit Constraints 70.0% 1/1 N/A
Unit Rls 0.0% — N/A
Integration Relations 0.0% — N/A
E2e Ops 0.0% — Not tracked in quick emit mode

⚠️ MRI Breakdown

Component Risk Share Points Count
Drops 100.0% 20 0
Renames Without Uid 0.0% 0 0
Add Not Null Without Default 0.0% 0 0
Non Concurrent Indexes 0.0% 0 0

📊 The Weight of Evidence

"Observe, Watson, how not all features carry equal importance..."

Element Weight Status Evidence Deduction
schema 5 ✅ SQL & tests out/schema.sql:1-9999@9eedb59 Elementary!

🚪 Security & Performance Gates

"Elementary security measures, Watson..."

Gate Status Evidence Holmes's Ruling
Migration Risk ✅ MRI: 20.0% "Acceptable risk"
Test Coverage ⚠️ TCI: 70.0% "Insufficient coverage"
Sensitive Fields ✅ 0 fields "All secured"

📋 The Verdict

⚠️ REQUIRES FURTHER INVESTIGATION
"Some clues remain unclear. Address the noted issues."

Signed and sealed,

  • S. Holmes, Consulting Detective

[END OF INVESTIGATION FOR COMMIT 9eedb59]


🩺 Dr. WATSON's Verification (click to expand)

🩺 Dr. Watson's Independent Verification Report

Medical Examination of Evidence

  • Examination Date: 2026-03-09T06:41:11.589Z
  • Patient SHA: 9eedb59

🔬 Citation Verification

"Let me examine each piece of evidence independently..."

  • Citations Examined: 2
  • Verified: 0 ✅
  • Failed: 0 ❌
  • Unable to Verify: 2

Verification Rate: 0.0%

📊 Mathematical Verification

"I shall recalculate Holmes's arithmetic..."

Holmes claimed SCS: 60.0%
Watson calculates: 100.0%
Difference: ⚠️ Significant

🔍 Consistency Analysis

"Checking for contradictions in Holmes's deductions..."

✅ No logical inconsistencies detected

🩺 Dr. Watson's Medical Opinion

VERIFICATION: CONCERNS NOTED ⚠️

"While Holmes's methods are generally sound, I have noted some"
"discrepancies that warrant further investigation."

Respectfully submitted,

  • Dr. J. Watson, M.D.
    Medical Examiner & Verification Specialist

🔮 Professor MORIARTY's Predictions (click to expand)

🧠 Professor Moriarty's Temporal Predictions

The Mathematics of Inevitability

  • Analysis Date: 2026-03-09T06:41:44.393Z

🔮 Current State

SCS: ██████░░░░ 60.0%
TCI: ███████░░░ 70.0%
MRI: 20.0% risk

📈 Velocity Analysis

SCS Velocity: +0.00%/day
Git Activity (window): 24h · commits 62 (2 relevant) · ~62.00 commits/day
↳ Magnitude: ~278 relevant LOC/day across ~2.0 files/day
Activity Index: 25 / 100 (PR 0, Window 63)
Blended Velocity: +0.15%/day
Commit Size Burstiness: 42 / 100 (higher = more uneven commit sizes)
⚠️ PLATEAU DETECTED - Low SCS movement and low recent Git activity.

⏰ Completion Predictions

ETA: Cannot predict (insufficient velocity)

"At current velocity, completion is... improbable."

🧪 Readiness EXPLAIN

  • SCS ≥ 80% → FAIL ❌ (actual 60.0%)
  • TCI ≥ 70% → PASS ✅ (actual 70.0%)
  • MRI ≤ 40% → PASS ✅ (actual 20.0%)
  • CI Stability ≥ 90% (branch main) → PASS ✅ (actual 99% over ~168h)
  • Delivery context (last 168h): 1 issues closed · 7 PRs merged (informational, not gating)

Signals blend: SCS velocity (70%) + Git activity (30%, branch-first). Activity only suppresses false plateaus; it never inflates readiness.

📊 Historical Trajectory

03-09: ██████░░░░ 60.0%
03-09: ██████░░░░ 60.0%
03-09: ██████░░░░ 60.0%

"Every problem becomes elementary when reduced to mathematics"
— Professor Moriarty


Machine-readable reports: holmes-report.json · watson-report.json · moriarty-report.json (see workflow artifacts).


Filed at 221B Repository Street

@coderabbitai coderabbitai Bot added enhancement New feature or request feature New feature or request labels Mar 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9bef21c46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/wesley-generator-echo/README.md (1)

40-44: ⚠️ Potential issue | 🟡 Minor

artifact_count: 6 appears stale given "always emitted" WASM ABI codecs.

The example shows artifact_count: 6, but:

  1. Lines 36-38 state WASM ABI codecs are "always emitted"
  2. EchoPlugin.plan() now declares 10 potential artifacts
  3. With 4 always-emitted files (ir.json, ops.generated.ts, schemas.generated.ts, client.generated.ts) plus 2 WASM ABI codecs, the minimum is now 6, but the realistic count with any encodable types would be 8+

Consider updating the example to reflect a realistic invocation or adding a note that artifact_count varies by schema.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wesley-generator-echo/README.md` around lines 40 - 44, The README
example's artifact_count is stale: update the example or add a note to reflect
that EchoPlugin.plan() now declares 10 potential artifacts and that WASM ABI
codecs are always emitted, meaning the minimum emitted files include ir.json,
ops.generated.ts, schemas.generated.ts, client.generated.ts plus two WASM codec
files (so realistic artifact_count is 8+ when encodable types exist); change the
sample object (artifact_count: 6) to a more realistic number (e.g.,
artifact_count: 8) or append a brief clarifying sentence that artifact_count
varies by schema and can be higher due to always-emitted WASM ABI codec files
and additional generated artifacts from EchoPlugin.plan().
♻️ Duplicate comments (1)
packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs (1)

44-86: 🧹 Nitpick | 🔵 Trivial

Parser logic duplicated from Rust emitter.

parseAbiTypes and unwrapType are byte-for-byte identical to emitWasmAbiCodec.mjs. Extract to a shared parseAbiSdl.mjs utility to reduce maintenance surface.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs` around lines 44 -
86, The parseAbiTypes and unwrapType functions are duplicated; extract this
parsing logic into a shared utility module (e.g., parseAbiSdl) and import it
from both emitWasmAbiCodecTs.mjs and the Rust emitter file to avoid duplication.
Create a new module that exports parseAbiTypes and unwrapType (keeping their
signatures), move the implementations there, update emitWasmAbiCodecTs.mjs to
import { parseAbiTypes, unwrapType } from the new module and remove the local
definitions, and do the same in emitWasmAbiCodec.mjs so both use the shared
parseAbiSdl helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Around line 10-36: Add the missing blank lines above the Markdown headings
flagged by markdownlint MD022: insert a blank line before the "#### WASM ABI
Codec Generation" heading, another blank line before the "### Changed" heading
(the section that starts with CONTRACT_VERSION bump and EchoPlugin.plan()), and
a blank line before the "#### Other" heading so each heading is separated by an
empty line as required.

In `@packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs`:
- Around line 66-89: The unwrapType function currently discards inner list-item
nullability (both [T] and [T!] yield { list: true }); update unwrapType to
detect and return the inner non-null flag (e.g., listItemRequired or
itemRequired) when node.kind === Kind.LIST_TYPE by checking whether the list
element is a NON_NULL_TYPE before unwrapping, so callers (code that generates
Rust types/codec) can emit Vec<T> vs Vec<Option<T>>; if the ABI intentionally
requires non-null items, add a clear comment in unwrapType documenting that
invariant instead of dropping the information.
- Around line 613-619: The current toSnakeCase function produces verbose output
for consecutive capitals (e.g. "HTTPRequest" -> "h_t_t_p_request"); update the
implementation of toSnakeCase to use a regex that groups consecutive uppercase
runs and splits only between acronym/word boundaries (for example the pattern
used in the review: replace with a regex that handles ([A-Z]+)([A-Z][a-z]) and
([a-z])([A-Z]) so acronyms become "http_request"). Replace the existing replace
chain in toSnakeCase with this single smarter regex-based replacement, keep the
final .toLowerCase() call, and ensure it still trims any leading underscores if
needed.
- Around line 590-602: Add a new enum variant
AbiDecodeError::InvalidEnvelopeTag(u8), update the emitDecodeError generator and
the AbiDecodeError Display implementation to render a clear message for this
variant, and change the default arm in the generated envelope decoder (the match
on bytes[0] in emitEnvelope) to return
Err(AbiDecodeError::InvalidEnvelopeTag(bytes[0])) instead of
Err(AbiDecodeError::UnexpectedEof) so invalid discriminators produce the new,
accurate error.

In `@packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs`:
- Around line 26-28: The generated TypeScript references AbiError in the
exported AbiResult<T> but never emits an AbiError definition, causing a compile
error; modify the emitter (the code that calls lines.push in
emitWasmAbiCodecTs.mjs) to emit a proper AbiError type/interface before emitting
AbiResult (for example add a lines.push that defines export type AbiError = {
message: string; code?: number } or an equivalent shape needed by callers) so
that AbiError is declared prior to the AbiResult<T> line.
- Around line 117-119: The generated TypeScript includes a redundant "|
undefined" for optional properties; update the code in emitWasmAbiCodecTs.mjs
where tsType is modified (the lines that set tsType for list and for !required)
so that when a field is not required you append " | null" instead of " | null |
undefined" (i.e., change the !required branch to tsType = `${tsType} | null`).
Reference the tsType variable and the existing list/!required conditional logic
when making the change.

In `@packages/wesley-generator-echo/src/index.mjs`:
- Around line 17-63: WASM_ABI_SDL is a verbatim copy of
schemas/echo-wasm-abi.graphql and can drift; add a unit test that loads the
canonical file and asserts its (trimmed/comment-stripped) contents equal the
embedded WASM_ABI_SDL value (export WASM_ABI_SDL from index.mjs if not already
exported so the test can import it), or alternatively change the module to read
the canonical file at build-time; ensure the test normalizes whitespace and
strips leading comment headers before comparing to avoid false negatives.
- Around line 150-158: The if-guards around emitWasmAbiCodec(WASM_ABI_SDL) and
emitWasmAbiCodecTs(WASM_ABI_SDL) are dead because WASM_ABI_SDL is a hardcoded
object and EchoPlugin.plan() / README declare these codecs as "always emitted";
remove the conditional checks and unconditionally push the results into files
(i.e., always push { path: 'wasm_abi_codec.generated.rs', content: abiRust } and
{ path: 'wasm_abi_codec.generated.ts', content: abiTs } after calling
emitWasmAbiCodec and emitWasmAbiCodecTs), or if you prefer defensive coding keep
the guards but add a comment on the immutability/unreachability of null for
WASM_ABI_SDL and why the check exists.

In `@packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs`:
- Around line 9-51: The ABI_SDL string is duplicated across tests; extract it
into a single shared fixture (e.g., export const ABI_SDL from a shared
test-helper module or re-export the canonical schema string) and update the test
file to import ABI_SDL instead of redefining it; locate the constant named
ABI_SDL in this test (wasm-abi-codec.test.mjs) and replace the inline SDL with
an import from the shared fixture or the canonical schema export so changes only
need to be made in one place.

In `@packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs`:
- Around line 236-249: The test slices the emitted TS using ts.indexOf('function
_encodeHash32') and ts.indexOf('function _decodeHash32') without verifying the
functions exist, which can throw -1 slices; add a guard that captures the index
for each function (e.g., idxEncode = ts.indexOf('function _encodeHash32') and
idxDecode = ts.indexOf('function _decodeHash32') ), assert each index is > -1
with expect(...).toBeGreaterThan(-1), then perform the slice using that index to
ensure the slice only runs when the function is present; update both the
_encodeHash32 and _decodeHash32 checks accordingly.

---

Outside diff comments:
In `@packages/wesley-generator-echo/README.md`:
- Around line 40-44: The README example's artifact_count is stale: update the
example or add a note to reflect that EchoPlugin.plan() now declares 10
potential artifacts and that WASM ABI codecs are always emitted, meaning the
minimum emitted files include ir.json, ops.generated.ts, schemas.generated.ts,
client.generated.ts plus two WASM codec files (so realistic artifact_count is 8+
when encodable types exist); change the sample object (artifact_count: 6) to a
more realistic number (e.g., artifact_count: 8) or append a brief clarifying
sentence that artifact_count varies by schema and can be higher due to
always-emitted WASM ABI codec files and additional generated artifacts from
EchoPlugin.plan().

---

Duplicate comments:
In `@packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs`:
- Around line 44-86: The parseAbiTypes and unwrapType functions are duplicated;
extract this parsing logic into a shared utility module (e.g., parseAbiSdl) and
import it from both emitWasmAbiCodecTs.mjs and the Rust emitter file to avoid
duplication. Create a new module that exports parseAbiTypes and unwrapType
(keeping their signatures), move the implementations there, update
emitWasmAbiCodecTs.mjs to import { parseAbiTypes, unwrapType } from the new
module and remove the local definitions, and do the same in emitWasmAbiCodec.mjs
so both use the shared parseAbiSdl helper.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2b5a8d3f-bb5f-4c5f-a337-1393d5ec05da

📥 Commits

Reviewing files that changed from the base of the PR and between 32685d5 and a9bef21.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • packages/wesley-generator-echo/README.md
  • packages/wesley-generator-echo/src/EchoPlugin.mjs
  • packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs
  • packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs
  • packages/wesley-generator-echo/src/index.mjs
  • packages/wesley-generator-echo/test/fixtures/basic-v2.ir.json
  • packages/wesley-generator-echo/test/fixtures/joins-v2.ir.json
  • packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs
  • packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs
  • schemas/echo-wasm-abi.graphql

Comment thread packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs
Comment thread packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs
Comment thread packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs Outdated
Comment thread packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs
Comment thread packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs
Comment thread packages/wesley-generator-echo/src/index.mjs
Comment thread packages/wesley-generator-echo/src/index.mjs Outdated
Comment thread packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs Outdated
Comment thread packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs
Fix Rust decode_raw_le_at &mut offset bug, add InvalidEnvelopeTag error
variant, fix toSnakeCase consecutive capitals, extract shared SDL test
fixture, and remove redundant | undefined from TS codec types.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 55: The markdown heading "#### Other" is missing a blank line after it
(MD022); update the CHANGELOG.md by inserting a single blank line immediately
after the "#### Other" heading to follow markdown heading formatting conventions
and match other headings in the file.
- Line 11: Add a blank line immediately after the Markdown heading "#### WASM
ABI Codec Generation" in CHANGELOG.md so the heading is surrounded by blank
lines (fixing MD022); locate the heading text "#### WASM ABI Codec Generation"
and insert a single empty line following it to satisfy the Markdown linter.
- Line 28: The PR summary contains incorrect test counts; update the summary so
it matches the actual implementation and the CHANGELOG by changing the Rust
codec count to 30 and the TypeScript codec count to 23 (total 53 tests). Locate
the PR summary text that currently lists "28 Rust" and "22 TypeScript" and
replace those numbers with "30 Rust" and "23 TypeScript" respectively, and
update the total to "53" where shown.

In `@packages/wesley-generator-echo/README.md`:
- Line 43: The README's artifact_count value is inconsistent with
EchoPlugin.plan(): update the README or the plugin so they match; specifically
either change the example line "artifact_count: 8" (and the comment "6 always +
conditionals") to reflect the actual 10 artifacts declared by EchoPlugin.plan()
(6 always + 4 conditionals) or modify EchoPlugin.plan() to only declare 8
artifacts if that was intended; locate EchoPlugin.plan() to confirm which
artifacts are always emitted (ir.json, ops.ts, schemas.ts, client.ts,
wasm_abi_codec.rs, wasm_abi_codec.ts) and adjust the README example text to
clearly state whether the number is for a specific schema or the general max/min
so the documented artifact_count aligns with the code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 049ecf41-7235-4aba-97a8-228379b7e1c8

📥 Commits

Reviewing files that changed from the base of the PR and between a9bef21 and 8693ff8.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/wesley-generator-echo/README.md
  • packages/wesley-generator-echo/src/emitWasmAbiCodec.mjs
  • packages/wesley-generator-echo/src/emitWasmAbiCodecTs.mjs
  • packages/wesley-generator-echo/src/index.mjs
  • packages/wesley-generator-echo/test/fixtures/wasm-abi-sdl.mjs
  • packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs
  • packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
`U32`/`U64` as unsigned little-endian integers
- **Envelope wire format**: Success `[0x01][payload...]`, Error
`[0x00][u32 LE code][u32 LE msg_len][UTF-8 msg...]`
- 53 tests (30 Rust codec, 23 TypeScript codec) covering struct generation, scalar

@coderabbitai coderabbitai Bot Mar 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Count actual test cases in the test files
echo "=== Rust codec tests (describe/it blocks) ==="
grep -c "^\s*it\(" packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs || echo "0"

echo "=== TypeScript codec tests (describe/it blocks) ==="
grep -c "^\s*it\(" packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs || echo "0"

Repository: flyingrobots/wesley

Length of output: 229


🏁 Script executed:

#!/bin/bash
# First, check if the test files exist
echo "=== Checking for test files ==="
ls -la packages/wesley-generator-echo/test/ 2>/dev/null || echo "Directory not found"

echo ""
echo "=== Checking available test files in repo ==="
find . -name "*codec*test*" -type f 2>/dev/null | head -20

Repository: flyingrobots/wesley

Length of output: 2074


🏁 Script executed:

#!/bin/bash
# Look at the structure of both test files
echo "=== wasm-abi-codec.test.mjs (first 50 lines) ==="
head -50 packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs

echo ""
echo "=== wasm-abi-ts-codec.test.mjs (first 50 lines) ==="
head -50 packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs

Repository: flyingrobots/wesley

Length of output: 4001


🏁 Script executed:

#!/bin/bash
echo "=== Counting test cases ==="
echo "Rust codec tests (wasm-abi-codec.test.mjs):"
grep -c "it(" packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs

echo "TypeScript codec tests (wasm-abi-ts-codec.test.mjs):"
grep -c "it(" packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs

echo ""
echo "=== Total ==="
rust_count=$(grep -c "it(" packages/wesley-generator-echo/test/wasm-abi-codec.test.mjs)
ts_count=$(grep -c "it(" packages/wesley-generator-echo/test/wasm-abi-ts-codec.test.mjs)
total=$((rust_count + ts_count))
echo "Rust: $rust_count, TypeScript: $ts_count, Total: $total"

echo ""
echo "=== Verification against claims ==="
echo "CHANGELOG claims: 30 Rust, 23 TypeScript (53 total)"
echo "PR summary claims: 28 Rust, 22 TypeScript (50 total)"
echo "Actual counts: $rust_count Rust, $ts_count TypeScript ($total total)"

Repository: flyingrobots/wesley

Length of output: 435


PR summary has incorrect test counts.

The CHANGELOG is correct: 30 Rust codec tests and 23 TypeScript codec tests (53 total). The PR summary claims 28 Rust and 22 TypeScript tests (50 total), which does not match the actual implementation. Update the PR summary to reflect the correct counts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 28, The PR summary contains incorrect test counts;
update the summary so it matches the actual implementation and the CHANGELOG by
changing the Rust codec count to 30 and the TypeScript codec count to 23 (total
53 tests). Locate the PR summary text that currently lists "28 Rust" and "22
TypeScript" and replace those numbers with "30 Rust" and "23 TypeScript"
respectively, and update the total to "53" where shown.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — updated PR summary to 30 Rust / 23 TypeScript (53 total), matching the actual test counts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rate Limit Exceeded

@flyingrobots have exceeded the limit for the number of chat messages per hour. Please wait 2 minutes and 2 seconds before sending another message.

Comment thread CHANGELOG.md
Comment thread packages/wesley-generator-echo/README.md Outdated
- Fix MD022 blank-line-after-heading violations in CHANGELOG.md
- Update README artifact_count from 8 to 10 (6 always + 4 conditionals)
- Remove dead null guards for WASM ABI codec emission in index.mjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant