Skip to content

template is documented pure and reads the host environment #680

Open

Description

@David-Noble-at-work

Epic: #454
Plan: docs/plans/template-purity-claim.md

3.5-provider-catalog.md describes the template provider as "pure" with "no filesystem."
pkg/op/provider/template/provider.go:110 maps "Env": os.Getenv into the template function map, so any template
string can read any environment variable on the rendering machine.

The behaviour is deliberate and documented at provider.go:105 — graphs are transportable, so resolving
environment values at plan time would embed them in persisted graph documents, potentially leaking secrets into
durable artifacts. The claim of purity is what is wrong.

This is also the counterexample that bounds per-method classification: template.render_text has the signature of
a pure function and the behaviour of a query, decided by a string passed at runtime. No static classification can
decide it. That limit belongs in 3.6 §3, not in a catalog footnote.

Whether Env survives is deferred to 3.6, where it is already an open question — removing it breaks any
authored template that uses it, and the per-runtime alternative needs the module-selection plumbing tracked by
#563.

Activity

  1. added
    bugSomething isn't working
    documentationImprovements or additions to documentation
    Epic:DocDebtDesign and documentation debt
    Severity:MediumBroken with a workaround, or a narrow path
    on Aug 25, 2026
  2. David-Noble-at-work commented on Aug 25, 2026

    @David-Noble-at-work
    ContributorAuthor

    The code half is now ruled and filed separately as #683: Env consults declared runtime variables through op.VariableResolver, the way make does — not the ambient process environment. Dispatch-time resolution is unchanged; only the source moves from ambient to declared.

    That means this issue narrows to the documentation claim alone. Once #683 lands, template.render_text stops being content-dependent for hermeticity purposes: every value it can reach becomes a declared input, so it can carry a determinism claim like any other method.

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

Metadata

Metadata

Labels

Area:ArchitectureSystem architecture and designEpic:DocDebtDesign and documentation debtPriority:P2Scheduled, not urgentSeverity:MediumBroken with a workaround, or a narrow pathbugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions