Skip to content

fix: surface hollow-success failures instead of swallowing them (#3480)#3484

Draft
rysweet wants to merge 5 commits intomainfrom
fix/3480-surface-hollow-success-failures
Draft

fix: surface hollow-success failures instead of swallowing them (#3480)#3484
rysweet wants to merge 5 commits intomainfrom
fix/3480-surface-hollow-success-failures

Conversation

@rysweet
Copy link
Owner

@rysweet rysweet commented Mar 23, 2026

Summary

Fixes #3480 — surfaces hollow-success failures in the default-workflow recipe instead of silently swallowing them.

Changes

Step 03b (extract-issue-number): Empty issue number extraction now exits 1 with diagnostic message instead of silently returning empty string.

Step 15 (commit-push):

  • Nothing staged → exits 1 with hollow-success error + git status output
  • Missing upstream tracking → warns and skips push
  • set -euo pipefail enforced, rebase/push split for proper error propagation

Step 16 (create-draft-pr):

  • Zero commits ahead → exits 1 with hollow-success error + root cause list
  • Non-numeric issue number → exits 1
  • set -euo pipefail enforced with quoted paths

Merge Criteria Evidence

✅ CI Green

All GitHub Actions checks pass.

✅ Gadugi Outside-In Testing

Scenario: tests/gadugi/hollow-success-failure-surfacing.yaml

  • 16 steps validating failure surfacing in steps 03b, 15, 16
  • Validated with gadugi-test validate and executed with gadugi-test run
  • All steps pass

✅ Documentation

Internal workflow fix — no user-facing documentation changes needed.

✅ Quality Audit (3 cycles converged)

Cycle SEEK VALIDATE FIX Result
1 10 findings (1 Critical rejected as false positive via 3-agent validation) 3 agents: analyzer, reviewer, architect — ≥2/3 consensus 7 confirmed findings fixed: tests for step-15/16 error paths, removed stderr suppression, added set -euo pipefail, upstream detection 32 tests pass
2 8 findings (3 Medium, 5 Low) Self-validated (specific, code-referenced) Fixed: set -euo pipefail ordering before cd, quoted paths, separated rev-list pipeline, added 2 more tests 32 tests pass
3 1 Low finding (rebase && chain under set -e) N/A (Low only) Split git pull --rebase && git push to separate statements CONVERGED — clean scan

SEC-001 (Critical) REJECTED: The unquoted heredoc pattern is correct by design — the Rust recipe runner substitutes {{var}}$RECIPE_VAR_var env var references. Bash single-pass expansion makes this safe. Confirmed by test_shell_injection_fix_3045_3076.py (14 adversarial payloads) and PR #3140 documentation.

✅ No Unrelated Changes

All changes scoped to steps 03b, 15, 16 in default-workflow.yaml and their regression tests.

Three default-workflow steps silently succeeded when they should have failed:

1. step-03b-extract-issue-number: Returned empty string without error when
   no issue URL was found in the creation output. Now exits 1 with a clear
   diagnostic message showing the raw output that failed to parse.

2. step-15-commit-push: Exited 0 with a WARNING when nothing was staged to
   commit — masking the critical fact that implementation agents wrote files
   outside the worktree. Now exits 1 with hollow-success diagnostic including
   git status output.

3. step-16-create-draft-pr: Exited 0 when 0 commits were ahead of main and
   no PR existed — silently completing the workflow with no deliverable.
   Now exits 1 with diagnostic listing possible causes.

Tests updated: empty extraction now correctly raises RuntimeError instead of
returning empty string. All 23 existing tests pass.

Fixes #3480

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Repo Guardian - Passed

All 4 files changed in this PR were reviewed and none contain ephemeral content.

File Assessment
.claude/context/PROJECT.md ✅ Configuration file — durable project metadata (name fix: "fixy" → "amplihack")
CLAUDE.md ✅ Configuration file — durable framework instructions with user preferences block
amplifier-bundle/recipes/default-workflow.yaml ✅ Reusable workflow recipe — converts silent warnings to hard failures for hollow-success detection
amplifier-bundle/tools/test_default_workflow_fixes.py ✅ Test file — updated assertions to match new error-surfacing behavior

No violations found. All changes are durable, reusable artifacts that belong in the repository.

Generated by Repo Guardian for issue #3484 ·

- hollow-success-failure-surfacing.yaml: validates step-03b, step-15, step-16
  failure surfacing and 23 regression tests pass
- supply-chain-audit-skill.yaml: structural verification of the skill

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Repo Guardian - Action Required

One of the 6 changed files contains ephemeral, environment-specific content that does not belong in the repository.


Violation: tests/gadugi/supply-chain-audit-skill.yaml

Why flagged: The file hardcodes a path to a temporary development worktree that is specific to one developer's machine and will not exist after the feature branch is cleaned up:

agents:
  - name: "verifier"
    type: "system"
    config:
      cwd: "/home/azureuser/src/amplihack/worktrees/feat/issue--review-github-issue-3440-gh-issue-view-3440-and-th"
```

This violates the "Scripts with hardcoded environment-specific values" rule. Specifically:

- The path `/home/azureuser/src/amplihack/worktrees/feat/...` points to a **git worktree** that was created temporarily during development of a different PR (#3481). Worktrees are ephemeral by nature — they are created and deleted as work progresses.
- This test was authored for PR #3481 (`supply-chain-audit skill`) but appears in PR #3484. It validates content at a worktree path that will not exist on CI, other contributors' machines, or after the worktree is cleaned up.
- Running this test anywhere other than the original author's machine at the time of writing will fail immediately.

**Where this content belongs:** If this is an integration test for the supply-chain-audit skill, it should either:
1. Use a relative path or an environment variable (e.g., `$AMPLIHACK_HOME` or `$PWD`) instead of the hardcoded worktree path, or
2. Be submitted as part of PR #3481 (the supply-chain-audit PR) once the skill is merged to main, with paths updated to point to the installed skill location.

---

### Note (non-blocking): `tests/gadugi/hollow-success-failure-surfacing.yaml`

This file also uses `cwd: "/home/azureuser/src/amplihack"` — a hardcoded absolute path to a specific machine's repo location. This is borderline: if `/home/azureuser/src/amplihack` is the standard path for this project's CI runner, it may be acceptable. If not, consider parameterizing it. This is not flagged as a hard violation since it at least refers to the repo root rather than a temporary worktree.

---

To override, add a PR comment containing:
```
repo-guardian:override (reason)

where (reason) is a required non-empty justification for allowing the file(s).

Generated by Repo Guardian for issue #3484 ·

@github-actions
Copy link
Contributor

PR Triage Report

Risk: Medium | Priority: High | Draft — awaiting CI

Assessment

  • Type: Bug fix — surfaces silent failures in 3 default-workflow steps that previously produced hollow successes
  • Scope: Steps 03b (extract-issue-number), 15 (commit-push), 16 (create-draft-pr)
  • CI Status: In progress — Validate Code and conclusion checks still running
  • Test Coverage: 23 regression tests pass; 2 tests updated from "empty-is-ok" to "RuntimeError-on-empty"

Findings

Recommendation

Await CI green, then convert draft → ready for review. High-value reliability fix. Once CI passes this should be fast-tracked — it prevents a systemic class of silent workflow failures.

Generated by PR Triage Agent ·

- Add tests for step-15/16 error paths (TEST-001)
- Remove stderr suppression from git rebase (REL-001)
- Add set -euo pipefail to steps 15/16 (SHELL-001/002)
- Add upstream tracking detection (REL-002)
- Add REL-003 comment documenting intentional gh pr list resilience

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Repo Guardian - Action Required

One of the 6 changed files contains ephemeral, environment-specific content that does not belong in the repository.


Violation: tests/gadugi/supply-chain-audit-skill.yaml

Why flagged: The file hardcodes a path to a temporary development worktree that is specific to one developer's machine and will not exist once the feature branch is cleaned up:

agents:
  - name: "verifier"
    type: "system"
    config:
      cwd: "/home/azureuser/src/amplihack/worktrees/feat/issue--review-github-issue-3440-gh-issue-view-3440-and-th"
```

This violates the "Scripts with hardcoded environment-specific values" rule:

- The path `/home/azureuser/src/amplihack/worktrees/feat/...` points to a **git worktree** created temporarily during development of PR #3481. Worktrees are ephemeral — they are created and deleted as development progresses.
- This test validates content that will not exist on CI runners, other contributors' machines, or after the worktree is cleaned up.
- The test was authored for PR #3481 (`supply-chain-audit skill`) but is included here in PR #3484 with a path that references that other branch's worktree, which cannot exist after merge.

**Where this content belongs:**
1. If intended as a permanent integration test, update the `cwd` to use a relative path or environment variable (e.g., `$AMPLIHACK_HOME`, `$PWD`, or `${GITHUB_WORKSPACE}`) instead of the hardcoded worktree path, **and** ensure it targets a path that will exist post-merge.
2. Alternatively, defer this test to PR #3481 (the supply-chain-audit PR) once the skill is merged to `main`, with paths updated to the installed skill location.

---

### Note (non-blocking): `tests/gadugi/hollow-success-failure-surfacing.yaml`

This file uses `cwd: "/home/azureuser/src/amplihack"` — a hardcoded absolute path. This is borderline: if `/home/azureuser/src/amplihack` is the standard path on this project's CI runners it may be acceptable. It is not flagged as a hard violation since it refers to the stable repo root rather than a temporary worktree. Consider parameterizing with `$GITHUB_WORKSPACE` or a similar variable for portability.

---

### Clean files (no violations)

| File | Assessment |
|------|------------|
| `.claude/context/PROJECT.md` | ✅ Durable config — project name correction |
| `CLAUDE.md` | ✅ Durable config — user preferences block |
| `amplifier-bundle/recipes/default-workflow.yaml` | ✅ Reusable workflow recipe — converts silent warnings to hard failures |
| `amplifier-bundle/tools/test_default_workflow_fixes.py` | ✅ Test file — updated assertions for new error-surfacing behavior |

---

To override, add a PR comment containing:
```
repo-guardian:override (reason)

where (reason) is a required non-empty justification for allowing the file(s).

Generated by Repo Guardian for issue #3484 ·

- Move set -euo pipefail before cd in steps 15/16 (C2-001)
- Quote worktree path in cd commands (C2-002)
- Separate git rev-list from grep pipeline (C2-007/C2-003)
- Add upstream tracking detection test (C2-005)
- Add PR idempotency detection test (C2-006)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Repo Guardian - Action Required

One of the 6 changed files contains ephemeral, environment-specific content that does not belong in the repository.


Violation: tests/gadugi/supply-chain-audit-skill.yaml

Why flagged: The file hardcodes a path to a temporary development worktree specific to one developer's machine that will not exist once the feature branch is cleaned up:

agents:
  - name: "verifier"
    type: "system"
    config:
      cwd: "/home/azureuser/src/amplihack/worktrees/feat/issue--review-github-issue-3440-gh-issue-view-3440-and-th"
```

This violates the "Scripts with hardcoded environment-specific values" rule:

- The path `/home/azureuser/src/amplihack/worktrees/feat/...` points to a **git worktree** created temporarily during development of PR #3481. Worktrees are ephemeral — created and deleted as development progresses.
- This test validates content that will not exist on CI runners, other contributors' machines, or after the worktree is removed.
- Running this test anywhere other than the original author's machine at the time of writing will fail immediately.

**Where this content belongs:**
1. If intended as a permanent integration test, update the `cwd` to use a relative path or environment variable (e.g., `$AMPLIHACK_HOME`, `$PWD`, or `${GITHUB_WORKSPACE}`) pointing to a location that will exist post-merge.
2. Alternatively, defer this test to PR #3481 (the supply-chain-audit PR) once the skill is merged to `main`, with paths updated to the installed skill location.

---

### Note (non-blocking): `tests/gadugi/hollow-success-failure-surfacing.yaml`

This file uses `cwd: "/home/azureuser/src/amplihack"` — a hardcoded absolute path. This is borderline: if `/home/azureuser/src/amplihack` is the standard path on this project's CI runners it may be acceptable. It is not flagged as a hard violation since it refers to the stable repo root rather than a temporary worktree. Consider parameterizing with `$GITHUB_WORKSPACE` or a similar variable for portability.

---

### Clean files (no violations)

| File | Assessment |
|------|------------|
| `.claude/context/PROJECT.md` | ✅ Durable config — project name correction |
| `CLAUDE.md` | ✅ Durable config — user preferences block |
| `amplifier-bundle/recipes/default-workflow.yaml` | ✅ Reusable workflow recipe — converts silent warnings to hard failures |
| `amplifier-bundle/tools/test_default_workflow_fixes.py` | ✅ Test file — updated assertions for new error-surfacing behavior |

---

To override, add a PR comment containing:
```
repo-guardian:override (reason)

where (reason) is a required non-empty justification for allowing the file(s).

Generated by Repo Guardian for issue #3484 ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Repo Guardian - Action Required

One of the 6 changed files contains ephemeral, environment-specific content that does not belong in the repository.


Violation: tests/gadugi/supply-chain-audit-skill.yaml

Why flagged: The file hardcodes a path to a temporary development worktree specific to one developer's machine that will not exist once the feature branch is cleaned up:

agents:
  - name: "verifier"
    type: "system"
    config:
      cwd: "/home/azureuser/src/amplihack/worktrees/feat/issue--review-github-issue-3440-gh-issue-view-3440-and-th"
```

This violates the "Scripts with hardcoded environment-specific values" rule:

- The path `/home/azureuser/src/amplihack/worktrees/feat/...` points to a **git worktree** created temporarily during development of PR #3481. Worktrees are ephemeral — created and deleted as development progresses.
- This test validates content that will not exist on CI runners, other contributors' machines, or after the worktree is removed.
- Running this test anywhere other than the original author's machine at the time of writing will fail immediately.

**Where this content belongs:**
1. If intended as a permanent integration test, update the `cwd` to use a relative path or environment variable (e.g., `$AMPLIHACK_HOME`, `$PWD`, or `${GITHUB_WORKSPACE}`) pointing to a location that will exist post-merge.
2. Alternatively, defer this test to PR #3481 (the supply-chain-audit PR) once the skill is merged to `main`, with paths updated to the installed skill location.

---

### Note (non-blocking): `tests/gadugi/hollow-success-failure-surfacing.yaml`

This file uses `cwd: "/home/azureuser/src/amplihack"` — a hardcoded absolute path. This is borderline: if `/home/azureuser/src/amplihack` is the standard path on this project's CI runners it may be acceptable. It is not flagged as a hard violation since it refers to the stable repo root rather than a temporary worktree. Consider parameterizing with `$GITHUB_WORKSPACE` or a similar variable for portability.

---

### Clean files (no violations)

| File | Assessment |
|------|------------|
| `.claude/context/PROJECT.md` | ✅ Durable config — project name correction |
| `CLAUDE.md` | ✅ Durable config — user preferences block |
| `amplifier-bundle/recipes/default-workflow.yaml` | ✅ Reusable workflow recipe — converts silent warnings to hard failures |
| `amplifier-bundle/tools/test_default_workflow_fixes.py` | ✅ Test file — updated assertions for new error-surfacing behavior |

---

To override, add a PR comment containing:
```
repo-guardian:override (reason)

where (reason) is a required non-empty justification for allowing the file(s).

Generated by Repo Guardian for issue #3484 ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

smart-orchestrator hollow success: 32 steps pass but zero commits produced

1 participant