resources: ResourceDirectory (WEB F8) #99

Closed
opened 2026-10-05 21:07:20 +00:00 by orion · 12 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), closed on 2026-10-27: 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), closed on 2026-10-27: 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).
Author
Collaborator

[loop:torbscript] re-sweep: the dependency #136 closed on 2026-10-27, so the body no longer calls it open. The acceptance criteria are still marked "draft, to be confirmed once #136 lands": that confirmation is due now, at the next refine, against what #136 built (build-time embedding and stable names). No ready label set in this sweep.

[loop:torbscript] re-sweep: the dependency #136 closed on 2026-10-27, so the body no longer calls it open. The acceptance criteria are still marked "draft, to be confirmed once #136 lands": that confirmation is due now, at the next refine, against what #136 built (build-time embedding and stable names). No `ready` label set in this sweep.
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261114 until 2026-11-14T02:30:00Z

[loop:torbscript] claim refine by session:loop-torbscript-20261114 until 2026-11-14T02:30:00Z
Author
Collaborator

[loop:torbscript] decided by the loop: dependency #136 (RESOURCES slice 3) closed on 2026-10-27, so the criteria are confirmed as written; the listing is build-time (sorted, same stable names as single literals, missing directory = build error naming the path), matching RESOURCES.md section 3 and 6. Seed impact: the worker checks first against CLAUDE.md 'Seed and breaking changes'. Labelled ready.
refine: done, next: implement (ready)

[loop:torbscript] decided by the loop: dependency #136 (RESOURCES slice 3) closed on 2026-10-27, so the criteria are confirmed as written; the listing is build-time (sorted, same stable names as single literals, missing directory = build error naming the path), matching RESOURCES.md section 3 and 6. Seed impact: the worker checks first against CLAUDE.md 'Seed and breaking changes'. Labelled `ready`. refine: done, next: implement (ready)
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261114 until 2026-11-14T06:00:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261114 until 2026-11-14T06:00:00Z
Author
Collaborator

[loop:torbscript] checkpoint: implementing in worktree torbscript-language-99 (branch loop/99-resource-directory). Design: ResourceDirectory is a plain std/resource type read by the literal rule; the checker lists the directory (recursive, sorted by path) from the workspace listing and records each file as a shipped Resource (same stable name as its own literal); files(): List<Resource>. No new native, no new syntax, so no seed refresh. Next: tests, RESOURCES.md section 6, docs, PR.

[loop:torbscript] checkpoint: implementing in worktree torbscript-language-99 (branch loop/99-resource-directory). Design: `ResourceDirectory` is a plain std/resource type read by the literal rule; the checker lists the directory (recursive, sorted by path) from the workspace listing and records each file as a shipped `Resource` (same stable name as its own literal); `files(): List<Resource>`. No new native, no new syntax, so no seed refresh. Next: tests, RESOURCES.md section 6, docs, PR.
Author
Collaborator

[loop:torbscript] implement: PR #774 opened, CI pending (all jobs of runs 2808/2809 still queued after ~40 min, none started). next: review (argus)

  • #774 (head 1c982ee9, two commits: feat(checker) + docs(resource)), reviewer argus requested.
  • Seed impact judged none (no syntax, no native, no looked-up std name); CI confirms.
  • Not verified locally: nothing was compiled, formatted or regenerated (no torb binary here). Possible CI findings: the std idioms (split/first/skip/map, sort({ _ })) and docs skill --check (skills copies were mirrored by hand).
  • Review should wait for green CI; the next tick reads the CI state and fixes red.
[loop:torbscript] implement: PR #774 opened, CI pending (all jobs of runs 2808/2809 still queued after ~40 min, none started). next: review (argus) - https://git.torb.dev/torbscript/language/pulls/774 (head 1c982ee9, two commits: `feat(checker)` + `docs(resource)`), reviewer argus requested. - Seed impact judged none (no syntax, no native, no looked-up std name); CI confirms. - Not verified locally: nothing was compiled, formatted or regenerated (no `torb` binary here). Possible CI findings: the std idioms (`split/first/skip/map`, `sort({ _ })`) and `docs skill --check` (skills copies were mirrored by hand). - Review should wait for green CI; the next tick reads the CI state and fixes red.
Author
Collaborator

[loop:torbscript] claim review-fix by session:loop-torbscript-20261114 until 2026-11-14T05:49:00Z

[loop:torbscript] claim review-fix by session:loop-torbscript-20261114 until 2026-11-14T05:49:00Z
Author
Collaborator

[loop:torbscript] review-fix: CI of PR #774 is red on commit messages: the commit 2ff533f1 has the subject style: ... and style is not one of the types tools/check-commits.sh accepts (feat fix perf refactor docs test build ci chore revert). next: a worker rewords it to chore(resource): ... on the branch (the rest of CI is still queued).

[loop:torbscript] review-fix: CI of PR #774 is red on `commit messages`: the commit `2ff533f1` has the subject `style: ...` and `style` is not one of the types tools/check-commits.sh accepts (feat fix perf refactor docs test build ci chore revert). next: a worker rewords it to `chore(resource): ...` on the branch (the rest of CI is still queued).
Author
Collaborator

[loop:torbscript] review-fix: new head cf091cad. Reworded the tip commit from style: ... to chore(resource): format the resource directory changes and shorten the std/resource summary (style is not an accepted type); tools/check-commits.sh origin/main HEAD passes. Tree unchanged. next: wait for CI, then review (argus)

[loop:torbscript] review-fix: new head cf091cad. Reworded the tip commit from `style: ...` to `chore(resource): format the resource directory changes and shorten the std/resource summary` (style is not an accepted type); tools/check-commits.sh origin/main HEAD passes. Tree unchanged. next: wait for CI, then review (argus)
argus closed this issue 2026-11-14 09:07:53 +00:00
Sign in to join this conversation.
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.