Skip to content

feat(antd)!: normalize put/get convention + close private-file PUT and GET gaps#115

Merged
Nic-dorman merged 1 commit into
mainfrom
nic/v2-340-file-upload-private
May 21, 2026
Merged

feat(antd)!: normalize put/get convention + close private-file PUT and GET gaps#115
Nic-dorman merged 1 commit into
mainfrom
nic/v2-340-file-upload-private

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

Stacked on #114 (V2-288 PaymentMode sweep). Will rebase to main once #114 merges.

Summary

Two gaps + one inconsistency on antd's data/file surface:

  • No private file PUTfiles.proto only had UploadPublic. The canonical ant file upload <path> CLI defaults to private; the daemon offered only the strictly-more-expensive public variant.
  • No private file GET — symmetric gap on the download side. ant file download --datamap … works in the CLI; antd never exposed the equivalent.
  • Naming inconsistency_private/_public suffixes everywhere, plus REST URLs sprinkled with /upload/ and /download/ segments. Pre-1.0 = time to normalize.

Convention

Private = unqualified verb; _public is the suffix. Mirrors the CLI default. Applied to proto rpcs, REST URL paths, and internal handler names. Cost rpcs normalize to plain Cost on each service.

Two new endpoints

  • POST /v1/files (gRPC FileService.Put) — private upload; returns DataMap.
  • POST /v1/files/get (gRPC FileService.Get) — private download from caller-held DataMap.

Bulk renames

Now Was
POST /v1/data POST /v1/data/private
POST /v1/data/get GET /v1/data/private?data_map=…
POST /v1/files/public POST /v1/files/upload/public
POST /v1/files/public/get POST /v1/files/download/public
DataService.{Put, Get, Cost} DataService.{PutPrivate, GetPrivate, GetCost}
FileService.{Put, PutPublic, Get, GetPublic, Cost} FileService.{Upload/Download…, GetFileCost} + 2 new
Messages: Put/GetDataRequest/Response, PutFileRequest, PutFile{Public,}Response, GetFile{Public,}Request, GetFileResponse old verbose names

POST /v1/data/get switches from GET-with-query to POST-with-body so large DataMaps (multi-KB hex) no longer hit URL length limits.

antd-rust

Minimum compile-fix: internal rpc method names and REST URL paths follow the rename. SDK public method signatures unchanged (data_put_private, file_upload_public still the public API). Full SDK fan-out — rename + new typed PaymentMode enum + the two new methods exposed publicly — is a separate per-SDK PR series.

Test plan

  • cargo check clean on antd + antd-rust
  • cargo clippy --all-targets -- -D warnings clean on both
  • cargo test --bin antd — 37/37 pass
  • cargo test antd-rust — 56/56 unit, 1/1 doc test pass
  • Live end-to-end against ant dev start: POST /v1/files (private) returns a hex DataMap; the address space is not fetchable via POST /v1/files/public/get
  • Live end-to-end: POST /v1/files/get with the returned DataMap downloads the file
  • dev2 full-stack sweep continues to pass with antd-rust SDK

🤖 Generated with Claude Code

…d GET gaps

Surface rename and two new endpoints on the data/file API. Pre-1.0, so no
backward-compat shim — old route names and proto types are removed.

Convention: private = unqualified verb; `_public` is the suffix. Mirrors
the canonical `ant file upload` CLI, which defaults to private. Applies to
proto rpc names, REST URL paths, and internal handler names. Cost rpcs
normalize to plain `Cost` on each service.

Two new endpoints close the missing private-file gaps:
  * file_put (POST /v1/files, FileService.Put) — private upload; returns
    the DataMap to the caller, no on-network data_map_store.
  * file_get (POST /v1/files/get, FileService.Get) — private download from
    a caller-held DataMap; no address lookup. ant-core's `file_download`
    already supports this; the daemon just never exposed it.

Bulk renames:
  * DataService: PutPrivate→Put, GetPrivate→Get, GetCost→Cost; message
    Put/GetPrivateDataRequest/Response → Put/GetDataRequest/Response.
  * FileService: UploadPublic→PutPublic, DownloadPublic→GetPublic,
    GetFileCost→Cost; UploadFileRequest→PutFileRequest;
    UploadPublicResponse→PutFilePublicResponse;
    DownloadPublicRequest→GetFilePublicRequest;
    DownloadResponse→GetFileResponse.
  * REST URLs:
      /v1/data/private (POST/GET) → /v1/data (POST), /v1/data/get (POST)
      /v1/files/upload/public → /v1/files/public
      /v1/files/download/public → /v1/files/public/get
      new: /v1/files (POST), /v1/files/get (POST)
  * The /v1/data/private GET (data_map in query) becomes POST /v1/data/get
    with the data_map in the body, so large DataMaps no longer hit URL
    length limits.
  * Rust handler fns: data_put_private→data_put, data_get_private→data_get,
    file_upload_public→file_put_public, file_download_public→file_get_public,
    plus new file_put / file_get.

The `Cost` message keeps its name; the rpc named `Cost` returns
`antd.v1.Cost` (fully qualified) to disambiguate at the proto level.

antd-rust gets the minimum update to keep compiling against the renamed
proto: internal method/type names + REST URL paths follow the rename.
The SDK's public method signatures (data_put_private, file_upload_public,
etc.) are unchanged — full SDK fan-out (rename + PaymentMode enum + new
methods) is a separate per-SDK PR.

openapi.yaml is updated to reflect the new paths, the renamed schemas,
the two new endpoints, and the now-bidirectional payment_mode fields on
the cost requests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman force-pushed the nic/v2-340-file-upload-private branch from cc9cea2 to 7e3d414 Compare May 21, 2026 15:41
@Nic-dorman Nic-dorman merged commit 206c3fc into main May 21, 2026
3 checks passed
Nic-dorman added a commit that referenced this pull request May 21, 2026
First per-SDK PR adopting the renamed antd surface — see ant-sdk #115 for the
proto/REST contract this lands against.

API rename (private = unqualified verb, `_public` suffix = public):

- DataPutPrivate / DataGetPrivate     -> DataPut / DataGet
- FileUploadPublic / FileDownloadPublic -> FilePutPublic / FileGetPublic
- New: FilePut / FileGet (the V2-340 private-file endpoints)

PaymentMode threading:

- PaymentMode becomes a required positional arg (dropping the variadic
  "fake-optional" pattern). Callers pass antd.PaymentModeAuto explicitly.
- gRPC client now threads payment_mode on every put/cost path (previously
  the gRPC client ignored payment_mode entirely).
- DataCost and FileCost gain payment_mode parameters to match the renamed
  proto/REST request messages.

Result types:

- New: DataPutResult, DataPutPublicResult, FilePutResult, FilePutPublicResult
- Dropped: FileUploadResult (replaced by FilePutPublicResult)
- Kept: PutResult — now exclusive to ChunkPut

Tests:

- TestPaymentModeWiresIntoRequestBody asserts payment_mode reaches the REST
  body on every put/cost endpoint.
- gRPC mocks capture lastPaymentMode and gRPC tests assert the enum reaches
  the proto request field.

Proto stubs regenerated from antd/proto/antd/v1/*.proto.

Branch off nic/v2-340-file-upload-private; rebase to main once #115 lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nic-dorman added a commit that referenced this pull request May 21, 2026
)

* feat(antd-go)!: adopt PaymentMode enum + put/get convention (1/11)

First per-SDK PR adopting the renamed antd surface — see ant-sdk #115 for the
proto/REST contract this lands against.

API rename (private = unqualified verb, `_public` suffix = public):

- DataPutPrivate / DataGetPrivate     -> DataPut / DataGet
- FileUploadPublic / FileDownloadPublic -> FilePutPublic / FileGetPublic
- New: FilePut / FileGet (the V2-340 private-file endpoints)

PaymentMode threading:

- PaymentMode becomes a required positional arg (dropping the variadic
  "fake-optional" pattern). Callers pass antd.PaymentModeAuto explicitly.
- gRPC client now threads payment_mode on every put/cost path (previously
  the gRPC client ignored payment_mode entirely).
- DataCost and FileCost gain payment_mode parameters to match the renamed
  proto/REST request messages.

Result types:

- New: DataPutResult, DataPutPublicResult, FilePutResult, FilePutPublicResult
- Dropped: FileUploadResult (replaced by FilePutPublicResult)
- Kept: PutResult — now exclusive to ChunkPut

Tests:

- TestPaymentModeWiresIntoRequestBody asserts payment_mode reaches the REST
  body on every put/cost endpoint.
- gRPC mocks capture lastPaymentMode and gRPC tests assert the enum reaches
  the proto request field.

Proto stubs regenerated from antd/proto/antd/v1/*.proto.

Branch off nic/v2-340-file-upload-private; rebase to main once #115 lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: align Go SDK references with PaymentMode + put/get rename

Three docs surfaces had stale Go method names / signatures pointing at the
pre-rename API:

- llms-full.txt — Go SDK Method Signatures section now lists DataPut /
  DataGet / FilePut / FileGet / FileGetPublic with their required
  PaymentMode parameter; ChunkPut/ChunkGet stay unchanged.
- README.md — top-level Go quickstart snippet passes antd.PaymentModeAuto.
- llms.txt — Go examples count fixed (4 examples spanning 01-07, not 5
  spanning 01-05 — the 04/05/06 slots are unused; example 07 is the
  external-signer one).

Other languages' sections (Java, C#, etc.) retain pre-rename signatures
on purpose — those land in each per-SDK fan-out PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman deleted the nic/v2-340-file-upload-private branch May 21, 2026 16:02
Nic-dorman added a commit that referenced this pull request May 21, 2026
Cuts v0.8.0 atop v0.7.1. Substantial breaking-change roll-up of the
put/get rename, the private-file PUT/GET gap close, and several minor
surface cleanups -- bundled here so the v1.0 cut can ship stable on top.

## Breaking (antd daemon)

- feat(antd)!: bind to 127.0.0.1 by default on REST and gRPC (#107).
  Previously bound 0.0.0.0; use --bind-rest / --bind-grpc to override.
- chore: remove dead graph_entry surface from antd proto + 5 SDKs (#92).
  GraphService and its 4 RPCs are gone; REST mounts dropped.
- chore: remove dir_upload_public / dir_download_public surface (#95).
  Use file_put_public on a directory path instead; the daemon recurses.
- feat(antd)!: normalize put/get convention + close private-file PUT and
  GET gaps (#115). Method renames across proto + REST + SDKs:
    data_put_private    -> data_put
    data_get_private    -> data_get
    file_upload_public  -> file_put_public
    file_download_public -> file_get_public
  New: file_put / file_get for the private file path (previously only
  the public variant existed). New typed results: DataPutResult,
  DataPutPublicResult, FilePutResult, FilePutPublicResult; PutResult
  is now annotated as chunk_put only.

## Additive

- feat(antd): honor payment_mode on gRPC put/cost paths and REST cost
  endpoints (#114). Optional kwarg threaded through every put/cost
  signature; empty/omitted maps to "auto" so older clients keep working.
- feat: external-signer public uploads + single-chunk prepare/finalize
  across 15 SDKs (#90).
- docs+spec: openapi.yaml refreshed for the v1.0 surface, including
  POST /v1/chunks/prepare and /v1/chunks/finalize for single-chunk
  external-signer publish (#126).

## SDK fan-out (PaymentMode + put/get convention, all 15)

#116 antd-go, #117 antd-py/ruby/elixir, #118 antd-rust, #119 antd-csharp,
#120 antd-java, #121 antd-swift, #122 antd-dart, #123 antd-kotlin,
#124 antd-cpp, #125 antd-js/php/zig/lua, #127 antd-mcp.

## SDK example + build fixes

- fix(antd-go): make 03-files example self-contained and runnable (#91)
- fix(examples): make 04-files runnable across cpp/rust/elixir/lua/php/ruby/zig (#93)
- fix(examples): runnable dart 04_files + java Example03Files; add java Example03Chunks (#94)
- feat: gRPC transport example for antd-py and antd-rust (#113)
- feat(antd-py): 07_external_signer example + ant-dev dispatcher entry (#98)
- feat(antd-js): 07-external-signer example + antd-py empty-payments fix (#99)
- feat(rust/go): 07-external-signer examples (#100)
- feat(antd-csharp): 07_external_signer example (#101)
- feat(antd-java): 07_external_signer example (#102)
- feat(antd-kotlin): 07_external_signer example (#103)
- feat(antd-dart): 07_external_signer example (#104)
- feat(antd-ruby): 07_external_signer example (#105)
- feat(antd-php): 07_external_signer example (#106)
- chore(antd-kotlin): drop stale GraphDescendant from local proto copy (#108)

## Docs / infra

- docs: external-signer flow reference + ABI + python smoke test (#97)
- docs: add SECURITY.md with threat model and disclosure policy (#109)
- docs!: refresh per-SDK READMEs + llms-full.txt + openapi.yaml for v1.0 surface (#126)
- ci: add Go lint + test + vuln scanning for antd-go (#112)
- ci: extend antd-rust to sibling-repo parity (fmt + clippy + audit + doc) (#111)
- ci: skip antd/openapi.yaml and llms-full.txt from triggering CI (#128)
- chore(scripts): add full-stack + integration sweep helpers (#96)
- fix(antd-rust): regenerate Cargo.lock to unbreak --locked CI (#110)

Co-Authored-By: Claude Opus 4.7 (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