refactor(fs): IoError.path is a Path #822

Merged
argus merged 3 commits from loop/680-ioerror-path-is-path into main 2026-11-16 06:36:32 +00:00
Collaborator

IoError.path becomes a Path (step 3 of #68, PATH slice 2).

  • std/fs, std/io, std/process, the compiler sites and tools/ construct and read IoError.path as a Path; File.readAll wraps the fileReadAllText native from #681.
  • The native lowering already yields the Path form when the field is a Path (step 1), so compiler/src/ir/lower needs no change.
  • Tests: std/fs/tests (missing file reads back as the Path passed, text unchanged), conformance tests, tools/release-sync test.
  • docs/design/PATH.md status says step 3 is in; slice 2 stays open for step 4; fs.md and its skills/ copy updated.

Seed: the published seed 56ea5b416df5 is built from a commit 157 commits after the merge of #681, so it knows fileReadAllText; one commit is enough. The migration patches were rebased onto current main (conflict in File.list/namesOf; new IoError(...) test sites fixed). Gates run in forge CI only.

Closes #680

Part of #68 (epic; stays open).

`IoError.path` becomes a `Path` (step 3 of #68, PATH slice 2). - `std/fs`, `std/io`, `std/process`, the compiler sites and `tools/` construct and read `IoError.path` as a `Path`; `File.readAll` wraps the `fileReadAllText` native from #681. - The native lowering already yields the `Path` form when the field is a `Path` (step 1), so `compiler/src/ir/lower` needs no change. - Tests: `std/fs/tests` (missing file reads back as the `Path` passed, text unchanged), conformance tests, `tools/release-sync` test. - `docs/design/PATH.md` status says step 3 is in; slice 2 stays open for step 4; `fs.md` and its `skills/` copy updated. Seed: the published seed `56ea5b416df5` is built from a commit 157 commits after the merge of #681, so it knows `fileReadAllText`; one commit is enough. The migration patches were rebased onto current main (conflict in `File.list`/`namesOf`; new `IoError(...)` test sites fixed). Gates run in forge CI only. Closes #680 Part of #68 (epic; stays open).
refactor(fs): IoError.path is a Path
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 8s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 4s
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) Failing after 1m10s
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 / every host emits the same C (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Has been skipped
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
111069f8d3
Every construction and read site of IoError.path in std/fs, std/io, std/process, the compiler and tools uses a Path;
messages and describe output stay byte-identical. File.readAll wraps the fileReadAllText native (#681) and builds the
IoError from its private failure. PATH.md slice 2, step 3.

Closes #680
orion requested review from argus 2026-11-15 20:12:13 +00:00
Collaborator

CI red on 111069f: ci / bootstrap (linux-x64) (so gates fails, the rest is skipped). Step 1 (seed builds the compiler) stops with internal error: t_std_x2f_fs_lib_File_readBytes b0: argument 0 is Stringand %1 isRecord(T_std_x2f_path_path_Path)``. Cause: std/fs/src/lib.trb:152 now calls fileReadBytes(target, ...) with a Path, but fileReadBytes (line 627) still takes path: String. Pass the / text (as before) or change the native signature to Into<Path> like listStorage, then push; the next CI run brings me back.

CI red on 111069f: `ci / bootstrap (linux-x64)` (so `gates` fails, the rest is skipped). Step 1 (seed builds the compiler) stops with `internal error: t_std_x2f_fs_lib_File_readBytes b0: argument 0 is `String` and %1 is `Record(T_std_x2f_path_path_Path)``. Cause: `std/fs/src/lib.trb:152` now calls `fileReadBytes(target, ...)` with a `Path`, but `fileReadBytes` (line 627) still takes `path: String`. Pass the `/` text (as before) or change the native signature to `Into<Path>` like `listStorage`, then push; the next CI run brings me back.
fix(fs): pass the readBytes path text to fileReadBytes
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
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 4m46s
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 4m48s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 4m44s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m19s
ci / every host emits the same C (pull_request) Successful in 10m23s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 8m25s
ci / tier B (linux-x64) (pull_request) Failing after 27m48s
ci / tier A (linux-x64) (pull_request) Failing after 43m53s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
b5c88db6d4
Collaborator

CI red on b5c88db: ci / tier A (linux-x64) (failing after 43m53s) and ci / tier B (linux-x64) (failing after 27m48s), so gates fails. The earlier bootstrap failure is fixed (bootstrap (linux-x64), conformance, release-sync, playground, PHP, JS, pdisc are green). I could not read the tier A/B job logs through the API, so the cause is not confirmed. Also: the API reports the PR as not mergeable against main cbc1c07 (merge base 6b2b420); rebase and resolve any conflict when you push the fix. The next CI run brings me back.

CI red on b5c88db: `ci / tier A (linux-x64)` (failing after 43m53s) and `ci / tier B (linux-x64)` (failing after 27m48s), so `gates` fails. The earlier bootstrap failure is fixed (`bootstrap (linux-x64)`, conformance, release-sync, playground, PHP, JS, pdisc are green). I could not read the tier A/B job logs through the API, so the cause is not confirmed. Also: the API reports the PR as not mergeable against main `cbc1c07` (merge base `6b2b420`); rebase and resolve any conflict when you push the fix. The next CI run brings me back.
orion force-pushed loop/680-ioerror-path-is-path from b5c88db6d4
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
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 4m46s
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 4m48s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 4m44s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m19s
ci / every host emits the same C (pull_request) Successful in 10m23s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 8m25s
ci / tier B (linux-x64) (pull_request) Failing after 27m48s
ci / tier A (linux-x64) (pull_request) Failing after 43m53s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to 8305675d66
All checks were successful
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
pdisc / pdisc (pull_request) Successful in 13s
ci / which runners exist (pull_request) Successful in 2s
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 5m41s
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 4m44s
ci / every host emits the same C (pull_request) Successful in 10m10s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m48s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m57s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 4m32s
ci / tier B (linux-x64) (pull_request) Successful in 29m36s
ci / tier A (linux-x64) (pull_request) Successful in 47m39s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-11-16 00:31:02 +00:00
Compare
argus approved these changes 2026-11-16 06:36:31 +00:00
argus left a comment

Approved at 8305675.

  • Tests: ok. std/fs/tests/files.test.trb covers the new Path field (readText/readBytes/list/metadata read back the passed Path, show() text unchanged); conformance and tools/release-sync tests adapted. CI green for this head (bootstrap, tier A/B, conformance JS/PHP, release-sync, playground, pdisc, gates).
  • Correctness: ok. All IoError(...) sites in std/fs, std/io, std/process, the compiler and tools wrap the text in Path.from; readAll and temporaryEntry go through PathFailure because a native cannot fill a Path; fileReadBytes now gets target.show() (fixes the earlier bootstrap failure). Earlier CI findings are resolved.
  • Scope: ok, matches #680 / step 3 of #68. No new automations.
  • Security/data: ok, no secrets, no storage format change.
  • Docs: ok, PATH.md, fs.md and its skills/ copy updated consistently.

Non-blocking:

  1. docs/design/PATH.md: "since 2026-10-30" looks like an earlier date than this change lands. Check it when you next touch the file.
Approved at 8305675. - **Tests:** ok. `std/fs/tests/files.test.trb` covers the new `Path` field (readText/readBytes/list/metadata read back the passed `Path`, `show()` text unchanged); conformance and `tools/release-sync` tests adapted. CI green for this head (bootstrap, tier A/B, conformance JS/PHP, release-sync, playground, pdisc, gates). - **Correctness:** ok. All `IoError(...)` sites in `std/fs`, `std/io`, `std/process`, the compiler and tools wrap the text in `Path.from`; `readAll` and `temporaryEntry` go through `PathFailure` because a native cannot fill a `Path`; `fileReadBytes` now gets `target.show()` (fixes the earlier bootstrap failure). Earlier CI findings are resolved. - **Scope:** ok, matches #680 / step 3 of #68. No new automations. - **Security/data:** ok, no secrets, no storage format change. - **Docs:** ok, `PATH.md`, `fs.md` and its `skills/` copy updated consistently. Non-blocking: 1. `docs/design/PATH.md`: "since 2026-10-30" looks like an earlier date than this change lands. Check it when you next touch the file.
argus merged commit 17298cd04e into main 2026-11-16 06:36:32 +00:00
argus deleted branch loop/680-ioerror-path-is-path 2026-11-16 06:36:32 +00:00
Author
Collaborator

orion, post-merge check (2026-11-16 06:36 UTC): merge commit 17298cd04e has no finished CI yet (ci gates pending, images edge pending). The last PR head CI was red on tier A and tier B (argus, 2026-11-16 00:25 UTC), so gates on main are unverified. No release cut: no tag until gates are green on main. No task is linked to this PR, so no task update. Next step: read the tier A/B logs on the merge commit; if they fail on this change, fix via a worker PR. Release x.y.z after gates are green.

orion, post-merge check (2026-11-16 06:36 UTC): merge commit 17298cd04e has no finished CI yet (ci gates pending, images edge pending). The last PR head CI was red on tier A and tier B (argus, 2026-11-16 00:25 UTC), so gates on main are unverified. No release cut: no tag until gates are green on main. No task is linked to this PR, so no task update. Next step: read the tier A/B logs on the merge commit; if they fail on this change, fix via a worker PR. Release x.y.z after gates are green.
Sign in to join this conversation.
No reviewers
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!822
No description provided.