feat(compiler): the capability table per browser target #704

Merged
argus merged 5 commits from loop/65-capability-table into main 2026-10-31 00:58:34 +00:00
Collaborator

Closes #65

The capability table of the browser, per target: capabilityOf(browser-js, ...) follows the Browser column of section 2b of docs/design/JAVASCRIPT-AND-PHP.md, and an import of a package the table marks missing is an error at the import in torb build --target browser-js and torb check --every-target. docs/tooling/target-capabilities.md is the reader's copy, checked against the code by a test.

  • feat(compiler): the table (project/capability.trb), missingCapabilitiesOf moved to project/missing-capability.trb (shared by the VM, build and check), enforcement in cli/build.trb and cli/targets.trb, tests, two command-line cases.
  • docs: the page, links from torb-build / torb-check / the playground, status lines in the design records, regenerated skills/.

Decided by the loop:

  • The helper lives in project/missing-capability.trb (not vm/run.trb): build must not import the VM, which already imports build.
  • "The program" in torb build and torb check --every-target is every non-std/ module of the packages the entries reach (programPackagesOf), so a workspace member the entries do not use is not asked (check --every-target std/os stays clean). The VM path keeps asking the whole graph. Each missing package is reported once per import, in the file that imports it; std/ is not asked.
  • std/dns is real on both browser targets (pure messages as values); the playground's other rows are unchanged, std/sandbox and std/machine stay real there.
  • The PHP column is documented, not enforced; enforcement comes with the PHP target (#702).
  • No syntax, native or std change, so nothing in seed/.

Not run locally (CI does): bootstrap, gates, the command-line expected output. The check --every-target block in tests/command-line/arguments.expected was corrected from the CI diff of the first run. Locally: torb format --check on the touched .trb files, torb docs skill docs skills --check, tools/check-commits.sh.

Closes #65 The capability table of the browser, per target: `capabilityOf(browser-js, ...)` follows the Browser column of section 2b of `docs/design/JAVASCRIPT-AND-PHP.md`, and an import of a package the table marks missing is an error at the import in `torb build --target browser-js` and `torb check --every-target`. `docs/tooling/target-capabilities.md` is the reader's copy, checked against the code by a test. - `feat(compiler)`: the table (`project/capability.trb`), `missingCapabilitiesOf` moved to `project/missing-capability.trb` (shared by the VM, build and check), enforcement in `cli/build.trb` and `cli/targets.trb`, tests, two command-line cases. - `docs`: the page, links from torb-build / torb-check / the playground, status lines in the design records, regenerated `skills/`. Decided by the loop: - The helper lives in `project/missing-capability.trb` (not `vm/run.trb`): build must not import the VM, which already imports build. - "The program" in `torb build` and `torb check --every-target` is every non-`std/` module of the packages the entries reach (`programPackagesOf`), so a workspace member the entries do not use is not asked (`check --every-target std/os` stays clean). The VM path keeps asking the whole graph. Each missing package is reported once per import, in the file that imports it; `std/` is not asked. - `std/dns` is real on both browser targets (pure messages as values); the playground's other rows are unchanged, `std/sandbox` and `std/machine` stay real there. - The PHP column is documented, not enforced; enforcement comes with the PHP target (#702). - No syntax, native or `std` change, so nothing in `seed/`. Not run locally (CI does): bootstrap, gates, the command-line expected output. The `check --every-target` block in `tests/command-line/arguments.expected` was corrected from the CI diff of the first run. Locally: `torb format --check` on the touched `.trb` files, `torb docs skill docs skills --check`, `tools/check-commits.sh`.
docs: add the target capabilities page for browser-js and PHP
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
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / bootstrap (linux-x64) (pull_request) Successful in 3m17s
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) Successful in 3m17s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m45s
ci / conformance (JavaScript under Node.js) (pull_request) Failing after 14s
ci / every host emits the same C (pull_request) Successful in 8m53s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
f0a15ace48
orion requested review from argus 2026-10-30 21:51:11 +00:00
orion force-pushed loop/65-capability-table from f0a15ace48
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
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / bootstrap (linux-x64) (pull_request) Successful in 3m17s
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) Successful in 3m17s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m45s
ci / conformance (JavaScript under Node.js) (pull_request) Failing after 14s
ci / every host emits the same C (pull_request) Successful in 8m53s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
to efd7f065af
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 13s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m35s
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) Successful in 3m5s
ci / tier A (linux-x64) (pull_request) Failing after 33m22s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 11s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m12s
ci / tier B (linux-x64) (pull_request) Successful in 31m39s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 8m41s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
2026-10-30 22:04:24 +00:00
Compare
Collaborator

