Repository navigation
Description
Every provider resource's ConvertFrom mints a resource with no identity and returns it as a slot value:
| Provider | Site | Returns |
|---|---|---|
appnet |
resource.go:293 |
&Resource{SourceURL: u} |
git |
resource.go:381 |
&Resource{SourcePath: …} |
pkg |
resource.go:328 |
&Resource{Name: str} |
service |
resource.go:304 |
&Resource{Name: str} |
file |
regular.go:233, directory.go:243, symbolic_link.go:246, resource_base.go:338 |
&Regular{resource: resource{SourcePath: …}} etc. |
None calls op.NewResourceBase, so the embedded op.ResourceBase stays zero and URI() returns "". The value is unclaimed, uninterned, and identity-less — and every doc comment hands the problem downstream rather than solving it:
"Provider methods consuming the projected Resource are responsible for re-canonicalization via their own
NewResource/DiscoverResourcepath when full identity is required."
That is the resource model depending on each consumer's good manners, which is the same thing #625 exists to stop depending on.
Why this is separate from #625
The seal governs construction from outside the package. ConvertFrom is a method on the resource, in its own package, so the seal permits it by design.
What #625 does change here
Convert step 7 reaches ConvertFrom by probing reflect.New(target) for TargetConverter (convert.go:364). After sealing, a resource slot's type is an interface, so the probe yields a pointer-to-interface with an empty method set, Implements returns false, and step 7 stops firing for resource slots entirely. Combined with tryHydrateStruct declining for the same reason, both identity-less routes into a resource slot close.
That leaves CanConvertFrom/ConvertFrom largely unreachable for resources — which is the decision this issue needs to make.
The decision
- Delete them — if step 7 can no longer reach them for resource slots, they are dead weight carrying a misleading contract.
- Make them honest — return an error instead of an identity-less value, so the failure is loud wherever they are still reached.
Option 1 has a consequence to size first: typesAreInterconvertible (convert.go:542 path 4) uses CanConvertFrom as its only bridge for string ↔ <provider>.Resource at plan time, since it deliberately does not probe registered-Resource construction (that needs a RuntimeEnvironment). Removing the probe makes a same-named-slot collision that is tolerated today become a hard collision in Subgraph.mergeBubbled.
Note file already lives in that state — its kind-indifferent methods take the Resource interface today — so this is a known condition being extended, not a new one. Authored strings are unaffected either way: they bind through op.RegisterResourceMint (#619), not through this path.
Activity
David-Noble-at-work commentedon Aug 24, 2026
Deferred (USER, 2026-08-24): too early to decide. The fork rests on a claim that has been read off the code but never observed, and on a contract question that cannot be answered until it is.
What has to be observed first
After #625 part 1, a resource slot's type is an interface, so
tryTargetConverter's probe (pkg/op/convert.go:364) doesreflect.New(target)and gets a pointer-to-interface with an empty method set —Implements(targetConverterType)returns false and step 7 should stop firing for resource slots entirely. That is inference from readingreflect's contract, not a measurement.#641 should observe it directly and record the result here.
Why the decision waits on that
The candidate answer is to split the pair — keep
CanConvertFrom, makeConvertFromreturn an error — because they do different jobs:CanConvertFrommints nothing and is the only bridge makingstring ↔ <provider>.Resourceplan-time-compatible (typesAreInterconvertibledeliberately cannot probe registered construction, which needs aRuntimeEnvironment), whileConvertFromis the half that produces the identity-less value.But that leaves a type advertising convertibility and then refusing to convert, which is an incoherent contract on its face. Whether that incoherence is acceptable depends on whether
CanConvertFromstill has a live consumer after part 1 — which is exactly what has not been observed. If nothing reaches either method, deleting both is clean and the incoherence never arises.Open sub-questions to settle at the same time
file's unexported baseConvertFrom(resource_base.go:338) follow the same rule? It returns&resource{…}— a bare base that deliberately lackssealedResource(), so it cannot satisfyfile.Resource. Where that value is meant to land is itself unclear.David-Noble-at-work commentedon Aug 25, 2026
The deferral trigger has fired — this is decidable now
Phase 1 (#641, merged) made the observation this issue was waiting on, and pinned it:
pkg/op/provider/service/forgery_test.go→TestConvert_EnvlessStringNoLongerReachesConvertFromop.Convertstep 7 reaches a resource'sTargetConverterby probingreflect.New(target). While the resource was a struct that probe produced a*Resource, which implements the interface, soConvertFromran and returned a value with no URI. Now that the slot type is an interface, the probe produces a pointer-to-interface whose method set is empty — the probe fails and the step declines. The test fails if that ever regains the ability to mint an identity-less resource.So the premise this issue rested on is confirmed rather than assumed, and the fork can be resolved.
Scheduled as step 3 of the current run
function.Providerend-to-end coverage — PR openjson,yaml,memIt may need no code
If nothing reaches
CanConvertFromorConvertFromfor a resource slot any more, the answer is delete both rather than the "keep the probe, error the conversion" split floated earlier — and the incoherent-contract objection to that split never arises.Two things to size before deciding, both from the earlier analysis:
typesAreInterconvertibleusesCanConvertFromas its only plan-time bridge forstring ↔ <provider>.Resource; it deliberately cannot probe registered construction, which needs aRuntimeEnvironment. Removing the probe turns a tolerated same-named-slot collision into a hard one inSubgraph.mergeBubbled.filealready lives in that state, so this is a known condition extending rather than a new one — but it should be confirmed, not assumed.Also unresolved and worth folding in: three of the eight providers are sealed and five are not, so step 7 still reaches
ConvertFromfor the unsealed five. Whether this lands now or as part of the last sealing phase depends on whether the answer is "delete" — which is cheap to do eight times — or "change behavior", which is not.Not yet started. Sizing happens at step 3 rather than being assumed to be a code change.
David-Noble-at-work commentedon Aug 25, 2026
Ruled: delete both, and sweep after the migration completes (USER, 2026-08-25)
Delete
ConvertFromandCanConvertFrom— not the "keep the probe, error the conversion" split floated earlier. That split existed to preserveCanConvertFromfortypesAreInterconvertible, and the preservation turns out to be unnecessary. Its residual objection — a type advertising convertibility and then refusing to convert — never arises.Scheduled as phase 8, after every provider is sealed, rather than per-phase. Sealing is what makes a pair unreachable, so once the migration completes all sixteen die at once and the sweep is pure dead-code removal instead of a behaviour change threaded through five PRs.
The toss list — sixteen methods, eight pairs, five providers
pkg/op/provider/appnet/resource.go:323,342(*resource).CanConvertFrom,(*resource).ConvertFrompkg/op/provider/git/resource.go:444,463(*resource).CanConvertFrom,(*resource).ConvertFrompkg/op/provider/service/resource.go:350,369(*resource).CanConvertFrom,(*resource).ConvertFrompkg/op/provider/pkg/resource.go:308,328(*Resource).CanConvertFrom,(*Resource).ConvertFrompkg/op/provider/file/regular.go:217,233(*Regular).CanConvertFrom,(*Regular).ConvertFrompkg/op/provider/file/directory.go:227,243(*Directory).CanConvertFrom,(*Directory).ConvertFrompkg/op/provider/file/symbolic_link.go:230,246(*SymbolicLink).CanConvertFrom,(*SymbolicLink).ConvertFrompkg/op/provider/file/resource_base.go:319,338(*resource).CanConvertFrom,(*resource).ConvertFromTheir doc comments go with them. Nothing else.
The framework seam stays
op.TargetConverter(pkg/op/interfaces.go:67),tryTargetConverter(convert.go:364, step 7),targetSideAdvertises(convert.go:632, path 4 oftypesAreInterconvertible), and the cachedtargetConverterTypeare all live for non-resource targets:pkg/op/ordering_edge.go:30—(*OrderingEdge).CanConvertFrom, a real production implementor unrelated to resourcespkg/op/convert_test.go:61— the test double, exercised byTestConvert_TargetConverterop.SourceConverteris a different interface in the other direction and is untouched — five implementors includingop.ResourceBase.CanConvertTo,function, andmem. Easy to conflate by name; deleting the wrong half would break content-addressed conversion.Why this is safe — evidence, not argument
pkg/op/interfaces.go:65: implementers "commonly omitTargetConverterwhen their natural source is content bytes or a parsed structure — not a CLI string." Four resources —json,yaml,mem,function— have never implemented it. The remaining five stop opting in, joining four that already decline.CanConvertFromistypesAreInterconvertible's only bridge forstring ↔ Resource, and removing it was expected to turn a tolerated same-named-slot collision into a hard one inmergeBubbled. Sealing already removed it for five providers — the probe returns false against an interface target — and the full suite, the scenarios, and all three platforms stayed green. Nothing depended on it.TestConvert_EnvlessStringNoLongerReachesConvertFrom.Distinct from #661
Opposite shape. There,
op.ResourceBase.MarshalJSON's doc invites concrete resources to override it and zero implementors do — a contract nobody honours. Here the seam is live, used by a non-resource type, tested, and explicitly optional for resources.Also settled
The second sub-question — does any env-less library caller or test depend on step 7 producing a resource? — is answered by the same evidence: five providers stopped producing one when sealed, and nothing failed.
The remaining sub-question about
file's unexported-baseConvertFrom(resource_base.go:338, returning a bareresourcethat lacks the seal marker) dissolves — it is on the toss list.The ConvertFrom pairs are gone from every sealed resource, constructo…
The ConvertFrom pairs are gone from every sealed resource, constructo…
A value in an any slot carries its type, a resource slot records the …