Skip to content

chore: sync upstream Archon #1506 — stop sweeping scratch artifacts#18

Merged
joshuarossi merged 1 commit into
mainfrom
chore/sync-upstream-add-A-fix
May 13, 2026
Merged

chore: sync upstream Archon #1506 — stop sweeping scratch artifacts#18
joshuarossi merged 1 commit into
mainfrom
chore/sync-upstream-add-A-fix

Conversation

@joshuarossi

Copy link
Copy Markdown
Owner

Summary

Cherry-picks coleam00/Archon PR coleam00#1506 onto our fork's main. The upstream commit replaces git add -A with explicit per-file staging in every workflow/command that operates inside the user's worktree, preventing transient review/scratch artifacts (.pr-body.md, review/scope.md, *-report.md, anything under $ARTIFACTS_DIR) from leaking into implementation commits and PRs.

Touched defaults: archon-create-pr, archon-finalize-pr, archon-fix-issue, archon-implement-issue, archon-implement-review-fixes, archon-simplify-changes, archon-fix-github-issue, archon-piv-loop, archon-ralph-dag, archon-refactor-safely, and the experimental archon-fix-github-issue-experimental.

Intentionally left as git add -A upstream (carried through here):

  • archon-release.yaml — working tree validated clean before this step
  • archon-adversarial-dev.yaml — operates inside a dedicated scratch repo, not the user's worktree

Conflict resolution

Only packages/workflows/src/defaults/bundled-defaults.generated.ts conflicted (our recent epic-decompose splice and the upstream sweep-fix touched overlapping bundled entries). Regenerated from the merged source files via bun run generate:bundled.

Validation

  • bun run cli validate workflows — all affected workflows ok; same pre-existing archon-smart-pr-review MCP config issue and python uv warnings as before, unrelated
  • (full bun run validate still recommended on the merge commit)

Test plan

  • Skim the diff to confirm the per-file staging + forbidden-paths blocks landed in every workflow they were intended for
  • Trigger one of the affected workflows (e.g. archon-fix-github-issue or the task-implement chain's create-pr step) and confirm scratch artifacts do not appear in the resulting commit

🤖 Generated with Claude Code

… site (coleam00#1506)

* fix(simplify): stage only edited files, forbid scratch artifacts

The simplify command used `git add -A`, which sweeps untracked review/
report files (e.g. `review/scope.md` left by upstream review nodes) into
the simplification commit. Replace it with explicit per-file staging
using the list of paths edited in Phase 2, plus a forbidden-paths list
so review artifacts, PR-body scratch files, and anything under
`$ARTIFACTS_DIR` cannot leak into the commit.

* fix(fix-github-issue): forbid scratch artifacts in create-pr step

The inline create-pr prompt told the agent to "stage and commit" any
uncommitted changes, which lets transient artifacts from upstream nodes
(`.pr-body.md`, `review/scope.md`, scratch reports) land in the
implementation commit and PR diff. Replace the loose instruction with
explicit per-file staging, a forbidden-paths list, and a rule that any
PR body file written for `--body-file` must live at
`$ARTIFACTS_DIR/pr-body.md` or `/tmp/` — never inside the worktree.
Applied to both the default and experimental variants.

* fix(workflows): purge remaining git add -A in worktree-context steps

Same class of bug as the simplify and create-pr fixes: every
worktree-facing default that used `git add -A` could sweep transient
review/scratch artifacts (`.pr-body.md`, `review/scope.md`,
`*-report.md`, anything left under `$ARTIFACTS_DIR`) into the commit.
Replace with explicit per-file staging plus a forbidden-paths list and
a `git status --porcelain` verification step.

Touched:
- commands: archon-create-pr, archon-finalize-pr, archon-fix-issue,
  archon-implement-issue, archon-implement-review-fixes
- workflows: archon-piv-loop (3 sites), archon-ralph-dag,
  archon-refactor-safely

Intentionally left as `git add -A`:
- archon-release.yaml: working tree validated clean before this step;
  comment already explains why.
- archon-adversarial-dev.yaml: operates inside `$ARTIFACTS_DIR/app/`,
  a dedicated scratch repo, not the user's worktree.
@joshuarossi joshuarossi merged commit 9ce49be into main May 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants