gnomonlearn
Docs/RFC-0039 template identity and execution outcomes

RFC-0039 template identity and execution outcomes

Versioned draft snapshot

RFCs, reference catalogs, and evidence reflect Spec 3b2e3e7a114fb826b1445d39a48756b8fff629cd. Counts and pending/status notes belong to that snapshot. Read the dated project update for later progress.

Source repositories are private during staging. Links marked “repository access required” need access to the linked repository.

This is a trace and gap record from the pinned draft specification. It does not establish proof or implementation conformance.

RFC-0039 §7 says templates are content-addressed so the same inputs and resolved template produce the same result. Content addressing identifies template bytes, but §5.2 includes now, uuid, and uniqueId, whose outputs vary across executions unless the runtime captures or injects them as stable inputs. The current graph template storage and engine sources contain no content-hash or content-addressed lookup implementation. The RDF claim conflates stable template identity with deterministic execution results.

Separately, §6.5 and diagnostic M39050 allow continueOnError: true to commit a partial result with errors, while §8 invariant 9 says any failure rolls back all writes. These clauses cannot both hold without an explicit exception.

Content-address the canonical template document and use that digest to pin the resolved template for an execution. Define repeatability only when every nondeterministic input is captured in the execution context, including clock, UUID/unique-ID sources, host functions, and graph reads. Idempotency keys control Resource upsert identity; they do not make all result fields identical.

Make all-or-none rollback the default. Allow committed partial results only when continueOnError: true is explicit, emit M39050 with per-object errors, and define which writes remain committed. Timeouts and transaction failures still roll back regardless of that flag.

The stronger alternative is to require deterministic injection and replay for every template execution, including external reads and host functions. That would require a persisted execution-input envelope and replay protocol before claiming equal results on re-execution.

Acceptance criteria

  1. Authored RFC, Lean, RDF claims, and emitted catalog separate template content identity, Resource upsert idempotency, and execution repeatability.
  2. Storage resolves a template by verified digest; compiler and executor pass that digest without relying on mutable registry names.
  3. Tests cover nondeterministic builtins, captured replay inputs, default rollback, explicit partial commit with M39050, and unconditional rollback on timeout or transaction failure.
  4. Backend and GraphClient transaction tests pass before a runtime guarantee is published.