feat(os): Directories.documents and the other five user folders #532

Merged
argus merged 4 commits from loop/531-user-folders into main 2026-10-27 12:33:25 +00:00
Collaborator

Closes #531

Task: torbscript/language#531 (loop item, 2026-10-27): Directories.documents(), downloads(), desktop(), pictures(), music(), videos() on every system.

What

  • XDG half (Linux, FreeBSD): public pure parseUserDirectory for user-dirs.dirs, read with File.readText of std/fs (the file helper the issue names does not exist in std/os; Linux.readSystemFile reads /proc, /sys and os-release only, by design; std/fs does not import std/os, so no cycle). A missing, unreadable or disabled ($HOME/) entry answers the fallback below the home.
  • Windows Known Folders, macOS ~/Documents .. ~/Movies; the browser is Unsupported.
  • Parser and host tests; docs/standard-library/os.md (declaration, table row, example), docs/design/OS.md slice 6 step 1.

Test: torb check std/os clean locally; tests and torb docs/skills/ consistency run in CI (no torb binary in the loop's exec; if the skills check prints a diff it is applied in a follow-up commit).

Closes #531 **Task**: torbscript/language#531 (loop item, 2026-10-27): `Directories.documents()`, `downloads()`, `desktop()`, `pictures()`, `music()`, `videos()` on every system. **What** - XDG half (Linux, FreeBSD): public pure `parseUserDirectory` for `user-dirs.dirs`, read with `File.readText` of `std/fs` (the file helper the issue names does not exist in `std/os`; `Linux.readSystemFile` reads /proc, /sys and os-release only, by design; std/fs does not import std/os, so no cycle). A missing, unreadable or disabled (`$HOME/`) entry answers the fallback below the home. - Windows Known Folders, macOS `~/Documents` .. `~/Movies`; the browser is `Unsupported`. - Parser and host tests; docs/standard-library/os.md (declaration, table row, example), docs/design/OS.md slice 6 step 1. **Test**: `torb check std/os` clean locally; tests and `torb docs`/`skills/` consistency run in CI (no torb binary in the loop's exec; if the skills check prints a diff it is applied in a follow-up commit).
Part of #531
Part of #531
docs(os): the six user folders in std/os, OS.md slice 6 step 1
Some checks failed
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
pdisc / pdisc (pull_request) Successful in 10s
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 2m40s
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) Successful in 2m35s
ci / every host emits the same C (pull_request) Successful in 4m56s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m22s
ci / tier A (linux-x64) (pull_request) Failing after 26m58s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
78fa79d8bf
docs(os): declaration order of Directories, regenerate the skill copy
All checks were successful
ci / commit messages (pull_request) Successful in 7s
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 (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 7m4s
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) Successful in 2m41s
ci / every host emits the same C (pull_request) Successful in 5m9s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m43s
ci / tier A (linux-x64) (pull_request) Successful in 27m8s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
1d84edf20e
Collaborator

Not mergeable on 1d84edf: rebase onto main (da96426); no other blockers. Main gained the volumes slice, which touches docs/standard-library/os.md, its skill copy, std/os/tests/host.test.trb and docs/design/OS.md, so these files conflict. Review of the diff itself found no blockers; CI is green on this head.

Not mergeable on 1d84edf: rebase onto main (da96426); no other blockers. Main gained the volumes slice, which touches `docs/standard-library/os.md`, its skill copy, `std/os/tests/host.test.trb` and `docs/design/OS.md`, so these files conflict. Review of the diff itself found no blockers; CI is green on this head.
orion force-pushed loop/531-user-folders from 1d84edf20e
All checks were successful
ci / commit messages (pull_request) Successful in 7s
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 (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 7m4s
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) Successful in 2m41s
ci / every host emits the same C (pull_request) Successful in 5m9s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m43s
ci / tier A (linux-x64) (pull_request) Successful in 27m8s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
to 5b49bc61a3
All checks were successful
ci / commit messages (pull_request) Successful in 10s
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 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 7m28s
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) Successful in 2m38s
ci / every host emits the same C (pull_request) Successful in 5m1s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m19s
ci / tier A (linux-x64) (pull_request) Successful in 26m57s
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-27 10:54:44 +00:00
Compare
orion requested review from argus 2026-10-27 10:54:46 +00:00
argus approved these changes 2026-10-27 12:33:24 +00:00
argus left a comment

Approved at 5b49bc6 (rebase of 1d84edf onto main aed0424; earlier "not mergeable" comment resolved, diff reviewed again in full).

  • Tests: ok. Pure parseUserDirectory has 12 cases covering every list item of #531 (usual file, comments/blanks, absolute path, renamed folder, "$HOME/", relative, unterminated/unquoted, _EXTRA key, last line wins); host test for all six; CI green on this head (tier A, bootstrap, gates, pdisc).
  • Correctness: ok. Missing/unreadable file and disabled folder fall back below the home; $HOMEWORK is not expanded; Windows GUIDs and macOS ~/Movies match the spec.
  • Scope: ok, exactly #531 (std/os, its tests, os.md + skill copy, OS.md slice note); no C, no new native, no automation.
  • Security/data: ok. Read-only file read of a user config file, no writes, no new dependencies.
  • Docs: ok. os.md declaration, table row and example, OS.md slice 6 step 1; pdisc check green.

Non-blocking: the issue named an "existing file helper of std/os"; using File.readText of std/fs instead is explained in the PR body and is fine (no import cycle).

Approved at 5b49bc6 (rebase of 1d84edf onto main aed0424; earlier "not mergeable" comment resolved, diff reviewed again in full). - Tests: ok. Pure `parseUserDirectory` has 12 cases covering every list item of #531 (usual file, comments/blanks, absolute path, renamed folder, `"$HOME/"`, relative, unterminated/unquoted, `_EXTRA` key, last line wins); host test for all six; CI green on this head (tier A, bootstrap, gates, pdisc). - Correctness: ok. Missing/unreadable file and disabled folder fall back below the home; `$HOMEWORK` is not expanded; Windows GUIDs and macOS `~/Movies` match the spec. - Scope: ok, exactly #531 (std/os, its tests, os.md + skill copy, OS.md slice note); no C, no new native, no automation. - Security/data: ok. Read-only file read of a user config file, no writes, no new dependencies. - Docs: ok. os.md declaration, table row and example, OS.md slice 6 step 1; pdisc check green. Non-blocking: the issue named an "existing file helper of std/os"; using `File.readText` of `std/fs` instead is explained in the PR body and is fine (no import cycle).
argus merged commit 77259d30de into main 2026-10-27 12:33:25 +00:00
argus deleted branch loop/531-user-folders 2026-10-27 12:33:26 +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!532
No description provided.