cli: add caller-buffer lexical path APIs

Add pure std.path queries and failure-preserving normalization/join using
safe reverse measurement/emission and caller-provided output storage.
Component queries return explicit Copy ranges; filesystem authority is
checked independently. Complete the STD-7 implementation gate.

Validation: 1079 conformance cases, 18 path cases with per-step collection
and 12-seed schedule stress, independent 132-path/49-join capacity oracle,
68 CLI checks, fourteen previous source/std CLI suites, unit/Quick Reference,
formatting, hosted smoke, 117/117 source coverage and reference budgets.
This commit is contained in:
dev committed 2026-10-07 13:41:45 +03:00
1 parent 8d8bef8f3e
commit 8edec5b831
35 files changed
+1189 -8

No files matched your search

+2
View File
@@ -129,3 +129,5 @@ RFC 0032 owning BinaryHeap (cl100k, relative to HashSet): Quick Reference 8,201
RFC 0033 bounded I/O (cl100k, relative to BinaryHeap): Quick Reference 8,284 → 8,350 (+0.8%), other source docs 56,770 → 58,473 (+3.0%), full source excluding AIR 65,054 → 66,823 (+2.7%). library/std.md is 21,614 tokens; AIR remains 179,282 bytes / 51 sections. Six safe concrete compositions retain exact effects and caller resource loans, distinguishing EOF/limits from partial failure. No new syntax, diagnostic or verifier/runtime state; cumulative source growth is +96.6%, justified by progress/authority/cleanup contracts without an empirical MCC claim.
RFC 0034 owning buffered files (cl100k, relative to bounded I/O): Quick Reference 8,350 → 8,445 (+1.1%), other source docs 58,473 → 61,223 (+4.7%), full source excluding AIR 66,823 → 69,668 (+4.3%). library/std.md is 24,364 tokens; AIR remains 179,282 bytes / 51 sections. Ten safe concrete operations keep fixed allocation, file transfer, prefetch and first-error/partial-write cleanup visible. No new syntax, diagnostic or verifier/runtime state; cumulative source growth is +105.0%, justified by these contracts without an empirical MCC claim. Full representation/API details stay on demand; front-door consolidation remains separate work.
RFC 0035 caller-buffer paths (cl100k, relative to buffered files): Quick Reference 8,445 → 8,518 (+0.9%), other source docs 61,223 → 63,296 (+3.4%), full source excluding AIR 69,668 → 71,814 (+3.1%). library/std.md is 26,437 tokens; AIR remains 179,282 bytes / 51 sections. Six pure operations return raw Copy ranges or write a measured canonical prefix, keeping lifetime, byte syntax, capacity failure and authority visible. No new syntax, diagnostic or verifier/runtime state; cumulative source growth is +111.3%, justified by these contracts without an empirical MCC claim. API details stay on demand; front-door consolidation remains separate work.
+2
View File
@@ -373,6 +373,8 @@ The usual enum rules apply: missing arm `E7004`, wrong enum/payload `E7005`, unk
`std.io.reader`/`std.io.writer` own a file and an explicitly allocated fixed byte buffer. Use new, read/read_exact or write/flush, then finish to return the file for explicit close. Unread/failed finish returns the whole adapter; discard explicitly abandons buffered bytes and frees storage. A failed writer preserves its first error and never retries. Capacity zero uses direct I/O. Effects and ownership remain explicit; see `/docs/library/std.md`.
`std.path` provides pure slash-based is_absolute/basename/parent/extension and supplied-buffer normalize/join. Queries return Copy Range{start,end}; explicitly borrow that range from the original path. Writers preserve output on error and return the successful prefix size, with no heap or filesystem authority. Dot/parent and root rules are in `/docs/library/std.md`.
`std.hash.fnv1a64` and `crc32c` hash byte slices without allocation; their `_extend` forms continue from a previous result. Hashes do not establish key equality or authentication. Exact algorithms and chunk/byte-order conventions are in `/docs/library/std.md`.
## 11. Package modules