Repository navigation
Conversation
jessevz
added this pull request to stack #2501
October 16, 2026 06:02
jessevz
marked this pull request as draft
October 16, 2026 06:03
s3inlc
force-pushed
the
886-stack-6-file-checksum
branch
2 times, most recently
from
October 19, 2026 14:06
7e09760 to
6e6a3b8
Compare
four-random-common-words
force-pushed
the
886-stack-6-file-checksum
branch
from
October 20, 2026 07:47
6e6a3b8 to
6a71575
Compare
Files carried no content integrity information: only their size was recorded, and the agent can therefore verify a download by length alone. A wordlist whose bytes changed at the same length is indistinguishable from an intact one, and a corrupted or truncated-then-padded transfer is accepted. The TUS upload checksums are per chunk and discarded, so they never describe the assembled file. File now carries a BLAKE3 checksum of its content, computed off-request by a background job and advertised on download as a RFC 9530 Repr-Digest header. - `File.checksum` holds the digest as 64 lowercase hex characters, null until computed. It is cleared whenever the bytes on disk change, so a stale digest is never served, and deliberately kept across a rename, which moves the same bytes to a new name. - `ChecksumFileJob` does the hashing through the background job runner, as a 100 GB wordlist cannot be hashed inside a request. Note that the runner processes jobs one at a time under a global lock, so a large file delays other jobs for its duration. - Jobs are enqueued when a file is created, deduplicated against work already queued, and withdrawn again when the file is deleted. A global rescan backfills files without a checksum and re-queues any whose size no longer matches. - `GET /api/v2/helper/getFile` and the legacy `getFile.php` both send Repr-Digest. It describes the representation rather than the message, so it is also sent on a 206, and it is added to Access-Control-Expose-Headers because the browser cannot read it otherwise. - The agent protocol's getFile response gains a `checksum` field, which is additive: the existing agents deserialize without deny_unknown_fields and ignore it. It is null until the job ran, which an agent has to treat as "no checksum available". - `POST /api/v2/helper/recomputeFileChecksum` re-queues a single file on demand. BLAKE3 is absent from PHP's hash extension in every version, so the hashing shells out to b3sum, which the Dockerfile now installs. It is a hard requirement: when it is missing the job fails with that reason instead of leaving files silently unchecksummed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
s3inlc
force-pushed
the
886-stack-6-file-checksum
branch
from
October 22, 2026 13:07
6a71575 to
a28b24a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Files carried no content integrity information: only their size was recorded, and the agent can therefore verify a download by length alone. A wordlist whose bytes changed at the same length is indistinguishable from an intact one, and a corrupted or truncated-then-padded transfer is accepted. The TUS upload checksums are per chunk and discarded, so they never describe the assembled file.
File now carries a BLAKE3 checksum of its content, computed off-request by a background job and advertised on download as a RFC 9530 Repr-Digest header.
File.checksumholds the digest as 64 lowercase hex characters, null until computed. It is cleared whenever the bytes on disk change, so a stale digest is never served, and deliberately kept across a rename, which moves the same bytes to a new name.ChecksumFileJobdoes the hashing through the background job runner, as a 100 GB wordlist cannot be hashed inside a request. Note that the runner processes jobs one at a time under a global lock, so a large file delays other jobs for its duration.GET /api/v2/helper/getFileand the legacygetFile.phpboth send Repr-Digest. It describes the representation rather than the message, so it is also sent on a 206, and it is added to Access-Control-Expose-Headers because the browser cannot read it otherwise.checksumfield, which is additive: the existing agents deserialize without deny_unknown_fields and ignore it. It is null until the job ran, which an agent has to treat as "no checksum available".POST /api/v2/helper/recomputeFileChecksumre-queues a single file on demand.BLAKE3 is absent from PHP's hash extension in every version, so the hashing shells out to b3sum, which the Dockerfile now installs. It is a hard requirement: when it is missing the job fails with that reason instead of leaving files silently unchecksummed.