diff --git a/harnesses/contexts/agent-repo/v1/init.sh b/harnesses/contexts/agent-repo/v1/init.sh index a53c967..b3ebec6 100755 --- a/harnesses/contexts/agent-repo/v1/init.sh +++ b/harnesses/contexts/agent-repo/v1/init.sh @@ -123,6 +123,35 @@ if [ -d /workspace/project/results ]; then fi mkdir -p /workspace/project/results +# Ensure scratchpad/ exists at the top level (cross-node artifact passing). +# The git branch is this project's shared data channel between manifest +# nodes — each node runs in its own ephemeral container/pod with no shared +# filesystem, so an agent node that needs to hand data to a downstream +# kind: script node (or another agent node) does it by writing here and +# committing/pushing, for the next node to clone the same branch and read +# back. NEVER merged into main — the no-scratchpad-in-main CI gate +# (agent-runtimes .gitea/workflows/build-images.yaml) rejects any commit to +# main that still contains this directory. +mkdir -p /workspace/project/scratchpad +if [ ! -f /workspace/project/scratchpad/README.md ]; then + cat > /workspace/project/scratchpad/README.md << 'SCRATCHPAD_EOF' +# scratchpad/ + +Ephemeral, per-task working data — NOT deliverable content. + +- Use this directory to pass data between nodes in the same workflow + manifest (e.g. an agent node writes a verdict/artifact here for a + downstream `kind: script` node to read back off the SAME branch — the + git branch is the only thing nodes in a manifest share, since each runs + in its own ephemeral container). +- Anything under `scratchpad/` is scratch, not review/deliverable content. + **Do not** reference or copy `scratchpad/` content into the actual + deliverable during integration/merge. +- A CI gate rejects any commit to `main` that still contains a + `scratchpad/` directory — it must never survive merge. +SCRATCHPAD_EOF +fi + # Populate .gitignore (AR-32) GITIGNORE=/workspace/project/.gitignore cat >> "$GITIGNORE" << 'GITIGNORE_EOF'