Skip to content

Spike: an Alchemy state store on a GitHub branch - #4

Draft
nicu-chiciuc wants to merge 15 commits into
mainfrom
github-state
Draft

nicu-chiciuc wants to merge 15 commits into
mainfrom
github-state

Conversation

@nicu-chiciuc

@nicu-chiciuc nicu-chiciuc commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

A spike, for review only. Do not merge.

What it is

The test bed of @samebase/alchemy-kit/github-state, an Alchemy v2 state store that keeps the state on a branch of the repository instead of in Cloudflare or Convex.

  • The state is on the branch alchemy-state-store, one folder per stage: github-state-spike/{stage}/{resource}.json.
  • The deploy lock of each stage is on the branch alchemy-state-store-lock.
  • Each record is plain JSON. Each secret value is {"__redacted__": {"__sealed__": "v1.<iv>.<ciphertext>"}}, sealed with AES-256-GCM under the key ALCHEMY_GITHUB_STATE_KEY.
  • CI needs only github.token and the key secret.
  • Released packages only: alchemy and @alchemy.run/github 2.0.0-beta.85.

Where to look

  • github-state/alchemy.run.ts: the spike stack (a label, a random secret, a note), with state: GitHubState.state().
  • The package is @samebase/alchemy-kit@0.1.0 from npm (github-state/package.json).
  • .github/workflows/github-state-spike.yml: deploys the stage ci on a push to github-state-run.
  • github-state/RESUME.md: the log of every check and its numbers.

Everything is in github-state/, with its own install. The template app is not changed.

To deploy the stage ci

Push the head of this branch plus one empty commit to github-state-run. A push to this branch itself would also start the template's pull request workflows, so commits here carry [skip ci].

What was checked on the package

  • Laptop, stage demo: 3 creates (42 s), no changes (11 s), 1 update (17 s). Without the key, the deploy stops before it reads or writes anything.
  • Actions, stage ci: 3 creates, then no changes. Both green.

Known limits

  • A commit takes about 2 s.
  • Each record read is one API call. The Actions token allows 1,000 per hour.

@github-actions

Copy link
Copy Markdown

No description provided.

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