Skip to content

wallet costs: align estimate contexts with upload's real provider/context selection #31

Description

@nijoe1

wallet costs currently approximates the next upload: it builds --copies storage contexts by reusing the wallet's first N active datasets and padding with new-dataset placeholder objects (cast to StorageContext; prepare()'s costing reads only dataSetId/withCDN in the pinned SDK).

The real upload path instead runs selectHealthyProviders() (reachable, unique providers) and createContexts() (matching provider + source + CDN metadata), so the estimate can diverge:

  • it may reuse two datasets on the same provider, though a multi-copy upload requires unique providers;
  • it may reuse a dataset whose CDN/source metadata upload would not reuse;
  • it prices arbitrary historical datasets rather than the providers the next upload will select.

Divergence changes dataset-creation fees, CDN lockups, effective monthly rate, and depositNeeded. The plain-object placeholders also depend on SDK costing internals that a compatible minor upgrade could change.

Interim state (shipped in PR #30): the CLI/README/skill describe the command as an approximate requested-copies estimate — not the source of truth — and note that upload re-quotes via its own prepare() before spending.

Acceptance:

  • The estimate builds contexts the same way upload does (health-checked unique provider selection + metadata-matched dataset resolution), or uses SDK support for costing hypothetical contexts without side effects.
  • No plain-object as StorageContext casts.
  • Regression: estimate for a wallet with same-provider duplicate datasets and mismatched-CDN datasets matches what upload's own prepare() quotes.
  • Restore the stronger wording in README/skill once aligned.

Context: PR #30 follow-up review (2026-07-23), "wallet costs is still not the exact upload quote it claims to be".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions