Skip to content

AnyEntry: claims that assert existence, not kind #616

Closed
6 of 6 issues completed
Closed

Description

@David-Noble-at-work

Give the claim surface the permissive option the discovery surface already has. A mutation target's kind is not the author's business — a move moves whatever is there — but today the claim's Go type is the kind assertion, so a kind-indifferent operation must either name a kind it does not care about or multiply into one method per kind.

file.AnyEntry is the claim that asserts existence and nothing else. It resolves to the observed kind inside the Pending → Active transition (Gone leaves it unasserted, because nothing was observed) — the moment the model already consults the disk, using the seam op.RootBinder established and the ledger swap rebindEntry already performs.

The immediate payoff: file.move moves any kind again from a plain authored path, file.move_directory retires, and a symbolic link can be moved — a capability that regressed when kind-honest activation landed (#611).

The surface audit (all 27 announced file-provider methods) found three more defects the feature exposes: file.remove's *Regular type contradicts its own documentation ("file or empty directory"); file.unlink is the same operation as remove (both discover → archiveAndPrune → MutationDeleteFile receipt → markEntryGone) and retires; file.remove_all is already rm -rf in its body, with the *Directory claim the only thing keeping it off a file or a link.

The removal family ends up split by blast radius, never by kind — the stdlib's split, arrived at for the same reasons (os.Remove deliberately does not ask the kind; os.RemoveAll opens by calling Remove), and the shape Python declines with os.remove/os.rmdir/shutil.rmtree plus a legacy os.unlink alias.

Tasks: one per phase, filed below.

Plan and design documents

Kind Document
Plan docs/plans/any-entry-claims.md

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

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

    @David-Noble-at-work
    ContributorAuthor

    Complete 2026-08-24. All six phases merged — #617 (PR #624), #618 (#633), #619 (#634), #620 (#636), #621 (#637), #622 (#638) — develop fbec7095.

    A claim can now assert existence without asserting kind. file.Any is that claim; it resolves to the variant the disk shows inside the Pending → Active transition, and an authored path claims as it because the file.Resource interface designates it. The kind became the disk's business, which is what it always was.

    What that bought:

    • file.move moves any kind again — the symbolic-link regression from file.discover and file.resolve; kind-honest activation #611 is closed.
    • file.move_directory and file.unlink retired: both existed only because a claim had to name a kind. The removal family now splits by blast radius, never by kind — the standard library's split, and Go's reason for never needing an Unlink.
    • file.backup claims its source, the surface's last unclaimed mutation. Policy parameters go last throughout.
    • File stopped being the one provider a newcomer learns an exception for: its resource type is named Resource like every other provider's, an interface rather than a struct because file alone has kinds. That made it the template for Sealed provider resources: every announced resource type is an interface #625.

    Two findings the work surfaced, both caught by acceptance pins rather than by review:

    • file.Any was never enrolled in pre-flight's verification gate, so its claims were silently skipped and a missing move source was rediscovered mid-run instead of failing at the starting line (file.move unifies: any kind, no policy, move_directory retires #620).
    • Retiring unlink dropped a safety property in the worst direction: writ decommission would have deleted a hand-written file that had replaced a deployed symlink. The fix was a ruling, not a patch — tolerance covers absence, never a kind mismatch (op.ErrClaimKindMismatch), because Ignore means the goal already holds, which is true of an empty path and false of a surprise. Decommission now claims the kind it deployed, which extends the protection to copies as well (The rest of the mutator surface: remove, unlink retirement, remove_all, backup #621).

    Known coverage gaps are measured and chartered on #635 rather than implied away: Regular.MismatchesKind and Directory.MismatchesKind untested, the kind enum's JSON/YAML paths untested, discover/resolve with nine scenarios and zero unit tests, and the unexported base's kind-blind Exists at zero coverage.

    Plan: docs/plans/any-entry-claims.md. Design: 4-resource-management.md §3 and §5.7; 3.5.4-file-provider.md.

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

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions