feat: add SourceHandle TypedDict for foreign-namespace user numbers - #4
Open
kryp2 wants to merge 1 commit into
Open
feat: add SourceHandle TypedDict for foreign-namespace user numbers#4kryp2 wants to merge 1 commit into
kryp2 wants to merge 1 commit into
Conversation
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>
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.
Summary
peck-overlay-schemaPR #66 shippedsource_handleon/v1/feedand/v1/threadrows whereapp == 'zanaadu'— a source-scoped alias read from Zanaadu's on-chain user-number registry (e.g.033663d2…+@14).PeckRowhere is intentionally an opendict[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.SourceHandle(TypedDict, exported from the package root) that may appear atrow["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)namespaceis mandatory so the value can never render bare and be mistaken for a peck handle (@14 · zanaadu).author— never replaces it.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/numberis 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)SourceHandleliteral and embedding it in aPeckRowround-trips as expectedPyPIpublish — left to Thomas; this PR does not publish🤖 Generated with Claude Code