Skip to content

subgraph-meta: named magics and OA schema - #331

Merged
thedavidmeister merged 4 commits into
mainfrom
328-upstream-consumers
Nov 1, 2026
Merged

thedavidmeister merged 4 commits into
mainfrom
328-upstream-consumers

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

After merge, @rainlanguage/subgraph-meta exports every known magic by its Rust name and gives each decoded item its OA schema, so st0x.deploy, rain.deploy and the OA subgraph can drop their local copies. Refs #328.

Live effect: none until a consumer bumps the package · Risk: low (no money path; decode accepts and rejects the same input) · Ships: next package publish

Decisions

Proof

  • The parity job compares each item's schema bytes and string with cbor_decode. It covers corpus cases for absent, empty, NUL and invalid UTF-8 schemas, plus 100000 fuzz documents.
  • Mutation on 376fe34 covered the named magics, KNOWN_MAGICS, the schema plumbing and schemaString(): 121 of 123 mutants were killed. A magic retyped i64 survived, and the u64 check now kills it. The other survivor is equivalent: an extra fail() after a read that already failed.
  • Not verified: no consumer has built against this package yet. CI runs the decoder under node, not inside graph-node.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Oct 31, 2026
thedavidmeister and others added 3 commits October 31, 2026 13:10
…d value

Both decoders now print each item's schema (hex or null) and its string under
the preimageString rule, and the magics listing pairs every exported u64 with
its name against KnownMagic's SCREAMING_SNAKE variant names, followed by
KNOWN_MAGICS membership. Corpus gains schema cases: absent, text vs byte
string, multibyte, invalid UTF-8, NUL, on dropped and name items, and per item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wasm global of an i64 export carries the same bits as a u64 one, so the
name and value diff cannot see the type. The runner build now emits its
TypeScript definitions and the magics mode requires u64 for every exported
64-bit global.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedavidmeister
thedavidmeister merged commit b92b877 into main Nov 1, 2026
12 of 13 checks passed
@linear

linear Bot commented Nov 1, 2026

Copy link
Copy Markdown

RAI-4253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant