Skip to content

Relocate root pipeline relative refs to the output dir (v0.1.32) - #77

Merged
Volv-G merged 1 commit into
masterfrom
piforge/pipeline-validation-investigatio/relocate-root-pipeline-local-ref-62ad732
Oct 4, 2026
Merged

Volv-G merged 1 commit into
masterfrom
piforge/pipeline-validation-investigatio/relocate-root-pipeline-local-ref-62ad732

Conversation

@Volv-G

@Volv-G Volv-G commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

(AI-assisted)

What

pipelines compile now works for any -o location when the root @pipeline uses relative local refs. Version 0.1.32.

Before, only subpipeline children had their author-written relative file:// / resolve:// refs rewritten from the source dir to the output dir. The root's refs were emitted verbatim and then validated against the output dir. So compiling pipeline.py with ref(url="file://../x/config.yaml") into temp/ or /tmp failed with target does not exist relative to the output directory.

How

  • The existing relocation step (now _relocate_local_refs, reusing _relocate_relative_local_url) also runs for the root. The source dir is the script's dir and the target is the output YAML's dir.
  • Compiler-managed refs (@task, subpipeline, @registered) are skipped, as before. Absolute file:///, remote/nested-remote and name: refs are untouched.
  • Compiling in place leaves URLs byte-identical.
  • The root "missing local component" error now says relative refs are resolved from the pipeline source file's directory.

Evidence

  • A new parametrized test compiles a root with relative file://../comp/… and resolve://../comp/…#frag refs to three places: the source dir (URLs verbatim), a deeper temp/ dir, and an unrelated dir. Each output hydrates. The last two fail without the fix.
  • Existing tests that relied on refs resolving next to the output were updated:
    • The unresolvable-ref tests now use a source dir that has no noop.yaml.
    • The decompile round-trip test now writes the generated .py next to the YAML whose relative refs it keeps.
  • Real pipeline (UPI builder, 37 tasks): compiles and hydrates into temp/ and /tmp/x/. Compiling in place gives byte-identical output, root and subgraphs, compared with 0.1.27.

Behaviour note

A relative ref that only resolved because the component was copied next to the compiled output now fails. Relative refs are always read relative to the source file.

The root @pipeline's relative file:// / resolve:// refs were emitted verbatim and then validated against the output dir, so compiling anywhere but the source dir failed. Apply the existing child relocation to the root too.
@Volv-G
Volv-G requested a review from Ark-kun as a code owner October 4, 2026 04:50
@Volv-G
Volv-G merged commit 0c1e0a8 into master Oct 4, 2026
6 checks passed
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.

1 participant