Skip to content

Standardize SDK and foundation runtime package contracts - #362

Merged
ty-everett merged 6 commits into
mainfrom
codex/program-wave-16-foundation-runtime
Jul 26, 2026
Merged

Standardize SDK and foundation runtime package contracts#362
ty-everett merged 6 commits into
mainfrom
codex/program-wave-16-foundation-runtime

Conversation

@ty-everett

@ty-everett ty-everett commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Advances #324 Wave 10 with one dependency-coherent foundation/runtime pass across:

  • @bsv/sdk
  • @bsv/verifast
  • @bsv/wallet-toolbox
  • @bsv/gasp
  • @bsv/teranode-listener
  • @bsv/wallet-relay

Repository-health debt falls from 45 to 24 findings with 0 control errors.

What changed

  • Adds the missing format, zero-warning lint, typecheck, coverage, exact-tarball, and browser contracts required by each package profile.
  • Hardens exact npm artifacts with files allowlists, honest ESM/CommonJS conditional exports, mode-correct declarations, strict type-resolution checks, clean installed consumers, and non-mutating publish hooks.
  • Adds reusable exact-artifact checker support for allowlisted scaffold source, peer-aware consumers, ESM-only entrypoints, and explicitly untyped raw asset entrypoints.
  • Gives the SDK and Wallet Relay independently bundled Vite/esbuild browser checks, Node/server-dependency rejection, source-map validation, and measured raw/gzip/Brotli budgets. The SDK UMD bundle no longer retains a static node:https dependency.
  • Expands deterministic coverage for VeriFast entrypoints/batches, Teranode listener/subtrees, Wallet Relay clients/components, and Wallet Toolbox CDN ingestion. Removes the Wallet Toolbox test's live CDN dependency.
  • Consolidates Teranode listener lifecycle and legacy startup behavior, adds clean shutdown/reconnect cleanup, and validates subtree inputs/removal indexes.
  • Preserves Relay as a public multi-application service by default, with opt-in CORS/origin allowlists and deployment-owned CSP guidance. Authentication, topic validation, QR signatures, tokens, and encrypted pairing remain enforced independently of CORS.
  • Corrects stale package documentation and records the deterministic/manual-test, distribution, consumer, browser, and release contracts.

Validation

Exact head: 89372b13db947bb9b88d74fffd357533b40cf81e

  • All six format:check, lint, and typecheck commands pass.
  • All six pack:check commands pass against exact generated tarballs.
  • SDK: 145 suites; 5,738 passed / 3 skipped; 91.95% statements, 83.56% branches, 94.54% functions, 92.81% lines.
  • Wallet Toolbox: 143 suites passed / 5 skipped; 1,285 passed / 26 skipped; 69.12% statements, 59.09% branches, 72.83% functions, 71.06% lines.
  • GASP: 21/21 tests; 91.56% statements, 82.75% branches, 89.65% functions, 92.12% lines.
  • Teranode Listener: 21/21 tests; 95.69% statements, 80.32% branches, 95.16% functions, 97.65% lines.
  • Wallet Relay: 138/138 tests; 80.54% statements, 72.13% branches, 77.77% functions, 82.74% lines.
  • VeriFast: 72/72 tests plus real ESM, CommonJS, worker, browser-bundler, and WASM consumers.
  • SDK browser tarball: Vite 706,745 raw / 171,756 gzip / 138,548 Brotli; esbuild 533,021 / 155,324 / 128,894; UMD 528,186 / 150,755 / 125,193.
  • Wallet Relay client browser tarball: Vite 200,000 / 62,783 / 51,595; esbuild 167,054 / 60,853 / 51,266.
  • pnpm health:check: 31/31 control tests; 37 projects, 30 public packages, 24 findings, 11 active exceptions, 0 errors.
  • pnpm audit --audit-level=high: no known vulnerabilities.
  • git diff --check: clean.

Release and scope

@sonarqubecloud

Copy link
Copy Markdown

@ty-everett

Copy link
Copy Markdown
Collaborator Author

Maintainer/admin exact-head approval — ty-everett

I reviewed and approve exact head 89372b13db947bb9b88d74fffd357533b40cf81e for squash merge.

Evidence reviewed:

  • CI run 30222294279: all required build, lint, policy, artifact, test, coverage, browser/mobile, dependency-review, docs, health-contract, and merge-gate jobs passed.
  • CodeQL run 30222294265: JavaScript/TypeScript and Actions analyses passed; no open CodeQL alerts.
  • Conformance run 30222294253: passed.
  • Codecov patch coverage is 91.37% (1,260 hits, 45 misses, 74 partials), resolving the earlier stale 83.33% bot report without reducing the 90% gate.
  • SonarCloud quality gate is OK with 0 open/confirmed issues and 0 unreviewed security hotspots.
  • Socket project and pull-request checks passed.
  • Dependabot has 0 open alerts; secret scanning has 0 open alerts. The only open code-scanning alerts are the two existing Scorecard posture items (ci(sonar): exclude tests from duplication via .sonarcloud.properties #202 fuzzing and fix(release): drop cross-ref/infra rewrites from #203, keep only version bumps #204 CII Best Practices), not CodeQL defects introduced here.
  • There are no review threads, human change requests, or unresolved review comments.

GitHub does not permit a pull-request author to submit a formal approving review on their own PR, so this comment records my substantive maintainer approval. I will use the authorized admin merge solely to satisfy that formal self-review restriction; no red or pending quality gate is being bypassed.

@ty-everett
ty-everett merged commit 78563db into main Jul 26, 2026
31 checks passed
@ty-everett
ty-everett deleted the codex/program-wave-16-foundation-runtime branch July 26, 2026 22:09
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