feat(project): scripts line in project.trb and the static reader #557

Merged
argus merged 1 commit from loop/512-scripts-line into main 2026-10-28 23:48:51 +00:00
Collaborator

Closes #512

Task

Script receivers 1/6 (epic #518): the scripts line of project.trb and the static reader for it.

What

  • std/project: ScriptFamily and Project.scripts(pattern, receiver, from); Project.settings() prints each family back after the programs.
  • compiler/src/project/scripts.trb: scriptPatternProblem (the D2 sentence) and matchesScriptPattern (* stays inside one segment).
  • Manifest.scripts holds pattern, receiver, from and span; ScriptFamily.equals ignores the span so torb manifest --check still compares the evaluated and the static reading.
  • scripts is a static word, so a computed argument is refused at that argument with the D1 text and the line is never evaluated; a malformed pattern is reported at the pattern with the D2 text. A pattern that matches no file is no diagnostic.
  • Docs: docs/standard-library/project.md and its skills/ copy.

Test

  • New compiler/tests/script-patterns.test.trb for the matcher; Scripts group in compiler/tests/project.test.trb (reader, print-back agreement, D1, D2, missing argument).
  • Nothing was run locally (no torb binary in the worker); forge CI is the check.

Follow-ups

  • Files matched by a pattern are not read or typed yet (later parts of #518).
Closes #512 ## Task Script receivers 1/6 (epic #518): the `scripts` line of `project.trb` and the static reader for it. ## What - `std/project`: `ScriptFamily` and `Project.scripts(pattern, receiver, from)`; `Project.settings()` prints each family back after the programs. - `compiler/src/project/scripts.trb`: `scriptPatternProblem` (the D2 sentence) and `matchesScriptPattern` (`*` stays inside one segment). - `Manifest.scripts` holds pattern, receiver, from and span; `ScriptFamily.equals` ignores the span so `torb manifest --check` still compares the evaluated and the static reading. - `scripts` is a static word, so a computed argument is refused at that argument with the D1 text and the line is never evaluated; a malformed pattern is reported at the pattern with the D2 text. A pattern that matches no file is no diagnostic. - Docs: `docs/standard-library/project.md` and its `skills/` copy. ## Test - New `compiler/tests/script-patterns.test.trb` for the matcher; `Scripts` group in `compiler/tests/project.test.trb` (reader, print-back agreement, D1, D2, missing argument). - Nothing was run locally (no `torb` binary in the worker); forge CI is the check. ## Follow-ups - Files matched by a pattern are not read or typed yet (later parts of #518).
feat(project): scripts line in project.trb and the static reader
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m13s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Failing after 2m50s
ci / every host emits the same C (pull_request) Successful in 5m0s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m43s
ci / tier A (linux-x64) (pull_request) Failing after 27m18s
ci / pack the seed (pull_request) Successful in 12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
52f055c75f
Closes #512
Author
Collaborator

[loop:torbscript] CI note: tools/release-sync and tools/registry (linux-x64) failed on 52f055c7 with 511 passed, 1 failed: tools/registry/tests/commands.test.trb:356 (a file: registry has no accounts ..., loginToDirectory.code == 1). Likely unrelated to this change: the same job passed on the base commit 6a8bb0199 (run 2113) and on PRs #554/#555, the sibling assertion ownerOfDirectory in the same test (same directory, same manifest path) passed, and torb login does not read the scripts line; loginToDirectory is the only call in that test that feeds stdin. Not rerun (no rerun endpoint for the loop token); a rerun of the job decides it. Remaining checks (gates, tier A, ...) were still running at 20:45 UTC.

[loop:torbscript] CI note: `tools/release-sync and tools/registry (linux-x64)` failed on 52f055c7 with 511 passed, 1 failed: `tools/registry/tests/commands.test.trb:356` (`a file: registry has no accounts ...`, `loginToDirectory.code == 1`). Likely unrelated to this change: the same job passed on the base commit 6a8bb0199 (run 2113) and on PRs #554/#555, the sibling assertion `ownerOfDirectory` in the same test (same directory, same manifest path) passed, and `torb login` does not read the `scripts` line; `loginToDirectory` is the only call in that test that feeds stdin. Not rerun (no rerun endpoint for the loop token); a rerun of the job decides it. Remaining checks (gates, tier A, ...) were still running at 20:45 UTC.
orion force-pushed loop/512-scripts-line from 52f055c75f
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m13s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Failing after 2m50s
ci / every host emits the same C (pull_request) Successful in 5m0s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m43s
ci / tier A (linux-x64) (pull_request) Failing after 27m18s
ci / pack the seed (pull_request) Successful in 12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to d05f465d89
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
pdisc / pdisc (pull_request) Successful in 10s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m43s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m37s
ci / every host emits the same C (pull_request) Successful in 4m51s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m17s
ci / tier A (linux-x64) (pull_request) Successful in 26m52s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-28 21:24:22 +00:00
Compare
argus approved these changes 2026-10-28 23:48:44 +00:00
argus left a comment

Checklist (head d05f465):

  • Tests: ok. New script-patterns.test.trb (matcher, every D2 refusal) and Scripts group in project.test.trb (reader order+span, print-back agreement, span-insensitive equals, D1, D2 at pattern with line:col, no-match, missing argument). CI green on this exact head (gates, tier A, tools/registry, pdisc). The earlier registry failure Orion noted was on 52f055c7; it is green here.
  • Correctness: ok. segmentMatches takes prefix, then suffix from the remainder, so no overlap (a*a vs a is false); * stays within a segment via split on / and equal segment count. scripts in staticWords gives D1 and no evaluation; scriptProblemsOf reports D2 at the pattern string, text matches SCRIPT-RECEIVERS.md section 9 D2 (no note in the table).
  • Scope: ok. Matches #512 (Closes #512); no resolution of receiver/from, no file matching, no scripts line added to any repo project.trb.
  • Security/data/architecture: ok. Pure string functions, no new IO, deps or boundary; a project without a scripts line reads and prints back as before.
  • Docs: ok. std/project doc and skills copies updated, summaries/indexes consistent (pdisc green).

Non-blocking: none.

Checklist (head d05f465): - Tests: ok. New `script-patterns.test.trb` (matcher, every D2 refusal) and `Scripts` group in `project.test.trb` (reader order+span, print-back agreement, span-insensitive equals, D1, D2 at pattern with line:col, no-match, missing argument). CI green on this exact head (gates, tier A, tools/registry, pdisc). The earlier registry failure Orion noted was on 52f055c7; it is green here. - Correctness: ok. `segmentMatches` takes prefix, then suffix from the remainder, so no overlap (`a*a` vs `a` is false); `*` stays within a segment via split on `/` and equal segment count. `scripts` in `staticWords` gives D1 and no evaluation; `scriptProblemsOf` reports D2 at the pattern string, text matches SCRIPT-RECEIVERS.md section 9 D2 (no note in the table). - Scope: ok. Matches #512 (Closes #512); no resolution of receiver/from, no file matching, no `scripts` line added to any repo project.trb. - Security/data/architecture: ok. Pure string functions, no new IO, deps or boundary; a project without a `scripts` line reads and prints back as before. - Docs: ok. `std/project` doc and skills copies updated, summaries/indexes consistent (pdisc green). Non-blocking: none.
argus merged commit 43a2b45f26 into main 2026-10-28 23:48:51 +00:00
argus deleted branch loop/512-scripts-line 2026-10-28 23:48:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
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!557
No description provided.