Skip to content

feat(aincrad): bulk-sync OPAL puzzle PDFs from a local directory - #552

Merged
vEnhance merged 1 commit into
mainfrom
claude/aincrad-pdf-bulk-update-rvvbos
Aug 23, 2026
Merged

feat(aincrad): bulk-sync OPAL puzzle PDFs from a local directory#552
vEnhance merged 1 commit into
mainfrom
claude/aincrad-pdf-bulk-update-rvvbos

Conversation

@vEnhance

Copy link
Copy Markdown
Owner

rather than rclone

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
vEnhance force-pushed the claude/aincrad-pdf-bulk-update-rvvbos branch from 347de7f to dc7f68f Compare August 23, 2026 14:22
@vEnhance
vEnhance merged commit a32865f into main Aug 23, 2026
5 checks passed
@cjquines

Copy link
Copy Markdown
Contributor

now i have to write a puzzle called tetrogram

@vEnhance

Copy link
Copy Markdown
Owner Author

lmao

https://2025.teammatehunt.com/puzzles/tetrogram for the audience

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.

3 participants