Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/goulinkh/code-review-harness/llms.txt

Use this file to discover all available pages before exploring further.

@code-review-harness/stdout-sink provides a zero-configuration sink that writes the agent’s review payload as a single JSON line to process.stdout. It requires no authentication and accepts no options, making it the fastest way to test a review pipeline or inspect the raw output before wiring up a platform-specific sink.
createStdoutSink() is the default sink used by the CRH CLI when --sink is not specified.

Installation

npm install @code-review-harness/stdout-sink

Import

import { createStdoutSink } from "@code-review-harness/stdout-sink";

Signature

function createStdoutSink(): StdoutSink
No options. No arguments.

Output format

When the agent calls submit_review, the sink serialises the full review object with JSON.stringify and writes it as a single line followed by a newline character (\n) to process.stdout. The stdout sink uses Type.Record(Type.String(), Type.Unknown()) as its schema — it accepts any JSON object the agent produces. This means the output shape is determined entirely by what you prompt the agent to include. For a typical CRH review the output looks something like this:
{"verdict":"needs-work","summary":"One major issue found in auth module.","findings":[{"severity":"major","path":"src/auth.ts","line":42,"comment":"Token is logged in plain text."}]}
If you need a predictable output shape with enforced fields, implement a custom ReviewSink with an explicit TypeBox schema. See the ReviewSink interface for details.

Usage example

import { createReviewSession } from "@code-review-harness/core";
import { createLaunchpadProvider } from "@code-review-harness/launchpad-provider";
import { createStdoutSink } from "@code-review-harness/stdout-sink";

const provider = createLaunchpadProvider({
  url: process.argv[2] ?? "",
});

// Pipe stdout to a file or jq for inspection.
const sink = createStdoutSink();

const { session } = await createReviewSession({ provider, sink });

// Stream agent events to stderr to keep stdout clean for the JSON output.
session.subscribe((event) => process.stderr.write(`${JSON.stringify(event)}\n`));
await session.prompt("Review merge proposal. Submit final review with submit_review.");
Run it and capture the review:
node review.js https://api.launchpad.net/devel/~user/+git/repo/+merge/123 \
  2>agent-events.ndjson \
  | jq .

When to use stdout-sink

  • Local development — inspect the review shape without posting anything to a code host.
  • CI pipelines — capture the JSON artifact for downstream steps (notifications, metrics, archiving).
  • Schema exploration — run once to see what the agent produces before writing a custom ReviewSink.
Switch to createLaunchpadSink() when you are ready to post reviews back to Launchpad.

Build docs developers (and LLMs) love