sdk: round-2 CLI follow-ups — producer guards, DRY, build-bid parity, coverage (#0422-#0427)#242
Merged
Merged
Conversation
… coverage (#0422-#0427)
0422 toBaseUnits throws on negative/non-finite/precision-losing amounts
(the bb build * JSON-input path bypassed resolveAmount's guard);
product-catalog maxSupply rejects negative/non-integer instead of
silently going unlimited.
0423 shared splitCsv (cli/utils/csv-options) replaces 2 byte-identical
clones + 3 inlined sites; resolveRecipientList (address.ts) dedups
the split+strict-bb1 sequence in custom-2fa + dynamic-stores.
0424 bb build bid reaches parity with bb nfts bid: collection-wide bid
when --token-ids omitted, new --token-amount, ms-since-epoch
--expiration (via new core resolveExpiration) — was duration-only.
0425 producer↔recognizer drift guard: buildSubscription output is run
through the indexer's bigint normalization and asserted to satisfy
isSubscriptionFaucetApproval + doesCollectionFollowSubscriptionProtocol.
0426 determinism stragglers: custom-2fa / quests / pm-buy-intent gain
two-call byte-identical tests; bounty strengthened to a full
msg-equal (Date.now expiry window normalized out).
0427 subscriptions enable-renewal/subscribe --approval-id covered:
shape test + integration pin assertion.
Build clean (no circular deps); unit 140 suites / 3077 tests;
integration 20 suites / 186 tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 15, 2026
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
Round-2 audit follow-ups on the post-#241 CLI/SDK surface (same angles as #240/#241: frontend-parity, producer-side correctness, DRY, test-bar). Six tickets, behavior + coverage.
toBaseUnitsnow throws on negative / non-finite / precision-losing amounts instead of silentlyMath.round-coercing — thebb build *JSON-input path bypassedresolveAmount's guard, so every amount-taking builder was exposed.bb build product-catalogmaxSupplyrejects negative/non-integer instead of silently emitting an unlimited catalog (0/omitted = unlimited stays, documented).splitCsv(cli/utils/csv-options.ts) replaces two byte-identical private clones (dynamic-stores,price) + three inlined sites (assets,pools,pairs).resolveRecipientList(address.ts) dedups the split→trim→filter→requireBb1AddressStrictsequence incustom-2fa+dynamic-stores.bb build bidreaches parity withbb nfts bid: omit--token-ids⇒ collection-wide bid; new--token-amount;--expirationaccepts ms-since-epoch (new coreresolveExpiration) — it was duration-only and silently rejected the ms input its sibling's--helpadvertises.buildSubscriptionoutput is run through the indexer's bigint normalization and asserted to satisfyisSubscriptionFaucetApproval+doesCollectionFollowSubscriptionProtocol(single + multi-tier). Closes the 0407-class gap where the sole producer and thebb subscriptions status|claim|charge-dueconsumers could drift apart with a green suite.custom-2fa/quests/pm-buy-intentgain two-call byte-identical tests;bountystrengthened from proposalId-only to a full msg-equal with theDate.nowexpiry window normalized out (not flaky).bb subscriptions enable-renewal|subscribe --approval-id(#0418): shape test + integration pin assertion.Scope notes
build.tssubscription-payouts loop left as-is (it validates a JSON object array per-element, not a comma-string split — not the same resolution logic; adopting the helper would be churn).expectCleanVerificationto the 5 delegating approval builders. VerifiedverifyStandardsComplianceonly traversescollectionApprovals, so it would pass aMsgSet*Approvalvacuously — the masking anti-pattern. Delegation-parity + integration chain-acceptance remain the contract (reconfirms #0421's documented call).Validation
tsc×2, no circular dependencies.Test plan
bun run buildcleanbun run test:unitgreenbun run test:integrationgreenbb build bid --address … --collection-id 1 --price 5 --denom USDC(no--token-ids) emits a collection-wide bidbb build product-catalogwith a negativemaxSupplynow errors🤖 Generated with Claude Code