Skip to content

sdk: intent/listing/bid canonical consolidation + 0416-0421 follow-up batch#241

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

sdk: intent/listing/bid canonical consolidation + 0416-0421 follow-up batch#241
trevormil merged 1 commit into
mainfrom
feat/0416-0421-cli-followups

Conversation

@trevormil
Copy link
Copy Markdown
Collaborator

Post-#240 CLI follow-up audit batch (tickets #0416–#0421). One PR, one commit (files interleave across tickets — see the per-area changelog).

Bug fixes

  • bb build listing emitted an outgoing approval with no fromListId — an under-constrained approval the chain could reject or interpret permissively. Now correctly seller-scoped (FE-canonical). (#0416)
  • bb build send silently ignored --browser / --burner / --simulate / --output-file — advertised in --help but the command hand-rolled its own output and never hit the deploy path. Now honored. (#0419)

Behavioral changes

  • bb build intent / build listing / build bid now emit canonical MsgSet{Outgoing,Incoming}Approval (was a divergent slim MsgUpdateUserApprovals). The build verb and the end-user command (bb intents create / bb nfts list / bb nfts bid) now produce a byte-identical on-chain tx (delegation-parity tests assert this). (#0416)
  • bb build listing / build bid reject a multi-token range with a clear error (orderbook approvals are single-token) instead of silently building a non-canonical range approval. (#0416)
  • Deterministic on-chain ids: intent, listing, bounty builders derive approval/proposal ids from params (stableHashId) instead of random — identical inputs → byte-identical, replayable txs (last uniqueId stragglers from the 0405/0406 line). (#0416, #0417)
  • bb build intent default --expiration 7d → 30d to match bb intents create. (#0416)

Deprecations

  • bb intents create --valid-until → canonical --expiration. --valid-until and --expiry still work as hidden aliases for one release, warn once on use. (#0416)

New capability

  • bb subscriptions enable-renewal / subscribe gained --approval-id — the recurring-approval id can now be pinned for replay (was always random/unpinnable). (#0418)

Refactor + test hardening (summary)

  • New shared resolveApprovalId helper; swept 5 commands off the duplicated RNG. (#0418)
  • bb custom-2fa mint gained unit shape + emit/guard + full broadcast integration coverage (was zero coverage from sdk: custom-2fa mint helper (#0407) + pm-intent consolidation (#0415) + --expiration rename (#0414) #240). (#0420)
  • 6 weak .violations.filter(standard===X) checks upgraded to expectCleanVerification (unmasks cross-standard violations); +5 builder determinism tests; 4 vacuous invalid-input tests now assert real behavior; the expect([0,tx.code]).toContain(tx.code) tautology replaced with toBe(0). (#0421)

Validation

  • Build clean (no circular deps); unit 139 suites / 3052 tests; integration 20/20 suites green (incl. the new bb custom-2fa mint on-chain broadcast asserting a bounded 5-min ownership window).

Downstream

  • Paired bitbadges-docs PR: build-commands.md corrected for the new build intent default (30d) and the build listing/build bid single-token constraint (old docs showed a "1-5" range example that now errors).

🤖 Generated with Claude Code

Post-#240 CLI follow-up audit batch. Files interleave across tickets
(builders.spec.ts spans 0416/0417/0421; build.ts spans 0416/0419), so
this is one commit; per-ticket breakdown:

#0416 — bb build intent/listing/bid now delegate to the canonical
buildIntentApproval / buildOrderbook{Listing,Bid}Approval and emit
MsgSet{Outgoing,Incoming}Approval, byte-identical to bb intents create /
bb nfts list|bid. FIXES the listing.ts missing-fromListId parity bug
(was an under-constrained outgoing approval). Deterministic stableHashId
ids; single-token (range now errors clearly); bb intents create
--valid-until → canonical --expiration (--valid-until/--expiry hidden
deprecated aliases); bb build intent default 7d→30d.

#0417 — bounty.ts votingChallenges proposalId: uniqueId → stableHashId
(last 0405/0406 nondeterminism straggler) + determinism test.

#0418 — new cli/utils/approval-id-options.ts (resolveApprovalId);
swept nfts/auctions/prediction-markets/intents/subscriptions off the
duplicated RNG; subscriptions enable-renewal/subscribe gained a
pinnable --approval-id (previously unpinnable random).

#0419 — bb build send routed through the shared emit(): --browser/
--burner/--simulate/--output-file were advertised but silently
ignored; now honored.

#0420 — bb custom-2fa mint: command shape unit spec + emit/guard
coverage + a full broadcast integration spec (was zero coverage).

#0421 — 6 weak .violations.filter(standard===X) → expectCleanVerification
(unmasks cross-standard violations); +5 builder determinism tests; 4
vacuous invalid-input edge tests now assert real behavior; the
expect([0,tx.code]).toContain(tx.code) tautology → toBe(0).

Build clean (no circular deps); unit 139 suites / 3052 tests green;
integration 20/20 suites green (incl. the new custom-2fa mint broadcast).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@trevormil trevormil merged commit b1f0319 into main May 15, 2026
3 checks passed
@trevormil trevormil deleted the feat/0416-0421-cli-followups branch May 15, 2026 17:14
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