Skip to content

feat(antd-py): sha256 on upload results and manifest entries (REST + gRPC) - #398

Merged
Nic-dorman merged 1 commit into
mainfrom
nic/v2-1724-sha256-py
Oct 23, 2026
Merged

Nic-dorman merged 1 commit into
mainfrom
nic/v2-1724-sha256-py

Conversation

@Nic-dorman

Copy link
Copy Markdown
Member

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.

Carry the antd 0.17.0 sha256 fields (V2-1724) through all four clients
(sync and async, REST and gRPC), with identical types and no new methods.

Upload results: DataPutResult, DataPutPublicResult, FilePutResult,
FilePutPublicResult and FinalizeUploadResult (finalize_upload and
finalize_merkle_upload) gain sha256, the plaintext's SHA-256 in hex. It
reads None when the REST key is absent, null or "", and when the gRPC
field is "" (proto3 zero value), so an older daemon reads as none.

Manifests: ManifestEntryInput gains an optional sha256. REST sends the key
only when it is set and non-empty; gRPC sets the proto3 optional field
only then, so presence is meaningful. The value is passed through as
given (no hex, length or case check); the daemon validates it and a bad
one surfaces as the existing BadRequestError with the daemon's message.
ManifestEntryInfo gains sha256 on build and decode, None when absent or "".

Compatibility: the new field is last on every dataclass with a default of
None, so existing construction keeps working. No exhaustive-match changes,
no version bump, not BREAKING. The gRPC stubs already carried the fields;
they regenerate byte-identically with grpcio-tools 1.80.0 and are not
touched.

Tests: new test_sha256.py (43 tests: mock REST daemon and in-process gRPC
services, sync and async, present/absent/empty for every result type,
request JSON and proto presence, entry info from build and decode, the bad
sha256 400) and test_live_sha256.py (4 tests, gated on ANTD_TEST_URL and
ANTD_TEST_SHA_LINK, one paid public upload per transport). Full suite:
627 passed, 16 skipped. Live against antd 0.17.0 on a local devnet: all 4
passed, with the uploaded payload's SHA-256 matching on REST and gRPC.

🤖 Generated with Claude Code

…gRPC)

Carry the antd 0.17.0 sha256 fields (V2-1724) through all four clients
(sync and async, REST and gRPC), with identical types and no new methods.

Upload results: DataPutResult, DataPutPublicResult, FilePutResult,
FilePutPublicResult and FinalizeUploadResult (finalize_upload and
finalize_merkle_upload) gain sha256, the plaintext's SHA-256 in hex. It
reads None when the REST key is absent, null or "", and when the gRPC
field is "" (proto3 zero value), so an older daemon reads as none.

Manifests: ManifestEntryInput gains an optional sha256. REST sends the key
only when it is set and non-empty; gRPC sets the proto3 optional field
only then, so presence is meaningful. The value is passed through as
given (no hex, length or case check); the daemon validates it and a bad
one surfaces as the existing BadRequestError with the daemon's message.
ManifestEntryInfo gains sha256 on build and decode, None when absent or "".

Compatibility: the new field is last on every dataclass with a default of
None, so existing construction keeps working. No exhaustive-match changes,
no version bump, not BREAKING. The gRPC stubs already carried the fields;
they regenerate byte-identically with grpcio-tools 1.80.0 and are not
touched.

Tests: new test_sha256.py (43 tests: mock REST daemon and in-process gRPC
services, sync and async, present/absent/empty for every result type,
request JSON and proto presence, entry info from build and decode, the bad
sha256 400) and test_live_sha256.py (4 tests, gated on ANTD_TEST_URL and
ANTD_TEST_SHA_LINK, one paid public upload per transport). Full suite:
627 passed, 16 skipped. Live against antd 0.17.0 on a local devnet: all 4
passed, with the uploaded payload's SHA-256 matching on REST and gRPC.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@MaidSafe-Hermes MaidSafe-Hermes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — reviewed head b59aec3eb056d12771f24a8929ff6e350e6a9858.

Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3). Both seats found no source blocker; this is model agreement, not team consensus.

REST/gRPC upload result parsers and manifest serialization follow the optional-hash rules. CI reports Python and MCP tests successful. The live test remains environment-gated and was not independently run here. No merge performed.

@Nic-dorman
Nic-dorman marked this pull request as ready for review October 23, 2026 19:32
@Nic-dorman
Nic-dorman merged commit 0ef6416 into main Oct 23, 2026
2 checks passed
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.

2 participants