Skip to content

Make the sealed-resource shape structurally enforceable #646

Closed

Description

@David-Noble-at-work

Feature: #625 · Phase 6 of sealed-provider-resources.md.

Make the rule enforceable, so it survives the next contributor without depending on review.

  1. 4.3-resource-registration.md states the shape as the contract for adding a provider resource: the exported name is an interface, sealed by an unexported method; the struct behind it is unexported; the exported constructor is the public contract.
  2. 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 the suite rather than a review.

Judgment scenario: a deliberately non-conforming fixture — exported resource struct, no interface — fails the assertion. Without that, the rule is a convention, and conventions decay.

Depends on #625 part 2 landing first: the assertion "every announced resource type is an interface" is only true once file's variants are converted.

Plan and design documents

Kind Document
Plan docs/plans/feature/646-sealed-shape-enforceable.md
Design docs/architecture/4.3-resource-registration.md
Design docs/plans/feature/625-sealed-provider-resources.md (the feature plan)

Epic: #444 · Feature: #625

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions