Skip to content

Add failing tests for #1338#1346

Draft
prompt-driven-github[bot] wants to merge 2 commits into
mainfrom
fix/issue-1338
Draft

Add failing tests for #1338#1346
prompt-driven-github[bot] wants to merge 2 commits into
mainfrom
fix/issue-1338

Conversation

@prompt-driven-github
Copy link
Copy Markdown
Contributor

Summary

Adds failing regression tests that detect the stale worktree branch bug reported in #1338.

Test Files

  • Unit tests: tests/test_agentic_checkup_orchestrator.py
  • Unit tests: tests/test_checkup_pr_mode.py
  • Unit tests: tests/test_agentic_test_orchestrator.py
  • E2E tests: Not applicable; real-git unit tests cover worktree setup behavior end to end.

What This PR Contains

  • Failing tests for stale checkup/issue-N branches registered to removed worktrees
  • Failing tests for plain leftover and live checked-out branch behavior
  • Failing tests for scoped PR-mode checkup/pr-* branches
  • Failing tests for the sibling test/issue-* worktree setup path
  • Caller-boundary tests confirming actionable setup errors are preserved

Root Cause

pdd/agentic_checkup_orchestrator.py ignores failed branch deletion in checkup worktree setup and does not prune stale Git worktree metadata before deleting/recreating branches. The PR-mode checkup setup has the same ignored-delete pattern, and pdd/agentic_test_orchestrator.py checks deletion but also lacks stale worktree pruning. Stale branch registrations therefore make setup fall through to generic branch-exists or delete failures instead of recovering or returning an actionable live-worktree error.

Verification

Targeted regression run on current code produced the expected failures: 6 failed, 4 passed. The passing tests cover already-working paths and caller error propagation; the failures identify the stale/live branch cleanup gaps.

Next Steps

  1. Add git worktree prune before branch cleanup in affected setup helpers
  2. Honor branch deletion results and only treat branches as removed after successful deletion
  3. Return a direct actionable error when a branch is checked out in a live worktree
  4. Re-run targeted regression tests and relevant full test files
  5. Mark PR as ready for review after the implementation fix lands

Fixes #1338


Generated by PDD agentic bug workflow

@prompt-driven-github
Copy link
Copy Markdown
Contributor Author

Step 7/8: Verification & Final Report (Iteration 3)

Test Results After Fixes

  • Total: 1,307 observed test outcomes across bounded/full and targeted runs
  • Passed: 1,294
  • Failed: 5 environment-sensitive failures in the bounded root run; the same 5 passed when PDD_AUTO_UPDATE was unset
  • Previously failing, now passing: 6
  • New failures: 0 tied to the Checkup fails when a stale checkup/issue-* branch already exists #1338 stale-worktree fix

Build Status

Fail / incomplete. Python package compile/import passed, frontend Vite build passed with the existing chunk-size warning, and VS Code extension compile passed. Frontend tsc --noEmit still fails at pdd/frontend/components/DependencyViewer.tsx:517, matching Step 3. Root wheel build remains blocked because make and the Python build module are unavailable in this environment.

Overall Status

2 blocking verification issues remain: the full root pytest suite did not complete under the 240-second cap, and the existing frontend TypeScript build error remains.

Verification Scope

PR mode: full suite requested. Full-suite verification was attempted with:

PDD_MODEL_DEFAULT=vertex_ai/gemini-3-flash-preview PDD_RUN_REAL_LLM_TESTS=1 PDD_RUN_LLM_TESTS=1 PDD_PATH="$PWD/pdd" PYTHONPATH="$PWD/pdd:${PYTHONPATH:-}" python -m pytest -vv tests

It timed out after 240 seconds after collecting 10,661 tests and observing partial progress. Full-suite pass cannot be claimed.

Issue Alignment

issue_aligned: true — the current PR worktree substantively addresses #1338 by pruning stale Git worktree registrations, honoring branch-delete failures, and returning actionable live-worktree conflict errors. The #1338 regression set plus Step 6c CLI integration tests pass.

Issues Summary

Severity Category Module Description Fixed
critical test_failure PR full-suite verification Root pytest full suite timed out before completion; no authoritative full-suite pass available for full PR scope. No
critical build_error frontend npx tsc --noEmit still fails in pdd/frontend/components/DependencyViewer.tsx:517 due position: unknown not assignable to XYPosition. No
medium missing_dep root build make build cannot run because make is not installed in the environment. No
medium missing_dep root build python -m build cannot run because the Python build package is missing. No
low test_failure core CLI tests Five auto-update tests failed under inherited PDD_AUTO_UPDATE=false; they passed when rerun with that variable unset. Yes
low artifact frontend Vite build emits the existing chunk-size warning for a 1.66 MB JS bundle. No
medium missing_dep dependency audit Previous dependency audit found example-project dependency gaps and frontend audit advisories including direct yaml. No
low artifact architecture metadata Previous interface check found 15 architecture metadata mapping issues unrelated to the #1338 fix path. No
critical test_failure checkup worktree setup Original stale/live checkup/issue-*, scoped checkup/pr-*, and sibling test/issue-* worktree regressions now pass. Yes

Checkup complete.

{
  "success": false,
  "message": "PR mode full-scope verification: issue_aligned=true and the #1338 regression/integration tests pass, but success is false because the requested full root pytest suite did not complete under the time cap and the existing frontend TypeScript build error remains. Verification scope: full suite attempted, not completed.",
  "tech_stack": [
    "Python 3.12",
    "pytest",
    "Click",
    "Git worktree",
    "TypeScript",
    "React",
    "Vite",
    "Vitest",
    "VS Code Extension",
    "Mocha"
  ],
  "issue_aligned": true,
  "issues": [
    {
      "module": "PR full-suite verification",
      "file": "tests",
      "severity": "critical",
      "category": "test_failure",
      "description": "Full PR-scope pytest command collected 10661 tests but timed out after 240 seconds before completion, so full-suite pass cannot be claimed.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "frontend",
      "file": "pdd/frontend/components/DependencyViewer.tsx",
      "severity": "critical",
      "category": "build_error",
      "description": "Frontend TypeScript check still fails at line 517 because a node object has position typed as unknown instead of XYPosition.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "root build",
      "file": "Makefile",
      "severity": "medium",
      "category": "missing_dep",
      "description": "Root wheel build via make build could not run because make is unavailable in this environment.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "root build",
      "file": "pyproject.toml",
      "severity": "medium",
      "category": "missing_dep",
      "description": "Root wheel build via python -m build could not run because the Python build module is unavailable in this environment.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "core CLI tests",
      "file": "tests/core/test_cli.py",
      "severity": "low",
      "category": "test_failure",
      "description": "Five auto-update tests failed during the bounded full pytest run because the checkup environment inherited PDD_AUTO_UPDATE=false.",
      "fixed": true,
      "fix_description": "Reran the same five tests with PDD_AUTO_UPDATE unset; all 5 passed, confirming this was an environment-sensitive verification artifact and not a #1338 regression."
    },
    {
      "module": "frontend",
      "file": "pdd/frontend",
      "severity": "low",
      "category": "artifact",
      "description": "Vite production build passes but warns that the generated JS chunk is larger than 500 kB after minification.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "dependency audit",
      "file": "pdd/frontend/package-lock.json",
      "severity": "medium",
      "category": "missing_dep",
      "description": "Previous dependency audit found frontend npm audit advisories, including direct yaml, plus unrelated example dependency gaps.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "architecture metadata",
      "file": "architecture.json",
      "severity": "low",
      "category": "artifact",
      "description": "Previous interface check found 15 architecture metadata mapping issues, unrelated to the #1338 stale-worktree fix path.",
      "fixed": false,
      "fix_description": ""
    },
    {
      "module": "agentic_checkup_orchestrator",
      "file": "pdd/agentic_checkup_orchestrator.py",
      "severity": "critical",
      "category": "test_failure",
      "description": "Original #1338 stale/live checkup worktree branch handling failed for checkup/issue-* and scoped checkup/pr-* branches.",
      "fixed": true,
      "fix_description": "Current PR code prunes stale worktree registrations, checks branch-delete results, and returns actionable live-worktree errors. The issue regression tests pass."
    },
    {
      "module": "agentic_test_orchestrator",
      "file": "pdd/agentic_test_orchestrator.py",
      "severity": "critical",
      "category": "test_failure",
      "description": "Sibling stale/live test/issue-* worktree branch handling previously failed when stale worktree metadata blocked branch deletion.",
      "fixed": true,
      "fix_description": "Current PR code prunes stale worktree registrations and preserves clear live-worktree conflict errors. The sibling regression tests pass."
    }
  ],
  "changed_files": [
    "pdd/agentic_checkup_orchestrator.py",
    "pdd/agentic_test_orchestrator.py",
    "tests/test_agentic_checkup.py"
  ]
}

PR Push Status

Skipped push because: Checkup did not verify all issues fixed after 3 fix-verify iterations. Step 7 reported success=false. Message: PR mode full-scope verification: issue_aligned=true and the #1338 regression/integration tests pass, but success is false because the requested full root pytest suite did not complete under the time cap and the existing frontend TypeScript build error remains. Verification scope: full suite attempted, not completed.

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.

Checkup fails when a stale checkup/issue-* branch already exists

1 participant