Skip to main content
Goal: check a completed CodeRabbit review of a specific commit in a Millwork run. You are done with the offline example when: its pass, reject and no-verdict cases work. After an approved live run, read the receipt for the final decision. Use this when CodeRabbit already reviews your changes and you want its result to inform a Millwork run. Your output check applies rules you choose, and the run receipt records what happened. If your pull request check already makes the same decision and you need no Millwork run, keep that workflow.

Start with the offline example

Run Recipe D, download the checked example once, then try its local cases without keys or CodeRabbit calls.

How it works

Suppose a coding worker changes an authorization rule. CodeRabbit reviews the committed change before the Millwork run. During the run, your agent endpoint returns an evidence ID; the saved review stays in your store. This diagram shows how the review becomes one output-check result. With on_eval: [], a failed check records needs_review and emits execution.needs_review; your app can use that webhook to route a person to the run. If the review record is unavailable or altered, the check gives no verdict. The steps below show the exact fields and commands.

Example review question

A coding worker changes an authorization rule and commits SHA aaaaaaaa…aaaa (40 characters). The trusted runner records team/repo, base main, the full SHA, CodeRabbit CLI version, process result, and JSONL events. The output check asks: Did CodeRabbit report a completed review of that exact SHA under the selected severity rule?
What this check can say: CodeRabbit reported that the selected review of the pinned commit against your configured base completed, with no reported major or critical finding and no positive unreviewed-file count. CodeRabbit CLI 0.8.1 can omit that count even on a successful review, so this check cannot prove that every changed file was inspected. It also cannot say the code has no defects or that the commit answers this particular Millwork task.
For example, a completed review with one major finding returns:
severity_allowed: false names the failed rule. no_reported_unreviewed_files: true means CodeRabbit did not report a positive unreviewed-file count; the count may be absent, so it is not proof of file-by-file coverage. With on_eval: [], Millwork records needs_review and emits execution.needs_review. A failed CodeRabbit process, altered record, or unavailable store yields no verdict. quality_score cannot override the hard result and is not a code-quality grade.

Before you begin

  • Node.js 20 or newer and the published @millwork/solver@0.1.19 CLI. Install that pinned version, or ask your administrator to install it if your organization manages CLI access. Recipe E uses the existing --recipe d; there is no --recipe e command. The live API steps also use curl and jq.
  • For the local cases, no API key or CodeRabbit account is needed. Downloading the checked example bundle requires one docs-site network request; after that, the cases run locally without CodeRabbit or Millwork API calls.
  • For the live path, a clean checkout at a full commit SHA, an installed GitHub Cloud repository in your CodeRabbit organization, CodeRabbit CLI 0.7.7 or newer with authorized authentication, and customer-controlled private evidence storage. CodeRabbit’s CLI reference describes remote --agent review and its completion fields. Your plan may limit review rate.
  • A fast HTTPS agent endpoint and output-check endpoint. The agent endpoint must respond within 30 seconds, the output check within 10 seconds, and its connection probe within 3 seconds. Finish code work and CodeRabbit review before either call.
After installation, check the version used by this recipe:
Expected: package_version is 0.1.19. Keep that version for the protected-check connection steps below.
1

Try the published completion check

Start with Recipe D’s maintained adapter. Its first local cases need no keys:
Expected: selected_recipe is d and the local report has passed: true. If the CLI does not recognize --recipe, check its installed version before continuing. Recipe D explains the trusted evidence pattern you will adapt.
2

Run the CodeRabbit adapter offline

The checked example bundle below contains the saved-review reader, capture command, fast pointer endpoint, fixture seeder, and negative cases. While still in review-check, copy the downloader into coderabbit-example.mjs, review it, then run it. It creates a new coderabbit-review-check subdirectory, downloads only this docs site’s example asset, and checks every file and the bundle manifest before writing anything.
The displayed key is synthetic fixture data, never a production credential. Expected: the Node cases pass, then the published CLI reports passed: true for its contract cases. Its labelled cases show a completed review, major finding, skipped review, reported unreviewed file, wrong SHA and stale record. The Node suite also checks a dated raw CodeRabbit CLI 0.8.1 capture that omitted the optional count, plus tampering and an unavailable store. The passing seeded fixture expires after 24 hours; remove your own offline-store directory and run npm run seed again if it has expired. No command here contacts CodeRabbit, TypeSafe or a paid Millwork run.To use this check in the Recipe D adapter you generated, return to review-check, place the two check files beside selected-check.mjs, and replace that generated selection file:
Expected: passed: true. The generated existing-node-app.mjs imports this selected-check.mjs; keep check.mjs and review-record.mjs beside it when deploying. Replace the synthetic key and store with private production values before deployment.
3

Capture one completed review in your runner

Your coding worker or CI commits the change first. In a clean checkout of that commit, use the included capture.mjs under your runner’s control. It resolves the full git rev-parse HEAD, calls CodeRabbit’s remote review with --source-branch set to that SHA, records the CLI version and JSONL, then stores an immutable, signed record. Configure CR_REPO, CR_BASE, CR_EVIDENCE_DIR and CR_EVIDENCE_KEY privately; do not put keys in a command argument, chat, task body, or receipt.
That is the command the runner executes; the example runs it only when you explicitly launch capture.mjs. Before a live launch, approve the CodeRabbit destination, review quota or spend limit, and evidence retention with the account owner. A repaired commit needs a new SHA, a new review, and a new evidence ID. Preserve one dated raw --agent capture with its exact CLI version for the field mapping you deploy. Do not infer PR-side pre_merge_checks from this CLI stream.After that approval, load CR_REPO, CR_BASE, CR_EVIDENCE_DIR and CR_EVIDENCE_KEY privately in the clean checkout and run:
Expected: one JSON line with evidence_id, the full reviewed_sha, and cli_version. Keep the evidence ID for the run; a nonzero exit means there is no saved review to use.
4

Connect the two fast endpoints

Keep the evidence store and signing key in your environment. The included agent-pointer.mjs reads task.inputs_ref.json.evidence_id and returns only:
  1. Deploy the generated existing-node-app.mjs with the check files you selected above. Follow Recipe 0’s deployment steps to serve it over HTTPS, accept chunked POST requests, and answer the reserved probe without reading the store. Its endpoint contract defines the callback.
  2. Set CR_AGENT_TOKEN, CR_EVIDENCE_DIR and CR_EVIDENCE_KEY privately. Start the sample pointer process with node /path/to/review-check/coderabbit-review-check/agent-pointer.mjs. It listens on localhost by default.
  3. Place the pointer process behind your HTTPS ingress. Protect both endpoints with private bearer credentials. Keep the check’s key and raw review in your environment; only the opaque evidence ID enters the Millwork candidate.
  4. Before sending test traffic, get the endpoint owner’s approval. Then test protected access before a live run.
The agent endpoint can read the pointer supplied in the task, but that pointer is not trusted review proof. The check reads its own signed record and compares the saved review context with your configured repository and base. When CodeRabbit reports remote: true rather than a repository name, repository identity rests on the trusted runner’s CR_REPO value. The check receives no run ID or expected commit SHA, so it cannot prove this review belongs to the current task.
5

Authorize a run and read the receipt

Ask your administrator to register the agent endpoint’s bearer token and give you its credential handle. Put that handle in endpoint.auth_ref, never the token itself. Save the HTTPS endpoint as an agent option with POST /v1/arms, setting data_class_grants to a class your organization supports. Keep the returned arm_id. If your organization cannot provision an agent credential handle yet, finish the offline path and ask its administrator to set up the broker before a live run.
The endpoint URL must be your deployed agent endpoint; it receives { "task": { ... } } and returns the saved pointer. The handle must resolve to the same bearer token you configured for that endpoint. The example’s sandbox grant must be available to your organization.Save that body as coderabbit-agent.json. After its owner approves the agent endpoint’s registration probe, use an organization API key to register it. The sample endpoint answers the authenticated HEAD probe without reading evidence or starting a review:
Expected: HTTP 201 and status: "ready"; keep arm_id. If the response is lost, list GET /v1/arms before creating another option. A degraded status means the endpoint or brokered credential needs repair before the run.Connect the output-check endpoint separately with the same pinned CLI 0.1.19. The CLI reads the SOLVERAPI_API_KEY used for the API call above; keep it in your private terminal environment. Ask the endpoint owner to approve the registration probe. At that endpoint, issue a dedicated adapter key and configure it to accept the key. Set VERIFIER_URL to its deployed HTTPS route; CUSTOMER_APP_ORIGIN is the Millwork app address for private key entry, not the check endpoint:
Enter the adapter key only in the hidden terminal prompt. Customer-controlled automation may instead supply VERIFIER_CONNECTION_SECRET in the command’s host environment; never place the key in a command argument, chat, or task body. Without a private interactive terminal or configured secret, the command returns state: "action_required" with a saved verifier_id, private continue_url, intent_id, and expiry. The intended person opens that URL in their browser, signs in to the same organization, and enters the key privately. Then finish the saved intent using the same organization API key:
Keep the returned verifier_id only after connection.status is active and the ID matches the saved intent. A pending ID alone is not a connected check. Set VERIFIER_ID to that ID and test the protected route with a fresh request key before selecting it for a run:
Expected: headline: "ready", probe.contract.validated: true, and the same verifier_id. The reserved probe may return is_correct: false on purpose; that does not make a compatible endpoint unavailable. If connection or probe fails, repair it before the run. Keep arm_id and VERIFIER_ID for the request below.In the run request, pin routing.required_arm_id, send the opaque evidence ID in task.inputs_ref.json, set the approved budget, select verifier_id, and use on_eval: []. Review the full request and get explicit approval before sending a paid run. Results and receipts covers the recorded outcome.
The request sends only an opaque evidence ID, not source code or raw review text. Use a data class your organization and saved agent actually support; the current API accepts public and sandbox for saved arms. Save the JSON above as coderabbit-run.json. Only after the run owner approves that exact request, set a unique RUN_KEY and submit it with your organization API key:
Expected: the submission returns a queued execution ID, not a completed result. Read only the status and receipt for this pointer-only agent run:
While status is queued, running, or progress, repeat only the status read; do not submit the run again. Once status is final, fetch its receipt:
The results and receipts guide explains the fields. A complete allowed review has is_correct: true and named receipt results. A hard false with on_eval: [] becomes needs_review and emits execution.needs_review; it does not start fallback or repair. A technical outage produces no review verdict. The receipt records the Millwork platform fee separately from agent-reported usage; the earlier CodeRabbit review cost is external and is not included.

Interpret and recover

The receipt shows whether the saved CodeRabbit review met these rules. It cannot show whether that commit completes this task: the check cannot compare the reviewed SHA with this task’s expected SHA. A signed review record can be reused for another task within 24 hours. Bind each record to the intended task in your own runner before submitting a run. Do not treat the receipt as a code-safety certificate.
Keep the review runner, store, agent endpoint and check in your own environment. Use the offline matrix first. Before any vendor review or paid Millwork run, approve its destination, budget and retention. Record the exact CLI version and raw capture used to confirm the field mapping.
For a separate semantic question about source meaning, use the existing Jev recipe. The exact SHA, review-completion and severity rules here remain code-owned; a Jev score cannot establish them.