Skip to content

feat(core): fee breakdowns, authorization renewal, public status feed and seed data - #292

Merged
BigDella merged 1 commit into
Parcel-Protocol:mainfrom
harystyleseze:feat/utix-182-185
Oct 18, 2026
Merged

BigDella merged 1 commit into
Parcel-Protocol:mainfrom
harystyleseze:feat/utix-182-185

Conversation

@harystyleseze

@harystyleseze harystyleseze commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds four focused, independently testable core modules, one per issue: a deterministic fee calculator with explainable breakdowns, stale authorization cleanup and an audited renewal flow, a schema-backed public status feed, and contributor-safe seed data with a consistency validator.

Changes

  • core/fees/ (Utix: Create deterministic fee calculation module with explainable breakdowns #182): calculateFees works in bigint smallest units with per-line half-up rounding, per-line minimums and a refusal when fees exceed the amount. explainFees renders each line item, reconcileFees compares a breakdown to stored settlement figures, and parseAssetAmount rejects digits beyond the asset's precision instead of rounding them. Docs: docs/FEES.md.
  • core/authorizations/ (Utix: Implement stale authorization cleanup and renewal flow #183): time-boxed delegated permissions whose state (active, renewed, expired, cleaned, revoked) is derived from the clock, so an expired authorization is refused immediately. Adds a read-only stale report, a maintainer/system-only cleanup after a renewal grace period, and renewal that needs the grantor (or a maintainer) plus explicit confirmation. Grant, renew, revoke and cleanup are audited via four new SENSITIVE_ACTIONS, audit-first, with refusals recorded; scripts/verify-audit.mjs and docs/AUDIT.md are updated. An optional canDelegate hook lets callers enforce that a grantor holds what it delegates (wildcards reserved for maintainers; authorize re-checks it); without it, entitlement is the caller's responsibility. This is separate from the existing session revocation in core/sessions/. Docs: docs/AUTHORIZATIONS.md.
  • core/status/ (Utix: Add schema-backed public status page data feed #184): buildPublicStatusFeed turns trusted state into a versioned public feed (health, incidents, maintenance windows) as a pure function of state and time. validatePublicStatusFeed is the exact-shape schema and publishPublicStatusFeed only returns feeds that validate. Internal items, diagnostics, internal notes and internal component ids are never published. Docs: docs/PUBLIC_STATUS.md.
  • core/seed/ (Utix: Build contributor-safe seed data for complex edge cases #185): deterministic G_SEED_* placeholder dataset covering a failed settlement, revoked access, an overdue workflow and historical records, plus validateSeedDataset, which reuses the domain invariants and the fee module. createSeedDataset() returns a fresh copy each call, which is also how it is reset. Adds npm run verify:seed. Docs: docs/SEED_DATA.md.
  • README.md links the new docs.

Issues

Resolves #185
Resolves #184
Resolves #183
Resolves #182

Verification

  • Manual code and diff review only. Tests were written for every module (zero fee, minimum fee, multi-line fee, rounding and invalid asset precision; active, expired, cleaned, renewed and revoked authorizations; healthy, degraded, incident, maintenance and private-data filtering; seed consistency and corruption detection) but none were executed.
  • cargo build and cargo test were not run. No npm build, lint or test command was run either.
  • No snapshots or generated files were added or changed.

Limits and tradeoffs:

  • The status feed and authorization store are library modules with injected clock and audit recorder. No HTTP route serves the feed, and authorize is not yet wired into each protected action or a scheduled cleanup job, because the repository has no incident or authorization persistence to bind them to.
  • The fee module is not yet called from the ticket transfer mutations; the seed settlements are validated against it instead.

@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@harystyleseze Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@BigDella
BigDella merged commit 7e6e2f1 into Parcel-Protocol:main Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants