web: std/web core (WEB slice 2) #94
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#97 web: forms and CSRF (WEB slice 3)
torbscript/language
#98 web: sessions and signed cookies (WEB slice 4)
torbscript/language
Reference
torbscript/language#94
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Handler,WebApp,web { }, middleware,WebError, response helpers,WebTest. This is an epic: it is a new package with an error type, an application builder, a middleware chain, request and response helpers, a test helper and an example application, which is more than one PR. Steps become issues just in time, one at a time.Source
Design record point
WEB.md sections 3.1 to 3.4, 3.8, 3.9, slice 2 of section 10, decisions D5 and D13. Decided by the loop (full reasoning in the comment below):
std/web;RequestandResponsearestd/http's shared types, extended byextend, not redefined.TemplateRoutesofstd/uri, not the hand-writtenmatchof the section 3.2 example.WebTest.assertRoutesis the round trip overTemplateRoutes.linkandmatched.request.query<Value>()goes with the form-urlencodedDecoderof #97; slice 2 ships the raw query accessors. Cookies andwithCookieare #98,assetsis #100, the HTML page reader ofWebTestwaits on the tree of #79.Steps
std/webpackage:WebError,Handler, the request and response helpers, docs page (filed as #575)Middleware,Next,WebApp, theweb { }builder (wrap,handle,errors), the adapter tostd/http's handler,app.answer(request); a conformance probe for the record-carrying-a-function question of WEB.md section 8 (filed as #776)WebTest:Request.get,Request.post(form:),assertRoutes; the answered page checked as text until #79's tree existsexamples/web-shop: the orders pages onstd/html, routes by URI template, a request-log middleware, tests throughapp.answer, docs updated, WEB.md slice 2 marked builtDependencies
std/httpRequest/Response/Handler(onmain),std/uriTemplateRoutes(onmain).std/live).Moved from the planning lists of the docs; the design record stays the specification.
std/livepage placement (WEB slice 6) and the client script (slice 7) #103std/htmlmarkup (WEB slice 1) #93[loop:torbscript] intake: in scope (author orion, label loop), source WEB.md slice 2, not a duplicate. Large (
Handler,WebApp,web { }block, middleware,examples/web-shop); refine splits it. Depends on #93. next: waiting (dependency #93) until 2026-10-10T04:00:00Zstd/livepage placement (WEB slice 6) and the client script (slice 7) #103std/htmlmarkup (WEB slice 1) #93101 Switching Protocolsand a duplex connection (NETWORK slice 14) #74[loop:torbscript] claim refine by session:loop-torbscript-20261029 until 2026-10-29T10:20Z
std/webpackage:WebError,Handlerand the request and response helpers (step 1 of #94) #575[loop:torbscript] decided by the loop: #94 is too big for one PR, so it is an epic and stays without
ready. The slice names a package, an error type, an application builder with a block, a middleware chain over a trait, request and response helpers, a test helper and an example application; four reviewable pieces, each needing the previous. Step 1 is filed as #575 (keyword search of open issues for web, Handler, std/web, WebTest, middleware found only the sibling slices #97, #98, #99, #100, #103, #105, #107, #108, #109, none a duplicate) and isready; steps 2 to 4 are filed just in time. The dependency #93 is closed, so the earlier waiting note is obsolete; problem 3 of WEB.md section 1 (the generated C for a trait method answering a task) is fixed byacf9360f, held bytests/conformance/task-member-value-parameter.trb.Decisions:
RequestandResponsestaystd/http'sshared types. WEB.md section 9 assumed values (a middlewarecopys a request, a participle answers a copy). They own a one-shot body stream, so: a middleware that changes the request builds a newRequestfrom the parts of the old one and takes its body over;withStatus/withHeaderanswer a newResponseover the sameBody, and the old binding is not read afterwards. Step 1 documents this, tests it, and adds a "Built" note to WEB.md section 3.4.std/http:Request.segments()(percent-encoded) andResponse.jsonOfstay;std/webaddsdecodedSegments()and usesjsonOf.Handlerofstd/webis its own type (Result<Response, WebError>) and is not a re-export ofstd/http's; programs needing both qualifystd/http.matchof WEB.md section 3.2, which that section's example predates.WebTest.assertRoutes(routes, samples)checksmatched(link(sample)) == samplefor each sample; the startup check already lives inTemplateRoutes.of.request.query<Value: Decode>()moves to #97. It needs a form-urlencodedDecoder, which the forms slice builds anyway forrequest.form; building it here would be that slice's work in this one. Slice 2 getsqueryParameters()andqueryParameter(name)overString.formDecoded(std/uri).request.json,request.cookie,withCookieandassetsfollow with #97, #98, #100.WebTest's page reader (page.text("h1")) waits for #79's tree (steps 2 to 4 of that epic). Until then tests read the markup withhtml.text()and string checks; step 3 notes this, no new issue.testbody cannot await yet (F13). Handler tests arefns answering aTaskthat the test file awaits at its top level, as WEB.md section 3.9 says.assetsis not inWebApp's vocabulary in slice 2 (#100 adds it); the receiver starts withwrap,handle,errors.Nextcarryingendpoint: Handleris refused by the task capture rule (WEB.md section 8, "one question for the checker"), step 2 makesendpointa trait value, as the record says, and records the result; the conformance probe is part of step 2.[loop:torbscript] refine: released the claim of session:loop-torbscript-20261029. #94 is an epic (checklist of 4 steps in the body), step 1 filed as #575 with label
ready; the decisions are in the comment above. Nothing was written to the repo. Worker usage: about 120k tokens (sonnet).next: waiting (epic waits on its steps)
[loop:torbscript] re-sweep: ticked #575 in the checklist, because this step is closed and landed on main; the checklist now matches the state of its children.
[loop:torbscript] refine: epic with step 2 (Middleware, Next, WebApp, the web builder) as the next step to file; the ready buffer is full, next: waiting (ready buffer full, file step 2 when fewer than 4 issues are ready)
[loop:torbscript] claim refine by session:loop-torbscript-20261114 until 2026-11-14T02:40:00Z
Middleware,Next,WebApp, theweb { }builder andapp.answer(step 2 of #94) #776[loop:torbscript] decided by the loop: step 2 is one PR, not split. Middleware,
Next,WebAppandanswerare one chain that cannot be tested apart (a layer needs the app to run in), the adapter is a few lines overanswer, and the probe decides theNextshape before the builder is written, so it goes first as its own commit. Two commits,std/webonly, about 1 h on top of #575 (landed, PR #578 merged).assets, typedquery, cookies stay with #97, #98, #100;WebTestis step 3. No seed change. Details and criteria are in #776 (loop,ready).[loop:torbscript] refine: step 2 filed as #776 (ready); claim released. next: waiting (epic, step 2 ready for implement)
[loop:torbscript] wait: step 2 (#776) is in review as PR #777 (head
7f61a966, CI queued behind the runner backlog, argus requested); #94 closes with the last step. next: waiting (PR #777 CI and review)[loop:torbscript] wait: step 2 (#776) merged (PR #777,
c9d07e7d) and closed; step 3 (WebTest) is filed when fewer than 4 issues are ready (9 now). #100 was waiting on #776 and is startable. next: waiting (ready buffer below 4, then refine step 3)[loop:torbscript] park: starved epic, step 3 (WebTest) is not filed while 9 issues are ready (buffer rule: refine below 4). Parked with status/parked; unpark when ready drops below 4. next: waiting (ready buffer below 4)