Skip to content

[P2] Implement a first owned bounded vector slice for everyday data processing #62

Description

@wsdt

Audit: 2026-09-05, commit 2b3b1ee24da2.
Classification: Documented language/standard-library gap; proposed bounded enhancement. Priority: P2.

Finding

docs/STANDARD-LIBRARY-V1.md marks std.collections missing. Existing fixed byte arrays, Bytes, and owned record/variant cleanup are useful but do not provide a general collection for values accumulated at runtime. This blocks ordinary agent results, parsed data, and application state before an HTTP or JSON layer can become convenient.

Relevant foundations include src/ast.rs, src/hir.rs, src/byte_ops.rs, src/cleanup_plan.rs, and the admitted ownership profiles in docs/COMPLETION-MATRIX.md. Do not infer that general collections already exist from the systems-language goal.

First implementation boundary

Specify an additive owned vector limited initially to Copy scalar element types, with an explicit maximum element/byte capacity. Include construction, length, fallible push, checked lookup, replacement, pop, and deterministic iteration. Use existing Option/Result conventions. Defer nested owned elements and public FFI layouts to separate tranches.

Define ownership and borrowing before syntax: one owner, no accidental Copy, no stale borrowed view across mutation/reallocation, atomic failure on allocation/capacity exhaustion, and one destruction path. Select an ordinary library or compiler-owned intrinsic boundary explicitly; do not hide unchecked Rust/C collection semantics behind an innocent library name.

Acceptance criteria

  • Parser, formatter, resolver, HIR, ownership verifier, graph, cleanup replay, interpreter, native, and Wasm agree on each admitted operation.
  • Empty/full/cap+1, invalid index, failed allocation, moved owner, outstanding borrow, and early-return cleanup have regressions.
  • Capacity arithmetic cannot overflow and failure does not partially mutate or leak the old collection.
  • Iteration order and serialization facts are deterministic.
  • One multi-file example accumulates and filters a variable number of scalar values.
  • The standard-library catalog, exact target/profile admission, and completion matrix reflect only the implemented subset.

Suggested sequencing: establish the collection semantics before expanding JSON into arbitrary owned trees. A bounded zero-allocation JSON token view can proceed independently.

Agent handoff

Recheck the working revision and existing issues first. Read AGENTS.md, the relevant completion-matrix row, and the owning versioned specifications. This proposed slice must preserve canonical source, independent replay, precise target admission, and separately granted authority. Place regressions in the existing owning harness. Execute the applicable quality gates and record what actually ran; unrun native, hosted, or device evidence must stay unpromoted.

Audit revision scope

Runtime observations in this ticket belong to commit 2b3b1ee. A final source-tree comparison against e1c5b56 was used to check for obvious superseding changes. That later snapshot was not rebuilt or exhaustively retested. Reproduce on the intended fixing revision before implementation.

Audit ID: SPX-AUDIT-20260905-14

Suggested scope: L. Dependencies: None required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions