Skip to content

[Artifact Forest 1/9] Define cycle-safe exhaustive derivative planning #422

Description

@szmyty

Parent: #421

Outcome

Add a canonical planning policy for "build every eligible derivative" without recursively walking cycles or producing duplicate/source-equivalent artifacts.

Problem

Renderflow's graph intentionally supports reversible and competing edges. A naive exhaustive traversal over edges such as fountain -> fdx -> fountain can loop, duplicate work, and create lower-fidelity derivatives from already-derived artifacts.

Model

Introduce a derivative-forest planning mode that is target-oriented.

For a source artifact and policy:

  1. enumerate eligible target artifact identities/capabilities;
  2. exclude source-format identity by default;
  3. compute one selected simple path per target;
  4. forbid repeated format nodes inside a selected path;
  5. deduplicate equivalent target identities;
  6. prefer higher-fidelity/direct source paths over paths starting from another derivative;
  7. preserve unavailable/unsupported targets as diagnostics rather than outputs.

Example:

source: fountain
targets: fdx, fadein, osf, json, pdf

fountain ─→ fdx
         ├→ fadein
         ├→ osf
         ├→ json
         └→ pdf

Deliverables

  • Versioned derivative-forest plan/evidence schema.
  • Explicit source-exclusion and target-deduplication rules.
  • Simple-path/cycle policy.
  • Target identity beyond raw extension where variants/profiles matter.
  • Loss/fidelity budget and path-selection evidence.
  • Provider-availability filtering.
  • CLI/SDK dry-run inspection for the forest.
  • Deterministic fixtures including reversible A ↔ B transforms and competing A → C paths.

Acceptance criteria

  • Reversible graph edges cannot cause recursive execution or duplicate target artifacts.
  • The source format is not regenerated unless explicitly requested.
  • Each target identity is materialized at most once per source/profile.
  • Selected paths contain no repeated format node.
  • Higher-fidelity source-derived paths win according to documented policy.
  • Unsupported/unavailable targets remain explicit.
  • Plan identity includes source, policy, targets, provider/toolchain identity, and relevant options.
  • Existing targeted graph execution remains compatible.
  • Tests cover cycles, aliases, competing paths, unavailable providers, lossy paths, and explicit source-format requests.

Non-goals

No new screenplay, subtitle, or AI provider is implemented here.

Activity

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions