Skip to content

Validate submit root is a graph with --skip-validation bypass#27

Draft
arseniy-pplx wants to merge 1 commit into
TangleML:masterfrom
arseniy-pplx:feat/submit-root-validation
Draft

Validate submit root is a graph with --skip-validation bypass#27
arseniy-pplx wants to merge 1 commit into
TangleML:masterfrom
arseniy-pplx:feat/submit-root-validation

Conversation

@arseniy-pplx

Copy link
Copy Markdown

Summary

tangle sdk pipeline-runs submit builds an API submit payload from root_task.componentRef.spec and, until now, submitted whatever root shape the spec resolved to. A bare-container root (implementation.container) is accepted by the API but cannot run under current orchestrators, which require a graph root (implementation.graph) — the run later fails server-side with no local signal.

This change validates the resolved root locally, before any network call, and fails fast with an actionable message when the root is a bare container. An explicit opt-out preserves forward compatibility and advanced testing.

What changed

  • Default validation: submit (and --dry-run) now reject a bare-container root before contacting the API, with a message that names the graph-root requirement and the bypass flag.
  • Correct canonical target: the check runs after hydration/resolution against the canonical submit spec (root_task.componentRef.spec), so valid graph pipelines and resolved component references are not falsely rejected. Graph-root behavior is unchanged.
  • Narrow check: validation is a focused root-shape check (graph vs. bare container) and does not run the full authoring validator, so unrelated validation cannot alter submit compatibility. Specs without an implementation mapping, or without a container root, are left for the API to validate.
  • Explicit bypass: --skip-validation (and a matching skip_validation config key) bypass only this root-shape check and submit the body unchanged. Parsing, hydration, and security checks still run. The config value must be a real boolean; anything else fails with an invalid-config error.
  • Single choke point: the check is threaded through prepare_submit_payload_from_spec, which backs both the dry-run and real-submit paths, while leaving the prepared-body escape hatches untouched.
  • README updated to document the requirement and the bypass.

Test plan

  • Bare-container root is rejected before any client call (submit and dry-run)
  • Rejection message names the graph requirement and --skip-validation
  • --skip-validation submits the bare body unchanged and reaches the client
  • Graph root accepted by default; graph pipeline with a container task accepted
  • skip_validation honored via config file; non-boolean config value rejected
  • Root check does not trigger unrelated authoring validation
  • uv run --frozen pytest -q (pre-existing unrelated failures only), uv build, CLI smoke test

🤖 Generated by Computer

By default, pipeline-runs submit now rejects a bare-container root locally, before any API call, with an actionable message pointing at the graph-root requirement and the bypass flag. The check runs after hydration/resolution against the canonical submit spec (root_task.componentRef.spec), so valid graph pipelines and resolved component references are unaffected.

Add --skip-validation (and a matching skip_validation config key, which must be a real boolean) to bypass only this root-shape check and submit the body unchanged; parsing, hydration, and security checks still run.
Volv-G added a commit that referenced this pull request Jul 15, 2026
Run the full pipelines validate authoring validator during pipeline-runs submit and --dry-run after hydration, and route PipelineRunner through the same base hook. Root graph requirements are enforced by the authoring validator, with README and tests updated. Bump tangle-cli patch version to 0.1.3. This is based on master and intentionally excludes PR #27 skip-validation CLI flag and separate submit-root check.

Assisted-By: devx/5490f7cb-c7e4-4cf5-b525-a8c4e2af55b1
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