Skip to content

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

Open
Nic-dorman wants to merge 1 commit into
mainfrom
nic/v2-455-surface-already-stored-preflight
Open

feat(antd): surface already-stored preflight in prepare-upload + bump ant-cli-v0.2.7#194
Nic-dorman wants to merge 1 commit 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

… 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>
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