Skip to content

file's four variants are sealed interfaces discriminated by kind(), and converter probes look through a sealed interface - #810

Merged
David-Noble-at-work merged 2 commits into
developfrom
feature/645-seal-file
Sep 5, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
feature/645-seal-file

Conversation

@David-Noble-at-work

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

Copy link
Copy Markdown
Contributor

Thread 2 (Epic:ResourceModel), phase 7 of 625-sealed-provider-resources.md — the phase where the feature's goal is met: every announced resource type is now an interface.

#645 — seal file's four variants

AnyKind, Regular, Directory, SymbolicLink are sealed interfaces over unexported structs, each declaring kind() <Self> (ruling 6) so the compiler keeps the kinds mutually exclusive. Constructors return the interfaces; init registers four implementations and five mints. Consumers (encryption, archive, starcode, plan's tests) hold the interfaces and read Path(), under the 2026-09-04 ruling that this worktree edits them.

op.convert's plan-time probes now resolve a registered sealed interface to its implementation before inspecting converter methods; without that, binding a file.Directory output to a string slot was refused at validation.

Sized first (commit 1); the sizing's misses are recorded in the plan's landed note.

Closes #645

https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW

David Noble added 2 commits September 4, 2026 11:12
…cord the consumer-edit ruling

Phase 7 (#645) sized against develop at 1fc3ea9: file.Resource is already sealed; the four variants embed
one unexported base and add no fields; three constructors return struct pointers; one mint exists. Three
consumer packages hold the pointer type (encryption, archive, starcode) plus one test. Ruled 2026-09-04: this
worktree edits those sites, since the change is mechanical and the phase cannot compile without it. Five
steps listed; status in-progress.

Claude-Session: https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
…nd plan-time converter probes look through a sealed interface

Phase 7 of the sealed-resources plan (#645). AnyKind, Regular, Directory, SymbolicLink become sealed interfaces
over unexported structs, each declaring kind() with its own result type so no concrete type can be two kinds at
once. Constructors return the interfaces with an explicit nil on error; resource.go's init registers the four
implementations and five mints; the plan-path normalizers register the interfaces. Consumers hold the interfaces
(encryption, archive, starcode, plan's tests) and read Path() instead of the field, per the 2026-09-04 ruling;
archive's redundant IsDir check after a kind-honest Exists folds into one refusal.

op.convert's sourceSideAdvertises and targetSideAdvertises probe the registered implementation of a sealed
interface, since the interface type carries none of the struct's converter methods; without it a graph binding
a file.Directory output to a string slot was refused at validation. Generated files are byte-identical. Plan
phase 7 complete; #807 and #808 logged for the typed-nil constructors of earlier phases and the collision
error's struct names.

Claude-Session: https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW
@David-Noble-at-work David-Noble-at-work self-assigned this Sep 4, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 15ac850 into develop Sep 5, 2026
12 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the feature/645-seal-file branch September 5, 2026 00:21
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.

Seal file's four variants, discriminated by kind()

1 participant