resources: ResourceDirectory (WEB F8) #99

Open
opened 2026-10-05 21:07:20 +00:00 by orion · 3 comments
Collaborator

Goal

Add ResourceDirectory: a literal naming a directory that resolves, at build time, to the list of files in it, each a resource of the embedding type. It removes the need to write a hundred Scene.embedded(...) literals by hand.

Design record

  • RESOURCES.md section 6 ("Directories and globs, not yet"), with Go's embed.FS as the starting shape.
  • WEB.md F8 (D11 chose list literals until F8 exists).
  • Depends on #136 (RESOURCES slice 3, shipping), which is still open: the listing must reuse its build-time embedding and stable-name rules.

Decisions the implementation must record (loop decides, with the numbers from CI)

Section 6 lists open questions: fixed at build time or read at run time; is a file added after the build part of it; what is a directory on the web. Default to build-time listing (matches the literal-adapts model of section 3, fails at build time). Record the final choice in RESOURCES.md in the same PR.

Acceptance criteria (draft, to be confirmed once #136 lands)

  • A directory literal type checks against a ResourceDirectory parameter; a missing directory is a build error with a message naming the path.
  • The listing is deterministic (sorted) and each entry gets the same stable name as an individual resource literal.
  • Tests: checker accept/reject cases plus one run test over a fixture directory with at least two files.
  • RESOURCES.md section 6 updated from "not yet" to the decided behaviour.

Seed impact

Likely yes (new syntax or checker-recognised type); confirm after #136.

Size

One PR, one or two Conventional Commits (feat(checker), test), only after #136 has landed.

## Goal Add `ResourceDirectory`: a literal naming a directory that resolves, at build time, to the list of files in it, each a resource of the embedding type. It removes the need to write a hundred `Scene.embedded(...)` literals by hand. ## Design record - RESOURCES.md section 6 ("Directories and globs, not yet"), with Go's `embed.FS` as the starting shape. - WEB.md F8 (D11 chose list literals until F8 exists). - Depends on #136 (RESOURCES slice 3, shipping), which is still open: the listing must reuse its build-time embedding and stable-name rules. ## Decisions the implementation must record (loop decides, with the numbers from CI) Section 6 lists open questions: fixed at build time or read at run time; is a file added after the build part of it; what is a directory on the web. Default to build-time listing (matches the literal-adapts model of section 3, fails at build time). Record the final choice in RESOURCES.md in the same PR. ## Acceptance criteria (draft, to be confirmed once #136 lands) - [ ] A directory literal type checks against a `ResourceDirectory` parameter; a missing directory is a build error with a message naming the path. - [ ] The listing is deterministic (sorted) and each entry gets the same stable name as an individual resource literal. - [ ] Tests: checker accept/reject cases plus one run test over a fixture directory with at least two files. - [ ] RESOURCES.md section 6 updated from "not yet" to the decided behaviour. ## Seed impact Likely yes (new syntax or checker-recognised type); confirm after #136. ## Size One PR, one or two Conventional Commits (`feat(checker)`, `test`), only after #136 has landed.
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop). Implements WEB.md F8 / RESOURCES.md section 6; no collision with a design record. Depends on #136 (open), so it cannot be implemented yet. next: waiting on dependency, then refine.

[loop:torbscript] intake: in scope (author orion, label loop). Implements WEB.md F8 / RESOURCES.md section 6; no collision with a design record. Depends on #136 (open), so it cannot be implemented yet. next: waiting on dependency, then refine.
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261027 until 2026-10-27T02:00Z

[loop:torbscript] claim refine by session:loop-torbscript-20261027 until 2026-10-27T02:00Z
Author
Collaborator

[loop:torbscript] refine: body rewritten to the draft definition of ready (goal, criteria, design record, seed impact, size). Not set ready: it depends on #136 (resources: shipping), which is still open, and the criteria need the stable-name and embedding rules from it. next: waiting (#136 open). Worker usage: about 30k tokens (sonnet).

[loop:torbscript] refine: body rewritten to the draft definition of ready (goal, criteria, design record, seed impact, size). Not set ready: it depends on #136 (resources: shipping), which is still open, and the criteria need the stable-name and embedding rules from it. next: waiting (#136 open). Worker usage: about 30k tokens (sonnet).
Sign in to join this conversation.
No labels
loop
ready
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#99
No description provided.