Skip to content

Commit c2e3588

Browse files
authored
fix: write structured outputs to /tmp/alcove-outputs.json in v2 agents (#1141)
Skiff-init reads outputs from /tmp/alcove-outputs.json, but agents were only printing JSON to stdout. Use Python json.dump via heredoc to safely handle quotes, newlines, and special characters in output values. Verifier and reviewer agents also exit non-zero on failure/rejection to trigger downstream patch/revision steps. Assisted-by: Claude Opus 4.6 (1M context)
1 parent af6b255 commit c2e3588

7 files changed

Lines changed: 117 additions & 35 deletions

File tree

.alcove/agents/patcher.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ prompt: |
3636
`pytest pulp_service/pulp_service/tests/functional/`
3737
8. **Commit** each fix with a descriptive message.
3838
39-
Output: {
40-
"fixes_applied": ["list of fixes applied"],
41-
"too_complex": false,
42-
"too_complex_reason": ""
43-
}
39+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
40+
Use Python to safely serialize your results:
41+
42+
python3 - <<'PYEOF'
43+
import json
44+
output = {
45+
"fixes_applied": ["description of fix 1"],
46+
"too_complex": False,
47+
"too_complex_reason": ""
48+
}
49+
with open("/tmp/alcove-outputs.json", "w") as f:
50+
json.dump(output, f)
51+
PYEOF
52+
53+
Replace with your actual fixes applied.
4454
4555
timeout: 480
4656
enforcement_mode: monitor

.alcove/agents/planner-v2.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,22 @@ prompt: |
6060
6161
Be concrete. Name files, functions, classes. Do not be vague.
6262
63-
Output: {
64-
"plan": "detailed implementation plan text",
65-
"verification_commands": ["command1", "command2"],
66-
"reviewers_needed": ["django", "security"]
67-
}
63+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
64+
Use Python to safely serialize your plan (handles quotes and newlines):
65+
66+
python3 - <<'PYEOF'
67+
import json
68+
output = {
69+
"plan": """Your detailed implementation plan here.
70+
Can span multiple lines safely.""",
71+
"verification_commands": ["black --check --line-length 100 pulp_service/", "pytest pulp_service/pulp_service/tests/functional/"],
72+
"reviewers_needed": ["django", "security"]
73+
}
74+
with open("/tmp/alcove-outputs.json", "w") as f:
75+
json.dump(output, f)
76+
PYEOF
77+
78+
Replace values with your actual plan and commands.
6879
6980
timeout: 600
7081
enforcement_mode: monitor

.alcove/agents/pulp-developer.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,19 @@ prompt: |
5959
If fixing CI failures or addressing review feedback, focus only on the
6060
specific issues listed. Do not refactor or add features beyond what's needed.
6161
62-
Output: {"summary": "what you implemented and key decisions made"}
62+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
63+
Use Python to safely serialize your summary:
64+
65+
python3 - <<'PYEOF'
66+
import json
67+
output = {
68+
"summary": "What you implemented and key decisions made."
69+
}
70+
with open("/tmp/alcove-outputs.json", "w") as f:
71+
json.dump(output, f)
72+
PYEOF
73+
74+
Replace with your actual summary.
6375
6476
timeout: 1800
6577
enforcement_mode: monitor

.alcove/agents/reviewer-django.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,24 @@ prompt: |
7777
trigger a revision cycle. Only approve if there are no critical or
7878
major issues remaining.
7979
80-
Output: {
81-
"approved": true,
82-
"comments": "summary of review",
83-
"issues": [{"severity": "critical|major|minor", "file": "path", "line": 42, "issue": "description", "suggestion": "how to fix"}]
84-
}
80+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
81+
Use Python to safely serialize your review (handles quotes in comments):
82+
83+
python3 - <<'PYEOF'
84+
import json, sys
85+
approved = True # set to False if critical/major issues found
86+
output = {
87+
"approved": approved,
88+
"comments": "Summary of review findings.",
89+
"issues": []
90+
}
91+
with open("/tmp/alcove-outputs.json", "w") as f:
92+
json.dump(output, f)
93+
if not approved:
94+
sys.exit(1)
95+
PYEOF
96+
97+
Replace with your actual review. Exit non-zero on rejection to trigger revision.
8598
8699
timeout: 600
87100
enforcement_mode: monitor

.alcove/agents/reviewer-security.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,24 @@ prompt: |
8383
trigger a revision cycle. Only approve if there are no critical or
8484
major security issues remaining.
8585
86-
Output: {
87-
"approved": true,
88-
"comments": "summary of review",
89-
"issues": [{"severity": "critical|major|minor", "file": "path", "line": 42, "issue": "description", "suggestion": "how to fix"}]
90-
}
86+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
87+
Use Python to safely serialize your review (handles quotes in comments):
88+
89+
python3 - <<'PYEOF'
90+
import json, sys
91+
approved = True # set to False if critical/major security issues found
92+
output = {
93+
"approved": approved,
94+
"comments": "Summary of security review findings.",
95+
"issues": []
96+
}
97+
with open("/tmp/alcove-outputs.json", "w") as f:
98+
json.dump(output, f)
99+
if not approved:
100+
sys.exit(1)
101+
PYEOF
102+
103+
Replace with your actual review. Exit non-zero on rejection to trigger revision.
91104
92105
timeout: 600
93106
enforcement_mode: monitor

.alcove/agents/triage.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,25 @@ prompt: |
6767
Only set `automatable: true` and produce the full output if you are confident
6868
an agent can implement this end-to-end.
6969
70-
Output: {
71-
"complexity": "small|medium|large",
72-
"target_area": "description of affected area",
73-
"candidate_files": ["file1.py", "file2.py"],
74-
"approach": "how to implement",
75-
"risks": "what could go wrong",
76-
"automatable": true,
77-
"reviewers_needed": ["django", "security"]
78-
}
70+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
71+
Use Python to safely serialize your findings:
72+
73+
python3 - <<'PYEOF'
74+
import json
75+
output = {
76+
"complexity": "small", # or "medium" or "large"
77+
"target_area": "description of affected area",
78+
"candidate_files": ["file1.py", "file2.py"],
79+
"approach": "how to implement",
80+
"risks": "what could go wrong",
81+
"automatable": True,
82+
"reviewers_needed": ["django", "security"]
83+
}
84+
with open("/tmp/alcove-outputs.json", "w") as f:
85+
json.dump(output, f)
86+
PYEOF
87+
88+
Replace values with your actual findings.
7989
8090
timeout: 480
8191
enforcement_mode: monitor

.alcove/agents/verifier.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,24 @@ prompt: |
6262
trigger the patch phase for corrections.
6363
Do not be lenient. A FAIL now is cheaper than a FAIL in CI.
6464
65-
Output: {
66-
"verdict": "pass",
67-
"fixes_required": ["list of things to fix"],
68-
"code_issues": [{"severity": "critical|major|minor", "file": "path", "line": 42, "issue": "description", "suggested_fix": "what to change"}]
69-
}
65+
CRITICAL — YOUR VERY LAST ACTION must be writing outputs to the pipeline file.
66+
Use Python to safely serialize your verdict:
67+
68+
python3 - <<'PYEOF'
69+
import json, sys
70+
verdict = "pass" # or "fail"
71+
output = {
72+
"verdict": verdict,
73+
"fixes_required": [],
74+
"code_issues": []
75+
}
76+
with open("/tmp/alcove-outputs.json", "w") as f:
77+
json.dump(output, f)
78+
if verdict == "fail":
79+
sys.exit(1)
80+
PYEOF
81+
82+
Replace with your actual findings. Exit non-zero on fail to trigger patching.
7083
7184
timeout: 600
7285
enforcement_mode: monitor

0 commit comments

Comments
 (0)