fs: IoError.path becomes a Path (step 3 of #68) #680

Open
opened 2026-10-30 07:08:18 +00:00 by orion · 4 comments
Collaborator

Context

Step 3 of #68 (PATH slice 2): IoError.path becomes a Path. Steps 1 (#419), 2 (#547), 2b (#559) and 2c (#580, PR #583) are on main; the compiler already understands Path in IoError.path (step 1 taught the lowering both forms).

Source

Goal

Every construction and read site of IoError.path uses a Path: std/fs, std/io, std/process, compiler/ and tools/. The type of the field changes from String to Path; messages and describe output stay byte-identical.

Acceptance criteria

  • IoError.path is declared as Path; all IoError(...) construction sites (about 30 in std/fs, std/io, std/process, the compiler) pass a Path, and all read sites handle a Path.
  • The lowering that builds the IoError of a native from its path parameter yields the Path form (verify against what #419 landed before changing anything).
  • Tests in std/fs/tests cover the error path: the path of an IoError for a missing file reads back as the Path that was passed, and its text is unchanged.
  • docs/design/PATH.md status paragraph says step 3 is in; slice 2 stays open for step 4. Docs regenerated into skills/ as needed; tools/check-commits.sh clean; sh tools/gates.sh a green in forge CI.

Seed

Decide first, from CLAUDE.md "Seed and breaking changes": if the change needs a seed that does not exist yet (the field type changes in a form the published seed 4b3045d31334 cannot compile), do NOT land it in one go; push the teaching half as its own commit and report in the release comment what the seed refresh needs. If the published seed compiles both forms, one PR with one Conventional Commit (refactor(fs): IoError.path is a Path) is enough.

Dependencies

#68 steps 1 to 2c (all landed). Step 4 (list, absolutePath answer Path) follows this one.

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

## Context Step 3 of #68 (PATH slice 2): `IoError.path` becomes a `Path`. Steps 1 (#419), 2 (#547), 2b (#559) and 2c (#580, PR #583) are on `main`; the compiler already understands `Path` in `IoError.path` (step 1 taught the lowering both forms). ## Source - [PATH.md slice 2](https://git.torb.dev/torbscript/language/src/branch/main/docs/design/PATH.md#L665) - Epic #68, step 3. ## Goal Every construction and read site of `IoError.path` uses a `Path`: `std/fs`, `std/io`, `std/process`, `compiler/` and `tools/`. The type of the field changes from `String` to `Path`; messages and `describe` output stay byte-identical. ## Acceptance criteria - [ ] `IoError.path` is declared as `Path`; all `IoError(...)` construction sites (about 30 in `std/fs`, `std/io`, `std/process`, the compiler) pass a `Path`, and all read sites handle a `Path`. - [ ] The lowering that builds the `IoError` of a native from its `path` parameter yields the `Path` form (verify against what #419 landed before changing anything). - [ ] Tests in `std/fs/tests` cover the error path: the `path` of an `IoError` for a missing file reads back as the `Path` that was passed, and its text is unchanged. - [ ] `docs/design/PATH.md` status paragraph says step 3 is in; slice 2 stays open for step 4. Docs regenerated into `skills/` as needed; `tools/check-commits.sh` clean; `sh tools/gates.sh a` green in forge CI. ## Seed Decide first, from `CLAUDE.md` "Seed and breaking changes": if the change needs a seed that does not exist yet (the field type changes in a form the published seed `4b3045d31334` cannot compile), do NOT land it in one go; push the teaching half as its own commit and report in the release comment what the seed refresh needs. If the published seed compiles both forms, one PR with one Conventional Commit (`refactor(fs): IoError.path is a Path`) is enough. ## Dependencies #68 steps 1 to 2c (all landed). Step 4 (`list`, `absolutePath` answer `Path`) follows this one. Part of #68 (epic; do not close it).
Author
Collaborator

[loop:torbscript] ready: scoped from the epic; the seed question is the worker's first check.
next: ready
[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T13:00:00Z

[loop:torbscript] ready: scoped from the epic; the seed question is the worker's first check. next: ready [loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T13:00:00Z
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T13:00:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T13:00:00Z
Author
Collaborator

[loop:torbscript] release: worker finished. The teaching half is PR #681 (head 74e0d095, native fileReadAllText, CI green, argus requested). The migration (IoError.path: Path across std/fs, std/io, std/process and compiler, File.readAll as a wrapper over fileReadAllText with a private ReadFailure, PATH.md and fs.md) is done and checked locally (torb check clean, std/fs 41/41) but cannot be pushed until the seed knows the new native. Patches are kept on the loop host. Order: merge #681, run the seed workflow on main, then a worker rebases and pushes the migration.
next: waiting (merge of PR #681, then seed refresh)

[loop:torbscript] release: worker finished. The teaching half is PR #681 (head 74e0d095, native `fileReadAllText`, CI green, argus requested). The migration (`IoError.path: Path` across std/fs, std/io, std/process and compiler, `File.readAll` as a wrapper over `fileReadAllText` with a private `ReadFailure`, PATH.md and fs.md) is done and checked locally (torb check clean, std/fs 41/41) but cannot be pushed until the seed knows the new native. Patches are kept on the loop host. Order: merge #681, run the `seed` workflow on main, then a worker rebases and pushes the migration. next: waiting (merge of PR #681, then seed refresh)
Author
Collaborator

[loop:torbscript] wait: PR #681 merged. Next is the seed refresh (Actions, seed, run on main), which is the owner's step; the migration commit is pushed by a worker after it.
next: waiting (seed refresh by the owner)

[loop:torbscript] wait: PR #681 merged. Next is the seed refresh (Actions, `seed`, run on main), which is the owner's step; the migration commit is pushed by a worker after it. next: waiting (seed refresh by the owner)
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#680
No description provided.