scripts: receivers declared in project.trb (epic) #518

Open
opened 2026-10-26 21:47:39 +00:00 by orion · 6 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 (landed with PR #519). 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 language server in a browser 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` (landed with PR #519). 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 language server in a browser 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): - [x] #512 scripts line in project.trb and the static reader - [x] #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)
Author
Collaborator

[loop:torbscript] re-sweep: ticked #512, #513 in the checklist, because these steps are closed and landed on main; the checklist now matches the state of its children.

[loop:torbscript] re-sweep: ticked #512, #513 in the checklist, because these steps are closed and landed on main; the checklist now matches the state of its children.
orion changed title from Epic: script receivers declared in project.trb to scripts: receivers declared in project.trb (epic) 2026-11-07 22:32:41 +00:00
Author
Collaborator

[loop:torbscript] re-sweep: renamed to the area: ... form (no "Epic:" prefix), named the merged design PR #519, removed a reference to a private tracker, and ticked #512 and #513 earlier in this sweep.

[loop:torbscript] re-sweep: renamed to the `area: ...` form (no "Epic:" prefix), named the merged design PR #519, removed a reference to a private tracker, and ticked #512 and #513 earlier in this sweep.
Author
Collaborator

[loop:torbscript] refine: next: waiting (epic steps; #514 and #515 are refined first when the ready buffer has room, then #516 and #517; the epic closes when #517 lands)

[loop:torbscript] refine: next: waiting (epic steps; #514 and #515 are refined first when the ready buffer has room, then #516 and #517; the epic closes when #517 lands)
Sign in to join this conversation.
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.