@plasius/economy 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -186,6 +186,29 @@ one boundary to durably accept verified evidence before acknowledgement and a
186
186
  second boundary to record the externally reconciled completed, failed, or
187
187
  no-op result.
188
188
 
189
+ ## Dual-approved operator adjustments
190
+
191
+ `OperatorAdjustmentPreviewV1` is the immutable value plan prepared by a
192
+ trusted site adapter. It binds the target account and component to the
193
+ server-resolved wallet, target and offset ledger accounts, deterministic
194
+ source lot, positive TokenSubunit magnitude, bounded reason, hashed ticket
195
+ reference, transfer/refund policy, and expiry. Browser and MCP callers may
196
+ request an account and component, but their wallet or ledger identifiers are
197
+ never authority.
198
+
199
+ `OperatorAdjustmentProposalV1` records the first operator's pending proposal.
200
+ `OperatorAdjustmentDecisionV1` requires another stable account and binds the
201
+ exact preview and proposal hashes. `OperatorAdjustmentExecutionV1` links an
202
+ approved plan to its source lot, immutable journal transaction and terminal
203
+ result receipt. A correction is a new `reverse-credit` proposal tied to the
204
+ original lot and transaction; the package exposes no set-balance or delete
205
+ operation.
206
+
207
+ The package validates and canonicalizes these records but deliberately does
208
+ not resolve platform owners, perform MFA step-up, evaluate capabilities or
209
+ flags, hash ticket references, persist proposals, or execute transactions.
210
+ Those controls stay in the consuming authority adapter.
211
+
189
212
  `verifyJournalChainSegment()` accepts an approved canonical-payload hash
190
213
  function, recomputes every transaction hash, checks previous-hash links and
191
214
  duplicate transaction IDs, and proves the resulting head against an expected
@@ -399,6 +422,21 @@ across wallets, even if the sum reaches 1,000 TokenSubunits, because source and
399
422
  transfer restrictions may differ. Authorization must happen before the server
400
423
  constructs a portfolio scope.
401
424
 
425
+ `createPersonalWalletInitializationState()` supplies the exact baseline needed
426
+ before a self account can read a portfolio: deterministic document IDs, one
427
+ account-owned personal `WalletV1`, a single-component scope, exact-zero balance
428
+ and lifetime projections, no activity entries, and a privacy-minimized
429
+ `wallet.initialized.v1` outbox intent. The caller provides SHA-256 and must
430
+ commit the state with audited receipts, idempotency, the authority manifest and
431
+ conditional head advance in one ACID boundary.
432
+
433
+ `initialize-wallet` exists only in `EconomyAuditedCommandTypeV1`; legacy V1/V2
434
+ command unions remain unchanged. It accepts a direct self-account browser
435
+ principal only and terminates with `WALLET_INITIALIZED` or
436
+ `WALLET_ALREADY_INITIALIZED` as a no-economic result. It never creates a
437
+ double-entry transaction or Token activity row and does not authorize value or
438
+ provider writes.
439
+
402
440
  Activity reads use bounded opaque cursor pagination in stable descending
403
441
  `(occurredAt, activityId)` order. Each row retains the component `walletId`
404
442
  whose signed display amount it represents. Cursor contents and signatures are