Skip to content

feat: add SourceHandle TypedDict for foreign-namespace user numbers - #4

Open
kryp2 wants to merge 1 commit into
masterfrom
feat/source-handle
Open

feat: add SourceHandle TypedDict for foreign-namespace user numbers#4
kryp2 wants to merge 1 commit into
masterfrom
feat/source-handle

Conversation

@kryp2

@kryp2 kryp2 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • peck-overlay-schema PR #66 shipped source_handle on /v1/feed and /v1/thread rows where app == 'zanaadu' — a source-scoped alias read from Zanaadu's on-chain user-number registry (e.g. 033663d2… + @14).
  • PeckRow here is intentionally an open dict[str, Any] (the indexer rides extra MAP keys), so it needs no shape change to carry the field through — but nothing documented its type, mirroring the TypeScript SDK.
  • Adds a typed SourceHandle (TypedDict, exported from the package root) that may appear at row["source_handle"]. Purely additive — no existing field's type or semantics changed.

Contract carried over from the canonical source (peck-overlay-schema/src/zanaadu/userNumbers.ts + ZANAADU_POSTANCHOR_FORMAT.md §13)

  • namespace is mandatory so the value can never render bare and be mistaken for a peck handle (@14 · zanaadu).
  • Comes in addition to author — never replaces it.
  • Omitted (not None) on rows where the author has no number — absence is a valid, measured state at the source, not a gap.
  • membership_proof: "none" says the number is read from Zanaadu's registry counter (cross-checked 7/7 against their own UI) but their sparse-Merkle-tree membership proof is not independently verified by us.
  • numbers (list[int], optional) only appears when a key owns more than one; value/number is the lowest (tie-break for "primary" is not proven on-chain).

Version bumped 0.2.0 → 0.3.0 (additive, non-breaking).

Test plan

  • pytest -q — 6 passed (live integration tests against overlay.peck.to)
  • manual smoke: constructing a SourceHandle literal and embedding it in a PeckRow round-trips as expected
  • PyPI publish — left to Thomas; this PR does not publish

🤖 Generated with Claude Code

peck-overlay-schema PR #66 added source_handle to /v1/feed and
/v1/thread rows for app == 'zanaadu' — a source-scoped alias read from
Zanaadu's on-chain user-number registry, additive to (never a
replacement for) author. PeckRow stays an open dict by design, so this
adds a typed SourceHandle (mirrors the TypeScript SDK's interface
one-to-one) that may appear at row["source_handle"]: mandatory
namespace, optional numbers[] for multi-number owners, and
membership_proof: "none" spelling out that the value is read from the
registry, not Merkle-verified.

Bumps to 0.3.0 (additive, non-breaking).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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