@plasius/economy 0.7.0 → 0.8.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
@@ -443,6 +443,68 @@ whose signed display amount it represents. Cursor contents and signatures are
443
443
  adapter concerns; `assertWalletActivityPageForPortfolio()` proves that a result
444
444
  never expands the authorized portfolio scope.
445
445
 
446
+ ## Pseudonymous Admin reporting
447
+
448
+ `AdminEconomyReportingQueryPortV1` defines provider-neutral global summary,
449
+ pseudonymous wallet balance, activity, and trend results for governed finance
450
+ operations. It does not grant access or query a database. A host must
451
+ authenticate the caller, enforce the stored rollout flags
452
+ `economy.admin-history.enabled` and `mcp.admin-economy-history.enabled` as
453
+ applicable, re-check the finance capability, and use a least-privilege
454
+ reporting projection.
455
+
456
+ The global summary is an identifier-free point-read projection. It contains
457
+ exact available, reserved, held, reward-progress and lifetime totals, wallet
458
+ counts, and the canonical positive authority sequence through which the
459
+ projection is current. Wallet balance pages contain separate audience-bound
460
+ wallet and subject aliases, a closed component/status code, exact non-negative
461
+ amounts, update time, and authority sequence. They are capped at 100 rows and
462
+ support stable available-descending or update-time-descending pagination.
463
+
464
+ Activity rows are deliberately narrow:
465
+
466
+ - timestamp, normalized type/status/source, and exact signed TokenSubunits;
467
+ - a closed non-identifying label code that the presentation layer maps to
468
+ localized text; and
469
+ - distinct opaque row and subject aliases produced by a versioned,
470
+ audience- and purpose-separated HMAC adapter.
471
+
472
+ The label-code allowlist is `token-acquisition`, `token-spend`,
473
+ `token-reversal`, `token-hold`, `token-activity-failed`,
474
+ `token-system-adjustment`, and `token-activity-unclassified`. A label must also
475
+ be valid for its activity type.
476
+
477
+ Failure rows may use exact zero when a failed workflow has no related economic
478
+ transaction or attempted amount. Zero remains invalid for every economically
479
+ meaningful activity type.
480
+
481
+ The validator accepts only plain enumerable data properties and rejects
482
+ serialization hooks and undeclared properties, including raw account, wallet,
483
+ transaction, order, payment, provider-event, idempotency, and journal-integrity
484
+ identifiers. It also rejects provider-specific source names and free-form
485
+ labels. Result metadata fixes `rawIdentifiersIncluded` to `false`.
486
+
487
+ Activity pages are capped at 100 rows. Cursor values use a versioned `c1.`
488
+ base64url confidentiality-protected opaque format and cannot contain raw
489
+ identifiers. A resumed request carries both that value and its trusted,
490
+ server-decoded binding to the original window, sort, filters, pseudonym
491
+ audience, and version. Result metadata echoes the normalized filter. The
492
+ deterministic default reporting window is 30 days and the interactive maximum
493
+ is 365 days.
494
+
495
+ Hourly trends are limited to 31 days and daily trends may cover the maximum
496
+ window. The result ceiling is 3,720 points, covering all five activity types
497
+ through the maximum hourly window. Trend cohorts with fewer than five distinct
498
+ subjects contain only a suppression marker.
499
+
500
+ Reported trend points carry either a calculated 28-window same-time
501
+ conventional median/MAD indicator or an explicit unavailable result. Only
502
+ non-suppressed baseline cohorts may enter the calculation. Median and MAD
503
+ values use reduced exact rational TokenSubunits with denominators up to two,
504
+ so no floating point or rounding is introduced. Indicators are review alerts
505
+ only and never mutate the ledger. Routine contracts contain no
506
+ identity-resolution operation.
507
+
446
508
  ## Persistence ports
447
509
 
448
510
  `EconomyPersistencePort` remains exported unchanged for existing consumers.