Skip to content

Plan-time claiming: pending entries for string-valued resource parameters; promises recorded; products excluded #585

Closed

Description

@David-Noble-at-work

Phase 3 of resource-construction.md.

Resource-typed parameter + string value → pending entry, no existence check (pre-flight owns transitions).
Resource-typed parameter + promise value → the promise binding only, no entry. Products are runtime facts —
no plan-time entry, no output declaration; Appendix A rejected. Acceptance: both demonstration pins flip
green with the ruled assertions (source pending present; destination absent).

Activity

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

    @David-Noble-at-work
    ContributorAuthor

    Ruling 2026-08-20, from judgment scenario 1's authoring: mutation targets are resource-typed
    consumers
    . A delete consumes the file resource exactly as a copy's source does — one pending entry, two
    consumers; at runtime the remove transitions the entry to Gone and its receipt relocates the bytes for undo.
    Step-23 ruling 2's path-typed mutation targets (file.Remove(path string, …)) are overruled; this task's
    scope includes the signature migration (Remove — and any sibling mutators whose target is a resource —
    take the resource), after which a delete-only graph carries its target as pending intent instead of an empty
    catalog section, and scenario 1's single entry carries both consumer links.

  2. David-Noble-at-work commented on Aug 21, 2026

    @David-Noble-at-work
    ContributorAuthor

    Refinement, same ruling (2026-08-20): the second consumer sees Gone. A consumer whose consumed entry is
    Gone fails on the catalog's verdict — it sees the state; it does not rediscover the loss through its
    own I/O. The behavior matrix in 4-resource-management.md §3 now carries this as the consumption table:
    Active → dispatch proceeds (a mutating consumer transitions the entry to Gone; its receipt carries the
    undo); Gone → fail on the verdict; Pending → unreachable at dispatch (pre-flight activated or failed).

    Evidence of today's gap, from judgment scenario 1's manual run: the receipt's resources section shows the
    entry still state: pending after the failed run — nothing transitions it. The remove contributes no
    consumer link (path-typed), and the copy's failure is a rediscovered filesystem error, not a catalog
    verdict. This task closes both halves.

  3. David-Noble-at-work commented on Aug 21, 2026

    @David-Noble-at-work
    ContributorAuthor

    Placement ruling (2026-08-20): the guard is built into the action dispatch seam. Method.Invoke
    (pkg/op/method.go:376) is the funnel — every concrete Action's Do delegates there
    (pkg/op/action_types.go:64/121/177), for graph dispatch and starlark immediate dispatch alike. The
    conversion loop (method.go:385-407, op.Convert at method.go:401) turns slot values into Go arguments;
    the forward call is m.Do at method.go:409. The guard runs between the two: after conversion, before
    the provider method.

    Why there and not a static executor pre-check: after conversion is the earliest point the complete consumed
    set exists — promise-fed and defaulted slots resolve only at slot-fill, so a static guard would miss
    promise-fed consumption. And it closes a live hole: Convert's catalog hit (pkg/op/convert.go:310-317,
    via Current/Lookup) screens no state — today it hands the consumer a Gone generation silently, while
    only Discover's hit-Gone path errors.

    Implementation notes for this task:

    1. The guard walks the converted arguments for catalog residents and reads their entry state; Gone fails
      the dispatch with a typed error so the executor classifies it into a structural run-status reason
      (sibling of ReasonPreflightFailed) — the forward method never ran, so the unit has nothing to
      compensate.
    2. MarkGone (pkg/op/resource_catalog.go:383) gains the destroying unit's id from the activation —
      symmetric with producerID — so the verdict reads "consumed by unit N before unit M could run".
    3. The catalog-resolve verdict stays the in-flight backstop; provider I/O errors still catch out-of-band
      losses.
  4. David-Noble-at-work commented on Aug 21, 2026

    @David-Noble-at-work
    ContributorAuthor

    Chartered (USER ruling, 2026-08-21): the graph's intent rows drop state entirely.

    The graph section borrowed the trace's row type, which is why state: pending appeared at all — the writer
    already forces Pending (IntentEntries, pkg/op/resource_catalog.go:137) and the reader ignores the field
    (reconstructIntentRow). Rather than refusing non-pending values, the field goes away: the intent row
    becomes its own type — IntentEntry{ID, URI} — and presence in the section IS the pending claim.
    Pending is definitional, not recorded. The trace keeps LedgerEntrySnapshot with
    state/etag/digest/producer, where observation genuinely varies (a paused run's trace legitimately carries
    pending rows).

    Scope for this task:

    1. IntentEntries() []IntentEntry; graphData.Resources []IntentEntry; unpackCatalog reads the new row.
    2. Re-pin the round-trip tests (graph_catalog_section_test.go) — document bytes change; old documents
      die, schema_version stays 1, per standing precedent.
    3. The star pins asserting e["state"] == "pending" (test_graph_catalog_contract.star,
      test_judgment_1_delete_then_copy.star) flip to asserting the field's absence; the Go catalog pin
      keeps presence/absence and drops its state assertion.
    4. writ readback untouched — it consumes the trace's rows.

    Known boundary, accepted and recorded in §5.4: decoders are lenient, so a stray hand-edited state: is
    ignored rather than refused — strict decoding is a codec-wide property, not this change's scope.

    Design doc (§5.4) and the plan (phase-3 item 4) updated with the ruling; both ride the open PR #600.

  5. David-Noble-at-work commented on Aug 21, 2026

    @David-Noble-at-work
    ContributorAuthor

    Rulings (USER, 2026-08-22): the claims taxonomy and scoped verification. Recorded in
    4-resource-management.md (§3 verification + consumption tables, §5.5) and the plan's rewritten phase-3
    docket.

    1. Gone-tolerant consumers are allowed — declared per call (force=True on the mutators, the -f the
      industry knows). The claim still enters the catalog; absence is recorded in the receipt ("target was
      already absent"), never fatal. Aggregation: an entry with both a required and a tolerated consumer is
      required — tolerance cannot waive another consumer's need.
    2. Claims verification pushes down to subgraph executors. A graph is an object holding a root subgraph
      — there is only subgraph execution — so each executor verifies the claims its own units consume when
      its scope starts. Choose cases are subgraphs: their claims are verified only when they matter — when
      they're hit. Unreached scopes never judge their claims. Mid-run production before a case is selected
      satisfies that case's claims naturally.
    3. writ decommission authors force=True — a target the user removed by hand decommissions as a
      recorded no-op instead of failing the plan.

    The deliberately strict case stands: an unconditional consumer of a promise-less mid-run product fails
    pre-flight — ordering-by-coincidence is what "ordering comes from promises" forbids.

    Also noted in the plan (development to start immediately, alongside): two e2e lore scenarios — Docker and
    Go Toolchain — covering deployment, upgrade, reconcile, decommission; Docker first
    ; prior spec material
    to be located and folded in.

    Revised PR slicing: A — stateless intent rows + this docket in the plan; B — scoped pre-flight + required
    consequence + tolerance plumbing; C — resource-typed mutators with force= + the authoring sweep; D — the
    tolerance-aware consumed-Gone guard + destroyer stamp.

  6. David-Noble-at-work commented on Aug 22, 2026

    @David-Noble-at-work
    ContributorAuthor

    Ruling (USER, 2026-08-22): tolerance is MissingResourcePolicy, and the type is the declaration.
    Supersedes the force=True / +devlore:tolerated-by discussion on this thread.

    An enumeration with explicit values (no iota) and a fail-safe zero:

    • MissingResourcePolicyStop (0 — zero value and default): a missing resource fails the consuming scope.
    • MissingResourcePolicyIgnore: the call is made — the provider handles the absence; the receipt records
      "target was already absent".
    • MissingResourcePolicySkip: the call is skipped — the unit does not dispatch, recorded as skipped.

    A warning is produced whenever a missing resource is detected, under every policy. No directive: at
    announcement, a MissingResourcePolicy-typed parameter links to the method's single consumed
    (resource-typed) parameter; ambiguity (two consumed params) refuses at announcement. Aggregation across
    consumers of one entry: Stop wins. Open consequence for the implementing PR: what a skipped unit's promise
    consumers see.

    Directive-inventory rulings, same session: +devlore:planner retires (inferred from the
    <MethodName>Planner naming convention + op.Planner interface check — 4/4 of today's uses conform);
    +devlore:struct_param removed (zero consumers; Convert already hydrates); +devlore:lifetime removed
    with its dormant machinery; +devlore:access retires separately per 3.6. Surviving set:
    defaults, property, root. The "wire" comment vocabulary renames in a background cleanup pass.

  7. David-Noble-at-work commented on Aug 22, 2026

    @David-Noble-at-work
    ContributorAuthor

    Ruling (USER, 2026-08-22): Skip is DROPPED. Its undo story is trivially clean — a skipped unit never
    dispatched, made no mutation, produced no receipt, contributes nothing to the unwind. The forward side is
    what killed it: a skipped unit's promise consumers would see nil (misattributed downstream failures), and
    the trace could not tell "skipped" from "ran and produced nothing" without new marker machinery — none of
    which Ignore needs, and choose cases already express optional steps structurally (claims judged only when
    hit). The enum is {Stop 0, Ignore 1}; "skip" refuses at parse, pinned. Re-adding later is purely
    additive.

    PR D delivers the docket's remainder: the destroyer stamp (MarkGone(r, destroyerID); trace rows gain
    destroyed_by), and the consumed-Gone guard at the ruled dispatch seam — Stop fails on the narrated
    verdict ("consumes X, destroyed by unit N before it could run"), Ignore proceeds to the provider, warning
    on every detection. Judgment scenario 1 sharpens to assert the narrated verdict; the new gone-tolerance
    scenario pins Ignore end to end.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions