Skip to content

sdk: round-3 CLI follow-ups — expiry parity, fetchCollection BigIntify fix, simulate/preview coverage (#0428-#0430)#243

Merged
trevormil merged 1 commit into
mainfrom
feat/0428-cli-followups-r3
May 15, 2026
Merged

sdk: round-3 CLI follow-ups — expiry parity, fetchCollection BigIntify fix, simulate/preview coverage (#0428-#0430)#243
trevormil merged 1 commit into
mainfrom
feat/0428-cli-followups-r3

Conversation

@trevormil
Copy link
Copy Markdown
Collaborator

Summary

Stacked on #242 (base feat/0422-0427-cli-followups-r2). Round-3 of the rolling CLI audit (same angles: FE-parity, producer-correctness, DRY, test-bar).

  • #0428 listing / intent / pm-sell-intent / pm-buy-intent build builders still used duration-only durationToTimestamp — the #0424 bid fix missed them. Swapped to resolveExpiration: ms-since-epoch --expiration now accepted (parity with bb nfts list / bb intents create / bb prediction-markets). pm-sell/buy-intent default 7d→24h to match the end-user verbs' default (was a silent on-chain divergence). build.ts help strings corrected.
  • #0429 New cli/utils/collection-options.ts. normalizeCollection is now the single boundary-normalization point: 5 command copies BigIntify-converted the indexer response, 4 (credit-tokens, pay-requests, bounties, prediction-markets) silently did not and handed string-typed amounts to bigint-comparing validators — a latent boundary bug, now fixed for all 9. validateCollectionOrExit dedups the 7 byte-identical result-variant validateOrExit blocks. The 2 bespoke boolean-protocol variants (subscriptions, credit-tokens) left as-is (no-churn).
  • #0430 simulate.ts + preview.ts had zero spec coverage anywhere. ensureTxWrapper exported + unit-tested (messages passthrough / bare-Msg wrap / non-object passthrough); command-shape specs guard flag/arg drift.

Scope notes

  • 0429: per-file fetchCollection wrappers kept (they bind the file's local callApi); only the duplicated logic (unwrap + BigIntify + the bug) is single-sourced — extracting the wrapper would force a ~50-call-site signature churn for no correctness gain (0423/0418 no-churn precedent). The 2-site bespoke boolean validateOrExit left (below the dedup bar, divergent messages).
  • 0430: unit specs follow the project convention (command-shape + pure-helper; network paths are integration territory).

Validation

  • Build clean — tsc ×2, no circular dependencies.
  • Unit: 142 suites / 3092 tests green (+2 suites, +15 tests).
  • Integration: 20 suites / 186 tests green (incl. the 4 newly-normalized standards).

Test plan

  • bun run build clean
  • bun run test:unit / test:integration green
  • bb build pm-sell-intent … default expiry ≈ 24h (not 7d)
  • bb build listing … --expiration 1798765432000 accepted (ms-since-epoch)

🤖 Generated with Claude Code

Stacked PRs: #242this.

…y fix, simulate/preview coverage (#0428-#0430)

0428 listing/intent/pm-sell-intent/pm-buy-intent swapped from
     duration-only durationToTimestamp to resolveExpiration (completes
     the #0424 bid fix): ms-since-epoch --expiration now accepted; pm
     defaults 7d→24h to match `bb prediction-markets buy/sell`; build.ts
     help strings updated.
0429 new cli/utils/collection-options.ts: normalizeCollection (the
     BigIntify boundary — fixes credit-tokens/pay-requests/bounties/
     prediction-markets which returned RAW string-typed amounts to
     bigint-comparing validators) + validateCollectionOrExit (the 7
     byte-identical result-variant blocks). 9 fetchCollection + 7
     validateOrExit delegated; the 2 bespoke boolean variants left
     (no-churn).
0430 simulate.ts + preview.ts (previously zero specs anywhere):
     ensureTxWrapper exported + unit-tested (passthrough / bare-Msg
     wrap / non-object) + command-shape specs.

Build clean (no circular deps); unit 142 suites / 3092 tests;
integration 20 suites / 186 tests (the 4 newly-normalized standards
green).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Base automatically changed from feat/0422-0427-cli-followups-r2 to main May 15, 2026 19:25
@trevormil trevormil merged commit 79b5c33 into main May 15, 2026
1 check passed
@trevormil trevormil deleted the feat/0428-cli-followups-r3 branch May 15, 2026 19:25
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