Skip to content

Seal git and appnet #642

Closed
Closed

Description

@David-Noble-at-work

Feature: #625 · Part 1, phase 2 of sealed-provider-resources.md. Follows the phase-1 template.

git (1 file outside its package) and appnet (2). Neither implements Unpacker, so both are mechanical applications of the template: sealed Resource interface, unexported resource struct, constructors and announcement unchanged.

Serialization must not move — the resources section for a given intent stays byte-identical.

Activity

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

    @David-Noble-at-work
    ContributorAuthor

    Two things phase 1 (#641, merged) established that this phase inherits — neither was in the plan.

    1. Every sealed provider registers two things from its own init, not one:

    func init() {
    	// What reflection runs against. The NON-pointer form, matching what the announcement passed while
    	// the resource was a struct.
    	op.RegisterResourceImplementation(reflect.TypeFor[Resource](), reflect.TypeFor[resource]())
    
    	// What an authored string claims as. An interface asserts no kind, so a plain string bound to an
    	// interface-typed slot is refused (§5.7 rule 6) unless the interface designates a claim type. A
    	// single-implementation provider designates itself.
    	op.RegisterResourceMint(reflect.TypeFor[Resource](), reflect.TypeFor[*resource]())
    }

    Omitting the mint does not fail to compile — it fails at plan time with "an authored string cannot bind the interface-typed resource slot", which is how phase 1 found it.

    2. The generated announcement loses its method metadata. The generator derives it by inspecting the exported type; sealing moves the methods onto the unexported struct, so the emitted map becomes nil. For service that cost three framework-facing entries and nothing noticed.

    Check this per provider before transforming it: any method that must be dispatchable has to be declared on the sealed interface. git and appnet should be checked for author-facing resource methods — the failure mode is a silently smaller Starlark surface, not a build error, so the suite will not catch it.

    Also inherited: op.Resource exposes neither ReachabilityURI, Equal, Format, nor the marshalers, so in-package tests reach the struct through a small concrete(t, r) helper rather than widening the exported contract.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions