Buffaly Logo Buffaly
Companion agent

Global Code Review

Global Code Review is Buffaly's dedicated, read-only reviewer. It does not critique a random diff. It asks whether every commit reported by one completed source-agent turn, taken together as one delivered implementation, actually fulfills the originating session's documented intent.

What it is

The agent profile is code-review-agent, with context prompt CodeReviewContext and action root GlobalCodeReviewsAgentAction. It is hidden from ordinary session lists. It does not edit source, tasks, designs, Plan, Scratch, or other source-session artifacts.

Interactive auto-fix rules in language guidance do not apply here. This is automatic global-review mode: inspect the delivered commits, map them to requirements, and either submit grouped findings or complete silently.

Exact review target

The queued instruction supplies immutable SourceTurnContextJson: exact source session, exact completed turn, final assistant message, and an ordered repository/SHA manifest.

  • Treat the final assistant message as a delivery claim, not as proof.
  • Inspect every manifest commit directly. Never construct one range across repositories.
  • Preserve manifest order. A defect introduced and fully corrected by a later listed commit is not a final finding unless the intermediate state itself is a material release problem.
  • Never substitute the current working tree, a newer commit, a different turn, or a history sweep for the delivered target.

Source-grounded workflow

  1. Read the latest source turn and recover the requested outcome, claimed implementation, claimed validation, and leftover constraints.
  2. Identify the governing task and extract acceptance criteria, non-goals, and required documentation.
  3. Read Plan as routing evidence. Plan does not override the user instruction or task criteria.
  4. Identify the governing design artifact when one exists.
  5. Use Scratch only when another source references a decision that needs supporting evidence.
  6. Read repository AGENTS.md and the language-specific CodeReviews guidance for every touched language.
  7. Inspect each commit with typed review tools, then map every requirement to evidence.

Governing-source priority

Conflicts are reported, not silently resolved in favor of the implementation:

  1. Explicit user instruction in the source turn
  2. Active task acceptance criteria and confirmed decisions
  3. Governing design document
  4. Source-session Plan
  5. Repository guidance and AGENTS.md
  6. Language-specific review guidance (C#, ProtoScript, JavaScript/kScript)
  7. Scratch and other supporting notes

Required review depth

Before finishing, every applicable user requirement, task criterion, design obligation, validation requirement, and required documentation update is classified as implemented, intentionally excluded, claimed but not evidenced, partial, contradicted, or not applicable.

Look for

  • Actual user problem vs adjacent implementation
  • Call-chain, contract, and ownership conformance
  • End-to-end data across host, worker, storage, and UI
  • Validation evidence matching the original agent's claims
  • Required .cs.md / .pts.md / design / task updates

Do not report

  • Style preferences without a correctness consequence
  • Already-corrected intermediate defects
  • Speculative future improvements
  • Praise or generic summaries
  • Findings that require editing the code in this mode

Findings vs silence

The source session is notified only when material actionable findings remain. A clean review completes silently. Each finding must exist in the exact reviewed commit group, be tied to a governing requirement or concrete risk, explain the user-visible or operational consequence, and give the original agent a specific correction, validation, documentation, or reconciliation action.

Dedicated tools

The automatic reviewer runs under GlobalCodeReviewsAgentAction. It does not get CRM tools, Plan mutation, generic filesystem, generic shell, or interactive GitHub actions. Missing capability is a failed grouped review, not an excuse to substitute a similarly named tool.

  • ToGetGlobalCodeReviewMostRecentSourceTurn / ToGetGlobalCodeReviewRecentSourceTurns
  • ToGetCodeReviewSourceSessionPlan, Scratch, Tasks, and artifacts
  • ToGetCodeReviewCommitDiff and ToGetCodeReviewFileAtCommit
  • ToGetGlobalCodeReviewLanguageGuidance
  • ToSubmitCodeReviewTurnFindings, ToCompleteCodeReviewTurnWithoutFindings, ToMarkCodeReviewTurnFailed

Next