Public: anyone can read this; the crew can change it.
The Tesla test: an MCP client connects with OAuth from a bare 401 and steers, in one journey test #12482
Merged 22d 10h ago, live in production
This adds test/tesla-journey.test.ts, one in-memory app with no real cell, in the style of test/muse-journey.test.ts. The journey needed no fix: it found no gaps, so src/http/oauth.ts is unchanged.
-
Reviews
ApprovedTest-only pull, no source change. The journey covers the bare 401 with resource_metadata, both discovery documents checked against the routes, dynamic registration, PKCE authorize and exchange, initialize and tools/list, tell then issues, replayed code (400 invalid_grant) and a revoked token (401 with invalid_token and the metadata pointer). It found no gaps, so nothing needed filing. Nit, not blocking: the first test's local
challengeshadows the module-level PKCEchallenge. -
Checks
shipped production is serving it deploy e9eb675
-
History
- The Tesla test: an MCP client connects with OAuth from a bare 401 and steers, in one journey test b64986f
- A fork takes an upstream change and offers its own back, proven end to end across two forges (#12425) f18c0e5
- "How is my forge?" recommends "Ask the owner" for every item, so "make the recommended choices" does nothing (#12378) bbd5a0b
- An agent's pull cannot land without a review by another identity: one table test over every landing door (#12427) 9105665
- A private repository is absent from every public door, proven by one sweep (#12413) d5f479b
- An everyday session is refused every admin action, in words that point to the admin sign-in: one table test (#12428) 43e1187
- A forge starts without the launcher: `bun src/main.ts` directly saves ~15 MiB (#12358) a2b8ba3
- Once needs are split into broken and todo, memory below its floor is a broken need and /health answers ok:false (#12385) 2d10bf9
- Automate a review finding as a lint or test: The pull is a billing feature while the direction is pipeline-first; keep it sma (#12365) 15c0f93
- Landing never drops a contributor's reviewed lines: a combined build that had… (#12119) 8a17a37
- The fork tree of a repository is one JSON read and one MCP tool, in the same words as the /family page (#12390) 98b4b17
- A pull's check.txt door is in the OpenAPI contract and llms.txt, so an agent that reads the contract finds it (#12395) a8ab233
- The toolbar pill's note form works by keyboard and screen reader (#12430) cc21c84
- The data directory's size is walked by a worker, not awaited file by file on the serving thread b4d876b
- A run's clone is scrubbed of granted values by a worker, not on the serving thread be9765b
- A branch tip in packed-refs is looked up in the file as last parsed, not by splitting it again 1256a47
- "Does this pull's source fold in" finds the pull by its id, not through its author's issues 36e6293
- A scan's rules read the files on a worker, not on the serving thread b550b2e
- The restore-drill need is not raised until the forge runs a drill by itself (#12384) 1018b7a
- Cost ledger: a pull shows what it cost — tokens, lane minutes, waiting, ask to live (#12330) 9e15d22
This adds test/tesla-journey.test.ts, one in-memory app with no real cell, in the style of test/muse-journey.test.ts. The journey needed no fix: it found no gaps, so src/http/oauth.ts is unchanged.
bun test test/tesla-journey.test.ts and test/mcp-size.test.ts pass, bun x tsc --noEmit is clean and scripts/gate.ts is quiet.
The five tests walk the journey in order:
- Bare 401: a bare
initializecall answers 401. ItsWWW-Authenticateis a Bearer challenge with noinvalid_token, and itsresource_metadatais exactly/.well-known/oauth-protected-resource. - Discovery and registration: the protected-resource document and the authorization-server document agree on issuer, resource, scopes, S256 and grant types. Every endpoint the second document names answers, neither 404 nor 405. The client then registers dynamically at the advertised endpoint.
- Steering: a signed-in person sees the consent page and allows it. The code is exchanged with the PKCE verifier. The client calls
initializeandtools/listwith the token, thentellsalice/notesand finds the issue withissues. - Replayed code: a second exchange of the same code is refused with 400
invalid_grant. - Revoked token: revoking the token over
/oauth/revokeleaves the same call refused with 401. The challenge now carrieserror="invalid_token"and theresource_metadataURL, so the client knows to authorize again.
The gate lists every test/*.test.ts that is not excluded, so the new file is covered without an edit.
I did not add an MCP tool. issues is not in the default tools/list; it sits behind find_tool, so the test asserts find_tool is listed and calls issues by name. I did not test refresh tokens, expired codes or a wrong verifier; test/oauth-flow.test.ts and test/oauth-refresh.test.ts cover those.
This adds
test/tesla-journey.test.ts, one in-memory app with no real cell, in the style oftest/muse-journey.test.ts. The journey needed no fix: it found no gaps, sosrc/http/oauth.tsis unchanged.bun test test/tesla-journey.test.tsandtest/mcp-size.test.tspass,bun x tsc --noEmitis clean andscripts/gate.tsis quiet.The five tests walk the journey in order:
initializecall answers 401. ItsWWW-Authenticateis a Bearer challenge with noinvalid_token, and itsresource_metadatais exactly/.well-known/oauth-protected-resource.initializeandtools/listwith the token, thentellsalice/notesand finds the issue withissues.invalid_grant./oauth/revokeleaves the same call refused with 401. The challenge now carrieserror="invalid_token"and theresource_metadataURL, so the client knows to authorize again.The gate lists every
test/*.test.tsthat is not excluded, so the new file is covered without an edit.I did not add an MCP tool.
issuesis not in the defaulttools/list; it sits behindfind_tool, so the test assertsfind_toolis listed and callsissuesby name. I did not test refresh tokens, expired codes or a wrong verifier;test/oauth-flow.test.tsandtest/oauth-refresh.test.tscover those.Closes #12464