feat(agent-repo): create scratchpad/ at task branch top level
Cross-node artifact passing within a workflow manifest — nodes each run in their own ephemeral container/pod with no shared filesystem, so an agent node writing e.g. a verdict to /workspace/verdict is invisible to a downstream kind: script node in the same manifest (found live 2026-09-06, bug-verify-sonnet's verdict-tx). The git task branch is the only channel every node in a manifest actually shares: write to scratchpad/, commit (picked up by finalize.sh's existing git add -A), next node clones the same branch and reads it back. scratchpad/ is scratch, never deliverable content, and must never survive a merge into main — a CI gate in the target repo (agent-runtimes .gitea/workflows/build-images.yaml, no-scratchpad-in-main) is the hard backstop.
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user