Skip to content

[P2][hillclimb] Specify and implement a bounded immutable-record language milestone #85

Closed

Description

@AetherAI3

Outcome and current gap

Replace parallel scalar evidence arguments with reusable, explicitly typed immutable records, while keeping pure-helper admission and host governance intact. RFC 0066 explicitly marks records/enums/results as proposed. The shipped package compiler accepts scalar signatures only. Do not describe these data types as already executable.

First deliverable: executable design before syntax expansion

Submit a compact RFC amendment defining one minimal records-only milestone: declaration, construction, field access, exact function parameter/result types and strict host-input validation. Supply proposed executable IR shape, loader rules, VM semantics, canonical identity and positioned diagnostics. Reserve enums/results/exhaustive matching for separately scoped future issues; no placeholder runtime opcodes or permissive fallbacks.

Use nominal type identity bound to defining module, declaration name and canonical schema. Decide declaration/field order significance and make hashing explicit. Reject ambiguous duplicate names, unknown/extra/missing fields, implicit numeric coercion, bool-as-int, nonfinite numbers, recursive record graphs and mutation. Do not reinterpret the existing reasoning-signature record<Signature> as a general-purpose record.

Compatibility and resource contract

A new executable representation requires an explicitly named supported IR revision and loader/VM compatibility policy. Old loaders must reject the new revision cleanly; existing v0.1.0/v1 programs and canonical fixtures remain unchanged. Keep package/lock/Intent/build-evidence versions separate; change only the formats whose semantics change and document migration. If lowering to existing opcodes is proposed instead, prove full validation/evaluation/provenance equivalence and explain why no hidden value semantics are added.

Proposed initial fixed ceilings: at most 32 fields per declaration, nesting depth 8 and 4096 materialized field values per admitted frame/result. These are design targets, not existing guarantees. Count cumulatively before allocation and include a clear total-byte/string bound using existing scalar limits. Accepting different ceilings requires a documented reason and frozen boundary tests before implementation, not raising limits to rescue a failing candidate. Preserve existing stricter package budgets and acyclic pure functions.

Implementation slices and ownership

PR1: RFC, version matrix and executable/invalid golden fixtures. PR2: declarations/type checking/construction, strict IR loading and VM behavior for the approved small record subset. PR3 only if needed: source-map, docs and installed-package parity. One lane owns compiler/type/IR/VM record changes; package CLI remains a consumer of the existing build API and must not patch these internals concurrently.

Acceptance and negative controls

  • A non-trading evidence record is imported by two pure helpers; inline and imported equivalents have identical documented executable behavior and stable package provenance.

  • The host rejects wrong schemas, stale nominal IDs, hidden fields, numeric coercions and over-budget payloads before rules or helpers run.

  • Field mutation, recursive declarations/values, effect injection, captured host data and implicit series lifting fail with stable code/path/span.

  • Field access evaluates only a validated value; helper expression-substitution/evaluation semantics are specified and tested, including unused and repeated arguments.

  • Boundary and boundary-plus-one tests cover field/depth/byte/materialization budgets without uncaught RecursionError or uncontrolled expansion.

  • Old single-source/package/Intent fixtures retain their hashes; new IR round-trip and unsupported-version tests pass.

  • Diagnostics retain dependency path and expansion stack; changing a record schema changes its identity and dependent packageHash.

  • Pure helpers remain effect-free. No host dispatch, inference, registry, arbitrary Python, loops or quantum service calls are introduced.

An RFC-only PR is milestone 1, not completion of this whole issue. Completion requires the minimal executable records milestone plus compatibility evidence; defer other data types explicitly.

Hillclimb protocol and evidence

Start from a clean, isolated branch and record the actual base SHA; the reviewed baseline is Nano cb6ea884d63dcaa8cc0e7c0b952bb88784e8219f (source). Rebase and recheck if main has advanced. Link this issue to roadmap #67. Before editing, freeze the contract/fixture hashes, reproduce the specific missing behavior, and record a passing adjacent compatibility control. A missing feature is an expected rejection, not an invented production incident.

Use at most three candidate iterations against the frozen development set. Log each hypothesis, minimal diff, command, seed/environment, result and regression delta. Keep any held-out set immutable and report its final evaluation separately; do not tune against it. Stop and report an unresolved failure or dependency rather than weakening validation, increasing caps, deleting a negative control or relabelling skips as passes.

Deliver small reviewable PRs with exact head/base SHAs, commands, pass/fail/skip denominators, fixture/artifact hashes and limitations. Coordinate shared schemas before implementation; only one lane edits each shared contract at a time. Preserve baseline/Intent/executable/package/quantum schema identities independently. Issue creation is planning authorization, not permission to launch agents, merge, deploy, spend or change runner/security/credential settings. Tests are offline, fake-provider or local simulator only. CI startup failure with zero jobs remains a failure; any later merge exception needs its own applicable authority. The prior local-test waiver covered only PRs #82/#188/#460.

Dependencies and lane boundary

Builds on completed #66. RFC/version/fixture agreement comes first; runtime work follows that fixed design. #84 remains independently usable with scalar helpers. Coordinate compiler/IR ownership with #61 before touching any shared type/version helper. #88 consumes record conformance only after it actually lands; enum/result execution remains deferred.

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