fs: systemPath in std/fs (step 2c of #68, commit 2 of 2) #580

Closed
opened 2026-10-29 11:52:31 +00:00 by orion · 6 comments
Collaborator

Context

Step 2c of #68 (PATH slice 2): commit 2 of 2 of the seed rule for systemPath. Commit 1 (#559, torb_file_system_path and the manifest row fileSystemPath) is on main as 4b3045d, and the newest published seed (4b3045d31334, head of seeds.txt) contains it, so a std source may declare and call the native now.

Source

  • PATH.md section 6: public fn systemPath(path: Path): String, "the path as the operating system of this machine reads it: for a foreign function and for a child process".
  • Epic #68, step 2c.

Goal

std/fs exports systemPath(path: Path): String over the native fileSystemPath. It answers the path text in the form this machine's operating system reads (POSIX: the / text unchanged; Windows: the drive-letter form the runtime hands to the wide-char calls), and cannot fail.

Acceptance criteria

  • std/fs/src/lib.trb declares the private native fn fileSystemPath(path: String): String (name and signature as the manifest row in compiler/src/backend/c/natives.trb) and public fn systemPath(path: Path): String over it, with a doc comment per the declaration rules (what it answers, when to use it: foreign functions and child processes, not for display or for a Path round trip).
  • A test in std/fs/tests/files.test.trb: systemPath of a relative path, an absolute path and a path with a trailing component answers the expected text on the CI platform; a test that the answer round-trips through File.exists on a path the test created.
  • docs/design/PATH.md: the status paragraph near the top says systemPath is in (the "runtime half is in" sentence is replaced); slice 2 stays open for steps 3 and 4.
  • docs/ changes regenerated into skills/ (the fs reference page lists systemPath); tools/check-commits.sh clean; sh tools/gates.sh a green in forge CI.

Design record point

PATH.md section 6 (systemPath) and the slice table row 2 (docs/design/PATH.md, "The boundary").

Seed

Does not touch the seed: it is commit 2 of 2 and only calls the native that the published seed 4b3045d31334 already contains. No syntax change, no new native, no driver flag, no name the compiler looks up by string (fileSystemPath is looked up by the manifest row that already exists). One PR, one Conventional Commit (feat(fs): systemPath answers the path in the form the operating system reads); if the docs regeneration is cleaner on its own, a second docs(fs) commit.

Dependencies

  • #559 (closed, 4b3045d) and the published seed 4b3045d31334.
  • Independent of steps 3 (IoError.path as Path) and 4 (list, absolutePath), which follow one after the other.

Part of #68 (epic; do not close it).

## Context Step 2c of #68 (PATH slice 2): commit 2 of 2 of the seed rule for `systemPath`. Commit 1 (#559, `torb_file_system_path` and the manifest row `fileSystemPath`) is on `main` as 4b3045d, and the newest published seed (`4b3045d31334`, head of `seeds.txt`) contains it, so a `std` source may declare and call the native now. ## Source - [PATH.md section 6](https://git.torb.dev/torbscript/language/src/branch/main/docs/design/PATH.md#L575): `public fn systemPath(path: Path): String`, "the path as the operating system of this machine reads it: for a foreign function and for a child process". - Epic #68, step 2c. ## Goal `std/fs` exports `systemPath(path: Path): String` over the native `fileSystemPath`. It answers the path text in the form this machine's operating system reads (POSIX: the `/` text unchanged; Windows: the drive-letter form the runtime hands to the wide-char calls), and cannot fail. ## Acceptance criteria - [ ] `std/fs/src/lib.trb` declares the private `native fn fileSystemPath(path: String): String` (name and signature as the manifest row in `compiler/src/backend/c/natives.trb`) and `public fn systemPath(path: Path): String` over it, with a doc comment per the declaration rules (what it answers, when to use it: foreign functions and child processes, not for display or for a `Path` round trip). - [ ] A test in `std/fs/tests/files.test.trb`: `systemPath` of a relative path, an absolute path and a path with a trailing component answers the expected text on the CI platform; a test that the answer round-trips through `File.exists` on a path the test created. - [ ] `docs/design/PATH.md`: the status paragraph near the top says `systemPath` is in (the "runtime half is in" sentence is replaced); slice 2 stays open for steps 3 and 4. - [ ] `docs/` changes regenerated into `skills/` (the `fs` reference page lists `systemPath`); `tools/check-commits.sh` clean; `sh tools/gates.sh a` green in forge CI. ## Design record point PATH.md section 6 (`systemPath`) and the slice table row 2 (`docs/design/PATH.md`, "The boundary"). ## Seed Does **not** touch the seed: it is commit 2 of 2 and only calls the native that the published seed `4b3045d31334` already contains. No syntax change, no new native, no driver flag, no name the compiler looks up by string (`fileSystemPath` is looked up by the manifest row that already exists). One PR, one Conventional Commit (`feat(fs): systemPath answers the path in the form the operating system reads`); if the docs regeneration is cleaner on its own, a second `docs(fs)` commit. ## Dependencies - #559 (closed, 4b3045d) and the published seed `4b3045d31334`. - Independent of steps 3 (`IoError.path` as `Path`) and 4 (`list`, `absolutePath`), which follow one after the other. Part of #68 (epic; do not close it).
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-29T18:57:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-29T18:57:00Z
Author
Collaborator

[loop:torbscript] release implement: lease expired 2026-10-29T18:57Z while PR #583 is red on 50c2bcf (tier A failing after 32m39s)

[loop:torbscript] release implement: lease expired 2026-10-29T18:57Z while PR #583 is red on 50c2bcf (tier A failing after 32m39s)
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-30T01:00:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-30T01:00:00Z
Author
Collaborator

[loop:torbscript] release implement: fix worker timed out after pushing c8d8653 (format canon for the Path.from binding in the systemPath test); CI on c8d8653 still runs, the playground job is already red (failing after 4m36s), so a fix worker reads its log next tick

[loop:torbscript] release implement: fix worker timed out after pushing c8d8653 (format canon for the Path.from binding in the systemPath test); CI on c8d8653 still runs, the playground job is already red (failing after 4m36s), so a fix worker reads its log next tick
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-30T01:30:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-30T01:30:00Z
Author
Collaborator

[loop:torbscript] release implement: CI on c8d8653 read from the runner logs. Tier A (linux-x64) finished green; the only red job was the playground (torb as WebAssembly), a timing flake in playground/smoke-test.mjs (cancel test), not caused by this change. PR #583 was reopened to start a fresh CI run (no code change, no push). Next: waiting (CI running, then the merge gate's review). Details: #583

[loop:torbscript] release implement: CI on c8d8653 read from the runner logs. Tier A (linux-x64) finished green; the only red job was `the playground (torb as WebAssembly)`, a timing flake in `playground/smoke-test.mjs` (cancel test), not caused by this change. PR #583 was reopened to start a fresh CI run (no code change, no push). Next: waiting (CI running, then the merge gate's review). Details: https://git.torb.dev/torbscript/language/pulls/583
argus closed this issue 2026-10-29 21:41:42 +00:00
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#580
No description provided.