Skip to content

feat(review): support provider execute vector for capture-result - #848

Open
dumbocan wants to merge 2 commits into
Gentleman-Programming:mainfrom
dumbocan:fix/execute-vector-capture
Open

dumbocan wants to merge 2 commits into
Gentleman-Programming:mainfrom
dumbocan:fix/execute-vector-capture

Conversation

@dumbocan

@dumbocan dumbocan commented Sep 10, 2026

Copy link
Copy Markdown

What

Add a provider execute vector for review.capture-result + agent=pi + execute=true so the host relay can drive one-correction admission retries for the Gentle AI issue #4406 fix and a matching refuter retry for #4422.

Includes:

  • New classifier for the execute slot in lib/review-host-relay.ts.
  • New self-contained native method in lib/native-review-cli.ts (generalize captureProviderRole to an execute vector; preserves verbatim tokens and decodes either artifact or review-last-event-closure).
  • Routing in extensions/gentle-ai.ts that uses the new method; legacy materialize+submission path remains as compat.
  • New tests covering the execute routing and verifying that the legacy decode path is not reused.

Validation

  • node --experimental-strip-types --test tests/review-host-relay-routing.test.ts: 22/22 pass.
  • node --experimental-strip-types --test tests/*.test.ts: 1923/1923 pass (cancelled / skipped are pre-existing).

Companion change

The companion provider metadata block lives in dumbocan/gentle-ai#fix/pi-host-relay-admission-retry; the bound block is opt-in. Without it, the legacy 1-run forecast stays; with it, up to 2 host model runs.

Summary by CodeRabbit

  • New Features
    • Added support for capturing review results through the native execute workflow.
    • Execute-based captures now expose argument tokens and optional lens, order, and subject details.
    • Added handling for successful, closed, rejected, unsupported, and failed execute operations.

…ent=pi

Add compatibility layer for Gentle AI upstream patch supporting the new
execute-native flow for reviewer capture:

- lib/review-host-relay.ts: Add ReviewHostRelayExecuteSlot interface,
  isReviewHostRelayExecuteInput() classifier, and reviewHostRelayExecuteSlots()
  extractor for execute=true + agent=pi routing

- lib/native-review-cli.ts: Add CAPTURE_EXECUTE operation, types, decoder,
  and captureExecute() method for the native Go-owned reviewer capture flow

- extensions/gentle-ai.ts: Add execute routing between materialize and
  correction-plan checks, with executeReviewHostRelayExecuteCapture() function
  mirroring the provider role vector pattern

- tests/review-host-relay-routing.test.ts: Add 5 tests covering execute
  capture success, closure response, parameter rejection, unsupported surface,
  and failure reporting

The execute vector is self-contained: Go materializes the prompt, spawns
its locked-down pi subprocess, and admits the raw verdict. The host never
materializes, launches pi, or submits - it runs one CLI invocation verbatim.
…ent=pi

Capture the provider metadata bound for the host relay execute slot, generalize captureProviderRole into a self-contained native method, and route the new execute slots while preserving legacy materialize+submission. Add focused tests.
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 81ebe84e-fe46-420c-b974-e55d9d103d83

📥 Commits

Reviewing files that changed from the base of the PR and between 584309d and befa72e.

📒 Files selected for processing (4)
  • extensions/gentle-ai.ts
  • lib/native-review-cli.ts
  • lib/review-host-relay.ts
  • tests/review-host-relay-routing.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The relay adds a self-contained execute capture vector for Pi and review.capture-result. Tests cover routing, closure, rejected bindings, unsupported native capture, and native operation failure. Existing relay code and tests receive formatting-only changes.

Changes

Execute-native capture routing

Layer / File(s) Summary
Execute capture input vector
lib/review-host-relay.ts
Adds ReviewHostRelayExecuteSlot, execute-input classification, and slot extraction for rendered arguments and optional metadata.
Relay preparation and submission flow
lib/review-host-relay.ts
Reformats relay validation, timeout, transport, preparation, reviewer execution, and submission code without changing behavior.
Routing and execute outcome validation
tests/review-host-relay-routing.test.ts
Preserves existing routing coverage and adds five execute-native capture tests for success, closure, rejected bindings, unsupported capture, and native operation failure.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReviewCollectInput
  participant ReviewHostRelay
  participant NativeCaptureExecute
  participant StatusReconciliation
  ReviewCollectInput->>ReviewHostRelay: submit Pi execute capture input
  ReviewHostRelay->>NativeCaptureExecute: invoke captureExecute with capture arguments
  NativeCaptureExecute-->>ReviewHostRelay: return captured or closed status
  ReviewHostRelay->>StatusReconciliation: reconcile capture outcome
Loading

Suggested reviewers: alan-thegentleman, decode2

Merge Risk: ⚪ Minimal · up to befa7

Adds opt-in Pi execute capture routing while preserving the legacy path. The new outcomes are covered by tests, so no merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding provider execute-vector support for review.capture-result.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@dumbocan

Copy link
Copy Markdown
Author

Self-repair context

This PR is the second half of the same minimal compat fix as dumbocan/gentle-ai#<https://github.com/Gentleman-Programming/gentle-ai/pull/4444>.

Highlights for maintainers reviewing this side:

  • Keeps the legacy materialize + --input decoder intact as a compat path, gated by the classic execute slot.
  • Generalizes captureProviderRole into an execute vector that preserves verbatim tokens and decodes either artifact or review-last-event-closure.
  • The new classifier and method accept the provider metadata block when present and stay 1-run otherwise, so the relay is forward- and backward-compatible.
  • No transport, admission, or retry re-implementation lives in this PR; it just learns to drive the bounded retry that gentle-ai already exposes for the compiled path.

Local validation: focused routing tests 22/22 and the full project suite 1923/1923. Happy to adjust to whatever contract shape upstream prefers for the provider metadata block.

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