Skip to content

Add agent-agnostic doctor preflight to e2e SetupRepo#1162

Draft
Soph wants to merge 1 commit into
mainfrom
soph/better-e2e-preflight
Draft

Add agent-agnostic doctor preflight to e2e SetupRepo#1162
Soph wants to merge 1 commit into
mainfrom
soph/better-e2e-preflight

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented May 8, 2026

After entire enable and any agent-specific tweaks, run entire doctor --force and fail the test if the output contains an actionable hook-drift marker (currently OUT OF DATE or REVIEW NEEDED). The full output is dumped to /doctor-preflight.log either way so failure traces include the diagnosis. Catches regressions like an incomplete hooks.json from entire enable before any prompt runs and the test fails in confusing ways.

Entire-Checkpoint: e88d4d18a0af


Note

Medium Risk
Moderate risk because it changes SetupRepo to add a new early-failure gate based on CLI output matching, which could introduce new E2E failures/flakiness if doctor output formats change.

Overview
Adds a post-entire enable preflight in SetupRepo that runs entire doctor --force, writes the full output to doctor-preflight.log, and fails early if the output indicates hook drift (currently matching OUT OF DATE or REVIEW NEEDED).

Introduces entire.DoctorOutput to capture doctor output without failing on non-zero exit codes, and adds a small unit test for the hook-drift marker matching logic (findHookDrift).

Reviewed by Cursor Bugbot for commit 8e0a274. Configure here.

After `entire enable` and any agent-specific tweaks, run `entire doctor
--force` and fail the test if the output contains an actionable
hook-drift marker (currently OUT OF DATE or REVIEW NEEDED). The full
output is dumped to <artifact-dir>/doctor-preflight.log either way so
failure traces include the diagnosis. Catches regressions like an
incomplete hooks.json from `entire enable` before any prompt runs and
the test fails in confusing ways.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Entire-Checkpoint: e88d4d18a0af
Copilot AI review requested due to automatic review settings May 8, 2026 16:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an agent-agnostic E2E preflight check to catch actionable hook drift immediately after entire enable, improving failure clarity and avoiding later confusing agent failures.

Changes:

  • Run entire doctor --force during SetupRepo and fail fast if hook-drift markers are present; always write the doctor output to an artifact log.
  • Add DoctorOutput helper to capture doctor output without forcing the caller to fail the test on non-zero exit.
  • Add a focused unit test for hook-drift marker detection logic.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
e2e/testutil/repo.go Adds doctor preflight execution, artifact logging, and hook-drift marker scanning during repo setup.
e2e/testutil/preflight_test.go Adds unit coverage for the hook-drift marker detection helper.
e2e/entire/entire.go Adds DoctorOutput helper to capture entire doctor --force output for preflight/grepping scenarios.

Comment thread e2e/testutil/repo.go
Comment on lines +204 to +207
out, _ := entire.DoctorOutput(dir)
if artDir != "" {
_ = os.WriteFile(filepath.Join(artDir, "doctor-preflight.log"), []byte(out), 0o644)
}
Comment thread e2e/entire/entire.go
Comment on lines +56 to +58
// output, ignoring the exit code. Useful for preflight scans where the
// caller wants to grep for specific findings without failing on
// unrelated non-zero exits (e.g. v2 generation health drift).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants