Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .archon/workflows/defaults/archon-fix-github-issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ nodes:
elif [ -f "$ARTIFACTS_DIR/investigation.md" ]; then
echo "investigation.md exists from investigate step"
else
echo "WARNING: No investigation.md or plan.md found — implement may fail"
# Fail, do not warn. investigate/plan can "succeed" while producing no
# artifact — an AI node that declines the task still exits 0, so the
# refusal reads downstream as a completed investigation. This node holds
# the only cheap deterministic view of that precondition, so it is where
# the run has to stop, before implement spends a model on nothing.
echo "bridge-artifacts: neither investigation.md nor plan.md exists in \$ARTIFACTS_DIR." >&2
echo "The investigate/plan phase produced no specification — implement has nothing to work from." >&2
exit 1
fi
depends_on: [investigate, plan]
trigger_rule: one_success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ nodes:
# pass. (Workflow constitution: the reliability carve-out, not a style rule.)
- id: capture-pr-number
bash: |
# Clear first so .pr-number reflects THIS validation and nothing earlier.
# pr-exists treats the file's presence as authoritative, so a stale one
# left by a prior attempt would send the review tail at a PR that is no
# longer there.
rm -f "$ARTIFACTS_DIR/.pr-number" "$ARTIFACTS_DIR/.pr-url"
Comment on lines +526 to +530

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Run stale-PR cleanup on every failure path.

Because capture-pr-number depends on create-pr at Line 540 without an all_done trigger, a failed or skipped create-pr skips this cleanup. In .archon/workflows/experimental/archon-fix-github-issue-experimental.yaml, Lines 555-563 then treat an old .pr-number file as current, so synthesize can run against a stale PR. An unchecked rm -f also does not prove that both files were removed.

Move cleanup to an always-run node before create-pr, and make pr-exists require a successful current-attempt reset or capture instead of file presence alone. This preserves the supplied workflow contract that .pr-number represents the current attempt.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/workflows/experimental/archon-fix-github-issue-experimental.yaml
around lines 526 - 530, Move the .pr-number and .pr-url removal into a dedicated
always-run node that executes before create-pr, including when upstream
validation fails or is skipped. Update the pr-exists condition to require
evidence that the current attempt successfully reset or captured the PR
artifacts, rather than relying on file presence alone; ensure cleanup failure
prevents stale artifacts from being treated as current.

pr=$(gh pr view --json number --jq .number 2>/dev/null || true)
if ! printf '%s' "$pr" | grep -qE '^[0-9]+$'; then
echo "capture-pr-number: no PR resolves for the current branch." >&2
Expand Down
Loading
Loading