Repository navigation
feat(cli): RFC-0048 step 5, agent upload links on every host - #349
Merged
Merged
Conversation
- CLOUDHAL_UPLOAD_SECRET: generated by `cloudhal deploy` into the 0600 secrets file and given to the admin Worker; the release manifest's SecretName gains it (additive contract change, TS and Rust regenerated, fixtures and the schema fingerprint updated). Optional on self-host (`_FILE`, generated by `selfhost secrets`, empty when unset so the preview secret signs; too short stops the image). - cloudhal.json media.agentUploads / media.agentUploadBytes (config-media.ts; deploy keys in the release key table) become the admin Worker's CLOUDHAL_AGENT_UPLOADS / CLOUDHAL_AGENT_UPLOAD_BYTES, passed through on self-host and read by `cloudhal studio`. - Studio Activity labels create_upload, complete_upload and asset.upload-received in every language (en by hand, the rest imported as drafts awaiting review). - docs/guides/agent-uploads.md (flow, settings, secret and rotation, proxy access logs and wrangler tail, body limits); self-host guide, Cloudflare README and the threat model's agent-upload rows updated (now mitigated); RFC-0048 implementation notes for step 5 (the eval task does not fit the Build eval and is left out). - Size baseline tightened (admin-worker, elevationTools, runTool). Refs #250 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
The release manifest's SecretName gains CLOUDHAL_UPLOAD_SECRET: an older @cloudhal/release-verify (or a portable schema copy) rejects a 0.12+ manifest, while the new schema still verifies older bundles. Said in the changeset and as an amendment to RFC-0046's header and compatibility notes. Refs #250 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.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.
RFC-0048 rollout step 5 (hosts) is the last step. It finishes agents' signed upload links on Cloudflare, self-host and
cloudhal studio, labels them in Studio, and documents them.CLOUDHAL_UPLOAD_SECRETcloudhal deploygenerates it once into.cloudhal/deploy/secrets.json(0600) throughSECRET_KEYSand gives it to the admin Worker. An existing project gets it on its next deploy (loadOrCreateSecretsfills in missing keys). The admin Worker already reads it (step 3).SecretNamegainsCLOUDHAL_UPLOAD_SECRET, an additive enum value, so the release bundle's admin template lists it (scripts/release-bundle/standard.tsADMIN_SECRETS, kept equal toSECRET_KEYSbyrelease-bundle.test.ts).pnpm gen: TS, Rust and release-verify's validators.valid/release-manifest/admin-upload-secret.jsonandinvalid/release-manifest/secret-name-unknown.json.RELEASE_SCHEMA_FINGERPRINTS["release-manifest"]is updated. Heads-up: the test says portable copies outside this repo pin the same constant. Nothing in this repo does, but an external remote deployer would need the new value.OPTIONAL_SECRETSinselfhost/settings.tsis read through_FILEtoo. When unset it becomes"", so workerd'sfromEnvironmentbinding exists and the API falls back to the preview secret.cloudhal selfhost secretsgenerates it for new installations, and the compose file passes it through (${CLOUDHAL_UPLOAD_SECRET:-})._FILEline.Compatibility of the manifest change
CLOUDHAL_UPLOAD_SECRETinbindingTemplates.admin.secrets. An older@cloudhal/release-verify, or a portable copy of the schema, rejects the unknown enum value as an invalid manifest. The changeset says so, and RFC-0046 has an amendment line in its header and in "Compatibility & migration".cloudhal deploy --releaseis unaffected: it deploys only the release of its own version, with its own bundled verifier.cloudhal.jsonmedia.agentUploads/media.agentUploadBytespackages/cli/src/config-media.tsreads them leniently:agentUploads: false, andagentUploadBytesas an integer from 1 to 100 MB. It doesn't takemediaover from the starter: it isn't inOWN_KEYS, sowriteProjectConfigkeeps the file'smediaas written.adminWorkerConfigwrites them as the varsCLOUDHAL_AGENT_UPLOADS=offandCLOUDHAL_AGENT_UPLOAD_BYTES, for bothcloudhal deploy(prepareAdmin) anddeploy --release. The admin Worker maps them ontomcp.media(cloudflare/src/agent-uploads.ts).deploykeys inconfig-build-keys.ts, sodeploy --releaseaccepts any value.PASSED_VARS).cloudhal studioreads them from the project.Studio labels (AGENTS.md rule 10)
KNOWN_TOOLSgainscreate_uploadandcomplete_upload.ASSET_EVENTSgainsasset.upload-received, the audit row of an accepted PUT.en.ts: "Create an upload link", "Complete an upload", "Receive an agent's upload".pnpm i18n:exportand imported withpnpm i18n:import, matching each catalog's existing words: "Importer" in French, "Agent" in Turkish, "智能体" in Chinese, noun forms in Polish. These are AI drafts awaiting review. No language is marked reviewed.Docs
docs/guides/agent-uploads.mdcovers:curlline;?sig=out of reverse proxy and ingress access logs (ingress-nginx, nginx, Traefik, Envoy, HAProxy, load balancers; for nginx, log$uriinstead of$request), andwrangler tail, marked unverified, so treat tail output as containing links;client_max_body_sizeand ingress-nginx'sproxy-body-size) and turning it off.The eval task: not added
The build eval (
packages/api/src/build-eval.ts) runs Workers AI models through Build chat's page-building turn, which has neither the MCP upload tools nor a shell. A "300 KB cover from disk without base64" task needs an agent harness with a shell and an MCP client, which this repo doesn't have yet. The API's end-to-end test (agent-uploads-auth.test.ts, step 4) runs the same flow without a model. This is recorded in the RFC as a follow-up.Size
node scripts/size-check.ts --update(no--allow-growth) tightened four entries:createAdminWorker248 → 247createAdminWorker>fetch190 → 189elevationTools228 → 223runTool244 → 217Checks run locally
biome check . --diagnostic-level=error,size-check,mcp-tools-doc --check.pnpm gengives the committed generated files.pnpm driftbefore the commit showed only the intended enum diff.tscpasses for core-contracts, release-verify, cli, cloudflare and apps/studio.config-media,hardening-cli,config-build-keys,release-bundle,deploy,deploy-release,deploy-workers-buildsandselfhost(51 in the last batch);agent-uploads;repo-docs;pnpm i18n:import's i18n tests (27).cargo testand the workerd, D1 and docker-smoke suites. They run in CI.Refs #250
🤖 Generated with Claude Code