Skip to content

feat(contracts): social v8, blog v3, storefront v3 on the 4.2.0-beta.3 grammar - #563

Merged
PastaPastaPasta merged 17 commits into
stagingfrom
beta3/social-v8
Sep 21, 2026
Merged

PastaPastaPasta merged 17 commits into
stagingfrom
beta3/social-v8

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

PR B of the 4.2.0-beta.3 upgrade: the contract re-cuts, their batteries, the client plumbing, and — now that PR A (#562) has merged — the write path that carries v8's action fee agreements and its choice between YAPP and credits. Rebased onto staging (5832ff6). Merge order: A, then this, then the deploy PR C. Nothing here writes to moutai.

Full write-up and semantics: docs/SOCIAL_V8.md.

Contracts

Social v8 (contracts/yappr-social-contract-v8.json, from v7 by scripts/build-v8-contract.py --self-test; read surface unchanged):

  • config v2 with moderation { banlist, suspensions, moderators: contractOwner } (registration scripts take --moderators <id,id>, verified on chain before signing)
  • canBeDeletedByModerators on post/reply, no window; owners still tombstone
  • all 9 references at post/reply → deletableDocument; preallocated dropped from like.byPost/byHashtagPost/byAuthorPost, likeReply.byReply
  • tokenCost.create.optional: true + gasFeesPaidBy: 2 on post/reply/like/likeReply/repost (free usage: owner pays gas only when the user pays YAPP)
  • oncePerIdentityDistribution 100 YAPP (distribution rules v1; +0.1 DASH registration surcharge)
  • actionFees moderators pot only, feeMultiplier: post.create 80M credits, reply.create 16M

Blog v3 (in place): same moderation; blog/blogPost/blogComment moderator-deletable; refs → deletableDocument; documentsKeepHistory dropped → the edit-history viewer is removed.
Storefront v3 (in place): same moderation; storeReview/itemReview moderator-deletable (nothing references them).

Offline: all three parse under FULL validation on the beta.3 wasm; the validator substitutes SOCIAL_CONTRACT_ID, reports moderation, and refuses a permanentDocument ref at a moderator-deletable type.

Client (read side)

  • Topology v8 (+ blog/storefront v3 gates); grammar helpers read off the v8 JSON and pinned by tests: contractIsModerated, referencesMayDangle, likeCountsArePreallocated, moderatorDeletableTypes, tokenCostFor, declaredActionFee, clearableReferencesFor, starterGrantAmount
  • moderation-service.ts over contracts.* (ban/suspend/unsuspend, moderator delete, status, entries, removals, pots, claim); team read off the contract config
  • UI: contract-moderation settings panel, "Remove post/reply (moderator)" menu item + reason dialog, RemovedPostStub (feed/quote/thread root/post page), barred-writer notice on 41107/41108
  • Read path: composite missingIds → quotedPostRemoved (matched by id), removed thread roots, ranked/homepage adjustments for no preallocation
  • Starter grant claim + one-time prompt (40722 settles it); payWith setting + PaymentPlan + compose hint

Client (write path)

Every amount is READ from the contract at runtime — declaredActionFee/tokenCostFor in the client, actionFeeFor in the scripts — so nothing is transcribed.

Action fee agreement. A create of a type the topology prices carries $actionFeeAgreement with the exact declared amounts, each pot on its own, plus the epoch multiplier the signer knew and a 20% tolerance (omitted entirely for fixed pricing — naming one there is the same 40133). The multiplier is read once per session and dropped on a 40134, including one raised by the cached-ST rebroadcast, whose fresh transition would otherwise reuse it. A failed epoch read agrees at 1000‰ rather than sending nothing (40132 is certain without an agreement). Replace and delete consult the same descriptor and throw before signing if an action they cannot carry an agreement for is ever priced; a test pins that v8 prices nothing but create.

Token or credits. resolveTokenPayment now follows the viewer's plan:

Plan What the create carries
yapp, balance ≥ cost (v8) TokenPaymentInfo { tokenContractPosition: 0, maximumTokenCost, gasFeesPaidBy: 2 }
credits, or balance < cost, or the balance read failed (v8) no tokenPaymentInfo at all — that is what makes an optional cost charge credits
Any priced type before v8 TokenPaymentInfo { tokenContractPosition: 0, maximumTokenCost } — required, no gas offer, byte-identical to today
Blog comment / storefront review TokenPaymentInfo { paymentTokenContractId: <social>, … } — cross-contract, required, unchanged

2 is PreferContractOwner, taken from the doctype's own tokenCost.gasFeesPaidBy; 1 is never requested (the type does not offer it — 40129). The balance is read only when it can change the plan, so a credits user and every required cost cost no round-trip — this matters because v8 prices like and repost too.

Tombstones. A replace re-validates every deletableDocument reference, so a tombstone keeping a quote a moderator removed is 40120. It is retried with exactly the property the rejection names dropped (Drive's message carries the path). Dropping every clearable reference would be wrong: the immutable check judges each removed property on its own, so clearing a live one is a 40128 — reachable, since a post may carry both quote fields and a reply has a REQUIRED rootPostId beside a possibly live replyToReplyId.

Errors. isBarredFromContractError moved into error-utils (it had a second copy in moderation-service), and isModerationBarredError builds on it, so 41114 is never shown as the viewer's own standing. 40222 and 40134 got their own messages — a short gas sponsor is something the user can route around, and a moved multiplier is not "the app is out of date". retryPostCreation refuses the whole 40129/40132–40134/40222/41107/41108 set (pinned). An insufficient balance now names credits as a way out where the contract offers one.

Seeders and batteries

sdk.documents.create cannot carry an agreement — DocumentCreateOptions is document/identityKey/signer/tokenPaymentInfo/settings — so on v8 every post/reply create is a hand-built batch (createWithAgreement), returning { id } so callers' acceptance logic is unchanged. --topology v8 shares v7's document shapes byte for byte; --credits-fraction (default 0.25) puts that share of actors on the credits path, fixed by persona index so a resume never switches an author's currency, with the YAPP estimate excluding them. A 40134 is the one consensus refusal the retry loops treat as retryable, after dropping the cached multiplier. verify-v8.mjs builds its agreements, payment and id derivation with those same helpers, so a live run proves the shape the app sends.

Validated

build-v8-contract.py --self-test, validate-contract-offline.mjs ×3, both registration --dry-runs, tsc --noEmit, npm run lint, npm run lint:dead, vitest 572/572, build:devnet, verify-{v7,v8,blog,storefront,dm,pollr,tips} --self-test, run-seeder --self-test (78 checks), all five seed-non-social --self-tests.

Reviewed by code-review-validator and code-simplifier; every finding verified against the platform source at v4.2.0-beta.3 before acting. Two were real bugs, fixed in 025f014: the seeders' nonce-cache refresh passed a base58 string to a binding that _assertClasses an Identifier and throws synchronously (so the .catch() never ran, and the throw escaped after the write had landed), and the tombstone retry dropped every clearable reference instead of the one that died.

First live checks on moutai (PR C)

In the order that isolates a wrong assumption fastest: a browser post landing at all (proves agreement + derived id + nonce together) → the moderators pot growing by 80M × multiplier‰ → a credits post charging credits and a yapp post moving the contract owner's credit balance (sponsorship is the one behaviour no offline test reaches) → 40700 on payment info with too little YAPP → the tombstone 40120/cleared pair → a banned identity refused 41107 while its delete still lands.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 20, 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: Advanced

Run ID: 9535a40a-a941-4131-9b74-3f820db33134

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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Deploying yappr-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8b5a559
Status: ✅  Deploy successful!
Preview URL: https://da2ec695.yappr-v2.pages.dev
Branch Preview URL: https://beta3-social-v8.yappr-v2.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Deploying yappr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8b5a559
Status: ✅  Deploy successful!
Preview URL: https://e9dd0b96.yappr.pages.dev
Branch Preview URL: https://beta3-social-v8.yappr.pages.dev

View logs

@thepastaclaw

thepastaclaw commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ DEGRADED — Queued for automated review — 3rd in line, estimated start in ~1.3 h (commit 8b5a559)
Estimated review time once started: ~55 min (two-phase automated review; median of recent runs).
The primary review models are currently out of quota; this review will run on stand-in models and be marked as degraded.

  • Request priority review — click to move this review to the front of the queue.

PastaPastaPasta and others added 11 commits September 20, 2026 19:03
…3 grammar

Social v8 is built from v7 by scripts/build-v8-contract.py (deterministic, --self-test): config v2 with moderation (banlist + suspensions, owner moderates by default), canBeDeletedByModerators on post/reply with no window, every reference at post/reply turned into deletableDocument with preallocated dropped from the four like indexes, optional YAPP cost with PreferContractOwner gas on the five priced types, a 100 YAPP oncePerIdentity starter grant (distribution rules v1), and feeMultiplier action fees to the moderators pot on post.create (80M credits) and reply.create (16M). Blog v3 drops documentsKeepHistory on blog/blogPost and makes blog/blogPost/blogComment moderator-deletable with the reference cascade; storefront v3 makes storeReview/itemReview moderator-deletable (nothing references them). Both registration scripts accept --moderators, verify each appointed identity exists before signing (41110), read the config from the contract file and audit the moderation grammar off the parsed contract; the offline validator substitutes the SOCIAL_CONTRACT_ID placeholder, reports moderation, and refuses a permanentDocument reference at a moderator-deletable type.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Blog v3 makes blog/blogPost moderator-deletable, and Drive refuses moderator deletes on a history-keeping type, so documentsKeepHistory is gone and with it the revision viewer: components/blog/blog-post-history.tsx and its mount in blog-post-view (an edited post now just says 'edited'), the b7 history readback in verify-blog (now an edit-only case), the documents.history table in the blog seeder, and the docs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eta.3 grammar descriptors

CONTRACT_TOPOLOGIES appends v8 (order significant), BLOG/STOREFRONT topologies become ordered lists with a v3 moderated cut and *IsModerated() gates. lib/contract-topology.ts gains a v8 descriptor (v7's read surface) and grammar helpers read off the committed v8 JSON for the write path to consume: contractIsModerated, referencesMayDangle, likeCountsArePreallocated (false from v8), moderatorDeletableTypes, tokenCostFor (amount/optional/gasFeesPaidBy), declaredActionFee (owner/moderators/pricing) and starterGrantAmount, all pinned against the JSON in the topology test. The composite/enrichment/ranked/bundle/DM vitest suites stub v8 where the read surface is unchanged; the e2e TOPOLOGY_ORDER and /contract page learn v8.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lib/services/moderation-service.ts wraps the beta.3 evo-sdk contracts.* surface: ban/unban/suspend/unsuspend with a recorded reason, moderatorDeleteDocument on post/reply, moderationStatus (cached standing), moderationEntries, documentRemovals (by id and paged), feePots and claimFees for the moderators pot, all signed with the viewer's CRITICAL key and gated on the topology declaring moderation. The moderation team is read off the contract config (owner + appointed), never a hardcoded id (useIsModerator). UI: a contract moderation settings panel (ban/suspend-until/unsuspend, both lists, removal records, pot balance + claim) shown to moderators beside the authority's YAPP freeze/slash card; a 'Remove post/reply (moderator)' item on the post menu with a reason dialog; a RemovedPostStub that resolves the removal reason lazily and replaces a removed card or a dangling quote; and a barred-writer notice that reads the viewer's own ban/suspension (41107/41108) on a refused compose, like or repost.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
On v8 every reference at post/reply is a deletableDocument reference, so a joined post may be proven absent instead of failing verification. The composite feed page reads the quoted-post join's missingIds (matched by id, never by position) and marks the quoting post quotedPostRemoved; useQuotedPost short-circuits on it so no per-card fetch re-proves the absence, and the card shows the removed stub with the lazily resolved reason. The post detail hook returns the thread root ids it could not load as removedChainIds, rendered as stubs above the chain, and the post page shows a stub for an absent main post on a moderated contract. Ranked hydration stops warning about proved-absent ranked ids on v8, and the homepage only over-asks the ranked page while like counts are preallocated (they are not from v8).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nt chooser

tokenService.claimStarterGrant claims the v8 token's oncePerIdentity distribution via sdk.tokens.claim({distributionType: 'oncePerIdentity'}) and maps 40722 to ALREADY_CLAIMED; StarterGrantModal prompts a signed-in identity with a zero balance exactly once (a claim or a 40722 settles it in scoped storage; declining postpones). A payWith setting ('yapp' | 'credits', default yapp) lands in the settings store with an Account row, and lib/payment-preference.ts turns the contract declarations, the setting and the balance into a PaymentPlan (currency, YAPP amount, gasFeesPaidBy offer, action fee, fallback reason) that the compose shows as a payment hint with a one-click switch. Presentation only: the write path wiring is the follow-up documented in docs/SOCIAL_V8.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…og v3 and storefront v3

scripts/verify-v8.mjs (on verify-lib, --self-test) covers the beta.3 grammar live: ban → create 41107 / delete allowed / unban; suspend → 41108 then lapses and is swept; moderator delete → fetch absent, removal record with reason, like on it 40120, tombstone keeping the dead quotedPostId 40120 and clearing it accepted; optional token cost (no payment info = credits, payment info = 1 YAPP with the contract owner's credits moving under PreferContractOwner, insufficient YAPP = 40700); action fees (no agreement 40132, mismatched amount or fixed pricing 40133, agreed = accepted with the moderators pot growing by fee × epoch multiplier, claimFees pays the team then 41111); oncePerIdentity once then 40722; first like counts to 1 without preallocation. Post/reply creates are manual batches carrying the agreement, with the nonce-committed v1 id derived locally and compared to the proof result's id; every other id is read from the create result. scripts/battery-moderation.mjs shares ban/moderator-delete cases and a moderated self-test wrapper; verify-blog gains b13-b16 (ban the stranger; take down a comment, a post with a dangling-comment probe, and a throwaway blog) and verify-storefront s14-s16 (ban; take down a store review and an item review, the proved average following). Both take --moderator. The unused *IsModerated constants are dropped (knip).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e write-path TODO

docs/SOCIAL_V8.md records the exact v8 diff against v7, the blog v3 and storefront v3 changes, the consensus codes, what the client relies on (absent removed posts matched by id, clear-only replaces of dead refs, free usage, agreed action fees, no preallocation), what this PR wired, the validation commands, and the precise write-path TODO list for state-transition-service and the script libs after PR A merges (agreement option-bag fields, knownPermille from sdk.epoch.current().feeMultiplierPermille with the 1000/20 fallback, the payWith → TokenPaymentInfo mapping, error predicates, tombstones clearing dead quotes). contracts/README.md and CLAUDE.md point at v8.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… battery scoring and cleanup

RemovedPostStub only asserts a moderator takedown when a join proved the absence (quotedPostRemoved) or a removal record is in hand, says 'unavailable' otherwise, and looks up post AND reply records when the detail page cannot tell the kind. The compose payment hint renders nothing until the balance resolved and distinguishes an unavailable balance from an insufficient one. moderationService caches the team fetch PROMISE so a feed of cards issues one contract fetch, and its claim-error matching accepts the spaced spellings. register-feature-contract keeps the beta.2 default config (format 1) for bare-schemas files so DM/pollr/vault republish unchanged; the social registration audit records every reference type per target so a half-converted cut cannot hide; the offline validator renders appointed moderators as ids. verify-v8: m2 refuses the suspended post through the manual batch and scores 41108 by pattern, bookmarks a target of its own (bookmark.ownerAndPost is unique and m1 already used the fixture), the preparation failure is remembered and rethrown for every case, m1 and the shared ban case always attempt the unban, the header states the PR A dependency for attemptCreate-based cases. The homepage keeps two ranked ids of headroom on v8 for a removed featured post. A composite-feed-page test pins missingIds → quotedPostRemoved matched by id.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
No behaviour change: EntryList loses its conditional-type cast (callers extract the field), the settings run() pairs each action with its message in one exhaustive switch, the removal-entry mapping is one toRemoval, the payment plan has an inCredits constructor beside inYapp, the removed stub's dead undefined state is gone, verify-v8 gains errorOf() for the try/catch boilerplate and thunks for the repeated bookmark probes, and the two moderation audits share one set-based reference check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Blog v3 dropped documentsKeepHistory so moderators can delete posts; the schema description still advertised documents.history.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PastaPastaPasta and others added 6 commits September 20, 2026 20:14
…igning

A post or reply create on v8 must carry $actionFeeAgreement naming the exact declared amounts (80M / 16M credits to the moderators pot) and, for feeMultiplier pricing, the epoch multiplier the signer knew plus a 20% tolerance: without one the create is a paid 40132, with the wrong numbers 40133. createDocument now builds it from the contract descriptor — never a hardcoded amount — reading the multiplier once per session from sdk.epoch.current() and forgetting it on a 40134 so the next write re-reads it. An epoch read that fails agrees at 1000 permille rather than sending no agreement: 40132 is certain without one, 40134 unlikely with the tolerance.

The unconditional token auto-attach becomes the viewer's payment plan. payWith: 'yapp' with a covering balance sends TokenPaymentInfo { tokenContractPosition: 0, maximumTokenCost, gasFeesPaidBy: 2 } (PreferContractOwner — the offer the type makes; insisting on 1 is 40129); 'credits', an insufficient balance or a failed balance read sends NO tokenPaymentInfo at all, which is what makes the signer pay credits on an optional cost. Payment info present with too little YAPP is a 40700 refusal rather than a fallback, so the choice is made before signing. Pre-v8 topologies keep the exact historical bag (required cost, position and cap, no gas offer), as do the cross-contract blog and storefront costs, whose contracts declare no optional.

Replace and delete consult the same descriptor and throw before signing if an action they cannot carry an agreement for is ever priced; a test pins that no v8 type prices anything but create.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… tombstone

moderation-service carried its own 41107/41108 predicate beside error-utils' broader 41107/41108/41114 one. The signer-barred half now lives in error-utils as isBarredFromContractError and isModerationBarredError builds on it, so the UI keeps showing the viewer's own standing for a ban or suspension and never claims 41114 (where the OTHER party is barred) as the viewer's.

Two members of their families get their own message, because they are not what the family says. 40222 is a short gas sponsor, not the client asking for a payer the type refuses: the user can act on it by paying in credits. 40134 is a fee multiplier that moved, not an app out of date with the fee rules: nothing about the client was wrong and the write path re-reads the multiplier. Both stay permanent for the transition as built, so retryPostCreation still refuses them — now pinned by a test over the whole 40129/40132-40134/40222/41107/41108 set.

On v8 a replace re-validates every deletableDocument reference, touched or not, so tombstoning a post that quotes one a moderator removed is 40120 while clearing the reference is the one change the immutable check lets through. tombstoneDocument retries once on 40120 with the OPTIONAL deletable references dropped (quotedPostId, quotedReplyId, reply.replyToReplyId); quotedPostOwnerId is not a reference and stays, and reply.rootPostId is required so it is never cleared. v7 and earlier retry nothing — there, nothing a post points at can disappear.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…PP from credits

`sdk.documents.create` cannot carry an $actionFeeAgreement — its DocumentCreateOptions are document / identityKey / signer / tokenPaymentInfo / settings, and PutSettings is transport and nonce staleness only — so on a v8 contract every post and reply create must be a hand-built batch or it is a paid 40132. seed-lib gains that path (`createWithAgreement`: take the nonce, derive the v1 id, build the transition with the agreement and whatever payment the caller chose, sign, broadcast and wait), returning { id } so callers' `createdId` acceptance logic is untouched. Everything unpriced keeps the facade path exactly as before.

The fee amounts are READ OFF contracts/yappr-social-contract-v8.json (`actionFeeFor`), never transcribed: a wrong amount is a paid 40133, and a battery asserting pot growth against a transcription would prove nothing. verify-v8 now builds its agreements, its YAPP payment and its id derivation with these same helpers, so a live run proves the shape the app actually sends rather than a battery-local copy.

TOPOLOGIES gains v8, whose document shapes are v7's byte for byte; what differs is what a create CARRIES. --credits-fraction (default 0.25 on v8) puts that share of actors on the credits path — no $tokenPaymentInfo at all, which is what makes an optional token cost charge credits — while the rest pay YAPP and offer the gas to the contract owner (PreferContractOwner; insisting is 40129). The currency is a pure function of the persona index, so a resumed run never moves an author between funding models, and the YAPP estimate excludes the credits actors instead of over-funding the run. pollr's caption post lives on the social contract and gets the same treatment.

run-seeder --self-test gains 14 offline checks over the new shapes: fees off the JSON, the agreement's exact amounts and tolerance, fixed pricing naming no multiplier, the YAPP bag's gas offer, the pre-v8 bag unchanged, a credits write carrying nothing, and the split's determinism.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SOCIAL_V8.md's write-path TODO becomes what was built: the action fee agreement and its multiplier cache, the YAPP-or-credits table per topology and payWith, the tombstone's 40120 retry, the two codes split out of their error families, and the seeder/battery shapes — plus the finding that sdk.documents.create cannot carry an agreement at all, which is why those creates are hand-built batches.

It also names what the first live run on moutai has to prove, in the order that isolates a wrong assumption fastest: a browser post landing at all, then the moderators pot growing by the declared amount, then sponsorship moving the OWNER's credits — the one behaviour no offline test can reach.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…payment honesty

The seeders' hand-built create refreshed the facade's nonce cache with a base58 STRING. The binding is refreshIdentityNonce(identity_id: Identifier): it _assertClasses and throws SYNCHRONOUSLY, so the .catch() never ran and the exception escaped after the write had already landed — every v8 post/reply create would have been reported as a failure the executor then had to reconcile by value, and the cache it exists to refresh stayed stale. Proved against the shipped glue, fixed with new Identifier(ownerId) and a try/catch.

The tombstone retry dropped EVERY clearable reference at once. Consensus judges each removed property on its own (document_replace_transition_action/state_v1), so clearing one whose target is still alive is a 40128 — and the handler then blamed the descriptor. A post may carry both quote fields, and a reply under a removed root has a REQUIRED rootPostId beside a possibly live replyToReplyId, so this was reachable. It now drops exactly the property the 40120 names (Drive's message carries the path), clears two dead references one rejection at a time, and reports rather than guesses when the named property is not one the contract lets go. Four tests cover the cases the first version would have failed.

Payment honesty: the balance is read only when it can change the plan, so a user set to credits — and every required cost — no longer pays a round-trip on each like or repost; the gas offer comes from the doctype's own tokenCost rather than being inferred from action fees, which are an independent property; a 40134 on the cached-ST rebroadcast now invalidates the session multiplier that the fresh transition below would otherwise reuse; and the claim that a stale balance can never be a 40700 is corrected to what is true — a FAILED read plans credits, a stale one can still be refused, and where the contract prices optionally the message now offers credits instead of only selling more YAPP.

Also: a self-test that builds the real DocumentActionFeeAgreement (the options bag alone would pass through a serde regression), a pin that pre-v8 token amounts still match the v7 contract now that the helper reads the v8 JSON for every topology, removal of the newly unused planPaymentForViewer, and two comments that asserted things that are not true (protocol-14 ids are not stable across a retry; the credits split is a coprime permutation, not Knuth's hash).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ltiplier

Simplification pass. The facade-or-hand-built-batch decision was written twice (run-seeder's writeShape and feature-seed-lib's createDoc); it is now one createDocument in seed-lib, which both call. error-utils asked whether credits are possible with a private predicate identical to the shipped paymentIsChoosable, so it calls that instead. A parameter in tombstone-helpers shadowed the stored document's fields.

The pass also surfaced a real gap: the client drops its cached fee multiplier on a 40134, but the seeders had no way to. A long run crossing an epoch boundary would therefore re-agree at the stale value and have every remaining post refused. FEE_MULTIPLIER_NOT_TOLERATED plus forgetFeeMultiplier now make that the one consensus refusal the three retry loops treat as retryable — and the pipelined executor rebuilds its agreement per attempt, without which dropping the cache would change nothing. The self-test observes the cache through a stub epoch source: read once per process, re-read after forgetting.

pipeline.mjs's buildSignedCreate was deliberately left separate: it owns its nonces and broadcasts without waiting, so it is a different path rather than a copy. The TS/.mjs duplication of the agreement builder stays too — scripts cannot import the TypeScript modules.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PastaPastaPasta
PastaPastaPasta marked this pull request as ready for review September 21, 2026 01:55
@PastaPastaPasta
PastaPastaPasta merged commit 51d56fe into staging Sep 21, 2026
10 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the beta3/social-v8 branch September 21, 2026 02:08
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