Skip to content

sdk 0.3.0: stricter decode, packaging fixes, PR CI, doc corrections - #11

Merged
GigaHierz merged 1 commit into
mainfrom
GigaHierz/fable-codebase-review
Jul 2, 2026
Merged

sdk 0.3.0: stricter decode, packaging fixes, PR CI, doc corrections#11
GigaHierz merged 1 commit into
mainfrom
GigaHierz/fable-codebase-review

Conversation

@GigaHierz

Copy link
Copy Markdown
Collaborator

Full-codebase review pass. Highlights:

SDK (@celo/attribution-tags → 0.3.0)

  • Schema-0-only decode: fromDataSuffix now returns null for non-zero schema IDs (e.g. Schema 1 custom-registry tags) and for empty code fields, instead of returning codes that look canonical but aren't.
  • Multi-code length cap: toDataSuffix rejects comma-joined code fields over 255 bytes (the wire format's single length byte) with a clear error instead of an opaque internal throw.
  • Type-only viem decoupling: the published .d.ts no longer imports from viem, so TypeScript consumers who don't install the optional peer no longer get "Cannot find module 'viem'". viem clients still satisfy the new structural TxClient type.
  • Packaging: added a default export condition (fixes require() / default-condition resolvers) and ship LICENSE in the npm tarball.

CI

  • New test-sdk.yml: typecheck + tests + build on PRs and pushes to main (previously tests only ran at publish time).
  • publish-sdk.yml: fail if the pushed tag doesn't match sdk/package.json version; actions pinned to commit SHAs.

Docs

  • INDEXERS.md: the length byte bounds the whole joined code field (1–255 bytes, not 1–32 — the SDK legally emits multi-code fields over 32 bytes); pseudocode gains truncation and schema guards; SQL filter rewritten for DuneSQL varbinary; corrected multi-code byte math and stale 8-char code examples; minimum suffix is 19 bytes, not 35.
  • BUILDERS.md: fixed the SSR guidance — "use client" modules still execute during SSR, so top-level window access throws; the safe pattern is deriving in an event handler/effect. Hostname-derived and issued/custom codes are now presented as equally supported paths.
  • Removed personal headers from repo docs; added MIT LICENSE.

Repo

  • Local-only tooling/context files (CLAUDE.md, .claude/, .env.example) moved out of version control and gitignored.

Verification

36/36 tests pass (incl. new schema-strictness and length-bound tests); dist/index.d.ts confirmed viem-free; npm pack --dry-run shows exactly dist/ + README + LICENSE; the canonical baseapp conformance vector still matches; both linked mainnet example txs decode correctly through the stricter path.

🤖 Generated with Claude Code

SDK:
- fromDataSuffix returns null for non-Schema-0 tags and empty code
  fields instead of letting custom-registry codes pass as canonical
- toDataSuffix rejects comma-joined code fields over 255 bytes (the
  wire format's length byte) with a clear error
- drop the viem type import from the public API so the published
  .d.ts works without the optional peer installed
- add a "default" export condition; ship LICENSE in the npm tarball

CI:
- new test-sdk workflow: typecheck + tests + build on PRs and main
- publish workflow: guard that the tag matches package.json version;
  pin actions to commit SHAs

Docs:
- INDEXERS: length byte bounds the joined field (1-255, not 1-32),
  truncation + schema guards in the pseudocode, DuneSQL varbinary
  filter, corrected multi-code byte math and stale code examples
- BUILDERS: fix the SSR guidance ("use client" modules still run on
  the server; derive in an event handler or effect), and present
  hostname-derived and issued/custom codes as equally open paths
- remove personal headers from repo docs; add MIT LICENSE

Repo:
- move local-only tooling and context files out of version control

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@GigaHierz
GigaHierz merged commit b11cabc into main Jul 2, 2026
3 checks passed
@GigaHierz
GigaHierz deleted the GigaHierz/fable-codebase-review branch July 2, 2026 18:17
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