Repository navigation
feat(antd-kotlin): sha256 on upload results and manifest entries (REST + gRPC) - #404
Conversation
…T + gRPC) Carry the plaintext SHA-256 antd 0.17.0 returns (V2-1724). Upload results: DataPutResult, DataPutPublicResult, FilePutResult, FilePutPublicResult, FinalizeUploadResult and FinalizeMerkleUploadResult (the two finalize results map POST /v1/upload/finalize, wave and merkle) gain `sha256: String?`. A missing key (antd < 0.17.0) or an empty string (gRPC's zero value) reads as null, on both transports. Manifests: ManifestEntryInput gains `sha256: String?`, sent only when set and non-empty (omitted from the REST JSON; unset proto3 optional over gRPC, so presence is meaningful) and passed through as given, with no client-side validation. ManifestEntryInfo gains `sha256: String?` from build and decode; absent or empty reads as null. A malformed hash is the daemon's 400 / INVALID_ARGUMENT, already a BadRequestException with the server's message. Compatibility: every new constructor parameter is last with a default of null, so existing positional and named construction keeps compiling. No interface, enum or version changes, and no stub changes (the proto copies already carry the fields). Tests: Sha256RestTest (9) and Sha256GrpcTest (6) cover each result type, absent and empty reads, the request JSON and proto presence, entry info on build and decode, constructor compatibility and the 400 mapping. Full build: 197 tests, 0 failures, 3 skipped live tests. LiveSha256Test (gated on ANTD_TEST_URL and ANTD_TEST_SHA_LINK) passed against antd 0.17.0 over REST and gRPC: fixture link entries public.txt / private.txt / nohash.txt, manifest build with the public hash and a "zz" rejection, and one public data upload per transport whose returned sha256 matched the locally computed one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…56 test The live sha256 test asserted the private.txt hash only when ANTD_TEST_SHA_DATA_MAP_SHA256 was set, so a missing fixture silently skipped that check. The env var, like the other ANTD_TEST_SHA_* fixtures the test uses (LINK, PUBLIC_ADDRESS, PUBLIC_SHA256), is now part of the test's gating: the whole test is skipped via assumeTrue when any of them or ANTD_TEST_URL is unset, and once it runs every assertion, including private.txt, is unconditional (V2-1724). Unit build: 197 tests, 0 failures, 3 skipped (live, no env). Live run against antd 0.17.0 passed over REST and gRPC. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MaidSafe-Hermes
left a comment
There was a problem hiding this comment.
APPROVE — reviewed exact head 69acb055990a5462fe14815d81b7035a0ee4b8a5.
Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3); both seats agree (two model families).
Kotlin upload results map SHA-256 on all six result types, convert absent/empty output to null, and preserve existing Kotlin source calls with trailing defaults. Manifest input omits unset/empty hashes on REST and gRPC; result entries map absent/empty values to null. Tests cover both transports and the antd 0.17.0+ requirement is documented. I checked the in-process finalize fixture: both finalize variants intentionally share the FinalizeUpload RPC and /v1/upload/finalize endpoint.
No CI checks are reported for this branch. I attempted ./gradlew :lib:test at this head, but the environment has no Java/JAVA_HOME, so the tests could not run here. This is an unverified-test limitation, not an observed code failure. The patch establishes Kotlin source compatibility; binary ABI compatibility is not claimed. 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.
feat(antd-kotlin): sha256 on upload results and manifest entries (REST + gRPC)
Carry the plaintext SHA-256 antd 0.17.0 returns (V2-1724).
Upload results: DataPutResult, DataPutPublicResult, FilePutResult,
FilePutPublicResult, FinalizeUploadResult and FinalizeMerkleUploadResult
(the two finalize results map POST /v1/upload/finalize, wave and merkle)
gain
sha256: String?. A missing key (antd < 0.17.0) or an empty string(gRPC's zero value) reads as null, on both transports.
Manifests: ManifestEntryInput gains
sha256: String?, sent only when setand non-empty (omitted from the REST JSON; unset proto3 optional over
gRPC, so presence is meaningful) and passed through as given, with no
client-side validation. ManifestEntryInfo gains
sha256: String?frombuild and decode; absent or empty reads as null. A malformed hash is the
daemon's 400 / INVALID_ARGUMENT, already a BadRequestException with the
server's message.
Compatibility: every new constructor parameter is last with a default of
null, so existing positional and named construction keeps compiling. No
interface, enum or version changes, and no stub changes (the proto copies
already carry the fields).
Tests: Sha256RestTest (9) and Sha256GrpcTest (6) cover each result type,
absent and empty reads, the request JSON and proto presence, entry info on
build and decode, constructor compatibility and the 400 mapping. Full
build: 197 tests, 0 failures, 3 skipped live tests. LiveSha256Test (gated
on ANTD_TEST_URL and ANTD_TEST_SHA_LINK) passed against antd 0.17.0 over
REST and gRPC: fixture link entries public.txt / private.txt / nohash.txt,
manifest build with the public hash and a "zz" rejection, and one public
data upload per transport whose returned sha256 matched the locally
computed one.
test(antd-kotlin): require the private-entry fixture in the live sha256 test
The live sha256 test asserted the private.txt hash only when
ANTD_TEST_SHA_DATA_MAP_SHA256 was set, so a missing fixture silently
skipped that check. The env var, like the other ANTD_TEST_SHA_* fixtures
the test uses (LINK, PUBLIC_ADDRESS, PUBLIC_SHA256), is now part of the
test's gating: the whole test is skipped via assumeTrue when any of them
or ANTD_TEST_URL is unset, and once it runs every assertion, including
private.txt, is unconditional (V2-1724).
Unit build: 197 tests, 0 failures, 3 skipped (live, no env). Live run
against antd 0.17.0 passed over REST and gRPC.
🤖 Generated with Claude Code