calesthio/OpenMontage · error · CheckpointValidationError

PREREQUISITE VIOLATION: stage {stage!r} cannot advance; {det

Error message

PREREQUISITE VIOLATION: stage {stage!r} cannot advance; {details}. Pipeline order: {stages}.

What it means

_validate_optional_parameters checks callback_url when present and requires it to start with https:// or http://. Ark calls this URL when the async video task completes; anything else (asset:// , data:, ftp:, bare hostnames) is rejected before submission.

Source

Thrown at lib/checkpoint.py:342

            or checkpoint.get("stage") != predecessor
        ):
            incomplete.append(predecessor)
            continue
        if checkpoint.get("status") != "completed":
            incomplete.append(predecessor)
            continue
        if _stage_requires_approval(pipeline_type, predecessor) and not checkpoint.get(
            "human_approved"
        ):
            unapproved.append(predecessor)

    if incomplete or unapproved:
        details = []
        if incomplete:
            details.append(f"incomplete or missing: {incomplete}")
        if unapproved:
            details.append(f"completed without required approval: {unapproved}")
        raise CheckpointValidationError(
            f"PREREQUISITE VIOLATION: stage {stage!r} cannot advance; "
            + "; ".join(details)
            + f". Pipeline order: {stages}."
        )


def _archive_superseded_checkpoint(path: Path, stage: str) -> None:
    """Copy an existing checkpoint into history/ before it is overwritten.

    Preserves the full run record: stage re-runs (script v1 → v2) and gate
    transitions (awaiting_human → completed) remain reconstructable. Repeated
    in_progress refreshes are NOT archived — they are partial-progress
    heartbeats, not versions.

    Archiving is best-effort and must never crash a checkpoint write: the
    Backlot watcher may hold the file open (Windows denies renames of open
    files), so we copy rather than move, and swallow archival I/O failures.
    """

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Include the scheme: http://localhost:9000/hook locally or https://your-host/webhook in production.
  2. Strip quotes/whitespace from env-provided callback URLs.
  3. Omit callback_url entirely if you poll for completion instead.

Example fix

# before
payload = {"callback_url": "events.example.com/hook"}
# after
payload = {"callback_url": "https://events.example.com/hook"}
Defensive patterns

Strategy: validation

Validate before calling

def callback_ok(url) -> bool:
    return url is None or str(url).startswith(("http://", "https://"))

Type guard

def is_http_url(v) -> bool:
    return str(v).startswith(("http://", "https://"))

Try / catch

try:
    tool.run(inputs)
except ValueError as e:
    if "callback_url" in str(e):
        payload["callback_url"] = "https://" + payload["callback_url"].lstrip("/")
        tool.run(inputs)
    else:
        raise

Prevention

When it happens

Trigger: callback_url="events.example.com/hook", callback_url="asset://cb", callback_url="file:///tmp/hook" in the optional parameters.

Common situations: Config templates omitting the scheme; local dev with localhost used without http://; webhook URLs loaded from env vars that include quotes or whitespace.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/4316ee2b003ccb05. Report an issue: GitHub.