Skip to content

Rename the provider roles: surface=graph produces RoleAction, and the rename retires both words #715

Closed

Description

@David-Noble-at-work

Plan: docs/plans/workflow-rename.md (status draft, last audited 2026-05-26)

ProviderRole's dispatch constants and the +devlore:surface= values that produce them are two different
vocabularies for one idea, and the rename removes the word one of them is built on.

The mismatch today

# generate.star
if surface == "graph":    roles = "op.RoleAction"
elif surface == "module": roles = "op.RoleModule"
else:                     roles = "op.RoleModule|op.RoleAction"
Directive Role
+devlore:surface=graph RoleAction different words for the same surface
+devlore:surface=module RoleModule agrees

An author writes graph and the generated code says Action. Nothing connects them but this function.

The rename removes both words

workflow-rename.md maps Graph → Definition, with workflow as the package. So after it lands there
is no type called Graph, and +devlore:surface=graph names something that no longer exists. module is no
better off — it is Starlark's word for a namespace, not a term in the new taxonomy:

workflow
├─ Definition            root container      (was Graph)
│  ├─ Node               abstract vertex     (was ExecutableUnit)
│  │   ├─ Step           leaf                (was Node)
│  │   └─ Block          composite           (was Subgraph)

What these roles actually mean now

Worth restating, because the names predate the meaning. #677 changed RoleModule from immediate mode to
eligible for a module surface, and made membership a per-method, per-runtime decision driven by claims. So
both constants now answer one question — which surface may this provider reach — and the answer is no
longer about invocation mode at all.

RoleRoot is a different axis (placement, not dispatch) and is in scope for review but not obviously wrong.

First order of business: pick the terms

Not to be decided in this issue's description. Candidates to weigh, and the criterion is that the directive
value and the constant should be the same word
:

Directive Constant Note
surface=definition RoleDefinition matches the type a provider's methods build
surface=workflow RoleWorkflow matches the package; may over-claim, since a Definition is one artifact in it
surface=script RoleScript names the other side by what an author is writing, not by Starlark's module
surface=module RoleModule keep; already agrees, and module is what starlark calls it

The pairing matters more than either word alone. graph/Action is the defect; any pair that agrees is an
improvement, and the best pair also survives the taxonomy change.

Scope

  • ProviderRole dispatch constants in pkg/op/receiver_type.go
  • +devlore:surface= values, and the mapping in generate.star
  • Every provider declaring a surface — today only flow (graph) and plan (module)
  • ReceiverRegistry's modules / actions / planners slices, which inherit the same vocabulary
  • Documentation: 3.6-method-classification.md and docs/guides/provider-development.md both carry the
    mapping table as of 2026-08-27

Sequencing

Belongs with the rename rather than before it: doing it first means renaming twice, and doing it after
means the new taxonomy ships alongside a constant named for the type it replaced.

Note the parent plan's prerequisite — "cannot start until refactor/extract-starlark-from-op.phase-8 merges"
— is satisfied; that branch is gone and phase 8 has landed. The plan has not been revisited since, and its
Current State predates claims, claimcheck, sealed resources, and the conversion rules.

Acceptance

  • A directive value and its constant are the same word
  • No surviving name refers to graph, which the taxonomy retires
  • The mapping table is correct in both documents that carry it
  • RoleRoot reviewed and either kept or renamed deliberately

Plan and design documents

Kind Document
Plan docs/plans/role-vocabulary.md

Activity

  1. David-Noble-at-work commented on Aug 27, 2026

    @David-Noble-at-work
    ContributorAuthor

    Blocked on #716 — the re-audit produces the name-mapping appendix this rename needs, and it has to walk the same identifiers.

    Both are now reflected in docs/plans/workflow-rename.md itself, which previously referenced neither. The plan gained a Related Rename: the provider roles section carrying the mismatch and the reasoning for doing this in the same window rather than before or after.

  2. David-Noble-at-work commented on Aug 27, 2026

    @David-Noble-at-work
    ContributorAuthor

    Term proposals, from discussion 2026-08-27

    Two axes, two directives — do not merge them

    ProviderRole has two zones: dispatch (bits 0–7) and placement (bits 8–15), with Dispatch() and
    Placement() projecting them. Folding root into surface= was considered and rejected — a value list
    reading starlark_module|action_provider|root says "a surface, a surface, and a not-surface", and a reader
    then cannot tell from the syntax that dropping root changes where names appear while dropping the other
    changes whether the provider can be planned at all.

    Directive Accessor Constants
    +devlore:surface= ProviderRole.Surface() RoleStarlarkModule, RoleWorkflow
    +devlore:placement= ProviderRole.Placement() RolePromoted, RoleQualified

    Placement: promoted | qualified, default qualified

    +devlore:root=true invites the question "root of what?" — a bare root has no referent, and the
    boolean is weak besides. Naming the opposite value is what makes the axis legible.

    promoted — the name appears at the namespace root, unqualified.
    qualified — the name appears under its provider's name: ui.note, plan.flow.choose.

    Neither term needs a referent: promoted says what happened to the name, qualified says what qualifies it.

    This is already the codebase's vocabulary. The implementation of root placement is written in it:

    promotedBuiltins  map[string]starlark.Value   // plan/provider.go:58
    buildPromotedBuiltins()                        // plan/provider.go:799
    promoteRootMethods(...)                        // plan/provider.go:823

    And it is not invented here — Go's own spec uses "promoted" for exactly this shape, a field or method of
    an embedded struct appearing at the outer level without qualification: "Promoted fields act like ordinary
    fields of a struct."
    The other half, qualified identifier (pkg.Name), is likewise the spec's term.

    nested was proposed first and withdrawn: its only precedent was our own doc comment, which is circular.

    RoleRoot becomes RolePromoted. That also resolves an existing contradiction — promoteRootMethods
    currently carries two words for one idea in a single identifier.

    Considered and not chosen: unqualified|qualified. More literal, and free of the embedding association
    that a Go reader might carry into "promoted", where this is namespace placement rather than struct embedding —
    analogous, not identical. promoted|qualified was preferred for naming the action on one side and the
    state on the other, which is what is actually true. Worth a second look if the embedding association proves
    misleading in review.

    Dispatch() has the same defect as RoleAction

    Raised while weighing whether the directive should be dispatch= rather than surface=. It should not —
    but the accessor is the thing that is wrong.

    Dispatch() names how methods are invoked. That stopped being what the zone means. #677 changed it, and
    3.6-method-classification.md says so:

    RoleModule now means eligible for a module surface rather than immediate mode

    So the accessor names invocation while the zone now means eligibility — the same staleness as RoleAction,
    one level up. Dispatch() → Surface() belongs in this issue's scope.

    Surface values

    starlark_module and workflow are the working proposal, matching RoleStarlarkModule and RoleWorkflow.

    action_provider was proposed and set aside: it names the thing, not the surface, and every provider is a
    provider. The value should answer "which surface does this reach", and after the rename that surface builds
    workflow.Definitions.

    Least settled: whether starlark_module is too implementation-flavored — it names starlark's mechanism rather
    than the author's intent, where the old word was immediate. Worth weighing before this is fixed.

    A new constant

    RoleQualified would be new. Placement has one bit today and absence means qualified, so Placement()
    returns zero. Making it explicit costs a bit and lets Placement() return something nameable instead of a
    zero meaning "the default" — the same weakness as root=true being a boolean.

  3. David-Noble-at-work commented on Aug 27, 2026

    @David-Noble-at-work
    ContributorAuthor

    Surface values SETTLED: script | workflow

    +devlore:surface=script|workflow      // default: both
    +devlore:placement=promoted|qualified // default: qualified
    Directive Accessor Constants
    +devlore:surface= ProviderRole.Surface() RoleScript, RoleWorkflow
    +devlore:placement= ProviderRole.Placement() RolePromoted, RoleQualified

    Both values name an artifact an author writes, both are single words, and each is the same word as its
    constant — the criterion this issue was opened on.

    script|workflow also answers the question the directive is actually asking, where may this method be
    used
    , rather than describing a mechanism.

    Rejected: starlark|workflow

    Proposed for parity with workflow, and set aside because both surfaces are starlark.
    plan.file.copy(...) is starlark too; workflows are built from starlark. A value pair reading
    starlark|workflow implies the workflow surface is something other than starlark, which is backwards — and
    it would land in the same trap as graph/Action, a value whose word does not name what it selects.

    Rejected: starlark_module|workflow

    The parity objection stands: one compound, one simple. module is also starlark's word for a namespace rather
    than a term in the new taxonomy.

    Rejected: action_provider

    Names the thing, not the surface. Every provider is a provider.

    Runner-up: immediate|workflow

    Kept on the record because it avoids a real subtlety in the chosen pair.

    A script is what builds a workflow, so a workflow-surface method is still called from a script —
    file.copy reached as plan.file.copy(...) sits in a .star file either way. script|workflow distinguishes
    them by what the call yields rather than where the text lives, which a new author could stumble on.

    immediate has no locational reading at all, so it sidesteps that. Its costs: it mixes axes — one word names
    timing, the other an artifact — and it is the vocabulary #677 retired, though #677 retired it for meaning
    invocation mode rather than eligibility, which is not quite what this would be doing.

    Revisit only if the "where the text lives" confusion shows up in practice.

    Consequences for the tree

    • flow — +devlore:surface=workflow (was graph), +devlore:placement=promoted (was root=true)
    • plan — +devlore:surface=script (was module)
    • ui — +devlore:placement=promoted; surface stays absent, since it reaches both
    • ReceiverRegistry's modules / actions / planners slices inherit the old vocabulary and follow
    • RootProviders() becomes PromotedProviders(), and promoteRootMethods loses its internal contradiction
  4. David-Noble-at-work commented on Aug 27, 2026

    @David-Noble-at-work
    ContributorAuthor

    Constants take their ACCESSOR's name, not the type's

    // today
    op.RoleModule|op.RoleAction|op.RoleRoot
    
    // proposed
    op.SurfaceScript|op.SurfaceWorkflow|op.PlacementPromoted
    Accessor Constants
    ProviderRole.Surface() SurfaceScript, SurfaceWorkflow
    ProviderRole.Placement() PlacementPromoted, PlacementQualified

    Supersedes the RoleScript / RolePromoted naming proposed earlier in this issue.

    The argument is a bug this repository already shipped

    The Role prefix flattens two orthogonal zones into one undifferentiated list, and RoleRoot therefore reads
    as a third peer of the other two. It is not — it is a placement modifier that applies to every dispatch zone
    the provider holds.

    That is exactly how #708 went wrong. ui was given +devlore:root=true after reasoning only about the module
    surface, and it silently promoted six names — error, fail, note, print, succeed, warn — into
    plan.* as well. Nothing collided, so nothing failed, and the consequence was found only by reading
    buildPromotedBuiltins days later.

    A call site reading op.SurfaceScript|op.SurfaceWorkflow|op.PlacementPromoted would have made that visible
    at the moment it was generated.
    Two surfaces, one placement — and it is obvious that the placement is not a
    third surface.

    It also makes invalid combinations look wrong. op.SurfaceScript|op.SurfacePromoted is visibly nonsense;
    op.RoleModule|op.RoleRoot is not.

    The cost, stated

    Go convention prefixes a type's constants with the type name, and all four remain ProviderRole values.
    PlacementPromoted does not announce its type, so a reader may briefly wonder whether it and SurfaceScript
    are even the same type — they must be, to compose with |.

    Judged a small price for making the zones legible, and the accessor names tie each family back to
    ProviderRole.

    Knock-on to decide in the same window

    If the constants stop saying Role, the type name ProviderRole becomes the odd one out. It packs a surface
    and a placement. Leaving it, or ProviderRoles, both work — but it should be decided here rather than
    discovered mid-rename.

    Full scheme as it now stands

    +devlore:surface=script|workflow        // default: both
    +devlore:placement=promoted|qualified   // default: qualified
    Directive Accessor Constants
    +devlore:surface= Surface() — renamed from Dispatch() SurfaceScript, SurfaceWorkflow
    +devlore:placement= Placement() PlacementPromoted, PlacementQualified

    Every directive value is the same word as its constant, and every constant names the accessor that projects
    it — which is the whole of what this issue set out to fix.

  5. David-Noble-at-work commented on Aug 28, 2026

    @David-Noble-at-work
    ContributorAuthor

    SETTLED: ProviderFlags packs a Surface and a Placement, each a distinct type

    Supersedes ProviderRole and the single-type constant families proposed earlier in this issue.

    // ProviderFlags packs a provider's Surface and Placement.
    type ProviderFlags uint16
    
    // Surface — which surfaces a provider's methods reach. A BIT FIELD: one or more.
    type Surface uint8
    
    const (
    	SurfaceScript   Surface = 0x01
    	SurfaceWorkflow Surface = 0x02
    	// remaining bits reserved for further surfaces
    )
    
    // Placement — how a provider's method names are placed. A VALUE: exactly one.
    type Placement uint8
    
    const (
    	PlacementQualified Placement = 0x00
    	PlacementPromoted  Placement = 0x01
    )
    
    const placementShift = 8
    
    func (f ProviderFlags) Surface() Surface     { return Surface(f) }
    func (f ProviderFlags) Placement() Placement { return Placement(f >> placementShift) }

    Why distinct types, not one packed type for everything

    reflect's own packed value does exactly this — verified in $GOROOT/src/reflect/value.go:

    type flag uintptr
    
    const (
    	flagKindWidth        = 5
    	flagKindMask    flag = 1<<flagKindWidth - 1   // a ZONE holding an enumerated VALUE
    	flagStickyRO    flag = 1 << 5                 // flag BITS
    	flagMethodShift      = 10                     // a second zone
    )
    
    func (f flag) kind() Kind { return Kind(f & flagKindMask) }

    A value zone, flag bits, a second zone, and an accessor that masks — our exact shape. And kind() returns
    Kind, a distinct type, not another flag.

    Applied here, the compiler stops a whole class of confusion: a Surface cannot be compared against a
    Placement, and neither can be passed where the other is wanted. With both zones typed as the packed type,
    role.Placement() == SurfaceScript compiles and is nonsense.

    Why ProviderFlags

    Precedent, verified in the Go stdlib: 14 exported types carry the suffix — ProgFlag, SectionFlag,
    FuncFlag, OpFlags, PragmaFlag, ValueFlags, DynFlag, TFlag, CountFlag.

    From memory, not verified: C# has System.Reflection.BindingFlags alongside MethodAttributes /
    TypeAttributes; Java uses java.lang.reflect.Modifier, with AccessFlag added in 22, and the class-file
    spec calls the field access_flags.

    The distinguishing principle across those: bits with a domain meaning take the meaning's name (FileMode,
    Modifier, MethodAttributes); an open-ended set of options takes Flags (BindingFlags, SectionFlag).

    ProviderFlags is deliberately generic, and that is the point. ProviderRole was specific and went
    stale: #677 changed the zone from invocation mode to surface eligibility and the name outlived the
    meaning, which is how RoleAction, Dispatch(), and ProviderRole all came to name something that was no
    longer true. A deliberately empty name cannot go stale that way, and the accessors carry the meaning.

    The cost, stated: it invites "flags about what?", the same question root invited. The accessors answer it.

    Read differently, because the zones are different kinds of thing

    flags.Surface()&SurfaceWorkflow != 0     // test a bit — may hold several
    flags.Placement() == PlacementPromoted   // compare a value — holds exactly one

    Directive grammar follows

    +devlore:surface=script|workflow     // a list; default both
    +devlore:placement=promoted          // one value; default qualified

    PlacementQualified = 0x00 is the zero value of an enumeration rather than an absent flag, so a provider
    declaring nothing gets both surfaces and qualified names — exactly the default.

    Nothing can express a nonsense placement. Not because a check rejects it, but because the zone holds one
    value of a type with two.

    Consequences for the tree

    • flow — +devlore:surface=workflow, +devlore:placement=promoted
    • plan — +devlore:surface=script
    • ui — +devlore:placement=promoted; surface absent, since it reaches both
    • RootProviders() → PromotedProviders(), resolving promoteRootMethods' internal contradiction
    • ReceiverRegistry's modules / actions / planners slices follow the new vocabulary
    • Constants take explicit values; the block being replaced uses iota

    Plan: docs/plans/role-vocabulary.md.

  6. David-Noble-at-work commented on Aug 28, 2026

    @David-Noble-at-work
    ContributorAuthor

    SETTLED: Surfaces plural, Placement singular — the grammar carries the distinction

    // ProviderFlags packs a provider's Surfaces and Placement.
    type ProviderFlags uint16
    
    // Surfaces — which surfaces a provider's methods reach. A BIT FIELD: one or more.
    type Surfaces uint8
    
    const (
    	SurfaceScript   Surfaces = 0x01
    	SurfaceWorkflow Surfaces = 0x02
    )
    
    // Placement — how a provider's method names are placed. A VALUE: exactly one.
    type Placement uint8
    
    const (
    	PlacementQualified Placement = 0x00
    	PlacementPromoted  Placement = 0x01
    )
    
    func (f ProviderFlags) Surfaces() Surfaces   { ... }   // plural — a set
    func (f ProviderFlags) Placement() Placement { ... }   // singular — one value

    flags.Surfaces() returning SurfaceScript|SurfaceWorkflow reads correctly. flags.Surface() returning two
    things reads as a contradiction — and that contradiction is the mistake this design already made twice: first
    by folding root into surface=, then by writing placement=promoted|qualified with | meaning "one of".

    The asymmetry is the point. Someone reading only the accessor signatures learns which zone is a set and
    which is a value, without reaching for the doc comment. The individual constants stay singular
    (SurfaceScript), because each names one surface; the type and accessor are plural because they hold a set.

    Cost, stated: Go's stdlib leans singular for bit fields (FileMode, SectionFlag, ProgFlag). Taken anyway,
    because this type sits directly beside a singular one that means something different — the local contrast
    matters more than the general convention.

    Rejected: SurfaceAttributes

    C#'s pattern is <Thing>Attributes where Thing is what is described — MethodAttributes are attributes
    of a method. Applied faithfully, the thing described here is the provider, which is ProviderFlags.
    SurfaceAttributes would read as attributes of a surface, and the type is not describing a surface; it is
    a set of surfaces
    . It also says "flags" twice inside a type already named for flags.

    A counter-precedent, recorded honestly

    The distinct-type choice follows Go's reflect, where flag.kind() returns Kind. C# disagrees.
    System.Reflection.MethodAttributes is exactly this shape — a MemberAccessMask = 0x0007 zone holding an
    access level, alongside independent flag bits like Static and Virtual — and C# does not split them into
    distinct types. One [Flags] enum, masks applied by the caller.

    Two respectable languages, two answers. Go's was chosen because distinct types make
    flags.Placement() == SurfaceScript a compile error rather than nonsense that compiles.

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions