You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This program slice makes the Message Box client and server safer, more predictable, easier to deploy, and conformant with the current ts-stack repository contracts. It also modernizes the client package artifact without changing or publishing either package version.
Modernize the published artifact to a verified tsdown ESM/CJS package with declarations, explicit exports, a minimal file set, strict type/lint/format gates, and reproducible pack checks.
Add browser composition and raw/gzip/brotli budgets for Vite, esbuild, and UMD consumers while removing the guarded SDK node:https fallback from browser bundles.
Validate configured and advertised hosts, reject unsafe untrusted overlay advertisements, preserve explicit local/development hosts, and consistently forward explicit deployment hosts through HTTP and WebSocket paths.
Harden HMAC checks, recipient-specific encryption, batch-send isolation, device and pagination bounds, permission handling, and backward-compatible pagination behavior.
Preserve the legacy misspelled batch API as deprecated while adding the correctly named API.
Replace the bundled integration server with an explicit opt-in external integration runner.
Message Box server
Add /health and /ready endpoints and fail startup cleanly when database migration, Firebase, or WebSocket initialization fails.
Keep CORS public by default for this public service while supporting configurable allowlists and explicit disablement.
Validate message, acknowledgement, permission, and device inputs; bound list queries; authenticate acknowledgement ownership; reject token ownership conflicts; and remove fail-open fee behavior.
Normalize permission scope with a reversible migration and add composite indexes for bounded list queries.
Simplify the production image to the Node service on port 8080, removing the unused nginx/build indirection.
Remove unused dependencies/configuration, standardize strict format/type/lint/test scripts, and close the Knex pool on failed initialization.
Contracts and documentation
Update the Message Box OpenAPI contract, generated TypeScript/Python/Go bindings, package and deployment docs, and repository-health baseline.
Document the public-default CORS model, pagination and validation contracts, deployment health probes, startup expectations, and opt-in integration workflow.
Compatibility and publication
@bsv/message-box-client remains at 2.2.2.
@bsv/messagebox-server remains at 1.1.14 and private.
No npm package has been published.
Licensing files and license policy are unchanged by this PR.
Validation
Client: format, strict typecheck, zero-warning lint, build, verified ESM/CJS pack, browser composition/budgets, 114 unit tests, and coverage (60.3% lines).
Server: format, strict typecheck, zero-warning lint, build, 95 tests, coverage (44.27% lines), and production/full npm audits with zero findings.
Admin exact-head review attestation for 91f638a: reviewed the Message Box client/server hardening, public-by-default configurable CORS contract, compatibility surface, packaging, documentation/spec/codegen, and the follow-up Sonar/coverage fixes. Local package and full-repository build, test, lint, audit, health, version, codegen, browser, and pack gates passed. GitHub checks are fully green, including both CodeQL analyses, SonarCloud with 0 new open/confirmed issues, Codecov patch at 93.86189%, dependency review, Socket, infrastructure image, conformance, docs, codegen, coverage matrix, and merge gate. There are 0 unresolved review threads. GitHub prohibits an author from formally approving their own PR, so this records the equivalent ty-everett admin review evidence before the authorized admin merge.
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
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
This program slice makes the Message Box client and server safer, more predictable, easier to deploy, and conformant with the current ts-stack repository contracts. It also modernizes the client package artifact without changing or publishing either package version.
Part of #324.
What changed
Message Box client
tsdownESM/CJS package with declarations, explicit exports, a minimal file set, strict type/lint/format gates, and reproducible pack checks.node:httpsfallback from browser bundles.Message Box server
/healthand/readyendpoints and fail startup cleanly when database migration, Firebase, or WebSocket initialization fails.Contracts and documentation
Compatibility and publication
@bsv/message-box-clientremains at2.2.2.@bsv/messagebox-serverremains at1.1.14and private.Validation
pnpm check-versions,pnpm health:check,pnpm build,pnpm test,pnpm lint,pnpm audit:security, andpnpm license:pack-check.mainbased4c98d06ca24d5e03722079b9e5b31df32ee9b68.