Skip to content

fix(wallet-toolbox): encrypt internalizeAction customInstructions once - #818

Merged
BraydenLangley merged 8 commits into
mainfrom
cursor/internalize-metadata-once-6ed5
Oct 13, 2026
Merged

BraydenLangley merged 8 commits into
mainfrom
cursor/internalize-metadata-once-6ed5

Conversation

@sirdeggen

@sirdeggen sirdeggen commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #785.

Program and scope

With metadata encryption enabled, a normal-basket insertion was encrypted before permission modules and again afterward when a registered p label or basket caused modules to run. This PR keeps the original fix: the after-module pass encrypts only permission-module baskets, so normal-basket instructions retain their existing single layer.

  • Original implementation and both PR test files are byte-identical to 81c0e0792f136975f6c5d3a87b99f3605c8de342.
  • Current main at be2a2e7ade2eb8487b08d4d2b158f02ab36a3160 is merged. Conflicts were limited to release notes, the changelog and the generated migration ledger; both sets of notes are preserved.
  • Existing double-encrypted records, read behavior, createAction, and trusted-module transformations remain outside this fix. No encryption-history tracking or automatic legacy recovery is added.
  • Exact head: 4c69a2c33016ea443cdaff6941ed7c68d31bdb5e.

Impact

  • Public package source changed: @bsv/wallet-toolbox, with shared browser/mobile implementation
  • Security-sensitive metadata behavior changed
  • Documentation and release notes updated
  • Public API, exports, declarations, stored format or runtime targets changed
  • Infrastructure, dependencies or deployment configuration changed

Package versions and release baseline declarations follow current main (2.14.8 source manifests from #675). This PR introduces no independent version bump. Its original changelog note is retained in the current candidate section.

Verification

  • Full workspace build and root health, lint, format and typecheck: pass. These four checks were repeated after formatting the merged changelog.
  • After incorporating fix(wallet-toolbox): change the profile list only after the UMP update succeeds #675, complete affected CWI/profile, WAB, authentication, metadata/encryption/module/proxy/token suites: 10 suites / 259 tests pass. The original eight-row encryption table and token tests are unchanged.
  • Earlier complete local wallet run on the first main integration (8199c6ca28): 295 suites / 3,251 tests pass, with existing 2 skipped suites / 7 skipped tests. After fix(wallet-toolbox): change the profile list only after the UMP update succeeds #675 landed, the complete affected 259-test regression batch was repeated on the final source. The new exact-head hosted wallet run below is required; the earlier full receipt is not relabelled as a final-head run.
  • Latest-source client/mobile units, BTMS/ECPM and wallet-helper tests pass. All other affected dependents passed locally on the first integration; fresh final-head hosted dependent checks remain required.
  • Conformance: 6,497 tests pass; 211 existing governed skips.
  • All three wallet packed-consumer checks and browser/mobile platform contracts: pass.
  • Documentation generation/checks and site build/link checks: pass; migration ledger generated by its original generator. Changed-file formatting and git diff --check: pass.
  • Hosted exact-head CI, CodeQL, and Conformance pass on 4c69a2c33016ea443cdaff6941ed7c68d31bdb5e. All 44 checks are terminal: 37 successful, 7 scope skips validated by the successful merge gate. Final-head full wallet coverage (all regular shards, both HTTP sync jobs and monitor), all affected dependents and all platform/consumer jobs pass. Sonar: quality=OK, newFindings=0, unreviewedHotspots=0. PR-ref CodeQL alerts: none.
  • Coverage delta: changed-line/branch coverage 100.00% (15/15 points; required target 90.00%). No threshold, suppression or exclusion change.
  • Complete diff reviewed; original runtime/tests preserved and current-main changes retained
  • All applicable exact-head checks terminal and successful, with scope skips validated by merge gate

Security and dependencies

  • No dependency, lockfile, override, suppression, exclusion or skipped-test change
  • Original negative/regression encryption coverage retained
  • Exact-head CodeQL has no new alert
  • Exact-head Sonar reports zero new findings and unreviewed hotspots

Dependency evidence

No dependency change. Security audit passes with 3 low and 2 moderate existing advisories, none high/critical. Existing peer contracts and package exports are unchanged; packed consumer and platform checks pass.

Release and operations

  • No npm publication, image release or deployment performed
  • Existing changelog, migration and release clauses preserved

No API, wire or database migration. The fix prevents future normal-basket double encryption. Existing affected values retain the original single-decrypt read behavior. There is no live-wallet access or database rewrite.

Completion evidence

  • All exact-head hosted checks passed
  • Review conversations resolved
  • Documentation and release guidance reflect the original fix
  • No pending or failed check handed off as complete
  • Existing GitHub maintainer approval is retained from the prior head; no new review request or merge is performed here.

Current with main, conflict-free and ready for review after exact-head qualification. Deggen’s original implementation/tests remain unchanged. No PR merge, publication or deployment performed.

cursoragent and others added 3 commits October 5, 2026 14:19
Normal-basket customInstructions were encrypted before permission modules
and again after a registered p-label or p-basket ran. listOutputs decrypts
one layer, so those values came back as ciphertext. The after-module pass
now encrypts only permission-module baskets, matching createAction.

Fixes #785

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

Sonar S9382 flagged the new await inside encryptInternalizeActionModuleMetadata.
Collect the permission-basket encryptions and finish them with Promise.all.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Keep the #785 once-only metadata encryption and record it on the
wallet-toolbox 2.14.6 notes alongside main's current release text.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@sirdeggen
sirdeggen marked this pull request as ready for review October 7, 2026 17:18
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…tadata-once-6ed5

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
cursoragent and others added 2 commits October 12, 2026 08:59
Keep the once-only customInstructions encryption and record it on the
wallet-toolbox 2.14.7 notes alongside main's current release text.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Keep the once-only customInstructions encryption beside main's confirmed
IndexedDB internalize notes.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@BraydenLangley
BraydenLangley marked this pull request as draft October 12, 2026 23:11
@BraydenLangley BraydenLangley changed the title fix(wallet-toolbox): encrypt internalizeAction customInstructions once fix(wallet-toolbox): encrypt metadata once and recover legacy instructions Oct 12, 2026
@BraydenLangley
BraydenLangley marked this pull request as ready for review October 12, 2026 23:52
@BraydenLangley BraydenLangley changed the title fix(wallet-toolbox): encrypt metadata once and recover legacy instructions fix(wallet-toolbox): encrypt internalizeAction customInstructions once Oct 13, 2026
@BraydenLangley
BraydenLangley force-pushed the cursor/internalize-metadata-once-6ed5 branch from a23c8c3 to 81c0e07 Compare October 13, 2026 03:03
@BraydenLangley
BraydenLangley marked this pull request as draft October 13, 2026 03:35
Preserve the original implementation and tests. Resolve release-note and changelog conflicts additively and regenerate the migration ledger.
Keep the original WalletPermissionsManager implementation and tests. Preserve current main release notes and package versions.
@sonarqubecloud

Copy link
Copy Markdown

@BraydenLangley
BraydenLangley marked this pull request as ready for review October 13, 2026 04:09

@BraydenLangley BraydenLangley 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.

Makes sense

@BraydenLangley
BraydenLangley merged commit b73c72d into main Oct 13, 2026
44 checks passed
@BraydenLangley
BraydenLangley deleted the cursor/internalize-metadata-once-6ed5 branch October 13, 2026 04:26
cursor Bot pushed a commit that referenced this pull request Oct 13, 2026
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>
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.

WalletPermissionsManager.internalizeAction double-encrypts customInstructions for normal baskets when a p-label is present

4 participants