Skip to content

fix(wallet-toolbox): wire live-sync chain preflight and ProcessSyncChunkResult.error - #551

Merged
sirdeggen merged 8 commits into
mainfrom
cursor/wallet-toolbox-dead-code-541-542-884b
Oct 15, 2026
Merged

sirdeggen merged 8 commits into
mainfrom
cursor/wallet-toolbox-dead-code-541-542-884b

Conversation

@sirdeggen

@sirdeggen sirdeggen commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #541 and #542 by wiring the existing public surfaces. This is not an API deletion.

Reworked after maintainer review (CHANGES_REQUESTED): WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error stay public. Live syncToWriter / syncFromReader now compare reader and writer TableSettings.chain before any chunk moves and throw WERR_NETWORK_CHAIN on mismatch. Custom writers may set ProcessSyncChunkResult.error; both live-sync loops throw that error and stop. First-party providers still throw. Deserializer and instanceof JSON round-trip coverage remain.

Merged onto current origin/main (5a600ef2b), including published 2.14.9 and the receipt/broadcast train (#1073, #1066). Conflicts were governance/package-release-notes.json and generated docs/reference/package-api-migrations.md. Live-sync source did not conflict. Unpublished candidate is now 2.14.10 (published 2.14.9).

Program and scope

Impact

  • No public package source or manifest changed
  • Public package source or manifest changed; affected packages are listed below
  • Infrastructure source, dependency, image, or deployment configuration changed
  • Public API, exports, types, runtime targets, or browser/mobile behavior changed
  • Security-sensitive boundary changed
  • Documentation or examples changed

Affected packages/services and intended patch versions (publication occurs only
through the release workflow after approval):

  • @bsv/wallet-toolbox 2.14.10 (unpublished candidate vs published 2.14.9; releaseType is patch)
  • @bsv/wallet-toolbox-client and @bsv/wallet-toolbox-mobile share the same source

Verification

  • Local commands and results after this merge:
    • pnpm --filter @bsv/wallet-toolbox exec jest --testPathPatterns='WalletError.test|liveSyncGuards.test|liveSyncManager.test' --no-coverage — 3 suites, 51 passed
    • pnpm docs:facts:check — passed
    • pnpm health:check — passed (existing maintenance reminders only)
    • pnpm check-versions — passed
  • Hosted CI on exact head ea9d5f88240efd639414bbe57b9b6d0c48d220e3: all 44 checks terminal without failures. Workflows: CI, CodeQL, Conformance, Codegen. Passed include Build/lint/policy, wallet-toolbox coverage shards and sync-http, dependents, wallet browser/mobile, package artifacts, Quality gate — zero new Sonar findings, CodeQL, merge-gate, Repository health, Dependency Review, Docs Site Validation. Expected skips: Infra, Coverage/SDK, Coverage/DID, Coverage/VeriFast, Mutation partitions, Tests/non-coverage packages.
  • Conformance evidence: BRC-40 completion still uses ProcessSyncChunkResult.done; hosted Conformance and ts-runner passed
  • Coverage delta: hosted wallet-toolbox coverage shards and sync-http passed
  • Lint/typecheck delta: hosted Build, lint, and policy passed
  • Browser/mobile/packed-consumer evidence: hosted wallet browser, wallet mobile, and package artifacts passed; WERR_NETWORK_CHAIN remains exported from the public sdk namespace and ./out/src/sdk subpath
  • Performance or bundle-size delta: none expected
  • I self-reviewed the complete diff for correctness, security,
    compatibility, public API, artifacts, dependencies, docs, and operations
  • All applicable checks are terminal and successful on the exact head; any
    scope-based skip is expected and validated by the merge gate

Security and dependencies

  • No dependency or lockfile change relative to current main
  • Changelog, runtime relevance, peer compatibility, transitive graph, and
    audit results were reviewed
  • CodeQL/negative tests cover any changed trust boundary
  • The exact-head CodeQL analysis has no new alert
  • The exact-head repository quality gate reports zero new Sonar findings
    (including accepted or false-positive issue states) and zero unreviewed hotspots;
    Sonar's aggregate Quality Gate passed verdict alone is not merge evidence
  • No new override, advisory dismissal, quality suppression, or skipped test
  • Any temporary exception is registered with owner, evidence, review date,
    and removal condition
  • Workflow permissions and lifecycle-script behavior remain least privilege

Release and operations

  • No npm publication was performed from a workstation or from this PR
  • Required npm patch bumps are included or intentionally deferred by the
    controlling program
  • Image/SBOM/provenance/deployment/rollback impact is documented (none)
  • Documentation, changelog, migration, and operational guidance are current

Decision

Public surfaces are retained and wired. Hosted CI is green on this merge head. Left open for human review. Do not merge.

Open in Web Open in Cursor 

@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ty-everett ty-everett left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review: retain this as draft and redesign it compatibly. WERR_NETWORK_CHAIN is exported through the public sdk namespace and SDK subpath; removing it breaks consumer imports, instanceof checks and typed JSON round trips. ProcessSyncChunkResult.error is also a public declaration. Internal non-use and the artifact checker’s selected export list do not establish absence of external consumers. Keep/deprecate these surfaces, retain round-trip coverage, and address #541 with an explicit live-sync chain preflight and #542 with documented, tested custom-provider failure handling. Do not close those issues through an API deletion in this maintenance release. A deliberate removal would need an approved major-version migration. Current main has also advanced substantially, so final acceptance must be rerun after the compatible revision.

…ChunkResult.error

WERR_NETWORK_CHAIN was defined and deserialized but never thrown, and no
processSyncChunk producer or consumer set or read result.error. Remove the
dead surface instead of inventing new chain-mismatch or chunk-error
semantics. Historical JSON with that error name still deserializes as a
generic WalletError.

Closes #541
Closes #542

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@cursor
cursor Bot force-pushed the cursor/wallet-toolbox-dead-code-541-542-884b branch from fbb0b5f to 5616c96 Compare October 9, 2026 12:01
cursoragent and others added 2 commits October 9, 2026 12:05
…0-16

The 2026-10-08 reviewBy date expired on main and blocks hosted CI. Static
re-review confirms the same 30 dispositions; 29 source hashes are unchanged
and the remaining suite matches the 2026-10-05 hash. No suite was executed.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
…unkResult.error

Keep WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error as public surfaces.
Compare reader/writer TableSettings.chain before any live-sync chunk moves and
throw WERR_NETWORK_CHAIN on mismatch. Honor a custom writer's
ProcessSyncChunkResult.error by throwing it and stopping the loop. First-party
providers still throw. Addresses #541 and #542 without an API deletion.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@cursor cursor Bot changed the title fix(wallet-toolbox): remove unused WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error fix(wallet-toolbox): wire live-sync chain preflight and ProcessSyncChunkResult.error Oct 9, 2026
cursoragent and others added 4 commits October 9, 2026 14:32
Close GHSA-8r5x-fm3f-whwj and GHSA-p8wg-vrv2-v86f on the frozen
ts-jest graph. 4.7.10 is younger than the 7-day floor until 2026-10-12,
so handlebars is temporarily age-excluded for this security install.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Resolve conflicts with #968 and the 2.14.7 wallet-toolbox train. Keep the
compatible live-sync wiring. Drop the temporary handlebars override now
that main already locks 4.7.10 and treats release age as advisory.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Bring in #1029 (IndexedDB confirmed internalize). Conflicts were changelog
and release notes only; keep both 2.14.7 notes and the live-sync wiring.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Bring in #818 and the 2.14.8 train. Conflicts were release notes and
generated migrations; keep the live-sync wiring and public error surfaces.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@sirdeggen
sirdeggen marked this pull request as ready for review October 13, 2026 09:55
@sirdeggen
sirdeggen requested a review from ty-everett October 13, 2026 09:55
Bring in published 2.14.9 and receipt/broadcast work. Conflicts were
release notes and generated migrations. Keep live-sync wiring as the
unpublished 2.14.10 patch; public error surfaces stay.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@sonarqubecloud

Copy link
Copy Markdown

@sirdeggen
sirdeggen merged commit 3af90aa into main Oct 15, 2026
45 checks passed
@sirdeggen
sirdeggen deleted the cursor/wallet-toolbox-dead-code-541-542-884b branch October 15, 2026 16:31
sirdeggen added a commit that referenced this pull request Oct 15, 2026
main carries an unpublished wallet-toolbox 2.14.10 (#551, live-sync chain
preflight). Keep 2.15.0 in the three manifests and the baseline, and keep
2.14.10 as its own CHANGELOG section below 2.15.0. The release-note entries
stay on the published 2.14.9 baseline as a minor release, and their summary
and migration now also carry the 2.14.10 text, since 2.15.0 ships it.
Generated reference docs are regenerated with pnpm docs:facts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants