RFC-0039 root value form
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 §2 defines exports.root as the primary created Resource, while
§3.2 permits a value-form template whose root is an evaluable expression.
The objects grammar in §4 allows resources, statements, and nested template
calls; it does not define an expression object that a value-form root can
reference. The runtime Zod schema accepts exports.root.as: value and checks
that from names an object, but its strict root resolver returns a Resource
name only and execution paths that require a root Resource reject the value
form. The RDF root claim repeats both branches without specifying how the
value branch evaluates. This is a public template result-shape choice.
The same unresolved choice affects the §3.2 recommendation to split
templates without a primary Resource and §4.3’s assertion that every nested
call root is usable as a Resource reference.
TemplateExecutionResult in §6.5 has only rootResourceName and
rootResourceId; it has no place for the permitted root value.
Recommendation
Define value-form roots explicitly rather than allowing an accepted document
that cannot execute. Add a typed value object or a direct root expression to
the grammar, define its evaluation and TemplateExecutionResult value field,
and make callers handle Resource and value roots distinctly. Keep resource
roots mandatory for graph-provisioning templates. If value-form templates are
not in the first release, remove the value branch from the authored grammar,
Lean, RDF claim, and Zod parser until the execution contract exists.
Acceptance criteria
- The RFC definition, grammar, Lean, RDF claim, parser, executor, nested-call export resolution, and result type agree on each supported root form.
- Tests cover successful Resource and value roots if both are supported, and a deterministic rejection if value roots are deferred.
- Generated reference and Turtle, source-bound reviews, and module/template integration gates pass before the first normative release.