✨ Tell agents to stage ephemeral files in /tmp - #84
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe migration harness now uses ChangesLayered prompt assembly
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Config
participant migrationHarness
participant promptPackage
participant ACP
Config->>migrationHarness: provide environment-backed prompt context
migrationHarness->>promptPackage: build stagePrompt from configured layers
promptPackage-->>migrationHarness: return ordered stagePrompt
migrationHarness->>ACP: submit stagePrompt
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: build linters: plugin(logcheck): plugin "logcheck" not found Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| Write ephemeral files to /tmp, never into the repository working tree: | ||
| - scripts you need to run: write them to /tmp, make them executable there, | ||
| and run them from there | ||
| - scratch notes, plans, logs, and intermediate output |
There was a problem hiding this comment.
This is the bit that makes scripts work. Rest of the prompt is unchanged, output's byte-identical to main once you strip this block off the front.
The agent's working directory is the git worktree whose commits the harness pushes to the user's branch at the end of a stage. Nothing tells the agent that, so it treats the worktree as scratch space. Given a skill that said only "write the script to a file, make it executable, run it", claude-sonnet-5 wrote to /workspace/repo/verify.sh and left /tmp empty. Re-running the same skill with only this change: before: tool: write · /workspace/repo/verify.sh after: tool: shell · cat > /tmp/verify.sh << 'EOF' The rule goes in the harness rather than in each SkillCard because it describes the execution environment, not any particular skill — relying on every skill author to restate it is how it gets forgotten. It is emitted first so a skill that does say where to write cannot read as overriding it. Prompt assembly moves out of main into internal/prompt, alongside the other harness packages. Build is a pure function over an explicit Layers struct; the prompt env vars join the rest in config.LoadFromEnv, so env access stays in one package and the composition is testable without touching the environment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Rename the config fields to say what they are: AgentPrompt, WorkflowGuide, StageInstructions. cfg.Instructions was ambiguous next to the model and provider fields. Read KONVEYOR_WORKFLOW_GUIDE, falling back to KONVEYOR_PLAYBOOK_INSTRUCTIONS. that merge rather than depending on merge order. Drop the fallback once konveyor#80 has landed everywhere. Correct the staging rules: the harness commits .gitignore and .konveyor/analysis.json itself, so "you decide what gets committed" overstated the agent's control. Rename the ## Migration Context header to ## Workflow Guide. The prompt package is general purpose and shouldn't hardcode migration. Always end the prompt with exactly one newline. Sections appended "\n\n" but StageTask appended nothing, so the ending varied with whether a stage task was set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Follow-up to #53, refs #70.
The agent's working directory is the git worktree the harness pushes at the end of a stage, but nothing tells the agent that, so it treats the repo as scratch space. Gave it a skill that only said "write the script to a file, make it executable, run it" — it wrote to
/workspace/repo/verify.shand left/tmpempty. Same skill with this change goes to/tmp.Rule's in the harness rather than in each SkillCard since it's about the environment, not the skill. Emitted first so a skill that does say where to write can't override it.
Also moved prompt assembly out of main into
internal/promptwhile I was in there.Buildis a pure function over aLayersstruct and the prompt env vars moved intoconfig.LoadFromEnvwith the rest, so env reads stay in one package. Can split that out if you'd rather review the behaviour change on its own.Summary by CodeRabbit
New Features
/tmpinstead of the repository working tree.Bug Fixes
Tests