Epic: script receivers declared in project.trb #518

Open
opened 2026-10-26 21:47:39 +00:00 by orion · 3 comments
Collaborator

Epic: the receiver type of a receiver script can be declared in project.trb (optional), instead of being decided only by the load site. Design record: docs/design/SCRIPT-RECEIVERS.md (PR linked below). Owner decisions 2026-10-26: no per-file receiver header; scripts stay an implicit configuration format; the mapping is optional (unmapped scripts stay valid, the LSP infers the receiver from Sandbox.load calls where it can, otherwise the script is untyped and fails at most at run time).

scripts "config/*.trb", receiver: "ServerConfig", from: "./src/server-config"

Goal: a mapped file gets its receiver from its nearest project.trb - forward-only, no reverse lookup of a loader - so torb check, torb lsp and a browser LSP (orion/infra#2329 on git.dmb.zone) can type a script opened alone. Unmapped files keep inference from literal loads (two loads with different types become a compile error) and are otherwise untyped; full typing in a browser needs the mapping.

Slices, in order (1, 2, 3 and 6 land in one release):

  • #512 scripts line in project.trb and the static reader
  • #513 graph and checker take receivers from project.trb
  • #514 diagnostics catalogue
  • #515 language server features for scripts
  • #516 forward-only file contract
  • #517 migrate repository scripts and docs

Done when: all slices closed and SCRIPT-RECEIVERS.md status is done; "first load decides" is gone.

Epic: the receiver type of a receiver script can be declared in `project.trb` (optional), instead of being decided only by the load site. Design record: `docs/design/SCRIPT-RECEIVERS.md` (PR linked below). Owner decisions 2026-10-26: no per-file receiver header; scripts stay an implicit configuration format; the mapping is optional (unmapped scripts stay valid, the LSP infers the receiver from `Sandbox.load` calls where it can, otherwise the script is untyped and fails at most at run time). ```trb scripts "config/*.trb", receiver: "ServerConfig", from: "./src/server-config" ``` Goal: a mapped file gets its receiver from its nearest `project.trb` - forward-only, no reverse lookup of a loader - so `torb check`, `torb lsp` and a browser LSP (orion/infra#2329 on git.dmb.zone) can type a script opened alone. Unmapped files keep inference from literal loads (two loads with different types become a compile error) and are otherwise untyped; full typing in a browser needs the mapping. Slices, in order (1, 2, 3 and 6 land in one release): - [ ] #512 scripts line in project.trb and the static reader - [ ] #513 graph and checker take receivers from project.trb - [ ] #514 diagnostics catalogue - [ ] #515 language server features for scripts - [ ] #516 forward-only file contract - [ ] #517 migrate repository scripts and docs Done when: all slices closed and SCRIPT-RECEIVERS.md status is done; "first load decides" is gone.
Author
Collaborator

Design PR: #519 · Epic: #518

Design PR: https://git.torb.dev/torbscript/language/pulls/519 · Epic: https://git.torb.dev/torbscript/language/issues/518
Author
Collaborator

Owner decisions 2026-10-26 (recorded in SCRIPT-RECEIVERS.md section 13, PR #519):

  1. The "Add to project.trb" hint/quick fix (D15) for an unmapped load is always shown, by default, not configurable.
  2. No strict mode: nothing demands every script be mapped or typed.
  3. A scripts pattern that matches no file is not an error (an empty mods/plugins folder is legitimate). D3 is retired; no diagnostic, not even a hint.
    Slice acceptance criteria updated accordingly (#512, #514, #515).
Owner decisions 2026-10-26 (recorded in SCRIPT-RECEIVERS.md section 13, PR #519): 1. The "Add to project.trb" hint/quick fix (D15) for an unmapped load is always shown, by default, not configurable. 2. No strict mode: nothing demands every script be mapped or typed. 3. A `scripts` pattern that matches no file is not an error (an empty `mods`/`plugins` folder is legitimate). D3 is retired; no diagnostic, not even a hint. Slice acceptance criteria updated accordingly (#512, #514, #515).
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop), epic of six slices (#512 to #517) for the script-receivers design record; owner decisions of 2026-10-26 are recorded in the body. No collision with a design record found at intake. The epic itself never gets ready; each slice is refined and implemented in order, the epic closes when #517 lands. next: waiting (epic steps, #512 refined first)

[loop:torbscript] intake: in scope (author orion, label loop), epic of six slices (#512 to #517) for the script-receivers design record; owner decisions of 2026-10-26 are recorded in the body. No collision with a design record found at intake. The epic itself never gets ready; each slice is refined and implemented in order, the epic closes when #517 lands. next: waiting (epic steps, #512 refined first)
Sign in to join this conversation.
No labels
loop
ready
No milestone
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#518
No description provided.