abhigyanpatwari/GitNexus · error · SandboxError

sanitized graph metadata does not prove a --pdg build

Error message

sanitized graph metadata does not prove a --pdg build

What it means

gitnexus.json's pdg field must be a non-empty dict. The harness invokes 'analyze ... --pdg' and then requires proof that PDG layers were actually produced; an absent or empty pdg object means the PDG build was silently skipped or produced nothing.

Source

Thrown at eval/workflow_bench/sanitized_graph.py:329

    assert node_result is not None and relation_result is not None
    _parse_empty_query(node_result, label="sanitized graph node proof")
    _parse_empty_query(relation_result, label="sanitized graph relation proof")


def _validate_graph_metadata(root: Path, sanitized_head: str) -> None:
    for name in ("gitnexus.json", "meta.json", "lbug"):
        path = root / ".gitnexus" / name
        metadata = path.lstat()
        if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISREG(metadata.st_mode):
            raise SandboxError(f"sanitized graph asset must be regular and non-symlink: {path}")
    try:
        metadata_payload = json.loads((root / ".gitnexus" / "gitnexus.json").read_text())
    except (OSError, json.JSONDecodeError) as exc:
        raise SandboxError("sanitized graph metadata is malformed") from exc
    if metadata_payload.get("lastCommit") != sanitized_head:
        raise SandboxError("sanitized graph metadata is not bound to the parentless task commit")
    if not isinstance(metadata_payload.get("pdg"), dict) or not metadata_payload["pdg"]:
        raise SandboxError("sanitized graph metadata does not prove a --pdg build")


def prepare_sanitized_graph(
    task: Mapping[str, Any],
    *,
    repo: Path,
    resolved_sha: str,
    parent: Path,
    cache: TaskAssetCache,
    claude_bin: Path | str,
    bwrap_bin: Path | str,
    runtime_mounts: Sequence[ReadOnlyMount],
) -> SanitizedGraphSnapshot:
    """Sanitize, index offline once, scrub, and freeze graph assets for all arms."""

    validate_no_prebuilt_graph_assets(task)
    seed = make_worktree(repo, resolved_sha, parent)
    primary: BaseException | None = None

View on GitHub (pinned to d540b00184)

Solutions

  1. Run the analyze command standalone and confirm gitnexus.json contains a non-empty pdg object.
  2. Verify the gitnexus CLI version supports --pdg and writes the pdg metadata field.
  3. If the target genuinely has no PDG-eligible code, the benchmark task is misconfigured for a PDG-bound graph - pick a task with eligible code.
  4. Check the sandbox prefix did not strip --pdg from the argument vector.
Defensive patterns

Strategy: validation

Validate before calling

import json, os

def assert_pdg_built(root):
    payload = json.loads(open(os.path.join(root, ".gitnexus", "gitnexus.json")).read())
    pdg = payload.get("pdg")
    if not isinstance(pdg, dict) or not pdg:
        raise RuntimeError("analyze did not produce a non-empty pdg metadata object")

Prevention

When it happens

Trigger: The analyze --pdg call dropped the flag, the PDG layer produced nothing (no PDG-eligible code), the indexer version does not populate the pdg metadata key, or the flag was stripped by the sandbox prefix.

Common situations: A CLI version change that renamed/removed the pdg metadata field; a target repo with no PDG-eligible language; --pdg stripped or overridden in the command vector.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/71212feb7f1a6000. Report an issue: GitHub.