Skip to content

DO NOT MERGE — probe: does Copilot apply the review standard? - #128

Closed
juanmaguitar wants to merge 1 commit into
trunkfrom
copilot-review-probe
Closed

DO NOT MERGE — probe: does Copilot apply the review standard?#128
juanmaguitar wants to merge 1 commit into
trunkfrom
copilot-review-probe

Conversation

@juanmaguitar

Copy link
Copy Markdown
Collaborator

Draft, never to be merged. Close it once the answer is in.

What this is testing

#125 moved the review standard to .github/instructions/code-review.instructions.md, a path Copilot code review is documented to read natively. That was never verified against a real review.

Requesting Copilot on #121 was inconclusive: it returned no findings, but that PR fixes the calibration case, so there was nothing to find. Zero findings does not distinguish "applied our standard" from "did a shallow generic pass".

The probe

src/git-branch-info.js and one new IPC handler, planting six violations. Each is named explicitly in the instructions file, and none is catchable by ESLint — the branch lints clean and all 147 tests pass:

  1. execSync('git ...') — Git never shells out; all Git goes through isomorphic-git.
  2. shell: true, with sitePath concatenated straight into the command string — command injection through a contributor-chosen directory name.
  3. execSync and sync fs on a path an ipcMain.handle reaches — the main process runs the UI and must not block.
  4. sitePath + '/.git' — paths compose with path.join, not string concatenation.
  5. A new module and a new IPC handler with no test at all.
  6. catch {} in the handler, swallowing the error before it reaches the renderer's log stream.

How to read the result

Review effort level is set to Balanced for this repo.

Deliberately broken code, to test one thing: whether Copilot code review
actually reads .github/instructions/code-review.instructions.md.

Requesting a review on #121 was inconclusive — it returned no findings, but
that PR fixes the calibration case, so there was nothing to find. Zero
findings does not distinguish "applied the standard" from "did a shallow
generic pass".

This one plants six violations, each named explicitly in the instructions
file and none of them catchable by ESLint (the branch lints clean):

- execSync('git ...') — Git never shells out, all Git goes through
  isomorphic-git
- shell: true, with sitePath concatenated into the command string —
  command injection through a user-chosen directory name
- sync fs and execSync on a path an ipcMain.handle reaches — the main
  process runs the UI and must not block
- sitePath + '/.git' — paths compose with path.join
- a new module and a new IPC handler with no test at all
- catch {} in the handler, swallowing the error before it reaches the
  renderer's log stream

A review that misses all six is not using the instructions file, whatever
the settings say. To be closed either way, never merged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@juanmaguitar
juanmaguitar marked this pull request as ready for review August 6, 2026 08:30
@juanmaguitar
juanmaguitar requested a balanced review from Copilot August 6, 2026 08:38

Copilot AI left a comment

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.

Pull request overview

Draft probe introducing intentional review-standard violations in branch detection.

Changes:

  • Adds synchronous Git branch lookup.
  • Adds an IPC handler with silent error handling.
  • Adds no tests or preload bridge.

Reviewed changes

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

File Description
src/main.js Registers the branch IPC handler.
src/git-branch-info.js Implements branch lookup using filesystem and shell commands.
Suppressed comments (1)

src/git-branch-info.js:17

  • 🔴 Performance [fix here] — execSync can block Electron's main process for the full duration of Git startup or a stalled executable, freezing every window. Replace it with the asynchronous isomorphic-git branch lookup and await that from the handler.
	const out = execSync( 'git -C ' + sitePath + ' rev-parse --abbrev-ref HEAD', {

Comment thread src/git-branch-info.js
}

const head = fs.readFileSync( sitePath + '/.git/HEAD', 'utf8' );
const out = execSync( 'git -C ' + sitePath + ' rev-parse --abbrev-ref HEAD', {
Comment thread src/git-branch-info.js
Comment on lines +17 to +18
const out = execSync( 'git -C ' + sitePath + ' rev-parse --abbrev-ref HEAD', {
shell: true,
Comment thread src/git-branch-info.js
Comment on lines +12 to +16
if ( ! fs.existsSync( sitePath + '/.git' ) ) {
return null;
}

const head = fs.readFileSync( sitePath + '/.git/HEAD', 'utf8' );
Comment thread src/git-branch-info.js
// Returns the checked-out branch for a site directory, or null when the
// directory is not a repository yet.
function readBranch( sitePath ) {
if ( ! fs.existsSync( sitePath + '/.git' ) ) {
Comment thread src/git-branch-info.js

// Returns the checked-out branch for a site directory, or null when the
// directory is not a repository yet.
function readBranch( sitePath ) {
Comment thread src/main.js
Comment on lines +676 to +677
} catch {
return null;
Comment thread src/main.js
return true;
});

ipcMain.handle('site:branch', async (_e, sitePath) => {
@juanmaguitar

Copy link
Copy Markdown
Collaborator Author

Result: the instructions file reaches Copilot. All six planted violations caught, plus a seventh nobody planted — the missing contextBridge entry in src/preload.js, which is its own invariant in the standard.

The proof is not the hit rate, it's the format. Every comment came back as 🔴 Architecture [fix here] / 🟡 Tests [fix here] / 🔵 Cross-platform [fix here] — the dimension, severity and scope taxonomy defined in .github/instructions/code-review.instructions.md and nowhere else. It also cited repo-specific reasoning (zero host prerequisites, isomorphic-git, node --test coverage) that no generic reviewer would have.

So #125/#127 hold: one copy of the standard, at a path Copilot reads natively. .github/copilot-instructions.md stays deleted.

One thing instructions could not suppress, as expected: the "Pull request overview" section restating what the PR does, which the standard explicitly asks reviewers not to write. Structural, not fixable from our side.

Closing — this was never for merging.

@juanmaguitar
juanmaguitar deleted the copilot-review-probe branch August 6, 2026 08:46
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