Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .archon/workflows/defaults/archon-adversarial-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ nodes:
"status": "running"
}
STATEEOF
sed -i "s/SPRINT_COUNT_PLACEHOLDER/$SPRINT_COUNT/" "$ARTIFACTS/state.json"
STATE_TMP="$ARTIFACTS/state.json.tmp"
sed "s/SPRINT_COUNT_PLACEHOLDER/$SPRINT_COUNT/" "$ARTIFACTS/state.json" > "$STATE_TMP"
mv "$STATE_TMP" "$ARTIFACTS/state.json"
Comment thread
LaplaceYoung marked this conversation as resolved.

echo "{\"totalSprints\": $SPRINT_COUNT, \"appDir\": \"$ARTIFACTS/app\", \"artifactsDir\": \"$ARTIFACTS\"}"
timeout: 30000
Expand Down
10 changes: 10 additions & 0 deletions packages/workflows/src/defaults/bundled-defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ describe('bundled-defaults', () => {
expect(content).toContain('workflow_name');
});

it('archon-adversarial-dev init-workspace should avoid non-portable sed -i', () => {
const content = BUNDLED_WORKFLOWS['archon-adversarial-dev'];
expect(content).toContain('STATE_TMP="$ARTIFACTS/state.json.tmp"');
expect(content).toContain(
'sed "s/SPRINT_COUNT_PLACEHOLDER/$SPRINT_COUNT/" "$ARTIFACTS/state.json" > "$STATE_TMP"'
);
expect(content).toContain('mv "$STATE_TMP" "$ARTIFACTS/state.json"');
expect(content).not.toMatch(/\bsed\s+-i(?:\s*(?:''|\"\"|\S+))?\b/);
});

it('should have valid YAML structure', () => {
// Workflows are YAML files, should parse without error
for (const [name, content] of Object.entries(BUNDLED_WORKFLOWS)) {
Expand Down