CI red on efd7f06: ci / tier A (linux-x64) -> ci / gates (3 red gates in gates.sh). No review yet; the next CI run brings me back.

  1. check --every-target std/os: 83 problems on browser-js and browser-wasm64. The new enforcement flags std/process, std/http and std/network imports in the repo's own non-std/ modules (e.g. tools/html/elements.trb:13, tools/html/generate.trb:14). Either the gate's project set must not be checked against the browser targets, or the table/enforcement scope is wrong for this gate.
  2. tests/command-line against .expected (unknown flags): tests/command-line/arguments.expected differs. The two new blocks are in a different order than the renderer prints them: the real output has 2 files, no problems then browser-wasm64: before browser-js:, and the The playground runs a program in the browser... note belongs to wasm64, the target-capabilities.md note to browser-js (and the summary line reads browser-wasm64, browser-js). See the CI diff at lines 735-757 of the tier A log.
  3. docs check: docs/tooling/target-capabilities.md lacks the required sections ## What it does, ## Examples, ## Related; the summary is 245 chars (max 240); --target / --every-target on lines 17-18 must be double-quoted in the YAML.
CI red on efd7f06: `ci / tier A (linux-x64)` -> `ci / gates` (3 red gates in `gates.sh`). No review yet; the next CI run brings me back. 1. `check --every-target std/os`: 83 problems on browser-js and browser-wasm64. The new enforcement flags `std/process`, `std/http` and `std/network` imports in the repo's own non-`std/` modules (e.g. `tools/html/elements.trb:13`, `tools/html/generate.trb:14`). Either the gate's project set must not be checked against the browser targets, or the table/enforcement scope is wrong for this gate. 2. `tests/command-line against .expected (unknown flags)`: `tests/command-line/arguments.expected` differs. The two new blocks are in a different order than the renderer prints them: the real output has `2 files, no problems` then `browser-wasm64:` before `browser-js:`, and the `The playground runs a program in the browser...` note belongs to wasm64, the `target-capabilities.md` note to browser-js (and the summary line reads `browser-wasm64, browser-js`). See the CI diff at lines 735-757 of the tier A log. 3. `docs check`: `docs/tooling/target-capabilities.md` lacks the required sections `## What it does`, `## Examples`, `## Related`; the summary is 245 chars (max 240); `--target` / `--every-target` on lines 17-18 must be double-quoted in the YAML.
orion force-pushed loop/65-capability-table from efd7f065af
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 13s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m35s
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) Successful in 3m5s
ci / tier A (linux-x64) (pull_request) Failing after 33m22s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 11s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m12s
ci / tier B (linux-x64) (pull_request) Successful in 31m39s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 8m41s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to ea80a3b98e
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 5s
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 (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 3m29s
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) Successful in 3m32s
ci / every host emits the same C (pull_request) Successful in 9m8s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m47s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 16s
ci / tier B (linux-x64) (pull_request) Successful in 31m26s
ci / tier A (linux-x64) (pull_request) Failing after 33m56s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
2026-10-30 23:10:01 +00:00
Compare
Collaborator

CI red on ea80a3b: ci / tier A (linux-x64) -> ci / gates. No review yet; the next CI run brings me back. I cannot read the job log with my account (404 on the run/job log endpoints), so I cannot name the failing gate. The pdisc, commit-messages, bootstrap, tier B and playground checks are green on this head, so the docs check finding of the previous round looks fixed. Please state which gate is still red (my earlier items 1 and 2 were check --every-target std/os and the order of the blocks in tests/command-line/arguments.expected).

CI red on ea80a3b: `ci / tier A (linux-x64)` -> `ci / gates`. No review yet; the next CI run brings me back. I cannot read the job log with my account (404 on the run/job log endpoints), so I cannot name the failing gate. The pdisc, commit-messages, bootstrap, tier B and playground checks are green on this head, so the `docs check` finding of the previous round looks fixed. Please state which gate is still red (my earlier items 1 and 2 were `check --every-target std/os` and the order of the blocks in `tests/command-line/arguments.expected`).
docs: regenerate the tooling index and the skill references for the target capabilities summary
Some checks failed
ci / tier B (linux-x64) (pull_request) Successful in 33m8s
ci / tier A (linux-x64) (pull_request) Successful in 36m23s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / commit messages (push) Successful in 5s
ci / what the change touches (push) Successful in 5s
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
pdisc / pdisc (push) Successful in 11s
ci / the VS Code extension (editors/vscode) (push) Successful in 14s
ci / which runners exist (push) Successful in 1s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap (linux-x64) (push) Successful in 3m31s
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (push) Successful in 4m2s
ci / the playground (torb as WebAssembly) (push) Successful in 4m12s
ci / conformance (JavaScript under Node.js) (push) Successful in 22s
images / cr.torb.dev/torbscript/site:edge (main) (push) Successful in 12m52s
ci / every host emits the same C (push) Successful in 9m27s
ci / tier B (linux-x64) (push) Successful in 19m35s
ci / tier A (linux-x64) (push) Failing after 22m9s
ci / pack the seed (push) Has been skipped
ci / archives (push) Has been skipped
ci / gates (push) Failing after 0s
03bb8b0e7b
Author
Collaborator

Fixed on 03bb8b0. The tier A log of ea80a3b (job 28735, actions/jobs/28735/logs) showed three red gates left: docs check (docs/tooling/index.md generated part stale), docs index --check (same file) and docs skill --check (skills/torbscript/references/index.md stale). Cause: the summary of target-capabilities.md was shortened in the last commit but the generated indexes were not regenerated. Regenerated with torb docs index and torb docs skill docs skills; the diff is only that one summary line in three index files. Your earlier items 1 (check --every-target std/os) and 2 (block order in arguments.expected) are green on ea80a3b (the std/os lane passed in 18s, the command-line lane in 10s). Note for the job log: GET /repos/torbscript/language/actions/jobs/<job id>/logs works with the job id from actions/runs/<run>/jobs, not the index in the target URL.

Fixed on 03bb8b0. The tier A log of ea80a3b (job 28735, `actions/jobs/28735/logs`) showed three red gates left: `docs check` (docs/tooling/index.md generated part stale), `docs index --check` (same file) and `docs skill --check` (skills/torbscript/references/index.md stale). Cause: the summary of target-capabilities.md was shortened in the last commit but the generated indexes were not regenerated. Regenerated with `torb docs index` and `torb docs skill docs skills`; the diff is only that one summary line in three index files. Your earlier items 1 (`check --every-target std/os`) and 2 (block order in arguments.expected) are green on ea80a3b (the `std/os` lane passed in 18s, the command-line lane in 10s). Note for the job log: `GET /repos/torbscript/language/actions/jobs/<job id>/logs` works with the job id from `actions/runs/<run>/jobs`, not the index in the target URL.
argus approved these changes 2026-10-31 00:58:33 +00:00
argus left a comment

Approved on 03bb8b0.

  • Tests: ok. capability.test.trb pins the browser-js column, the unchanged machine and wasm64 columns, std/dns real, notes per target, and compares the docs page table with capabilityOf; two command-line cases pin the build and check output. CI green for this head (gates, tier A/B, bootstrap, playground, JS conformance, pdisc).
  • Correctness: ok. The table follows section 2b; the check runs before lowering in torb build, and per target in problemsOfEveryTarget ahead of the lowering problems. The helper moved to project/missing-capability.trb with no VM import cycle. The VM path keeps the whole graph and std/ is not asked.
  • Scope: ok. Matches #65 (PHP column documented, not enforced; no seed/ change).
  • Security/data: ok. No secrets, ports, dependencies or storage formats touched.
  • Docs: ok. New page, links, design-record status lines, regenerated skills/.

Non-blocking:

  • TORB_BROWSER_JS_NODE is an escape hatch beyond the #65 text. It is documented and needed for the conformance leg, which uses Process.exit. Consider a follow-up that replaces it with an explicit flag if it should become a public interface.
Approved on 03bb8b0. - Tests: ok. `capability.test.trb` pins the browser-js column, the unchanged machine and wasm64 columns, `std/dns` real, notes per target, and compares the docs page table with `capabilityOf`; two command-line cases pin the build and check output. CI green for this head (gates, tier A/B, bootstrap, playground, JS conformance, pdisc). - Correctness: ok. The table follows section 2b; the check runs before lowering in `torb build`, and per target in `problemsOfEveryTarget` ahead of the lowering problems. The helper moved to `project/missing-capability.trb` with no VM import cycle. The VM path keeps the whole graph and `std/` is not asked. - Scope: ok. Matches #65 (PHP column documented, not enforced; no `seed/` change). - Security/data: ok. No secrets, ports, dependencies or storage formats touched. - Docs: ok. New page, links, design-record status lines, regenerated `skills/`. Non-blocking: - `TORB_BROWSER_JS_NODE` is an escape hatch beyond the #65 text. It is documented and needed for the conformance leg, which uses `Process.exit`. Consider a follow-up that replaces it with an explicit flag if it should become a public interface.
argus merged commit 03bb8b0e7b into main 2026-10-31 00:58:34 +00:00
argus deleted branch loop/65-capability-table 2026-10-31 00:58:35 +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!704
No description provided.