Repository navigation
Conversation
This was referenced Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pjeweb
force-pushed
the
pje/preset-captures
branch
from
October 16, 2026 03:18
f74de50 to
7bfba8d
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.
Describe your changes
Retain camera captures on the rack until cams-manager confirms delivery to website storage, and expose a read-only preset export for the website's initial import. The website owns subsequent preset edits.
sequenceDiagram actor User as Website or chat user participant Site as Website permissions and DB participant Worker as cams-manager participant API as control-api participant Disk as Capture volume participant S3 as Website S3 User->>Site: Save current view via UI or monorepo chatbot tRPC Site->>Worker: Authorized operation ID Worker->>API: Capture before deadline API->>Disk: Persist immutable image and metadata API-->>Worker: Capture ID, position and SHA-256 Worker->>Site: Request scoped upload URL Worker->>S3: Upload retained bytes Worker->>Site: Verify and commit preset with image Site-->>Worker: Durable delivery confirmation Worker->>API: Acknowledge matching capture hash/captures. Saving reads the current position and JPEG without moving the camera. Position checks around the image read reject detected changes; external movement between those observations remains possible./presets/export, readingPRESETS_IMPORT_PATH. Accept a preset-only dump or the legacy chatbot export, validate preset fields and omit unrelated bot state. Missing or unreadable input returns an error.CAPTURE_STORAGE_PATHand the separate export source in the environment example.Companion to the draft website preset stack, based directly on
main. Website migration #2443 consumes the export; Worker delivery #2444 creates/retrieves captures, uploads them to website S3, and acknowledges the matching hash after the website confirms delivery. Infrastructure #59 supplies the durable volume and read-only import mount.Before deployment, provide a current rack export and agree on capture storage, backups and retention. Acknowledged captures remain retained; automatic pruning is not implemented.
Notes for testing your change
Authorization: ApiKey <key>.GET /presets/exportshould work without a camera header, contain only validated preset data, and fail when its source is unavailable.POST /captures/<uuid>withx-camera-nameand anexpiresAttimestamp in milliseconds within the next 60 seconds. Inspect metadata andGET /captures/<uuid>/image; the camera should not move. Repeat after the deadline and after restart: the same UUID should return the original bytes. A new expired UUID should return 410, and reusing an ID for another camera should return 409.POST /captures/<uuid>/receipt. Matching/repeated receipts should succeed, a different hash should fail, and acknowledgement should leave the capture available. Change the simulated position during capture and confirm detected movement rejects the save.