feat(aincrad): bulk-sync OPAL puzzle PDFs from a local directory - #552
Merged
Conversation
Adds the first aincrad endpoint that takes files rather than JSON, so a directory of PDFs can be pushed to the server without visiting the admin once per puzzle. The client lives elsewhere; this is the server side of it. Change detection is a stored SHA-256 per puzzle, reported by `opal_list` alongside the `content` path it already carried. A client compares those against its local files and sends only what differs, and the server re-checks on arrival, so a stale listing costs a transfer but never a wrong write. A blank hash means "unknown", which makes the client upload; that is what every puzzle looks like until its first sync, so nothing needs backfilling. The admin recomputes the hash whenever the file changes, or an upload made there would leave a sync comparing new bytes against a stale fingerprint. Uploads get their own view because `api` is JSON-only, and take one puzzle per request so a partial sync can report per file. The view swaps in TemporaryFileUploadHandler: the project runs memory-only uploads capped at FILE_UPLOAD_MAX_MEMORY_SIZE, and that handler measures the whole request body, so a PDF over the cap would be dropped with request.FILES empty and a 200 going back. The old file is deleted before the new one is written, since the storage key ends in the basename -- a renamed PDF would otherwise strand the old blob and keep serving it. Creating puzzles and deleting PDFs stay in the admin, both being deliberate acts that a directory listing should not be able to trigger by accident. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZVa3W45G9x7zzk6Q2wA4f
vEnhance
force-pushed
the
claude/aincrad-pdf-bulk-update-rvvbos
branch
from
August 23, 2026 14:22
347de7f to
dc7f68f
Compare
Contributor
|
now i have to write a puzzle called tetrogram |
Owner
Author
|
lmao https://2025.teammatehunt.com/puzzles/tetrogram for the audience |
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.
rather than rclone