Skip to content

chore: terminology part 2 - requires/provides, Span, source-side rename, std.ref, descriptor and event consolidation #454

Description

@pskry

chore: terminology part 2 - one sweep over the naming thorns

Follow-up to the original terminology pass (TERMINOLOGY.md). Inventory
taken from the actual spec/engine/event symbols. One bucket issue;
commits reference this. Naming decisions marked [NAME] get decided
in-session as the work reaches them, not up front.

1. inputs/promises -> requires/provides (ruled)

The resource graph currently spells one concept five ways:

Current Where
promises / inputs stub params user configs, std stubs
spec.Promiser (Promises(), Inputs()) step-level interface
spec.StaticPromiseProvider / StaticInputProvider deploy-level (cross-deploy graph)
spec.ResourceDeclarer (ResourceDeclarations()) config structs
spec.Resource / ResourceKind / RefResource graph nodes (keep as-is)
  • Language surface: provides = [...] / requires = [...] in stubs,
    configs, fixtures, site docs, TERMINOLOGY.md.
  • Go surface: rename methods to Provides()/Requires();
    consolidate the three overlapping interfaces rather than
    renaming all in place. [NAME] the surviving interface(s).
  • Test_Rule_*/goldens/e2e fixtures updated in the same commit.

2. SourceSpan -> Span (ruled)

"Source" means three things today: (a) content origin (SourceRef,
src params), (b) the machine running scampi (package source), (c)
code locations. Ruling: Source == content-origin, exclusively.

  • spec.SourceSpan -> spec.Span; event.Template.Source ->
    .Span; review FieldSpan (likely stays).
  • Sweep doc comments that say "source span".

3. Rename meaning (b): "the machine running scampi" (open)

Package source (configs, env, local cache; "never touches target")
needs a name that is not Source. [NAME] - candidates to discuss:
controller (Ansible: control node), host, origin, operator,
workstation (Chef), base. The interface it exports
(source.Source, MemSource, LocalPosixSource) renames with it.
Note the coupling: this package BACKS meaning (a) reads - naming must
keep "content origins are resolved controller-side" legible.

4. std.ln -> std.ref (ruled)

The posix-ln pun is cryptic. Barely used (no production step
implements the output side per #445), so the rename is nearly free.

  • std.scampi decl + doc comment, spec.Ref stays, goldens.

5. Flatten the op-description chain (grown complexity)

Rendering one plan line takes three hops:
Op -> OpDescriber.OpDescription() -> OpDescription.PlanTemplate() -> PlanTemplate{ID, Text, Data}. The middle interface (OpDescription)
is a one-method pass-through; every op carries a <x>Desc struct just
to satisfy it. 30 files implement the chain.

  • Investigate: can ops implement PlanTemplate() PlanTemplate
    directly (check the diagnostic.go consumer)? Do the *Desc
    structs earn their keep, or fold into the ops?
  • Related audit while there: OpInspector/InspectField naming
    vs Diffable - consistent optional-interface vocabulary.

6. event.Change / event.Result / spec.Result.Changed (open)

Three "change/result" names in one pipeline: event.Change (live
drift/mutation event with ChangePhase), event.Result (step
verdict), spec.Result{Changed} (op outcome). Investigate fold or
rename - e.g. event.Change -> event.Drift/event.Mutation
[NAME]; check StepOutcome (StepUnchanged/StepChanged/
StepFailed) reads cleanly against whatever wins.

Order

1 -> 2 -> 4 (mechanical, ruled) then 5 -> 6 -> 3 (need discussion as
they are reached). Each item lands as its own gated commit referencing
this issue; the issue closes when the table above has no unchecked
rows.

Metadata

Metadata

Assignees

Labels

compat/breakingBreaking change that won't be backward compatibleimpact/highChanges what the tool can do, unlocks new use caseskind/enhancementImprove existing functionalitypriority/highThe priority is high

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions