Files
aji/docs/plan/standard-library.md
dev ad75ffe021
ci / build (ubuntu-latest) (push) Successful in 4m52s
ci / extended (push) Failing after 3h0m2s
ci / build (macos-latest) (push) Canceled after 0s
docs: adopt intermediate standard library foundation
Record the owner-requested STD-0..7 merge boundary and adoption of implemented
RFCs 0016-0035, whose normative rules and vertical implementations land together.
Update repository and std status; keep remaining Std 0.1 and service milestones
in the backlog. Track Q-034/P6-11 as the next source-language task and retain
the existing P7/P8 gate.

Implementation checks are recorded in RFC 0035 and the std plan; this change
updates adoption metadata and planning only.
2026-10-07 13:42:50 +03:00

33 KiB
Raw Permalink Blame History

Standard library implementation plan

Non-normative. Started on feat/std-bootstrap, 2026-10-06, at the owner's request. Normative contracts live in spec 16 and the relevant source/runtime specifications. The owner requested an intermediate STD-0..7 merge on 2026-10-07 and a return to source-language work; remaining std work stays in the backlog. P7/P8 remain on hold for B1 analysis. B1 frozen inputs and private held-out tasks do not guide API design and MUST NOT be inspected or changed by this work.

Target and design constraints

Without external source dependencies, Aji should support ordinary CLI tools, storage components, network services and structured concurrent programs. The mandatory semantic surface stays small.

  • Prefer safe .aji over new AIR opcodes or opaque runtime implementations.
  • One canonical API for a common operation; effects, borrows, moves, failure and allocation budgets remain visible.
  • Caller-provided slices first; owning/growing buffers request cap<mem.alloc> and expose failure and explicit consumption.
  • Separate features (implementation support), effects (behavior) and capabilities (authority). Importing a module grants none.
  • Avoid a broad trait hierarchy. Begin with concrete adapters; add abstractions only when they reduce contracts and repair work.
  • Library functions use the existing verifier. A trusted crypto/TLS boundary is a separate audited dependency with a deterministic-profile model. Do not implement homemade cryptography.
  • Runtime capabilities and primitive coverage must be specified through every layer before a wrapper promises them. No implicit cleanup, detached tasks, reflection or ambient environment access.

Current prerequisites

Capability Current state Consequence
Scalars, structs/enums, slices/arrays, explicit borrows implemented pure fixed-storage algorithms can start now
Heap/regions, I/O, files, TCP, clock/random, structured tasks/channels/mutex implemented primitives wrappers can reuse them, but their presence does not imply the complete APIs below
Built-in standard imports and enum types STD-0/1a/2a/2b implementation compiler-pinned, closed registry; nineteen modules; qualified enum types/constructors/patterns; no package lookup
General modules/imported struct literals STD-3 implementation (P6-3; RFC Implemented) explicit manifest mapping, direct qualified names, ordinary verifier
User generics/structural constraints STD-4 implementation (P6-4; RFC Implemented) needed for reusable Vec<T>, HashMap<K,V>, option/result
linear_aggregates STD-5 implementation (RFC Implemented) whole-value owning structs/enums/fixed arrays; initialized buffer/std.vec implemented by STD-6a/b
Extended filesystem, IPv6/DNS, args/env, TLS/crypto not promised by current runtime audit each primitive, authority, error and profile model before implementation

A Vec<u64> prototype is not completion of Vec<T>. The collection gate requires valid and rejected examples for Vec<File>, HashMap<Key, Own<Value>> and Vec<sender<Job>>, plus cleanup and failure paths. No linked list is planned.

Milestones

Milestone Deliverable Exit criterion
Bootstrap std.math, std.bytes, compiler-pinned import, normative API, source tests and bundle entry all functions lower to existing AIR, verify and run; bad calls/aliases reject; import order does not affect canonical AIR; no hidden allocations or authority
Intermediate foundation — STD-0..7 nineteen pinned modules, explicit owning collections, bytes/text/formatting/encodings, bounded and buffered I/O, lexical paths module contracts, failure/ownership, GC/schedule and source/AIR/profile/package gates pass; adopted for continuing language development
Std 0.1 — system utilities core bytes/math/mem/slice/hash, option/result, buffer and owning collections, UTF-8/fmt, hex/base64, small I/O/fs/path/time/random/log APIs a CLI and bounded storage utility written in .aji use only std, explicit grants, documented failure/cleanup and deterministic fixture tests
Integration gate public, independently chosen 5–10k LOC application ownership, cancellation, bounded memory and error cleanup work together; API/documentation costs recorded; defects become general repairs
Std 0.2 — network services TCP, IPv4/IPv6, DNS, task/channel helpers, JSON DOM, URI, bounded HTTP/1.1 a local concurrent JSON/HTTP service passes deterministic fixtures and hosted smoke tests without external source packages
Std 0.3 — internet services audited secure random, SHA-256/SHA-512/HMAC/constant-time compare, TLS client/server, complete HTTP client/server and buffered I/O verified caller contracts, audited trusted boundary, certificate validation, explicit network authority, bounded buffers and deterministic failure fixtures

CLI args/env move before the Std 0.1 exit, rather than waiting for Std 0.3: they are required by the CLI target. Their capabilities and startup contracts need a vertical feature. Secure entropy is distinct from deterministic test randomness. Typed JSON schema generation waits for an independently justified compile-time facility; the DOM comes first.

SQL/database clients, Redis/Kafka, ORMs, application authentication, gRPC/protobuf, GUI, templating, regex and broad compression suites remain package-ecosystem work. TLS may initially depend on a vetted host crypto library; “no external source dependencies for callers” does not mean “no trusted native dependency.”

Tasks

ID Status Work Depends Done when
STD-0 done (RFC Implemented) bootstrap spec, source std, closed imports, conformance, documentation and complexity measurement existing source frontend bootstrap exit criterion above and required repository checks pass
STD-1a done (RFC Implemented) endian u16/u32/u64 and qualified standard enum results STD-0 recoverable short-input/output failure, no partial mutation; all short lengths, empty/maximal values, fixtures and rejected alias examples pass
STD-1b done (RFC Implemented) bounded copy/search, split composition and recoverable arithmetic for u64/usize STD-1a contracts define capacity/overflow failure, no partial mutation, empty inputs and aliasing; independent fixtures pass
STD-2a done (RFC Implemented) UTF-8 next/validate and supplied-buffer hex/base64 STD-1a/1b malformed text and insufficient capacity are explicit, output unchanged on returned errors; independent vectors and boundary cases pass
STD-2b done (RFC Implemented) decimal u64/i64/usize/isize formatting into supplied buffers STD-2a minimal explicit format contract, no implicit heap, capacity/empty/maximal scalar tests and caller example
STD-3 done (RFC Implemented) general modules and imported type names (P6-3) STD-0 deterministic resolution, collisions/cycles and diagnostics specified and covered
STD-4 done (RFC Implemented) source generics (P6-4), constraints and option/result STD-3 deterministic specialization and rejected constraint examples; source/AIR budgets measured
STD-5 done (RFC Implemented) independent whole-value linear_aggregates RFC and vertical implementation phase STD-3/4 for its source surface spec → AIR → verifier → interpreter → source/lowering → Quick Reference → AIR/source tests; linear elements consumed on every path
STD-6a done (RFC 0024 Implemented) dynamic initialized buffer storage/drain contract (Q-036) STD-4/5 vertical allocate/grow/push/pop/view/free; allocation failures preserve state, returned owners consumed; no hidden destruction
STD-6b done (RFC 0024 Implemented) safe std.vec for Copy/owners/files/channel endpoints STD-6a explicit reserve, bounded push, moving pop/replace, empty-only free; deterministic and failure/cleanup tests
STD-6c done (RFC 0025 Implemented) safe std.deque for Copy/owners/files/endpoints STD-6a/b bounded ring, both ends, failure-preserving explicit growth, complete resource transfer and empty-only free
STD-6d done (RFCs Implemented) HashMap, HashSet, BinaryHeap STD-6a/b/c safe collection contracts, including HashMap<Key, Own>, recoverable failures and explicit draining
STD-6d.1 done (RFC 0026 Implemented) pure std.hash: FNV-1a 64 / CRC32C, fresh/extend STD-1b four safe functions, exact byte/chunk conventions, independent public vectors and CLI/profile checks
STD-6d.2a done (RFC 0027 Implemented) pure built-in error construction prerequisite STD-6d.1 vertical error_values feature, no authority/effect/resource changes; preflight allocation validation
STD-6d.2 done (numeric-key implementation; RFC 0028 Implemented) U64Map first; general HashMap<K,V> key policy Q-037 STD-6d.1 safe map with ownership/failure/collision tests and error_values prerequisite (RFC 0027); general-key gate resolved by STD-6d.4/5
STD-6d.3 done (RFC 0029 Implemented) explicit static hash/equality/order functions STD-4 exact callable contracts, ordinary AIR calls/workers and nominal operation identity; general collections remain required
STD-6d.4 done (RFC 0030 Implemented) general owning HashMap<K,V,H,E> STD-6d.3 dense complete entries, Copy probe indices, exact equality and returned key/value ownership
STD-6d.5 done (RFC 0031 Implemented) general owning HashSet<K,H,E> STD-6d.4 exact membership, duplicate/full input ownership, moving extraction and empty-only free
STD-6d.6 done (RFC 0032 Implemented) owning BinaryHeap<T,B> STD-6a/6d.3 explicit pure order, complete resource extraction, bounded push, failure-preserving growth
STD-7 done (intermediate foundation) concrete I/O adapters, buffered I/O and lexical paths STD-1b/2a/2b; STD-3 for public types short reads, EOF, capacity and write failures covered; paths never grant filesystem authority
STD-7a done (RFC 0033 Implemented) exact/bounded reads and limited file copies STD-1b/3 explicit progress/EOF/error, borrowed resources, caller slices and exact effects
STD-7b done (RFC 0034 Implemented) owning buffered concrete file reader/writer STD-6a/7a failure ownership, refill/flush, explicit finish/discard and no hidden cleanup
STD-7c done (RFC 0035 Implemented) caller-buffer lexical paths STD-1b/2a pure normalization/join/components with no filesystem authority
STD-8 todo filesystem gaps, args/env capability RFC, time/random distinctions and structured log STD-3/7; vertical runtime feature where needed CLI/storage milestone examples work in deterministic and hosted profiles; all authority is granted at entry
STD-9 todo independent integration application and API review STD-6/7/8 integration gate; public application is not private benchmark material
STD-10 todo IPv4/IPv6/TCP/DNS contracts and runtime gaps; task/channel helpers STD-9 bounded service fixtures, deterministic scheduling and schedule stress pass
STD-11 todo JSON DOM, URI and bounded HTTP/1.1 STD-6/10 depth/size/header/body limits, malformed-input errors, streaming/EOF and cleanup tests
STD-12 todo vetted crypto backend and TLS vertical RFC STD-10/11 explicit trusted dependency, certificate/trust/entropy inputs, audit and deterministic model
STD-13 todo HTTP client/server integration and Std 0.3 review STD-12 internet-service exit criterion

Each task can be split into reviewable increments; only executable exit criteria mark it done. The intermediate foundation is complete; the remaining system and service milestones are backlog work. P7 is reconsidered after B1 analysis and the integration gate; this plan does not unilaterally reopen it.

API review and Model Capability Compression

For each increment record public signatures, conceptual additions, syntax forms, diagnostics, required verifier state, allocations/budgets and cleanup obligations. Run zig build agent-reference and tools/agent_bundle_tokens.py --source; report Quick Reference and Source Reference Bundle growth by group. Library reference pages are read on demand.

Use general public use cases and fixtures to measure documentation read, output size, verifier failures, repair cycles and ownership visibility. Performance and allocations also matter, but an API with five overlapping forms needs evidence. No language/API design decision is made from tasks M/C or the private corpus, and no compression benefit is claimed before measurement.

Bootstrap verification

Required: zig build, zig build test, zig build conformance, zig fmt --check build.zig build.zig.zon src tools tests/extended, python3 tools/source_coverage.py, and zig build agent-reference. Because imported code reaches the ordinary CLI, also run python3 tests/hosted/smoke.py. Run tests use fuel, never wall-clock termination.

The bootstrap does not add ownership or concurrency semantics. Preserved invariant: shared slices only read, exclusive slices only write, no borrow escapes or resource is consumed. Existing borrow/bounds transfer functions and interpreter rules apply; valid and rejected source fixtures exercise that boundary. Existing E7001, E7002, E7005, E7006, E2101, T0002 suffice. AIR format 0 remains unchanged and existing programs without imports lower identically.

Bootstrap result: nine APIs implemented; full conformance, unit/Quick Reference, formatting and source coverage checks pass. Hosted file/stdin/TCP smoke tests and evaluation harness self-tests pass (22 tests; one environment-dependent skip). The documented example returns 42 with no grants; invalid clamp bounds report std/math.aji:20. RFC 0016 remains Proposed for owner review. Token growth (cl100k): Quick Reference +4.8%; source bundle excluding AIR +6.6%; AIR unchanged.

STD-1a verification

Twelve additional endian functions and four ordinary Copy enums lower to existing AIR. The invariant remains: no access outside the supplied slice, no escaping borrow, no hidden allocation, and no mutation on insufficient output capacity. The capacity branch precedes every access. Existing verifier/interpreter rules and diagnostics apply; valid/rejected source examples and hand-written AIR fixtures exercise payload typing and read behavior. AIR format 0 is unchanged. Qualified standard enum names implement only a closed-registry subset of STD-3; user modules, imported struct literals, dependencies and generics remain open.

Run the same required checks as bootstrap. Endian fixtures include independent LE/BE byte vectors, every short length, zero/maximal values, every bit, nonzero offsets, extra input/output bytes, returned enum records, compound types, name collisions, exhaustive matches and forbidden mutable aliasing. RFC 0017 records final checks and complexity measurements.

STD-1b verification

Eight further pure functions reuse existing primitives: std.bytes.copy and find_slice, plus checked add/sub/mul for u64 and usize. Copy reuses WriteResult; three additional ordinary Copy enums represent substring matches and arithmetic results. Wrapping remains an operator. Splitting composes a search with explicit caller-bounded slice operations; no borrowed aggregate, iterator, cursor, compiler/runtime change or hidden allocation is added.

The preserved invariant is shared-read/exclusive-write access only within the supplied slices, no escaping borrows and no mutation on short output. Existing verifier/call/alias/enum rules and interpreter behavior suffice. Valid/rejected source fixtures and hand-written AIR twins cover the contracts; current diagnostics and AIR format 0 are unchanged. Tests include all 81 input/output length pairs through eight, disjoint split borrows, overlapping and empty short-output aliases, 428 search cases, seven split cases and 320 independently computed arithmetic operand pairs exercised through both widths. The interpreter's numeric vectors use its default air64; library usize limits are computed with target-width wrapping subtraction. RFC 0018 records the final repository checks and complexity measurements. STD-2 can now start with UTF-8 and supplied-buffer encodings.

STD-2a verification

Six functions and six ordinary result enums add UTF-8 next/validate and supplied-buffer hex/Base64 to the closed registry. UTF-8 returns a scalar plus consumed bytes; caller offsets carry iteration state. Hex accepts both ASCII letter cases and emits lowercase; Base64 accepts canonical padded standard text with zero unused bits. Decode validates all input before capacity/mutation, so malformed input wins over insufficient output and every returned error preserves the destination. Size guards avoid intermediate overflow.

All algorithms are safe source using existing verifier/runtime rules, fixed frame storage and explicit slice borrows. No borrow escapes, owner/resource is consumed, heap allocation is hidden, AIR meaning changes or authority is granted. Valid/rejected examples, stable existing diagnostics, deterministic interpreter tests and compatibility are specified in spec 16 §2.5–§2.7 and RFC 0019. The registry embeds three additional modules without a resolver or dependency extension. Tests cover independent Python scalar/byte vectors, UTF-8 boundaries/truncation/surrogates, all input byte values, canonical pad bits, every relevant capacity, late invalid bytes, output suffixes, disjoint same-allocation buffers, namespace collisions and hand-written AIR equivalence. Formatting remains STD-2b; this increment does not mark the original whole text/formatting task complete.

STD-2b verification

Four safe decimal writers and one ordinary result enum complete the supplied-buffer formatting increment. No heap, retained cursor, format-string language, runtime primitive or syntax is added. Counts include a negative sign, suffixes remain unchanged and insufficient capacity preserves the complete destination. Counting precedes mutation; signed magnitude uses -(value + 1) then an unsigned increment, avoiding signed-minimum negation. Explicit caller offsets and std.bytes.copy compose a record; failure preserves the individual call's destination, not earlier successful calls.

Spec 16 §2.8 and RFC 0020 specify the invariant, existing verifier/runtime rules, valid/rejected examples, diagnostic impact, deterministic execution and unchanged AIR format 0. Independent Python decimal vectors exercise zero, all small values, decimal/binary transitions, seeded scalar inputs, both 64-bit limits and every capacity from zero through 22, checking all guard/suffix bytes. Target-width fixtures guard conversions against the target limits; the current interpreter executes at air64. Source/AIR result equivalence, explicit record composition, disjoint borrows, qualified types/collisions and rejection of conflicting borrows (including short output), missing imports, invalid payloads/types and incomplete matches cover the public boundary. RFC 0020 records required checks and source/AIR documentation budgets. Next semantic prerequisites for owning buffers and containers remain STD-3/4/5; a decimal writer does not complete general formatting or owning strings.

STD-3 verification

P6-3 now links explicit package sources through the same frontend as compiler-pinned std. Manifest mappings supply source bytes; pure linking checks an acyclic graph, module identity and direct-import visibility, then emits collision-free deterministic AIR. Imported functions, structs, enums and qualified task workers use existing ownership, lifetime, effect and scheduler rules. Check/lower/report instantiate no grants; run/explore use explicit manifest grants and overrides. Package sources have portable bounded paths, no symlink traversal and a 64 MiB aggregate source budget; file-only commands never discover manifests.

RFC 0021 records invariants, diagnostics, compatibility, complete validation and documentation growth. General modules and imported struct literals are implemented on this branch; dependencies and external package resolution are separate work. The next semantic step is STD-4/P6-4 generics and structural constraints, followed by the independent linear-aggregate gate. Owning collections still require both gates.

STD-4 verification

Explicit function/struct/enum generics specialize deterministically to ordinary AIR. Structural Copy/Send/Share/Freeze/Local constraints, header checking, nominal identity, direct-import visibility and fixed expansion limits are specified by spec 15 §15 and RFC 0022. Every concrete specialization passes ordinary ownership/effect/task verification; unused bodies make no validity promise for future types. The compiler registry adds safe Copy-only std.option/std.result with classification helpers. No allocation, implicit cleanup, AIR opcode or authority is added.

The finite-layout E1003 check now traverses arrays, repairing a prior verifier gap with source/AIR fixtures. Existing source from-returns remain unimplemented and are logged as Q-034 rather than given an invented lifetime/binding contract. RFC 0022 records complete validation and source/AIR budget measurements. Next is STD-5: the independent linear_aggregates vertical feature, required before containers or option/result can own resources. P6-4's generic/structural specialization task is implemented on this branch; this does not complete Phase 6.

STD-5 verification

RFC 0023 and spec 03 §25 implement whole-value linear structs/enums/fixed arrays vertically. Construction consumes nested owners; complete unpack, exhaustive match move, explicit exchange and own.pack failure preserve ownership on every normal path. Standard option/result accept owning payloads; observational classification helpers keep Copy constraints. Existing availability, alias/task-loan, Send/Share, budget and scheduler rules apply without per-field holes or hidden cleanup. No new diagnostic/effect/capability is introduced.

Source/AIR tests cover nested ownership, allocation success/failure, repeated exchange with a one-owner budget, enum replacement, borrowed fixed arrays, channels, tasks, mutexes, regions, atomics and rejected copies/leaks/aliases/recursive ownership. The interpreter preserves borrowed SSA identity across whole replacement and collection; individual own<array<T,N>> is distinguished from a repeated own_array allocation. RFC 0023 records final checks and documentation budgets. STD-6 starts with Q-036: dynamic storage, initialized length and explicit drain must be specified before growing resource collections. STD-5 does not complete Vec or Std 0.1.

STD-6a/b/c verification

Initialized buffer and safe Vec/Deque use existing ownership/borrow/task rules and deterministic allocation budgets. Deque is ordinary library source: Option represents vacancy, both ends exchange complete elements, and explicit growth rotates a ring only after allocation succeeds. Nonempty free returns the queue, so no library action closes user resources. Slot charges include Option's enum tag. Ordinary visible representation fields have a documented invariant, with no unsafe bypass.

RFC 0024 records storage/Vec validation. RFC 0025 records the deque API/budget measurements and validation: independent Python deque traces, all small head/length combinations under growth, wrapped owners, files/senders/workers, failure/cleanup and borrow/constraint rejections. Maps/sets/heaps are STD-6d; this increment does not complete Std 0.1.

Hash foundation and next map contract

STD-6d.1/RFC 0026 adds safe std.hash with four byte-only fresh/continuation operations, no new semantics or heap authority. FNV/CRC constants and public vectors are independently verified; hashes never replace key equality. The map design specifies numeric-key U64Map, bounded insert, returned replacement/full ownership, tombstone lookup, moving removal/drain and explicit peak-charged rehash. STD-6d.2/RFC 0028 implements safe std.map.U64Map with ten operations, using explicit error construction (RFC 0027) for preflight validation. Independent dictionary traces, collision/tombstone/wrap cases, exact peak/refund accounting, owning/files/sender/task tests and rejected leaks/aliases/Copy uses cover the contract. Q-037 is now resolved by STD-6d.4/5; general HashMap<Key, Own>/HashSet and BinaryHeap validation are recorded below.

General operation-selection prerequisite

STD-6d.3/RFC 0029 implements explicitly bound static functions with exact typed/effect contracts, forwarding, generic function arguments, nominal operation identity and named workers. It reuses ordinary AIR and preserves direct-import visibility, capability inputs, ownership and task loans. Source/AIR positives/rejections, recursive/cyclic contracts, GC/scheduler stress, CLI/profile/provenance checks and documentation budgets are recorded in the RFC. General HashMap/HashSet storage/API subsequently resolves Q-037, and BinaryHeap completes STD-6d; STD-7 remains required.

General owning set verification

STD-6d.5/RFC 0031 implements safe HashSet<K,H,E> over the general map, with nine explicit operations. Duplicate insertion preserves every stored entry/bucket and returns the exact incoming key, including its resources; full does likewise for new keys. Remove/pop transfer complete stored keys, and nonempty free returns the whole set. Allocation, failure rollback, peak/refund accounting and dense pop order follow the map. No new language syntax, verifier/runtime state, diagnostic, AIR feature or trusted boundary is added.

All 973 conformance cases pass, including 26 set cases. Runtime fixtures pass collection before every instruction; the shared lookup fixture passes 12 seeds under quanta 1, 2, 7 and its own quantum. Independent Python set/representative oracles cover 80 operations across Copy/owning traces and check membership after each operation. Byte-buffer/file keys, exact duplicate-table preservation, returned owners, allocation failure/refunds/peaks and rejected leaks/moves/aliases/loans/policies/non-Share contents are covered. Unit/Quick Reference, formatting, hosted smoke, 53 CLI/profile/package/source/AIR checks, 106/106 source coverage constructs and bundle generation pass. RFC 0031 records documentation growth. The separate general-map full GC/stress process subsequently completed with all 33 cases passing. BinaryHeap validation follows below; STD-7 I/O/path is next.

Owning binary heap verification

STD-6d.6/RFC 0032 implements eight safe std.heap operations with an exact explicit pure ordering function. Copy-index sifting preserves complete owners in dense initialized storage; moving pop repairs dense holes. Full push returns its input without callbacks, nonempty free returns the heap, and explicit reserve preserves values/layout/extraction order on every returned allocation failure. No new source/AIR semantics, diagnostics, verifier/runtime state or trusted boundary are added.

All 1007 conformance cases pass, including 34 heap fixtures. Heap runtime fixtures pass collection before every instruction; shared lookup, sender ownership transfer and restored task loans run 12 schedule seeds under quanta 1, 2, 7 and their own quantum. Independent heapq traces cover 160 operations over min/Copy and max/owning records, plus all 120 permutations of five values. Direct owners, owning byte buffers, files, sender endpoints, duplicates, empty/full/overflow, exact layout preservation under both reserve-failure phases, peaks/refunds/cross-authority accounting and rejected leaks/Copy/aliases/loans/policy/effects are covered. Unit/Quick Reference, formatting, hosted smoke, 70 CLI/source/AIR/package/profile/provenance checks, 109/109 source coverage constructs and bundle generation pass. RFC 0032 records documentation growth.

The long general-map GC/stress process also completed with 33/33; Q-037 and the collection gate STD-6d are resolved on this branch. I/O and lexical paths are STD-7; filesystem gaps, args/env and logs remain STD-8. This does not complete Std 0.1 or reopen the native backend phase.

Bounded I/O foundation verification

STD-7a/RFC 0033 implements six safe std.io compositions with concrete io.read/fs.read/net.read/fs.write effects, borrowed resources and caller-supplied slices. Exact reads distinguish completed data, EOF and read errors. Bounded read-to-end/copy stop at capacity/limit without consuming an extra byte to probe EOF. Copy errors distinguish confirmed reads from confirmed writes; external partial writes have no rollback promise. No heap, retained borrow, open/close, task/timeout, new syntax/AIR semantics, verifier state or diagnostic is added.

All 1027 conformance cases pass, including 20 I/O cases. All runtime I/O fixtures pass collection before every instruction; fragmented TCP and restored task loans run 12 schedule seeds under quanta 1, 2, 7 and their own quantum. An independent Python prefix oracle covers 162 exact/bounded reads and 250 copy/append combinations, validating bytes, guards, counts, source cursor tails, limits and empty scratch. Hosted tests produce a real read error and partial external file write: four bytes consumed, two confirmed written, three actually present. Unit/Quick Reference, formatting, hosted smoke, 55 CLI/source/AIR/package/import-order/profile/provenance checks, 111/111 source coverage constructs and bundle generation pass. RFC 0033 records documentation growth. Owning buffered adapters STD-7b and lexical paths STD-7c remain required; STD-7 and Std 0.1 are unfinished.

Owning buffered file verification

STD-7b/RFC 0034 implements safe std.io.reader/std.io.writer, each owning a file and a fixed-capacity initialized byte buffer. Only new allocates with explicit authority and failure returns the original file. Reads distinguish cached data/refill/EOF and finish returns unread readers. Writer errors preserve pending bytes and the first error, forbid further writes/retries, and return the whole failed writer from finish. Explicit discard reports abandoned cached/pending bytes, frees storage and returns the file. No file open/close/sync, hidden growth/cleanup or new syntax/AIR/runtime/verifier state is added.

All 1061 conformance cases pass, including 34 buffered adapter fixtures. Every buffered fixture passes collection before every instruction; worker transfer and restored loans run 12 seeds under quanta 1, 2, 7 and their own quantum. Independent byte oracles cover 48 read streams, 64 exact prefixes and 96 segmented writes. On Linux, 89 CLI/source/AIR/package/profile/provenance checks include a real read fault and four external partial-write cases; raising the child's file quota after failure proves the writer still performs no retry and preserves pending bytes/error. Unit/Quick Reference, formatting, hosted smoke, 115/115 source coverage constructs and reference generation pass. RFC 0034 records documentation growth. Lexical paths STD-7c, system gaps STD-8 and the Std 0.1 exit examples remain required; the full std roadmap is unfinished.

Caller-buffer lexical path verification

STD-7c/RFC 0035 implements six pure std.path operations: raw component queries return bounded Copy ranges; normalize/join write into caller-provided storage with no heap or authority. NUL/size/capacity errors preserve the entire output. Reverse measurement/emission retains relative unmatched parents, drops parents above root, and needs only the final normalized capacity. Filesystem operations still enforce their independent path/grant rules.

All 1079 conformance cases pass, including 18 path fixtures. All path runtime fixtures pass collection before every instruction; shared reads and restored output loans pass 12 seeds under quanta 1, 2, 7 and their own quantum. An independent Python forward-stack oracle covers 132 paths with raw queries/idempotence and every short/exact/extra capacity, 49 joins and four malformed pairs; separate fixtures cover all 255 non-NUL bytes, disjoint slices, one-byte canceled results, late malformed input, guards/suffixes and T0008 for reused ranges. The model uses bounded batches with separate literal frames, preserving all vectors and capacities. Linux CLI/source/AIR/package/profile/provenance/audit/authority checks pass (68); all fourteen preceding std/source CLI suites pass again. Unit/Quick Reference, formatting, hosted smoke, 117/117 source construct coverage and reference generation pass. RFC 0035 records documentation growth. STD-7 and the intermediate foundation are complete; STD-8, the full Std 0.1 exit and later service milestones remain unfinished.

Intermediate adoption (owner decision, 2026-10-07)

The owner requested a sufficient intermediate std stage, integration of the work branch and resumption of language development. STD-0 through STD-7 provide nineteen compiler-pinned safe source modules: math/bytes/hash, UTF-8/hex/Base64/formatting, option/result, Vec/Deque/U64Map/general HashMap/HashSet/BinaryHeap, bounded std.io, owning buffered file adapters and lexical paths. The branch also supplies explicit modules/generics, whole-value linear aggregates/initialized buffers, pure error values and exact static callable contracts, through source/AIR/verifier/interpreter and tests where applicable. RFCs 0016–0035 are adopted and implemented; their rules are integrated into spec/reference in the same merged change.

This intermediate gate is sufficient to resume language work. It does not mark Std 0.1 complete: filesystem gaps, args/env, time/random wrappers, structured logs and CLI/storage exit examples remain STD-8; the public 5–10k LOC integration gate and network/JSON/HTTP/TLS milestones remain in the backlog. Frozen evaluation inputs and the private held-out corpus are untouched. Next source-language work is Q-034/P6-11 (explicit borrowed-return calls/bindings); P7/P8 retain their existing gate.