Skip to content

docs: classify provider methods, and run the fixture that proves why - #566

Merged
David-Noble-at-work merged 2 commits into
developfrom
method-classification
Aug 19, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
method-classification

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

The diagnosis

+devlore:access is attached to a provider; the property belongs to methods. both is the tell — it
doesn't describe a provider, it says "this provider's methods aren't all the same kind."

file.join, file.name, file.parent          value in, value out
file.exists, file.read_text, file.glob     reads the host
file.write_text, file.copy, file.remove    changes the host

One annotation over three kinds can't be right about any of them, and today it's wrong in the dangerous
direction: file is access=both, so file.write_text runs during planning — outside the graph, with no
receipt, no compensation, no trace.

The scheme

Kind Effects Namespace Hermetic
pure none beyond arguments immediate yes
query reads host immediate no
action changes host plan.* only — must be a graph node no

Two things derive from one property. Namespace placement derives, because an action changes the world and
so must be a graph node to earn a receipt. Hermeticity derives, because a hermetic evaluation admits pure and
nothing else. immediate/planned/both were describing the consequence rather than the cause.

The mutation hole then closes by construction rather than by filtering.

Attribution is optional

Only one misclassification opens a hole — claiming pure for something impure. Requiring attribution
everywhere doesn't reduce it, and manufactures it: platform.Hostname() string takes nothing and cannot
fail, so pure is a plausible wrong answer. Unannotated it defaults to query, which is correct, with no
decision made.

  • action infers itself from a *Receipt return — already enforced by the Fallible / Actions /
    Compensable delineators
  • pure is claimed and verified against the call graph — a check every scheme needs, so not a
    differentiator
  • query is the default, which fails closed
  • Codegen emits the derived classification, so silence stops being ambiguous and a change shows up in a diff

Why the fixture is in this PR

test_imm_file.star had never been executed by any test. Running it is what proved the claim the document
rests on: write_text, mkdir, copy, move and remove all succeed immediately with unit_count == 0.

It failed on two stale type assertions and nothing else — "struct" where the Starlark type is now
"Regular". So everything it asserted about immediate mutation was true, and unwatched.

Verified

  • make check — run by the commit script before committing
  • TestImmediateFile passes with the corrected type names

Refs #563, #564.

+devlore:access is attached to a provider, but the property it describes belongs to individual methods, and
`both` is the evidence: it does not describe a provider at all, it says the provider's methods are not all the
same kind. file is three things wearing one name -- join and parent take a value and return one, exists and
read_text read the host, write_text and remove change it -- and one annotation covering all three cannot be
right about any of them.

Today it is wrong in the dangerous direction. Because file is access=both, file.write_text is callable during
planning, outside the graph, with no receipt, no compensation and no trace.

3.6 replaces the annotation with three method kinds -- pure, query, action -- from which two things derive
rather than being annotated separately. Namespace placement derives, because an action changes the world and so
must be a graph node to earn a receipt. Hermeticity derives, because a hermetic evaluation admits pure and
nothing else. The mutation hole then closes by construction instead of by filtering.

Attribution is optional rather than required. Only one misclassification opens a hole -- claiming pure for
something impure -- and requiring an attribution everywhere does not reduce it while manufacturing it where none
was needed: platform.Hostname() takes nothing and cannot fail, so pure is a plausible wrong answer, but left
unannotated it defaults to query, which is correct. The action tier infers itself from a *Receipt return, which
this repository already enforces through its Fallible / Actions / Compensable delineators. A pure claim is
verified against the call graph, a check every scheme needs and so no reason to prefer one. Codegen emits the
derived classification so that silence stops being ambiguous.

The fixture work rides along because it is the evidence. test_imm_file.star had never been executed by any test,
and running it is what proved the claim the document is built on: file.write_text, mkdir, copy, move and remove
all succeed immediately, with unit_count 0. It failed on two stale type assertions and nothing else -- "struct"
where the Starlark type is now "Regular" -- so what the fixture asserted about mutation was true and unwatched.

Refs #563, #564.
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 19, 2026
Wiring test_imm_file.star in regressed the windows baseline from 8 to 9. The fixture asserted

    file.join(parts=["a", "b", "c.txt"]) == "a/b/c.txt"

and file.Join is deliberately OS-native: it builds a path FOR USE, unlike Name and Parent, which answer
questions ABOUT a path as a value and are slash-form everywhere. So windows returns a\b\c.txt and the
expectation was wrong there before the fixture ever ran -- running it is what exposed it.

The fixture cannot assert multi-part join without encoding a platform, and does not need to:
TestJoin_MultipleParts already covers it per platform in Go. What this fixture uniquely proves is that
file.write_text, mkdir, copy, move and remove all succeed immediately with unit_count 0, which the remaining
assertions still do. The single-part and empty cases stay, since neither involves a separator.

Baseline returns to 8.
@David-Noble-at-work
David-Noble-at-work merged commit 5b2e287 into develop Aug 19, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the method-classification branch August 19, 2026 18:33
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