Repository navigation
feat(antd-ruby): sha256 on upload results and manifest entries (REST + gRPC) - #399
Conversation
…+ gRPC) antd 0.17.0 returns the plaintext's SHA-256 (lowercase hex) on uploads and lets a manifest entry record it (V2-1724). Carry it through both transports. Upload results: DataPutResult, DataPutPublicResult, FilePutResult, FilePutPublicResult (POST /v1/data, /v1/data/public, /v1/files, /v1/files/public) and FinalizeUploadResult (wave and merkle finalize) gain sha256. A missing key (antd older than 0.17.0) or an empty string (gRPC's zero value) reads as nil on both REST and gRPC. Manifests: ManifestEntryInput gains sha256, sent on REST and set on the gRPC request only when given and non-empty, so presence is meaningful and the wire never carries null or "". It is passed through unchecked; the daemon validates it and a bad one surfaces as the existing BadRequestError with the daemon's message. ManifestEntryInfo gains sha256 from both build and decode responses, nil when absent or "". The SDK's own unknown-field refusal now lists sha256 among the accepted keys. Compatibility: the new member is last on every Struct, defaulting to nil, so existing construction keeps working. No stubs regenerated (the committed ones already carry the fields), no version bump. Tests: test_sha256.rb (REST, 10) and test_grpc_sha256.rb (gRPC, 8) cover every result type present and absent, manifest build omit and send, entry info from build and decode, and the bad-request mapping; the full suite is 232 runs, 0 failures. test_live_sha256.rb (ANTD_TEST_URL and ANTD_TEST_SHA_LINK) passed against antd v0.17.0 over REST and gRPC, including one public data upload per transport whose sha256 matched the locally computed digest. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MaidSafe-Hermes
left a comment
There was a problem hiding this comment.
APPROVE — reviewed head 89e04eed80306bbfdbb65186195b2c1d8ad6a8a5.
Coverage: 2/2 seats completed, but both returned UNCERTAIN because generated gRPC stubs and execution results were omitted from their evidence. I checked the committed generated Ruby descriptors at the exact base revision a353f9cfe6e59e83b99fa5ee1345e05cc7ad2a91; they already include SHA-256 fields in data, file, upload and manifest messages, including optional manifest presence. The parent Linear comment reports fanout verification and live devnet tests, but those runs were not independently reproduced here.
The REST/gRPC mappings, omission semantics and models match the contract. No source-confirmed blocker remains. No GitHub checks are reported on this branch. This is a code-review approval only; no merge performed.
Part of the sha-fanout round (V2-1724): the SDK side of the sha256 fields antd 0.17.0 added in #347. Targets main; the daemon and antd-go are already released.
antd 0.17.0 returns the plaintext's SHA-256 (lowercase hex) on uploads and
lets a manifest entry record it (V2-1724). Carry it through both transports.
Upload results: DataPutResult, DataPutPublicResult, FilePutResult,
FilePutPublicResult (POST /v1/data, /v1/data/public, /v1/files,
/v1/files/public) and FinalizeUploadResult (wave and merkle finalize) gain
sha256. A missing key (antd older than 0.17.0) or an empty string (gRPC's
zero value) reads as nil on both REST and gRPC.
Manifests: ManifestEntryInput gains sha256, sent on REST and set on the
gRPC request only when given and non-empty, so presence is meaningful and
the wire never carries null or "". It is passed through unchecked; the
daemon validates it and a bad one surfaces as the existing BadRequestError
with the daemon's message. ManifestEntryInfo gains sha256 from both build
and decode responses, nil when absent or "". The SDK's own unknown-field
refusal now lists sha256 among the accepted keys.
Compatibility: the new member is last on every Struct, defaulting to nil, so
existing construction keeps working. No stubs regenerated (the committed
ones already carry the fields), no version bump.
Tests: test_sha256.rb (REST, 10) and test_grpc_sha256.rb (gRPC, 8) cover
every result type present and absent, manifest build omit and send, entry
info from build and decode, and the bad-request mapping; the full suite is
232 runs, 0 failures. test_live_sha256.rb (ANTD_TEST_URL and
ANTD_TEST_SHA_LINK) passed against antd v0.17.0 over REST and gRPC,
including one public data upload per transport whose sha256 matched the
locally computed digest.
🤖 Generated with Claude Code