Skip to content

spec(063): Node binding parity: acquisition source, profiles and variants, store seam, capture, repeatability commands, ratified (A-78) - #483

Merged
bartekus merged 1 commit into
mainfrom
spec-063-node-parity
Nov 4, 2026
Merged

bartekus merged 1 commit into
mainfrom
spec-063-node-parity

Conversation

@bartekus

@bartekus bartekus commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Draft: nothing to implement until ratified.

Proposes spec 063, an amendment of approved spec 027 that closes the Node exposure specs 029, 034, 036 and 044 each left out of scope. It is the spec #56 asks for (absorbing #62 and #73) before any code. This revision records the owner's answers of 2026-11-03.

Proposal

  • Profiles and variants (3.2, 3.3): compile/compileSync gain definitions, profile, profileBases, variant, definitionVersion and execution, mapped to compile_profiled_with, with the same PlanId the CLI produces. profileCheck and planDiff become binding commands over the existing rustev-surface functions.
  • Host callbacks (3.4): the acquisition source and the store take Promise-returning callbacks called through a napi threadsafe function. No Rust thread waits on JavaScript. Each call has a bounded queue, a deadline the runtime enforces itself, and an AbortSignal linked to the decision. A late settlement is discarded and counted. A Promise that never settles holds no thread or slot (it is counted in abandonedPending), and the call ends at its deadline.
  • Acquisition source (3.5): acquisitionSources on Engine.create, with explicit sources on compile and load. The cost bound comes from the descriptor, and SeamFailure gains denied. Failures are unresolved values in the judgment, never exceptions.
  • Store seam (3.6, 3.7): mirrors RuntimeStore with generations, plus PlanHandle.invalidate({ principalHandle?, timeoutMs? }).
    • The atomicity contract has five guarantees: G1 monotonic generations that are never lost apart from their entries; G2 invalidation is an atomic, linearizable generation increment; G3 snapshot get; G4 a conditional put (generation compare-and-set, put-if-absent per the conflict term, budgets, counters); G5 read-your-writes and an atomic delete.
    • Each method has a Redis recipe: Lua scripts under one hash tag per namespace, INCR for invalidate, primary reads only, non-evictable generation keys.
    • Section 5 lists the failures of a non-atomic host and whether Rustev can detect each.
    • A non-normative note: a replicated Redis or Valkey host routes every store call to the primary, and uses an eviction policy that cannot evict generation keys (for example volatile-lru).
  • Capture on decide (3.8): the evidence a host sink receives cannot replay a decision. The run record has no model outputs (AttemptEnd::Output carries none), no acquisition pages (036 3.14.4) and no supply order, and 004 5.3.4 sends no capture data to the sink.
    • The binding therefore exposes decide_with_capture with assembly into rustev.replay/1 or /2.
    • Retention is digest_only (the default), embedded, or external with content-addressed items. Lifetime is 7 days by default and at most 30.
    • Embedded and external bundles carry unredacted inputs, model outputs and acquisition pages. Spec 028's redaction policy does not apply to them, and hosts must treat them as personal data, with their own encryption at rest, retention and erasure.
    • The scope is required. No principal handle or credential enters a bundle, and nothing captured reaches the sink or telemetry.
    • Replay is the existing engine.replay, with zero backend and source calls.
  • Repeatability (3.9): native and in-process. The commands are eval with repeatConfig, evalCandidates, baselineRecord, evalReproducibility, evalDiff, gateSelect and 061's evalRepeatImport. The repeat code moves into rustev-surface with the CLI goldens unchanged.
  • WebAssembly: gains nothing.
  • Conformance: the 23 parameterized.* and 11 repeat-* cases gain native. Nine new runtime cases run on rust-api and native: acquisition, store, and capture-then-replay.
  • Increments: six, all targeting 0.5.0, in this order: capture, profiles and variants, acquisition, store, repeat-code move, repeat commands. Increments 1 (capture), 3 (acquisition) and 4 (store) depend on no other increment and can each ship in a 0.5.x alone. Capture comes first because it is the only capture path for shadow-then-switch: rustev run --capture-bytes refuses plan 3 decisions, and the CLI cannot run JavaScript model backends.

No extends/establishes edges. Territory names the edges ratification adds.

Owner decisions (2026-11-03, to be recorded at ratification)

  1. Repeatability is native only (increments 5 and 6).
  2. All increments target 0.5.0. Capture is increment 1, and increments 1, 3 and 4 are independently shippable.
  3. No WebAssembly repeat commands.
  4. The store mirrors RuntimeStore with generations, under the atomicity contract of 3.7.
  5. evalRepeatImport lands in increment 6 (061 is ratified as A-77).
  6. Capture on decide is in scope as increment 1, because the sink's evidence is not enough to replay.

Checks

  • make refresh: the derived shards for 063 are committed.
  • make gate: passes.
  • scripts/check-authored-content.sh: clean.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the new spec specs/063-node-binding-parity/spec.md.

Governance checks pass: status: draft, implementation: pending is a valid schedulable state; the draft makes no code claims; amends is declared in this spec's frontmatter only, and section 3.11 explicitly says the amended specs are not edited; the directory name matches id; obligations anchor to existing sections.

One concrete defect found:

Section 3.4.4 — wrong parse class named for acquisition pages.

The text reads:

The page crosses unchanged (an object is serialized with JSON.stringify, 027 3.2.1), copied up to 4 MiB (SNAPSHOT_V1, the page's parse class).

SNAPSHOT_V1 is stated to be "the page's parse class" for a rustev.acquisition-page/1 document. The repo contains both crates/rustev-contract/schema/rustev.acquisition-page-1.schema.json and rustev.snapshot-1.schema.json / rustev.snapshot-2.schema.json as distinct schemas. The acquisition page is not a snapshot; its parse class should correspond to its own schema (analogous to how section 3.5.3 correctly names RECORD_V1 as the store-entry parse class for get bytes, not SNAPSHOT_V1). Using SNAPSHOT_V1 here is a mislabelling that would bind an incorrect size-limit class to the acquisition page at the seam; a correct implementation following this spec would apply the snapshot parser's constraints to a structurally different document type.

No other concrete defects found. Security invariants (no host-supplied keys, denied not retried, queue overflow answered immediately, abort signal passed through) are consistently stated. The amends and depends_on lists are internally consistent with the text. The WebAssembly exclusion rationale (R-1, section 3.9) is coherent with 050's constraints.

{"head": "6d17745f9025b57228b568c9765d72d4696b4b1c", "verdict": "findings", "findings": [{"path": "specs/063-node-binding-parity/spec.md", "line": 193, "summary": "Section 3.4.4 names SNAPSHOT_V1 as the acquisition page's parse class, but the acquisition page has its own distinct schema (rustev.acquisition-page/1) separate from the snapshot schemas; SNAPSHOT_V1 is the wrong parse class and would apply snapshot constraints to a structurally different document type at the seam boundary."}]}

Subject: 2f7b8e6...6d17745, diff digest 711fb9076f44f36a0f8bfa253fbbe8664612ce0d457904ee6f4d5e58ad00e816, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 21:05 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the spec-063-node-parity branch from 6d17745 to d63ebdb Compare November 3, 2026 22:14
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the new draft spec for concrete defects.

Governance conformance: status: draft with implementation: pending is a valid schedulable state per the contract. The amends edges are in frontmatter only; the amended specs are not edited. The directory name matches id. The draft correctly declares no establishes or extends edges. All of that is clean.

Internal consistency check - missing depends_on entry for spec 061:

Spec 061 is cited as a functional dependency throughout, not merely as context:

  • Section 2 (Territory): "the repeat code moved into rustev-surface ... with 061's host import"
  • Section 2.1: "061 I-1" is invoked as a binding constraint on provenance separation
  • Section 3.9.1: evalRepeatImport is specified as "eval repeat import (061 3.2)", meaning its definition lives in 061
  • Section 3.9.3: "the renderings, with 061's import, move from crates/rustev-cli/src/repeat.rs into rustev-surface"
  • Section 3.14.3: "061 (ratified, A-77): its 3.10 sentence ... this spec adds evalRepeatImport to Node (3.9.1)"
  • Section 5 (negative cases): the gateSelect row cites "061 I-1" as the authority for the mixed-provenance exit code

The depends_on list (001, 003, 004, 027, 029, 034, 036, 044, 050) omits 061 entirely. This is a concrete omission: spec 063 amends 029 for repeatability commands and delegates one of the seven named commands (evalRepeatImport) entirely to 061's definition, yet 061 is not declared as a dependency.

No other concrete defects found. The security properties (I-3 preventing host-supplied keys, I-4 excluding principal handles and trace headers from bundles, the "proposals, never grants" principle) are stated consistently and coherently throughout. The store atomicity guarantees G1–G5 are internally consistent with the negative cases in section 5.

{"head": "d63ebdb0ea40a29985517811eb56236f48333b89", "verdict": "findings", "findings": [{"path": "specs/063-node-binding-parity/spec.md", "line": 27, "summary": "Spec 061 is a functional dependency (evalRepeatImport is defined in 061 3.2; 061's I-1 governs provenance separation in gateSelect; 061's import code moves into rustev-surface as part of this spec) but is absent from the depends_on list."}]}

Subject: 6894e86...d63ebdb, diff digest 00199b162b6ccac1b870d25df7b85f366de7c47bda958e11451e5cca04c7760f, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 22:22 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the spec-063-node-parity branch from d63ebdb to 9de0710 Compare November 3, 2026 22:28
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Review of specs/063-node-binding-parity/spec.md

Lifecycle and frontmatter: status: draft with implementation: pending is a valid schedulable pair per the contract. The id matches the directory name. The amends list (027, 029, 034, 036, 044) matches the title. No issue here.

Draft semantics: The preamble correctly disclaims "a proposal, never a claim about code." Section 2 notes no extends or establishes edge is declared while in draft. Consistent with governance.

Spec 061 missing from depends_on: This is the concrete defect. Spec 061 is substantively relied upon throughout the body, yet it appears in neither amends nor depends_on:

  • Section 3.9.1 defines evalRepeatImport via "061 3.2", and three other commands via "061 3.7.1", "3.7.2", "3.7.3".
  • Section 3.13.1 references "061's import goldens."
  • Section 3.14.3 explicitly discusses what changes relative to 061 and states "this spec adds evalRepeatImport to Node (3.9.1)" — this is a material extension of scope originally covered by 061.
  • Planned increment 6 and "Decisions at approval" item 5 reference 061 as a live dependency ("061 ratified as A-77").

Since the coupling gate uses depends_on to enforce spec-first development (AGENTS.md: "A changed code path must be accompanied by an authoring edit to a spec that owns it"), omitting 061 from depends_on means the gate cannot see this dependency. The contract requires depends_on to name specs the authoring spec relies on; the reliance here is direct and repeatedly cited.

Other items checked without findings:

  • Section cross-references (3.4.5, 3.8.3, 3.8.4 anchor slugs) are internally consistent.
  • The 34-case acceptance count (23 + 11) matches section 3.13.1.
  • lifetimeMs max 2,592,000,000 ms = exactly 30 days; consistent with 3.8.3.
  • remainingMs: number (required) in AcquireCall vs. remainingMs?: number (optional) in StoreCall is consistent with 3.4.3's rule that the value is absent for store calls without a decision deadline.
  • I-4 privacy invariants (no principal handle, trace header or telemetry key in a bundle) are reflected correctly in sections 3.8.4 and 2.1.
  • amends omitting 061 is consistent with 3.14.3's reading that 061's own sentence "stands for 061" (063 is not rewriting 061, it is extending Node coverage it left out of scope), so this is a depends_on omission rather than an amends omission.
{"head": "9de07105f27d58ce2b1cee447dc1f9f7aa8a0b00", "verdict": "findings", "findings": [{"path": "specs/063-node-binding-parity/spec.md", "line": 27, "summary": "Spec 061 is substantively relied upon throughout the body (evalRepeatImport defined at 061 3.2, commands at 061 3.7.1–3.7.3, import goldens, and 3.14.3's explicit statement that this spec adds evalRepeatImport to Node) but is absent from the depends_on frontmatter field, so the coupling gate cannot see the dependency."}]}

Subject: 6894e86...9de0710, diff digest de4e2877b9ae8ba04b23e378b63855a7dbc8e49abd393617c7ee729f3aaa7acf, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 22:36 — with GitHub Actions Inactive
@bartekus

bartekus commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Review note on d9.../9de07105's finding (061 missing from depends_on): 061 is not on main yet (its ratification lands with #481), and a depends_on edge to a spec absent from main fails governance. The ratification commit for 063, pushed after #481 merges, adds 061-host-scored-repeat-sets to depends_on and amends.

…ants, store seam, capture, repeatability commands (amends 027, 029, 034, 036 and 044), ratified (A-78)
@bartekus bartekus changed the title spec(063): Node binding parity: acquisition, profiles and variants, store seam, repeatability (amends 027; draft) spec(063): Node binding parity: acquisition source, profiles and variants, store seam, capture, repeatability commands, ratified (A-78) Nov 4, 2026
@bartekus
bartekus force-pushed the spec-063-node-parity branch from 9de0710 to a2a3733 Compare November 4, 2026 10:28
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Review

A-78 entry (docs/decisions/00-founding-decisions.md): The six open-question answers in A-78 match the spec's "Decisions at approval" section one-for-one. The amends list (027, 029, 034, 036, 044) is consistent with the frontmatter. No inconsistency found.

Spec 063 frontmatter: status: approved, implementation: pending, created: 2026-11-03, ratification claim back-referenced to A-78 — all consistent. Lifetime values check out (604,800,000 ms = 7 days; 2,592,000,000 ms = 30 days). maxBytes range (1–16,777,216) is consistent with observable negative cases. Conformance case counts (23 + 11 = 34; 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 9 runtime cases) match the Acceptance section.

Finding — amends list omits 006-cli-surface:

The extends block at spec line 35 declares:

- { spec: "006-cli-surface", unit: { kind: directory, path: "crates/rustev-cli/" }, nature: amending }

This is an amending edge against a unit that spec 006 owns. The contract (standards/spec/contract.md) states: "An amends edge is declared once, in the amending spec's frontmatter." The frontmatter amends list (lines 20–25) names 027, 029, 034, 036, and 044 — but not 006-cli-surface. The nature of the change to crates/rustev-cli/ is minimal (the CLI is updated to call renderings moved into rustev-surface), but the extends block itself names it amending rather than additive, which implies the amends relationship exists and must be declared in the frontmatter.

No other concrete defects found.

{"head": "a2a3733a2ef615575304baff78b47594a30247b3", "verdict": "findings", "findings": [{"path": "specs/063-node-binding-parity/spec.md", "line": 35, "summary": "The extends block declares an amending edge against spec 006's unit (crates/rustev-cli/) but 006-cli-surface is absent from the frontmatter amends list, which the contract requires to be the sole declaration point for all amends relationships."}]}

Subject: 19b9e92...a2a3733, diff digest 3afbde682e620217d32d746f8c7a96b8fc5d6c0c182e0d7eddad61948e738627, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 4, 2026 10:32 — with GitHub Actions Inactive
@bartekus

bartekus commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Review note on the AI finding at specs/063-node-binding-parity/spec.md line 35 (amending extends edge to 006 without an amends entry).

Not a defect. In this corpus amends names the specs whose contract this spec changes; an extends edge with nature: amending declares that this spec edits files in another spec's unit. The two are independent: 003, 004, 013, 014, 015, 017 and others carry amending extends edges to 002, 003, 004 or 006 with no matching amends entry, and make gate (governance) passes on this head. Spec 063 3.9.3 says the CLI only calls the moved renderings and its contract is unchanged, so 006 belongs under extends and depends_on, not amends.

@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 3ab57f8 Nov 4, 2026
20 checks passed
@bartekus
bartekus deleted the spec-063-node-parity branch November 4, 2026 21:19

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — a2a3733a Deployed Nov 4, 2026 by bartekus via review-exception #3330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant