Repository navigation
Vision server: opaque upload IDs, a delete route and optional retention; Dependabot ignores transformers majors - #29
Merged
Merged
Conversation
…l retention
POST /v1/gltf named every upload spatial-map-<date>-<time>-<8 hex>, so the
name gave away when a scan was uploaded, and nothing could remove an
upload: files stayed in GLTF_UPLOAD_DIR until someone deleted them on the
host.
- Each upload now gets an ID of 32 random lowercase hex characters (128
bits from secrets), with no file name, counter or timestamp in it. Its
parts are stored as <id>.gltf, <id>.bin and <id>.extras.json. The .gltf
is created exclusively, so an ID is never reused, and a failed write
leaves no partial upload. The response adds "id" and keeps ok,
gltf_path, bin_path and extras_path.
- DELETE /v1/gltf/{id} deletes an upload's files: 204, or 404 for an ID
that names no upload. The ID must match exactly, so nothing outside the
upload directory can be named (on Windows "..\x" could). The route sits
behind the same bearer-token middleware as every other route.
- GLTF_UPLOAD_RETENTION_DAYS deletes uploads whose newest file is older
than that many days, at startup and then hourly. 0 or unset, the
default, keeps today's behaviour (no expiry): the period is the owner's
decision. A negative or non-integer value stops the server from
starting. Only files named like an upload are ever deleted.
- Uploads stored before this change keep their files and names; their ID
is the name without the extension, so DELETE and retention cover them.
The Quest app (GltfSyncClient) and the web client (GltfExporter) only send
the upload and check the status; neither builds nor parses IDs or paths,
so neither needs a change.
Documented in cv-server/README.md, .env.example, app/config.py and
docker-compose.yml, which now passes the variable to the container.
tests/test_gltf.py covers the ID format, the new route and its auth, and
retention on and off, including at server start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…updates transformers is pinned to 5.17.0 (#27), the last release that needs nothing newer than torch 2.5.1, the last torch with CUDA 12.1 wheels. .github/dependabot.yml adds a pip entry for /cv-server that ignores semver-major updates of transformers, with open-pull-requests-limit: 0 so it opens no version-update pull requests. This does not cover Dependabot security updates. Per GitHub's documentation, ignore rules that match by dependency name or version apply to version and security updates, but update-types applies to version updates only, and security updates are created whatever it says. A security update can therefore still move transformers to a new major version, as #24 moved it from 4.40.1 to 5.10.1. Security updates also keep their own fixed limit of 10 open pull requests, which open-pull-requests-limit does not change. The file says so in a comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e system The exact-ID and traversal tests notice a missing upload-ID check only on Windows, where paths ignore case and split on backslashes. This test puts files with upload suffixes but names that are not upload IDs (scan.gltf, notes.bin, x.extras.json, spatial-map.gltf and an uppercase ID) in the upload folder, then checks that DELETE answers 404 for each and leaves every file in place. Without the ID check it fails on every platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mrhegemon
added a commit
that referenced
this pull request
Nov 14, 2026
…ver retention (#29) README.md conflicted in two places: keep this branch's release-build text (signing from GameCI's environment names, versionCode from bundleVersion) with the artifact names main's command-line build now writes, Builds/Android/CompanionScan.apk and .aab. The signature-check commands in the README and docs/SIDELOAD.md named the old CompanionCapture artifacts too and are updated the same way. The workflows pick packages up by dist/*.apk and dist/*.aab, so they need no change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
On
main, the vision server (cv-server/) stores each glTF upload (POST /v1/gltf) inGLTF_UPLOAD_DIRunder the namespatial-map-<date>-<time>-<8 hex>. The name holds the upload time but nothing about the user. Nothing can delete an upload except removing its files on the host, and uploads never expire.transformersis pinned to 5.17.0 (#27), the last release that needs nothing newer than the server's torch 2.5.1, the last torch with CUDA 12.1 wheels. Nothing tells Dependabot to leave it there. #24, a Dependabot pull request, had moved it from 4.40.1 to 5.10.1, which cannot run this server.This branch:
DELETE /v1/gltf/{id}, behind the same bearer token as every other route; it answers404for unknown or malformed IDs and never touches files that are not uploads;GLTF_UPLOAD_RETENTION_DAYS(default0, no expiry); when it is set, a sweep at startup and then every hour deletes older uploads;.github/dependabot.yml, which ignores semver-majortransformersupdates. It cannot stop a security update from movingtransformersto 6.x.Existing uploads stay readable, and neither the Quest app nor the web client needs a change. How long to keep uploads is the owner's decision, so the default keeps them as
maindoes.Three commits on
mainat714feb8:4b1b925(IDs,DELETEand retention),9f37767(Dependabot) and682752d(the platform-independentDELETEtest added after review).What changed
Upload IDs (
cv-server/app/gltf_store.py, new, called fromcv-server/app/routers/gltf.py)secrets, with no file name, counter or timestamp in it. Its parts are stored as<id>.gltf,<id>.binand<id>.extras.json. As before, the file names the client sends are not kept.idand keepsok,gltf_path,bin_pathandextras_path..gltfis created exclusively, so an ID already on disk is never reused, and a failed write removes the parts already written. The files are now written in a worker thread instead of on the event loop.DELETE /v1/gltf/{id}204. An ID that names no upload, or is not a well-formed ID, gets404(Upload not found.)...\xotherwise could on Windows. Files in the folder that are not uploads, such asscan.gltf, are never touched.401without the token or with a wrong one,503when the server has no token configured. Without the token, a known and an unknown ID get the same answer.Retention (
GLTF_UPLOAD_RETENTION_DAYS, incv-server/app/config.pyandcv-server/app/main.py)0, the default, keeps uploads until they are deleted, as onmain.GLTF_UPLOAD_DIRcannot be listed, the server does not start. Shutdown stops the loop.0.GLTF_UPLOAD_DIRare left alone.cv-server/docker-compose.ymlpasses the variable to the container, with0when it is unset or empty.Existing uploads stay readable. Files stored before this change keep their names and contents, and new uploads do not touch them. Their ID is the file name without the extension, so
DELETEand retention cover them too.Clients. The Quest app (
GltfSyncClient) and the web client (GltfExporter) send the upload and check only the HTTP status. Neither builds nor parses IDs or paths, and neither calls the new route, so neither needs a change. The Quest app stores nothing on a server today, and the web client stores uploads only through its development server:uploadAfterExport: 0inCompanionCapture.unity).web/srcnever sends the bearer token. Only the Vite dev server's proxy adds it, fromCV_SERVER_API_TOKEN(web/vite.config.ts), so uploads made throughnpm run devwith the token set are stored. A production build, or a server URL set in the Settings panel, sends no token, and the server refuses those requests, uploads included. That gap was already onmain, and this pull request leaves it as it is.Dependabot (
.github/dependabot.yml, new)pipentry for/cv-server. Withopen-pull-requests-limit: 0, Dependabot opens no version-update pull requests there. An ignore rule skips semver-majortransformersupdates if that limit is ever raised.update-typesaffects only version updates, and that security updates are created regardless ofupdate-types(how-to;dependabot.ymloptions reference, Enterprise Server 3.9). A security update could therefore still movetransformersto 6.x, as Bump transformers from 4.40.1 to 5.10.1 in /cv-server in the pip group across 1 directory #24 moved it from 4.40.1 to 5.10.1.open-pull-requests-limitdoes not change. A comment in the file says both.Docs and tests
cv-server/README.md(the setting, the route list and the glTF Upload section),cv-server/.env.exampleanddocs/quest-capture-gltf.md.cv-server/tests/test_gltf.py(new, 51 cases) and one more case incv-server/tests/test_auth.py(DELETEwithout the token).Verification
The repository's CI runs no cv-server tests. No workflow runs pytest or a linter on
cv-server/, and none runs on a pull request that changes onlycv-server/,docs/and.github/dependabot.yml. Everything below therefore ran locally on Windows, outside the Docker image, without the model weights.mainat714feb8gives 88 passed and 6 skipped, and this branch before its last commit gave 139 passed and 6 skipped.DELETE: every part removed, then404;404for unknown IDs, inexact IDs and three traversal paths; an oldspatial-map-*upload left unchanged by a new upload, then deleted by its name.401for a missing, wrong,Basicor empty bearer token; the same401for known and unknown IDs;503when no token is configured.-1,1.5anda weekrefused; expiry by the newest file; other files and folders kept; the startup sweep with0and with7days; the loop running again after a failed sweep.delete_upload(see the next point).682752d, removing the ID check failed only three cases in two tests, and all three depend on Windows path rules: the uppercase-ID case oftest_delete_needs_the_exact_id(Windows file names ignore case) and the two backslash cases oftest_delete_stays_inside_the_upload_dir. With those two tests deselected (all four of their cases) to stand in for Linux, where the image runs, the other 71 cases intest_gltf.pyandtest_auth.pypassed, whileDELETE /v1/gltf/scanreturned204and deleted ascan.gltfplaced in the upload folder.682752daddstest_delete_leaves_files_that_are_not_uploads, which does not depend on the platform. It putsscan.gltf,notes.bin,x.extras.json,spatial-map.gltfand a.gltfnamed with an uppercase ID in the upload folder, then checks thatDELETEanswers404for each name and leaves every file in place.DELETE, forscan, answers204and removesscan.gltf. The broken copy deletes all five files.test_gltf.py..github/dependabot.ymlpasses schema validation.Not verified
DELETEor ran a sweep.GLTF_UPLOAD_RETENTION_DAYSthroughdocker-compose.ymlwas not tried; only the parsing of the value is tested.Deleted N glTF upload(s) older than D day(s).at INFO. Nothing incv-server/configures logging, and uvicorn's default configuration sets up only its own loggers. Whether the line reaches the container log was not checked.dependabot.ymlfrom the default branch, so how it treats this file shows only after merge. The statement about security updates rests on GitHub's documentation, not on a test.Merge notes
git merge-tree: this branch and Fix the Quest launch blockers: app label, permissions, camera notice and licences #28 (the Quest launch blockers) merge cleanly.ci/release-signing) changes none of the files this branch changes.Owner actions
Before release
0, no expiry.GLTF_UPLOAD_RETENTION_DAYSon each vision server you run (with compose, in.envbesidedocker-compose.yml). On any server Companion Intelligence runs, such as a reviewer server for store review, set it before the server takes uploads.cv-server/app/config.pyandcv-server/docker-compose.ymlinstead.GLTF_UPLOAD_DIRfirst if any of them matter.docker-compose.ymlmounts no volume forGLTF_UPLOAD_DIR, so with it, uploads already disappear whenever the container is recreated.0. If the default changes, change that sentence too.After merge
main. Start it asdocker-compose.ymldoes. SendPOST /v1/gltfwith the token, thenDELETE /v1/gltf/{id}with the returnedid: expect204, then404for a secondDELETE. With a period set, check that an upload whose files are older than the period is gone after a restart.transformers. Adding aversionsrange to the ignore rule makes it apply to security updates too, as the comment in the file notes. It would then also hold back a security fix that ships only in a newer release.🤖 Generated with Claude Code