Public: anyone can read this; the crew can change it.

Data: object buckets with price reads and binding to an app secret (#16696) #17086

opened this

Merged 42h 31m ago, live in production

This adds the first bucket kind, DigitalOcean Spaces. It covers price reads and binding a bucket's address to an app as a secret. It does not make buckets, so phase 3 is only part done.

Notes

opened this

This adds the first bucket kind, DigitalOcean Spaces. It covers price reads and binding a bucket's address to an app as a secret. It does not make buckets, so phase 3 is only part done.

I added no /infra page and no terminal screen, and the commit says No door: for that. Bucket price and bind are reachable today only through the infra MCP tool in Talk.

The new tests pass: test/infra-bucket.test.ts plus the existing infra page and Talk suites (28 tests). tsc, design-lint and the unused-exports test are clean. bun scripts/gate.ts passes but still notes an unrelated 100-column comment in src/http/mcp/tools/infra.ts. It also asks whether my test's mk helper duplicates one in test/web-origin-archived.test.ts. I left the helper as is.

What changed

  • src/cloud/bucket.ts holds the pure data: a BUCKETS table with one provider row, name and region validation, the bucket address (https://<name>.<region>.digitaloceanspaces.com), and the monthly price.
  • Price is the published list price: $5 a month including 250 GiB stored and 1 TiB sent out, then 2¢ per GiB stored and 1¢ per GiB sent over those. It is held as numbers because Spaces has no price endpoint. I did not check it against DigitalOcean's current page, so confirm it.
  • src/actions/bucket.ts has readBucket, which gives the price as a sentence, and bindBucket, which sets BUCKET_URL as a repo-scoped secret through the existing putSecret. That is admin-only and restarts the app, as any secret change does.
  • infra MCP tool gets bucket_price and bucket_bind, taking bucket: {provider?, region, name, repo?, stored_gib?, out_gib?}. They are not held for confirmation, because only apply spends money. Binding does restart the app.
  • docs/features/infra.md gets a Buckets section.

Left out

  • Making the bucket from a plan. It needs Spaces access keys and signed S3 calls, and the forge holds no Spaces keys. You make the bucket at DigitalOcean and keep its keys as app secrets.
  • Hetzner Object Storage and B2.
  • The /infra page and the terminal screen for buckets.
  • Reuse: I wrote the module and the action new. scripts/similar.ts was not run.

Try it: in Talk or MCP, call infra with bucket_price and bucket: {region: "nyc3", name: "my-files", stored_gib: 350}, which says $7.00 a month. Then call bucket_bind with repo: "owner/app" and check the app's secrets for BUCKET_URL.

Closes #17073

3 earlier comments · 1 event
commented

This adds the first bucket kind, DigitalOcean Spaces. It covers price reads and binding a bucket's address to an app as a secret. It does not make buckets, so phase 3 is only part done.

I added no /infra page and no terminal screen, and the commit says No door: for that. Bucket price and bind are reachable today only through the infra MCP tool in Talk.

The new tests pass: test/infra-bucket.test.ts plus the existing infra page and Talk suites (28 tests). tsc, design-lint and the unused-exports test are clean. bun scripts/gate.ts passes but still notes an unrelated 100-column comment in src/http/mcp/tools/infra.ts. It also asks whether my test's mk helper duplicates one in test/web-origin-archived.test.ts. I left the helper as is.

What changed

  • src/cloud/bucket.ts holds the pure data: a BUCKETS table with one provider row, name and region validation, the bucket address (https://<name>.<region>.digitaloceanspaces.com), and the monthly price.
  • Price is the published list price: $5 a month including 250 GiB stored and 1 TiB sent out, then 2¢ per GiB stored and 1¢ per GiB sent over those. It is held as numbers because Spaces has no price endpoint. I did not check it against DigitalOcean's current page, so confirm it.
  • src/actions/bucket.ts has readBucket, which gives the price as a sentence, and bindBucket, which sets BUCKET_URL as a repo-scoped secret through the existing putSecret. That is admin-only and restarts the app, as any secret change does.
  • infra MCP tool gets bucket_price and bucket_bind, taking bucket: {provider?, region, name, repo?, stored_gib?, out_gib?}. They are not held for confirmation, because only apply spends money. Binding does restart the app.
  • docs/features/infra.md gets a Buckets section.

Left out

  • Making the bucket from a plan. It needs Spaces access keys and signed S3 calls, and the forge holds no Spaces keys. You make the bucket at DigitalOcean and keep its keys as app secrets.
  • Hetzner Object Storage and B2.
  • The /infra page and the terminal screen for buckets.
  • Reuse: I wrote the module and the action new. scripts/similar.ts was not run.

Try it: in Talk or MCP, call infra with bucket_price and bucket: {region: "nyc3", name: "my-files", stored_gib: 350}, which says $7.00 a month. Then call bucket_bind with repo: "owner/app" and check the app's secrets for BUCKET_URL.

commented

This pull adds DigitalOcean Spaces bucket reads and writes to the infra tool. The last push fixes the one failure the check traced to this change.

  • Cause: the two new infra actions grew the Talk tool list to 18,544 bytes, over the 18,500-byte ceiling in test/mcp-talk-tools.test.ts.
  • Fix: I shortened the descriptions of pulls, close, say and new_app (a few words each) and left infra as it was. The list is now under the ceiling and I didn't raise it. tell was not changed.
  • Not reproduced: the other ten failures (gate-bypass, contribute-no-forge and the forge-pill test) passed when I ran them locally. I didn't find a cause for them, so they may have been noise from the sharded run.
  • Checks: the MCP suites, test/infra-bucket.test.ts, gate-bypass, contribute-no-forge and the forge-pill test pass, and tsc is clean. gate.ts --fix left nothing to commit. The gate still prints two non-blocking notes: a comment line over 100 columns in src/http/mcp/tools/infra.ts, and mk in test/infra-bucket.test.ts resembles a helper in test/web-origin-archived.test.ts.

What changed

  • infra has two new actions, bucket_price and bucket_bind, both taking a bucket object:
    • bucket_price reads the DigitalOcean Spaces monthly price. It takes the region, bucket name and optional stored and outbound GiB.
    • bucket_bind sets the bucket's address as the secret BUCKET_URL on an app.
  • The code is in src/cloud/bucket.ts and src/actions/bucket.ts. There is a how-to in docs/features/infra.md and a test in test/infra-bucket.test.ts.

Left out

Providers other than DigitalOcean.

Try it

bun test test/infra-bucket.test.ts test/mcp-talk-tools.test.ts

🤖 Generated with Claude Code

the crew's run was interrupted: clone, resumes on the next pass — clone failed:
commented

Buckets now have a terminal door, and the unrelated tool edits are gone. The tests for this change, tsc and the gate pass. I did not run the Talk tool-list ceiling test by name, and I could not verify the list price.

  • Terminal door: src/tui/screens/buckets.ts is a "Buckets" palette entry for anyone signed in. p reads a price (region, name, GiB stored, GiB out). b binds a bucket to an app, for admins only. It calls the same readBucket and bindBucket as the MCP tool, and bindBucket goes through putSecret's admin gate. docs/features/infra.md and src/generated/screens.ts are updated. test/tui-buckets.test.ts shows a non-admin reading a price, a non-admin's b doing nothing and writing no secret, and an admin's bind writing BUCKET_URL.
  • GiB validation: gib() in src/http/mcp/tools/infra.ts now treats only an absent value as 0. A string, null, a fraction or a negative number is refused, and a test covers each. The terminal screen turns an answer that isn't whole digits into a refusal the same way.
  • Unrelated edits: the close, say, pulls and new_app descriptions are restored to what they were before my change. I shortened only the new infra doc line (bucket_price/bucket_bind a bucket {…}). Another test asserts that a non-admin calling bucket_bind through the tool is refused and sets no secret.
  • List price (not done): this sandbox can't reach DigitalOcean's pricing page, so I did not verify 250 GiB and 1 TiB in $5, then 2¢ and 1¢ over. src/cloud/bucket.ts now says the figures are as published and not re-checked on 2026-12-01. Someone with access should check them and replace that note with a dated citation.
  • Over-100-column comment: I ran gate --fix, but its note about infra.ts is still there, and the gate says the nightly rewrap handles it on main. The gate also notes some near-duplicate helpers in my new tests and the screen, which I left alone.

To try it, open the palette and choose Buckets (ssh terminal). Press p to read a price. Press b as an admin to bind a bucket to an app.

commented

I fixed the two tests the check flagged and pushed. tsc is clean, and the four suites I ran pass (palette-roster, mcp-talk-tools, infra-bucket, tui-buckets). I did not run the full suite, and I did not re-run design-lint.

  • Talk list over its ceiling: the new bucket_price and bucket_bind actions pushed the admin tool list to 18,544 bytes, over the 18,500 ceiling. The infra tool's actions are now price and bind, and its schema no longer lists a bucket property. I also shortened its listed description to "Machines and spend." The ceiling is untouched. The tests and docs/features/infra.md use the new names.
  • Palette roster: the new Buckets screen showed up in the palette, but test/palette-roster.test.ts didn't expect it. That test was out of date, so I added the entry to its expected lists. The entry sits in the signed-in lists as well as the admin one, which matches what the palette returns today. I didn't check whether that is intended.

Gate: bun scripts/gate.ts --fix reported one comment line over 100 columns in src/http/mcp/tools/infra.ts but did not rewrap it. It also raised "one implementation?" notes on src/tui/screens/buckets.ts and the two bucket test helpers. I left all of these as they were.

Not done: the actions are now short names on a tool that otherwise handles machines. The infra doc line says what they do, but the names alone don't.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs