Skip to content

feat(antd): surface already-stored preflight in prepare-upload + bump ant-cli-v0.2.7#194

Merged
Nic-dorman merged 2 commits into
mainfrom
nic/v2-455-surface-already-stored-preflight
Jun 18, 2026
Merged

feat(antd): surface already-stored preflight in prepare-upload + bump ant-cli-v0.2.7#194
Nic-dorman merged 2 commits into
mainfrom
nic/v2-455-surface-already-stored-preflight

Conversation

@Nic-dorman

Copy link
Copy Markdown
Collaborator

What

Surfaces the already-stored preflight on antd's REST prepare-upload response, plus folds in the ant-cli-v0.2.7 dependency bump.

ant-core's upload engine excludes chunks already on-network from payment + PUT, but antd's response previously reported nothing about how many were skipped — so an external signer (e.g. indelible) couldn't reconcile "why am I paying for K chunks when the file is M chunks." This adds two additive, optional, backward-compatible scalar fields:

  • total_chunks — total chunks including already-stored
  • already_stored_count — chunks skipped (no payment/PUT)

The signer pays for total_chunks - already_stored_count, so a prepare can legitimately come back cheaper than the raw file size implies.

Changes

antd core (Rust)

  • Add the two fields to PrepareUploadResponse, populated on both wave_batch and merkle paths in build_prepare_response (covers /v1/upload/prepare and /v1/data/prepare). Single-chunk /v1/chunks/prepare is unchanged — it already has already_stored: bool.
  • Bump ant-core pin ant-cli-v0.2.6 → v0.2.7 (self_encryption unchanged at 0.36; PreparedUpload fields verified identical; cargo check confirms no API break).
  • openapi.yaml documents both fields.

16-SDK REST fan-out — add the two fields (optional, default 0 on older daemons) to each PrepareUploadResult model + REST parser + tests. gRPC client mappings that share the model default the fields to 0 (gRPC proto parity is a separate follow-up). antd-zig needs no change: its multi-chunk prepare returns the raw JSON body (no typed model), so the fields pass through.

Docsdocs/external-signer-flow.md, skill.md, llms-full.txt.

Testing

Full sweep on the Linux SDK box — antd core + all 16 SDKs green: cargo test/fmt/clippy, and every SDK's unit suite (Go, Python, Rust, JS, C#, Java, Kotlin, Dart, Swift, Lua, Elixir, Zig, PHP, Ruby, MCP).

Note: the antd package version bump 0.9.2 → 0.10.0 is intentionally left for the release-cut PR.

🤖 Generated with Claude Code

Nic-dorman and others added 2 commits June 8, 2026 14:55
… ant-cli-v0.2.7

Surface the already-stored preflight on the REST prepare-upload response so
external signers can reconcile a (cheaper) payment against the full file size.
ant-core's upload engine now excludes chunks already on-network from payment +
PUT; antd's response previously reported nothing about how many were skipped.

antd core:
- Add additive, optional/defaulted `total_chunks` + `already_stored_count` to
  PrepareUploadResponse, populated on both wave_batch and merkle paths in
  build_prepare_response (covers /v1/upload/prepare and /v1/data/prepare).
- Bump ant-core pin ant-cli-v0.2.6 -> v0.2.7 (self_encryption unchanged).
- openapi.yaml documents both fields.

16-SDK REST fan-out: add the two fields (optional, default 0 on older daemons)
to each PrepareUploadResult model + REST parser + tests. gRPC client mappings
that share the model default the fields to 0 (gRPC proto parity tracked
separately). antd-zig needs no change — its multi-chunk prepare returns the raw
JSON body (no typed model), so the fields pass through.

Docs: external-signer-flow.md, skill.md, llms-full.txt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Was pinned to v0.2.7; v0.2.8 is now released and carries the same preflight
fields this PR reads (total_chunks, already_stored_addresses). Bumping here so
main lands directly on the final release dep and does not conflict with the
streaming branch's identical v0.2.8 pin. Transitive deps: ant-protocol 2.2.0,
saorsa-core 0.26.0, saorsa-transport 0.35.0. cargo check --release clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit 3ccdded into main Jun 18, 2026
7 checks passed
@Nic-dorman Nic-dorman deleted the nic/v2-455-surface-already-stored-preflight branch June 18, 2026 14:45
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.

1 participant