Repository navigation
Description
Why now
#712 phase 3 (e54e416, 312f4fb) changed what a document holds for a resource: a declared resource slot records the catalog id and reloads the catalog entry by Lookup(id); an any slot carries a $resource envelope holding the id; dispatch resolves a Resource or a recorded id by id and a run-time string by key. No slot path reaches a provider's resource unmarshaler any more. The catalog's own rows rebuild through Unpack(uri, content), not through a codec unmarshaler.
That leaves the providers' Unmarshal* constructors — methods that construct a resource from a URI string — as code with no slot caller. Their removal is the shape #649's ConvertFrom sweep took: one method family, every provider, one sweep.
Enumeration (2026-09-07, grep -rn '^func (.*) Unmarshal[A-Za-z]*(' pkg/op/provider --include='*.go', tests excluded)
| Provider | Resource types | UnmarshalJSON |
UnmarshalYAML |
UnmarshalText |
|---|---|---|---|---|
| appnet | 1 | 1 | 1 | 1 |
| file | 5 | 5 | 5 | 5 |
| git | 1 | 1 | 1 | 1 |
| json | 1 | 1 | 1 | 1 |
| mem | 1 | 1 | 1 | 1 |
| pkg | 1 | 1 | 1 | 1 |
| service | 1 | 1 | 1 | 1 |
| yaml | 1 | 1 | 1 | 1 |
| total | 12 | 12 | 12 | 12 |
Thirty-six methods. Twenty-four (UnmarshalJSON, UnmarshalYAML) have no caller left in pkg/op. Twelve (UnmarshalText) are still reached, all from the plan-time / immediate-mode conversion of an authored string:
pkg/op/convert.go:647— [Convert]'s text steppkg/op/env_value.go:171— an environment-sourced valuepkg/op/parameter.go:188— a parameter default
Those are the two places 4-resource-management.md §5.6 sanctions construction from a string (plan time and immediate mode), so they are not dead — they are the text-conversion seam wearing a codec interface.
Work
- Delete the 24
UnmarshalJSON/UnmarshalYAMLresource methods and the tests that pin them. A resource is never decoded from a codec: a slot holds an id, a catalog row goes throughUnpack. - Rule on the 12
UnmarshalText: keep them as the text-conversion step, or route the three callers through the receiver registry's constructor path (ConstructorForSourceforstring) so no resource type implementsencoding.TextUnmarshalerat all. The plan for this task records the ruling before code. - Close the A value in an any-typed slot loses its concrete type at save; the document must carry it #712 plan's phase 3 bullet "retire
Discover(uri)on unmarshal" by removal rather than by unreachability.
Evidence of completion
-
grep -rn 'func (.*) UnmarshalJSON\|func (.*) UnmarshalYAML' pkg/op/providerlists no resource type -
UnmarshalTexteither gone from every resource type or kept under a recorded ruling, with the three callers named - No slot, receipt, trace, or catalog path constructs a resource from a string (a test pins each seam)
-
make checkgreen; the sealed-resources plan (docs/plans/feature/625-sealed-provider-resources.md) gains this as a phase
Plan and design documents
| Kind | Document |
|---|---|
| Plan | no branch has opened; the plan arrives with it |
| Design | docs/architecture/4-resource-management.md |
| Design | docs/plans/feature/625-sealed-provider-resources.md (the feature's plan) |
Activity
A bare value or an unknown envelope in an any slot is refused, and th…
A value in an any slot carries its type, a resource slot records the …