Skip to content

feat(contract): v4 social contract draft — indexOnly likes, single hashtag, author agreements - #323

Merged
PastaPastaPasta merged 3 commits into
stagingfrom
feat/contract-v4
Aug 29, 2026
Merged

PastaPastaPasta merged 3 commits into
stagingfrom
feat/contract-v4

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

What

Phase 2b of PLAN_LIKE_OVERHAUL.md: the contract v4 shape, produced by a deterministic, reviewable transform (scripts/build-v4-contract.py) of the v3-topology contract:

  • like → indexOnly (entries are the rows; no stored body): byPost / byHashtagPost / byAuthorPost with full ranked chains + preallocated, byAuthorTimePost [postAuthor, $createdAt, postId] (notifications + unlike-tuple recovery; not preallocatable — the like's own timestamp isn't derivable from the post), byLiker (membership / my-likes). One-like-per-(post, owner) now falls out of structural uniqueness.
  • likeReply → indexOnly, lean (countable + notification + membership; no ranked).
  • Single-hashtag model: post.hashtag (+ tagAndTime listing index), postHashtag doctype deleted — tagged posts become one write instead of two. '' = untagged is a stand-in until the upstream null-skip release, at which point hashtag flips optional and this contract re-registers before any cutover.
  • author on post/reply (poster-attested = $ownerId), consensus-bound onto likes via refersTo propertyAgreement — the denormalized copies can no longer be poisoned (40127).
  • Everything else (flat threads, quotes, permanence/tombstones, embed triple, ipfs mediaUrl, sensitive, token costs) carried unchanged from v3/4UW9im1y.

Live validation so far

  • Registered on moutai as a draft: Aux325ifCRkYUteevirCv7ptHm3YB2g7PbMo8UjQwoz — consensus accepted the full PV14 indexOnly grammar first try; bots funded 1000 YAPP on its token.
  • Shape-critical behaviors independently verified 12/12 (branch feat/like-overhaul-phase2a, folds in via feat(experiments): indexOnly Phase 1 battery + results on moutai devnet #322's lineage): 3-property notification-index recovery end-to-end (multi-device unlike rebuilds its delete tuple from one query), byAuthorPost does NOT trip the one-like-per-author trap, author-pinned ranked queries work (zero-count groups filtered client-side).
  • byAuthorPost is included per DESIGN_CREATOR_LEADERBOARD.md — index sets freeze at registration, and this keeps the leaderboard path open for the upstream prefix-level-ranked-aggregation ask while serving the profile Top tab server-side today.

Landing on this branch before merge

  • scripts/verify-v4.mjs + docs/V4_BATTERY_RESULTS.md — the full battery (v3's 31 topology cases rebased onto v4 + the new indexOnly/agreement/ranked/recovery/tombstone-interplay suite) is being authored and run against Aux325if… right now; results push here when green.

Not in this PR: no client changes, no .env.devnet flip (a v3 client pointed at v4 queries doctypes that don't exist — cutover is Phase 3), and final registration waits for null-skip.

🤖 Generated with Claude Code

Built by scripts/build-v4-contract.py as a deterministic transform of the v3-topology contract: indexOnly like (byPost/byHashtagPost/byAuthorPost ranked chains preallocated, byAuthorTimePost notification index, byLiker membership) and lean likeReply; author + hashtag on post/reply with propertyAgreement bindings; tagAndTime listing index; postHashtag doctype deleted; token costs preserved. hashtag '' is a stand-in until upstream null-skip semantics ship (flip to optional + re-register before cutover).

Registered as a draft on moutai: Aux325ifCRkYUteevirCv7ptHm3YB2g7PbMo8UjQwoz (consensus accepted the full PV14 indexOnly grammar; bots funded 1000 YAPP).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ad15280e-1f98-4560-a4d8-2066ec067e04

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@thepastaclaw

thepastaclaw commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 4 ahead in queue (commit 7bd3875)
Queue position: 5/6
ETA: start ~14:47 UTC · complete ~15:04 UTC (median 17m across 30 recent reviews; 3 slots)
Queued 47m ago · Last checked: 2026-08-29 14:30 UTC

@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

Internal review note for the record: an independent code-review pass verified the transform is faithful (byte-identical carry-over of all untouched doctypes/config/tokens, collision-free positions, clean postHashtag deletion, no aliasing, idempotent script) and flagged the "countable": "countable" string form on the four ranked-chain indexes as unprecedented in this repo.

Disposition: intentional, not a defect — it is the enum form used by the upstream consensus-pinned reference fixture for indexOnly likes (packages/rs-drive/tests/supporting_files/contract/yappr-likes/yappr-likes-contract.json on dashpay/platform v4.2-dev), and upstream documents the boolean as the equally-valid legacy form. The reviewer's underlying ask — an actual count/ranked query against a contract registered from this exact file — is satisfied by the verify-v4 battery running against Aux325if… (registered from this JSON verbatim); results land on this branch per the PR checklist.

Two doc-drift findings (plan text contradicting the shipped byAuthorPost inclusion, and a stray preallocated tag on byAuthorTimePost) are fixed in PLAN_LIKE_OVERHAUL.md.


🤖 Posted autonomously by Claude on behalf of pasta.

The Phase 1 experiment harness (PR #322) targeted throwaway contracts and is superseded by verify-v4.mjs; the results doc is the durable artifact (verbatim consensus errors, fee table, grammar findings) and belongs with the contract it shaped. #322 closes unmerged; branch feat/like-overhaul-phase1 stays on origin for reference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Deploying yappr-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7bd3875
Status: ✅  Deploy successful!
Preview URL: https://cd94e6f8.yappr-v2.pages.dev
Branch Preview URL: https://feat-contract-v4.yappr-v2.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Deploying yappr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7bd3875
Status: ✅  Deploy successful!
Preview URL: https://f21a99b0.yappr.pages.dev
Branch Preview URL: https://feat-contract-v4.yappr.pages.dev

View logs

verify-v4.mjs rebases the 31-case v3 topology battery onto the registered v4 draft (Aux325if...) and adds the indexOnly like/likeReply surface: propertyAgreement 40127 in both '' -sentinel directions, ghost refs 40120, structural uniqueness 40105, the byAuthorPost trap-regression guard, batched terminal-in membership, ranked top-K (global / per-hashtag / '' pin / author pin) with zero-count-group filtering, unlike via full query-side tuple recovery (no create-returned Document), self-authorizing deletes, likeReply mirror, like-outlives-tombstone, and tagAndTime listing. 68/68 strict checks passed twice (second run on the dirty contract).

Two evo-sdk 4.2.0-dev.5 landmines found and worked around (no contract defects): rs-sdk starts devnets at protocol version 12 and never ratchets past a failing proof, so the PV14 ranked-index grammar makes the v4 contract unreadable until a non-v4 proved query bumps the version; and mid-run devnet quorum rotations kill the trusted context's static quorum cache and ban every address, cured by a full reconnect behind a proxy handle. Both documented with verbatim errors in docs/V4_BATTERY_RESULTS.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

Battery landed: verify-v4.mjs + docs/V4_BATTERY_RESULTS.md (commit 7bd3875). 68/68 strict checks green live against Aux325if…, full run repeated twice — zero contract defects. Every purchased surface validated: rebased topology cases, all four propertyAgreement directions incl. both ''-sentinel mismatches, structural uniqueness, the byAuthorPost trap-guard, batched terminal-IN membership with proved absence, all four ranked shapes with exact counts (this also empirically settles the countable enum-form question from the earlier review — count/ranked queries return correct values against this exact contract), tuple-recovery unlikes, self-authorizing deletes, likeReply mirror, and the documented likes-outlive-tombstones behavior.

Two evo-sdk 4.2.0-dev.5 issues surfaced for upstream filing (details in the results doc): the devnet protocol-version ratchet requires one proved non-v4 warm-up query after connect() before any PV14-grammar contract read, and quorum rotation (~20min) permanently poisons a long-lived trusted context. Both have working mitigations in the battery and are flagged into the Phase 3 client work.

The battery commit was independently code-reviewed within its authoring run (findings fixed and re-validated live). PR checklist is now complete.


🤖 Posted autonomously by Claude on behalf of pasta.

@PastaPastaPasta
PastaPastaPasta merged commit 76a0ded into staging Aug 29, 2026
3 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/contract-v4 branch August 29, 2026 14:48
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.

2 participants