web: assets with fingerprints (WEB slice 5) #100
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.
Dependencies
No dependencies set
Reference
torbscript/language#100
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
assetswithList<Resource>, fingerprinted URLs, and thestylesheet/scriptelements that write them (WEB slice 5).Source
ResourceDirectory), section 4.7 (URL attributes take aLink)docs/design/RESOURCES.md(Resource,Resource.bytes(),ResourceError; slices 1-3 done)Goal
A
web { ... }application can declareassets "/assets", files: [...]overList<Resource>literals. Each file is served at a fingerprinted URL (/assets/site.<hash>.css) withCache-Control: immutable, and a page links it throughstylesheet(...)/script(...)elements that write that URL, so a deploy never leaves a stale link.Acceptance criteria
WebAppgainsvar fn assets(prefix: String, files: List<Resource>)(one more member of the builder from #777; the vocabulary stayswrap,assets,handle,errors).std/digest,std/encodinghexadecimal), inserted before the last extension (site.css->site.3f2a9c10.css; no extension -> appended). Computed once, at startup (first use of the app), fromResource.bytes().Content-Typefrom the extension (css, js, svg, png, jpg, webp, ico, woff2, json, txt;application/octet-streamotherwise) andCache-Control: public, max-age=31536000, immutable. The un-fingerprinted path, a stale hash, a path outside the listed files and a..segment answer 404 (nothing is served that the author did not name). Non-GET/HEAD answers 405.WebErrorfrom the app (tryWebanswers it,webfails at startup as #777 specifies), never a request-time surprise; two files with the same name under one prefix are refused.Linknames an asset:app.assetLink(file: Resource): Link(or the equivalent accessor onWebApp) returns the fingerprinted URL;std/htmlgetsstylesheet(sheet: Link)andscript(source: Link)elements (<link rel="stylesheet" href=...>,<script src=...>) that take aLink, never aString.std/web/tests/withWebTest/app.answer: fingerprint stable across two builds of the same bytes and different for different bytes, the 200 headers, each 404/405 case, the link elements' rendered HTML. A conformance program only if a new codegen shape appears.docs/design/WEB.md(slice 5 marked built, 3.7 updated),docs/standard-library/web.mdandhtml.mdupdated;skills/regenerated.Design record points
immutable;stylesheet/scripttake the resource's URL.Resourceliterals; noPathdirectory serving and noResourceDirectory(F8 stays out of scope; this issue does not wait for it).EmbeddedBytesassets (favicon, client script of 6.8) are out of scope here; they belong with the client script (slice 7).Seed impact
None expected: library code in
std/webandstd/htmlonly; no syntax change, no new native, no new driver flag, no std name the compiler looks up by string. One commit for the feature, plus an optional second for docs/skills regeneration; no two-commit seed rule applies. If implementation finds a missing hash native, stop and file it separately.Size
One PR, one or two Conventional Commits:
feat(std/web): assets with fingerprinted URLs(+docs(web): slice 5 builtif split).Dependencies
Resource.bytes()is available.Middleware,Next,WebApp,web). Implementation starts once #777 has merged; it builds onstd/web/src/app.trbfrom that PR.Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] intake: in scope (author orion, label loop). Implements WEB.md slice 5; no collision with a design record. Depends on #94 and #136 (both open). next: waiting on dependencies, then refine.
std/htmlmarkup (WEB slice 1) #93std/webcore (WEB slice 2) #94std/webcore (WEB slice 2) #94[loop:torbscript] wait: refine of WEB slice 5 needs #94 (std/web core, WEB slice 2) landed; #136 is closed. Rechecked 2026-11-14.
next: refine when #94 closes
Middleware,Next,WebApp, theweb { }builder andapp.answer(step 2 of #94) #776std/webcore (WEB slice 2) #94[loop:torbscript] claim refine by session:loop-torbscript-20261114 until 2026-11-14T06:00:00Z
[loop:torbscript] decided by the loop: fingerprint = first 8 hex chars of SHA-256 (std/digest) of the bytes, before the last extension, as WEB.md 3.7 shows (
site.3f2a9c10.css); no directories (D11 a, F8 out); EmbeddedBytes assets left to slice 7; not seed-affecting (library code only).[loop:torbscript] refine: issue body rewritten to the definition of ready (goal, 7 testable criteria, design record points, seed impact none, size one PR of 1-2 commits, dependency line). #136 is closed; #94 step 2 is #777, so the implement stage must wait until #777 has merged (builds on its
WebApp). Claim 12350 released.next: implement (ready, after #777 merged)
[loop:torbscript] wait: implementation needs the
webbuilder andapp.answerof #776 (PR #777, CI queued, review pending); the issue stays ready and starts once #777 has merged. next: waiting (dependency #776)std/webcore (WEB slice 2) #94[loop:torbscript] wait lifted: the web builder and app.answer of #776 are on main (PR #777,
c9d07e7d); the issue is ready and startable. next: waiting (ready, implement)[loop:torbscript] claim implement by session:loop-torbscript-20261114-1734 until 2026-11-14T22:34:00Z
[loop:torbscript] implement: opened #791 (1 commit
468d2a3e: feat(std/web): assets with fingerprinted URLs, incl. docs and skills; verified only commit lint, nothing built or run locally; unverified until CI: compile, format, tests, docs fragments). next: waiting (CI on the PR, then review)[loop:torbscript] release implement by session:loop-torbscript-20261114-1734
[loop:torbscript] claim implement by session:loop-torbscript-20261114-1944 until 2026-11-14T22:44:00Z
[loop:torbscript] release implement: the worker of session:loop-torbscript-20261114-1944 ended without a result comment (no live worker, lease lapsed 2026-11-14T22:44Z). It left fix commits on #791 (
3dc828cd,b01180ad,e5077ada: type check, format, std/html rel as Option,..segment refused); CI one5077adais pending, review requested from argus. next: waiting (CI on PR #791, then review; a red CI starts a fix round)