Script receivers 3/6: diagnostics catalogue #514

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

Slice 4 of Design: docs/design/SCRIPT-RECEIVERS.md (branch docs/script-receivers). Part of the script-receivers epic.

The diagnostics D3-D18 of section 9, with exact texts, notes, related information and quick fixes.

Acceptance

  • Every diagnostic pinned with its exact text in compiler/tests/receivers.test.trb or compiler/tests/sandbox.test.trb.
  • D7 (overlap) is reported at both patterns, each with related information at the other.
  • D14 (type argument differs from mapping of a mapped file) carries related info at the scripts line and the fix "Load it as U".
  • D15 (literal load of an unmapped file) is an information/hint diagnostic, not an error, does not fail torb check, and carries the fix "Add to project.trb" with a correct scripts line.
  • D18 (loads of one unmapped file with different types) is an error at the second and further loads, related info at the first load; replaces first-load-wins.
  • D16 replaces the misleading NoModule for a use of a script.
  • D17 is the SandboxError of a runtime path loaded with the wrong type, or of an unmapped script failing only at run time.

Amended 2026-10-26 (owner): the scripts mapping is optional; unmapped scripts stay valid and are typed by inference from literal Sandbox.load calls, else untyped (SCRIPT-RECEIVERS.md sections 1, 5, 6).$\n\nDecided 2026-10-26 (owner): D3 (pattern matches no file) is retired, no such diagnostic exists; the number stays unused. D15 is always shown, by default and not configurable. Extra acceptance:

  • No diagnostic (not even a hint) for a pattern that matches no file; test pins it.
  • D15 and its quick fix are always reported; no option, setting or client switch turns them off.
Slice 4 of Design: `docs/design/SCRIPT-RECEIVERS.md` (branch `docs/script-receivers`). Part of the script-receivers epic. The diagnostics D3-D18 of section 9, with exact texts, notes, related information and quick fixes. Acceptance - [ ] Every diagnostic pinned with its exact text in `compiler/tests/receivers.test.trb` or `compiler/tests/sandbox.test.trb`. - [ ] D7 (overlap) is reported at both patterns, each with related information at the other. - [ ] D14 (type argument differs from mapping of a mapped file) carries related info at the `scripts` line and the fix "Load it as `U`". - [ ] D15 (literal load of an unmapped file) is an information/hint diagnostic, not an error, does not fail `torb check`, and carries the fix "Add to project.trb" with a correct `scripts` line. - [ ] D18 (loads of one unmapped file with different types) is an error at the second and further loads, related info at the first load; replaces first-load-wins. - [ ] D16 replaces the misleading `NoModule` for a `use` of a script. - [ ] D17 is the `SandboxError` of a runtime path loaded with the wrong type, or of an unmapped script failing only at run time. Amended 2026-10-26 (owner): the `scripts` mapping is optional; unmapped scripts stay valid and are typed by inference from literal `Sandbox.load` calls, else untyped (SCRIPT-RECEIVERS.md sections 1, 5, 6).$\n\nDecided 2026-10-26 (owner): D3 (pattern matches no file) is retired, no such diagnostic exists; the number stays unused. D15 is always shown, by default and not configurable. Extra acceptance: - [ ] No diagnostic (not even a hint) for a pattern that matches no file; test pins it. - [ ] D15 and its quick fix are always reported; no option, setting or client switch turns them off.
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

[loop:torbscript] intake: in scope (author orion, label loop, slice 3 of the script-receivers epic #518); no duplicate. The diagnostics D3-D18 need the receivers of #513 (and the reader of #512) in place. Just in time: refine when #513 has landed. next: waiting (#513 landed)

[loop:torbscript] intake: in scope (author orion, label `loop`, slice 3 of the script-receivers epic #518); no duplicate. The diagnostics D3-D18 need the receivers of #513 (and the reader of #512) in place. Just in time: refine when #513 has landed. next: waiting (#513 landed)
Author
Collaborator

[loop:torbscript] note from the refine of #513 (#513): the checks that need an error text move here. #514 now also owns D14 (type argument differs from the mapping), D18 and the removal of "first load decides" for unmapped files (#513 keeps that rule until then), D6/D7 for a pattern that matches an entry, test, library or two receivers, D8-D13 for an unresolvable receiver:/from: (in #513 such a file is silently untyped), and D16/D17. The examples/config-dsl line stays with #517.

[loop:torbscript] note from the refine of #513 (https://git.torb.dev/torbscript/language/issues/513): the checks that need an error text move here. #514 now also owns D14 (type argument differs from the mapping), D18 and the removal of "first load decides" for unmapped files (#513 keeps that rule until then), D6/D7 for a pattern that matches an entry, test, library or two receivers, D8-D13 for an unresolvable `receiver:`/`from:` (in #513 such a file is silently untyped), and D16/D17. The `examples/config-dsl` line stays with #517.
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#514
No description provided.