Skip to content

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 into
developfrom
feature/646-sealed-shape-enforceable
Sep 8, 2026
Merged

David-Noble-at-work merged 5 commits into
developfrom
feature/646-sealed-shape-enforceable

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Contract enforcement is added to the announcement of a resource, and nothing is taken away.

  • One check states the shape. CheckSealedShape (pkg/op/resource_implementation.go): an exported interface embedding op.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.
  • The announcement refuses a type that fails it. AnnounceResource runs 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: AnnounceProvider and AnnounceType are untouched, and a plain exported struct remains a data type exactly as before.
  • The suite reads the same rule. ResourceReceiverType.AnnouncedType() keeps the announced interface, and the boot-discipline suite walks every announced type with the check.
  • The registration document is the contract. §5 of 4.3-resource-registration.md lists 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.Resource has 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.md states the shape as the contract for adding a provider resource — §5, with §1 and §6
  • A test asserts it structurally: every announced resource type is an interface, and the struct behind it is unexported; a future provider that exports its struct fails — TestBootDiscipline_EveryResourceTypeIsASealedInterface, and the announcement itself refuses it at init
  • Judgment scenario: a deliberately non-conforming fixture fails the assertion — TestAnnounceResource_ANonConformingShapeIsRefused (an exported struct; an unsealed interface; a sealed interface over an exported struct), each refusal matched by message, nothing reaching the registry

Acceptance — the plan's goals

  • A resource announced as a struct, as an unsealed interface, or as an interface over an exported struct is refused at announcement, naming the type and the rule
  • Every announced resource type in the tree passes the check, asserted by a walk of the populated registry (twelve today)
  • 4.3-resource-registration.md states the shape as the contract; its status file and the feature plan record the phase

Closes #646.

https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW

Time

Marker UTC Elapsed
opened (first commit) 2026-09-08T06:10:57Z —
submitted (PR opened) 2026-09-08T17:07:37Z 10.9 h after opened
merged 2026-09-08T17:33:38Z 0.4 h after submitted; 11.4 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

David Noble 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
@David-Noble-at-work David-Noble-at-work self-assigned this Sep 8, 2026
@David-Noble-at-work
David-Noble-at-work merged commit b6a3d60 into develop Sep 8, 2026
13 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the feature/646-sealed-shape-enforceable branch September 8, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the sealed-resource shape structurally enforceable

1 participant