Repository navigation
fix(lab): let anyone reach strut's public POSTs; bump strut to a9f656c5 - #1855
Merged
Merged
Conversation
The /lab gate passed one public POST by hand (`/public/mcp`). strut's paid-runs plan added more: credit bought and claimed, a public run's launch and cancel, a runnable tool's call. Behind the old gate every one was mcp's 401 before strut saw it. - The gate now passes exactly what strut's exported `PUBLIC_POST` matches (and `PUBLIC_PATH` for reads), so it follows strut as it grows, plus `GET/HEAD /llms.txt`. Everything else it refused stays refused. - strut pin d3060351 -> a9f656c5 (main, paid-runs merged). Its lock block was re-resolved: strut now depends on @noble/curves. - Tests follow the bump: `GET /public` lists `runnable`; strut ships a `Game` Concept page; the orchestrator gates `remote/buy-credit`.
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.
Why
strut's paid-runs plan is merged. Anyone can now launch a runnable workflow or call a runnable tool, free or paid in sats over L402. mcp's
/labgate let through only one public POST (/public/mcp). Once the pin moved, every public launch, credit purchase, claim, cancel and tool call would have been mcp's 401 before strut saw it.What
mcp/src/lab/mount.tsisPublicViewRead): POSTs pass when strut's exportedPUBLIC_POSTmatches them, and reads whenPUBLIC_PATHmatches. The gate now follows strut as it adds routes. It also passesGET/HEAD /llms.txt, which shows only whatGET /publicshows and answers 404 when nothing is public. Everything the gate refused before is still refused, including/public-view, other methods, look-alikes and paths that resolve outside/public.d3060351→a9f656c5(strutmain). I deleted strut's lock block and re-resolved it, since strut added@noble/curves. Theai/@ai-sdk/anthropicpeer ranges are unchanged, and mcp's exact pins still satisfy them. strut'senginesis now>=22.13; the image runs 22.23.4.What else the bump brings
GET /publicnow listsrunnable. strut seeds aGameConcept page underApp.remote/listandremote/buy-credit. The second is gated: a call becomes a proposal the person must accept, and it needs a wallet.createLabStrutto boot or serve as before. Nothing is sold until an owner makes an item runnable and sets a wallet.LIGHTNING_*(orPUT /lab/earnings/wallet): the wallet.STRUT_RATE_URL: the BTC exchange-rate source.STRUT_PUBLIC_RUNS_MAX: public runs in flight at once (default 10).STRUT_REMOTE_LOCAL: lets this strut buy from a seller on loopback or the LAN.publicRuns.principal(one budget that pays for strangers' runs) is not reachable on a swarm. The lab never readsSTRUT_HOST_CONFIG, so a public run bills the workflow's owner, which is strut's default rule. Setting a separate principal would need a small mcp change.Tests
npm run test:node: 1055/1055 pass.tsc --noEmitis clean. mcp has no CI that runs these.PUBLIC_POSTroute with no credential and expects it through. It also asserts that strut's matcher still matches each example. Look-alikes (/public/workflows/x/run/extraand others), the private doors (/workflows/x/run,/chat, …) and/llms.txtby any method other than GET/HEAD stay 401.runnableinGET /public, theGamepage, andremote/buy-creditamong strut's gated tools.Boot check: I booted the lab on this pin against a throwaway Neo4j with
API_TOKENset: graph workspace, all lab seeds, no new warnings. With no credential:GET /lab/public→ 200{…, runnable: []}POST /lab/public/credit→ strut's 404 "sells nothing to run"GET /lab/llms.txt→ strut's 404POST /lab/workflows/hello/run,POST /lab/chatandPOST /lab/public/workflows/x/run/extra→ 401Not tested: a priced item's 402 / L402 round trip through the gate (no wallet locally), and a real swarm.