Repository navigation
A resource announcement is held to the sealed shape, and the registration document states it as the contract - #867
Merged
David-Noble-at-work merged 5 commits intoSep 8, 2026
Conversation
added 5 commits
September 7, 2026 23:10
A draft for review before any code: one check states the seven rules of the shape, AnnounceResource refuses a type that fails it, the boot-discipline suite walks every announced type with the same check, three fixtures pin the refusals, and 4.3-resource-registration.md becomes the contract. The feature plan's phase 9 reads in progress. Refs #646. Claude-Session: https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
Contract enforcement is added to the announcement of a resource, and nothing is taken away: only AnnounceResource runs the check; providers and plain data types are untouched; the twelve announced resources pass unchanged. Refs #646. Claude-Session: https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
…ads the same rule CheckSealedShape states the seven rules; AnnounceResource refuses a type that fails them, at the one place every resource passes; the boot-discipline suite walks every announced type with the same check through the new AnnouncedType accessor. Three fixtures pin the refusals by message. The rule's first catch: four test fixtures announced a resource as a bare struct and now take the shape, mint included. The seal rule requires a method the interface declares itself, since op.Resource's own unexported method made the first cut vacuous. Refs #646. Claude-Session: https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
… adding a resource Section 5 lists the four things a provider writes -- the sealed interface, the unexported struct, the two registrations in its own init, constructors that return the interface -- and what the announcement checks; section 1 says the announcement refuses any other shape; section 6's sequence gains the registrations and the check. The feature plan's phase 9 and this plan read complete. Refs #646. Claude-Session: https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
…-shape-enforceable
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Contract enforcement is added to the announcement of a resource, and nothing is taken away.
CheckSealedShape(pkg/op/resource_implementation.go): an exported interface embeddingop.Resource, sealed by an unexported method it declares itself, over an unexported struct in the same package whose pointer satisfies it. Seven rules, in the order a reader diagnoses in, each failure naming the type and the rule.AnnounceResourceruns the check at the one place every resource passes, so a non-conforming provider fails to start rather than waiting for a review. Only this door is held to the shape:AnnounceProviderandAnnounceTypeare untouched, and a plain exported struct remains a data type exactly as before.ResourceReceiverType.AnnouncedType()keeps the announced interface, and the boot-discipline suite walks every announced type with the check.4.3-resource-registration.mdlists the four things a provider writes; §1 says the announcement refuses any other shape; §6's sequence carries the registrations and the check.Found on the way, recorded in the plan: four test fixtures announced a resource as a bare struct and were the rule's first catch; they take the shape now. The seal rule's first cut was vacuous, since
op.Resourcehas an unexported method of its own, and the unsealed fixture caught it.Plan:
docs/plans/feature/646-sealed-shape-enforceable.md(complete). Feature plan phase 9 reads complete; #647 is next.Acceptance — #646
4.3-resource-registration.mdstates the shape as the contract for adding a provider resource — §5, with §1 and §6TestBootDiscipline_EveryResourceTypeIsASealedInterface, and the announcement itself refuses it at initTestAnnounceResource_ANonConformingShapeIsRefused(an exported struct; an unsealed interface; a sealed interface over an exported struct), each refusal matched by message, nothing reaching the registryAcceptance — the plan's goals
4.3-resource-registration.mdstates the shape as the contract; its status file and the feature plan record the phaseCloses #646.
https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
Time
Computed by the algorithm of noblefactor-ops#188 at merge.