Skip to content

file.discover and file.resolve; kind-honest activation #611

Closed

Description

@David-Noble-at-work

Phase 4, PR 3 of resource-construction.md — the explicit-conversion docket, all eight items. Phase task: #586.

Design: 4-resource-management.md §5.7 — explicit discovery and resolution (the seven rules) — and §9 items 15–18.

  1. The two actions. file.discover(path, kind?="entry") — lstat, the entry itself, no follow — and file.resolve(path, kind?="entry") — stat, what the chain designates (never a link), confinement-judged. kind is a named enum (entry, regular, directory, symbolic_link) with explicit values and UnmarshalText. Stop-only — no on_missing. Results intern as discoveries (observed facts, no production claim).
  2. The runtime path grammar: plan-space plus the under-root rebase; escapes and @name refuse; a machine-absolute input rebases under the bound run root and refuses outside it.
  3. The pure ordering-edge mechanism (exec→discover sequencing) — decided in this PR; test_judgment_discover_after_exec.star gains the edge and TestJudgmentDiscoverAfterExec un-skips.
  4. An authored string into an Entry-typed slot refuses at plan time — a shaped refusal ("state the kind or feed a discovery"), never an incidental construction error.
  5. Kind-honest activation (claims are true when made): per-kind Exists — lstat plus kind test, the SymbolicLink override extended across the taxonomy — and activation's best-effort Etag/Digest capture stops swallowing the kind-mismatch: it becomes a verdict (pkg/op/resource_catalog.go, the Active-entry capture).
  6. The writ audit: find any writ flow claiming linked paths as *Regular — writ claims links as links; re-author any found.

Acceptance: explicit-conversion suite items 4–13 flip green (statuses tracked in the plan's judgment-scenarios section). Phase 4 closes with this PR.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions