Skip to content

Add /notes: storage decided by Almide, performed by each host - #4

Merged
O6lvl4 merged 2 commits into
mainfrom
feat/notes-io
Oct 4, 2026
Merged

O6lvl4 merged 2 commits into
mainfrom
feat/notes-io

Conversation

@O6lvl4

@O6lvl4 O6lvl4 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds /notes (POST to save, GET to list newest first, newest 50 kept) to the shared Almide logic. api.step returns the keys it needs to read and the write to make; each host performs them.
    • Native (ConoHa, Cloud Run container): Almide itself reads and writes STORE_DIR files with fs, or Cloud Storage with http.request and a metadata-server token.
    • Cloudflare Workers: KV binding NOTES (provisioned by wrangler deploy).
    • Cloud Run functions: Cloud Storage through fetch (no SDK).
    • Lambda and Azure: no store, so /notes answers 503.
  • Why this protocol: a --target wasm --host js build refuses http.get (E081), and JS storage APIs are asynchronous, so the shared code describes storage instead of doing it.
  • One 10-request scenario (tests/notes.mjs) runs through every route's tests.

Test plan

  • npm test 156/156, test:workers 29/29 (local KV), test:google-framework 39/39, test:staged-functions 38/38
  • Compose with a named volume: scenario passed, and notes survived down/up
  • Live Cloudflare Workers + KV: 29/29; the KV value held exactly the saved notes. Worker and namespace deleted
  • Live Cloud Run container (Almide → GCS) and Cloud Run functions (Node → GCS), from inside the VPC: 18/18 + 11/11 each; objects verified. Project deleted
  • ConoHa VPS with /notes: not rerun (credentials removed)
  • GitHub Actions

🤖 Generated with Claude Code

O6lvl4 and others added 2 commits October 4, 2026 17:38
api.step decides what to read and what to write; the host performs it.
Native, Almide is the host: files under STORE_DIR, or Cloud Storage via
the metadata-server token and http.request. Workers use a KV binding and
the Node function host uses Cloud Storage through fetch. Without storage,
/notes answers 503. One scenario runs through every route's tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Explain the step protocol, which host performs storage on each route, the
single-key read-modify-write limits, and per-provider setup (KV binding and
its separate deletion, GCS_BUCKET with a bucket-scoped objectUser grant, the
Compose volume). Record the local suite, Workers KV, and Cloud Run container
and functions with Cloud Storage runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@O6lvl4
O6lvl4 merged commit c904bf7 into main Oct 4, 2026
2 checks passed
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.

1 participant