Skip to content

fix(github): close probe PRs without local gh reads - #397

Merged
miyaontherelay merged 4 commits into
mainfrom
fix/probe-closer-mounted-read
Aug 26, 2026
Merged

fix(github): close probe PRs without local gh reads#397
miyaontherelay merged 4 commits into
mainfrom
fix/probe-closer-mounted-read

Conversation

@miyaontherelay

Copy link
Copy Markdown
Contributor

Decision

Resolve the two gh pr view reads according to what each one was proving:

  • Migrate the pre-close guard to the exact authenticated mounted PR record. The App projection contains state, headRefName/head.ref, body, and title, and Factory already has the exact resolver path.
  • Delete the post-close CLI read-back. GithubConnectionWrite.closePullRequest is a confirmed App mutation: the concrete Relayfile implementation resolves only after the provider PATCH succeeds and confirmWrite reports acked. A second unauthenticated CLI read did not add a stronger authority boundary and cannot execute in the production container.

Missing mounted-read or App-write capabilities fail explicitly. A custom injected probe closer keeps its existing input shape; the default closer alone receives the mount, exact path, and connected write port.

Observed red before implementation

Test Files  1 failed (1)
Tests  9 failed | 1 passed (10)

Error: Command failed: gh pr view 123 --repo AgentWorkforce/pear --json state,headRefName,body,title
GraphQL: Could not resolve to a PullRequest with the number of 123.

AssertionError: expected [] to deeply equal [ "/github/repos/AgentWorkforce__pear/pulls/by-id/123.json" ]

That run used the old implementation and demonstrated that the new mount inputs were ignored while gh was still executed.

Ablation matrix

Columns: T1 mounted guard+close / T2 no CLI read-back / T3 missing mount is diagnostic / T4 default Factory wiring+exact path / T5 close error stays closed.

Individual change reverted T1 T2 T3 T4 T5
none (final) PASS PASS PASS PASS PASS
restore unusable CLI read behavior (spawn gh ENOENT) FAIL FAIL PASS FAIL FAIL
restore post-close read-back requirement FAIL FAIL PASS PASS PASS
omit default Factory mount wiring PASS PASS PASS FAIL PASS
remove diagnostic capability error PASS PASS FAIL PASS PASS

Observed ablation summaries:

CLI-read ablation: Test Files 2 failed (2); Tests 4 failed | 1 passed | 666 skipped (671)
read-back ablation: Test Files 1 failed | 1 passed; Tests 2 failed | 3 passed | 666 skipped (671)
Factory-wiring ablation: Test Files 1 failed | 1 passed; Tests 1 failed | 4 passed | 666 skipped (671)
diagnostic-error ablation: Test Files 1 failed | 1 passed; Tests 1 failed | 4 passed | 666 skipped (671)

Green verification

$ npm run build
> tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json

$ npm exec vitest -- run src/github/probe-closer.test.ts src/mount/relayfile-github-connection-write.test.ts
Test Files  2 passed (2)
Tests  26 passed (26)

$ npm exec vitest -- run src/orchestrator/factory.test.ts --testNamePattern 'treats already-closed mount-resolved probe PRs'
Test Files  1 passed (1)
Tests  1 passed | 660 skipped (661)

$ npm exec vitest -- run src/github/probe-closer.test.ts src/orchestrator/factory.test.ts --testNamePattern 'closeProbePr|treats already-closed mount-resolved probe PRs'
Test Files  2 passed (2)
Tests  11 passed | 660 skipped (671)

Session-Id: 01a03f5e-1101-7122-b7d0-e104ef9468c7
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 39a12491-8aa5-4e1e-9324-670997b00c2f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head bbc8a1277dee470c9044940f361d1bef0a0eb96a.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/github/probe-closer.test.ts Outdated
Session-Id: 01a03f5e-1101-7122-b7d0-e104ef9468c7
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head ff51e00ab0c4da1b44e55a7ced1095902f143830.

Session-Id: 01a03f5e-1101-7122-b7d0-e104ef9468c7
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head a4fb478574b2c928fb8ff73849c2d33ff3276a99.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/github/probe-closer.test.ts
Session-Id: 01a03f5e-1101-7122-b7d0-e104ef9468c7
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head 3ae01db0aecd45eb35a9471562b0a7db22038e6e.

@miyaontherelay
miyaontherelay merged commit 0246a15 into main Aug 26, 2026
12 of 13 checks passed
@miyaontherelay
miyaontherelay deleted the fix/probe-closer-mounted-read branch August 26, 2026 20:17
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.

1 participant