メインコンテンツまでスキップ

Artifact Input Contract

River Review is a review agent that consumes artifacts produced by upstream workflows such as PlanGate as external inputs and performs review, QA, and double-check operations. This document defines the input contract that River Review can read stably.

Related issues: #516 (Task) / #508 (Capability) / #507 (Epic)

Policy

  • River Review operates artifact-driven and does not depend on PlanGate-internal commands or on a specific directory layout.
  • Inputs are consumed on a file path basis; only the content format (Markdown / JSON / XML / plain) is contracted.
  • Behavior when a file is missing (skip / degrade / error) is defined per artifact.
  • When adding a new artifact, update this document and preserve backward compatibility.

Artifact Catalog

The input artifacts recognized by River Review are listed below. See "Legend" at the end for column semantics.

IDExample filenameFormatRequiredSchema / referenceRole
pbi-inputpbi-input.mdMarkdownOptional (rec.)Free-formInput spec / background of the Product Backlog Item
planplan.mdMarkdownOptional (rec.)Free-formImplementation plan and design rationale
todotodo.mdMarkdownOptionalFree-form (checklist)Implementation tasks and progress
test-casestest-cases.mdMarkdownOptionalFree-form (bullets or tables)Test case design
review-selfreview-self.mdMarkdownOptionalFree-formSelf-review by the author
review-externalreview-external.mdMarkdownOptionalFree-formExternal review (AI or human)
diffdiff.patchunified diffRequired (alt.)git diff compatibleReview target diff; falls back to git diff when absent
junitjunit.xmlXMLOptionalJUnit XMLUnit/integration test results
coveragecoverage.xml etc.XML / JSONOptionalOne of Cobertura / LCOV / Istanbul JSONCoverage report
lintlint.json etc.JSON / plainOptionalESLint JSON, stylelint JSON, or tool-specific plainLint result
typechecktypecheck.txt etc.plain / JSONOptionaltsc --pretty=false or tool-specific plainType checker result
findings-poolfindings-pool.jsonJSONOptionalfindings-pool section in this documentAggregated findings[] history from multiple Review Artifacts
tdd-ledgertdd-ledger.jsonJSONOptionaltdd-ledger section in this documentRED/GREEN/REFACTOR VERIFY phase execution evidence for TDD

Legend

  • Required
    • Required: Without this input River Review aborts.
    • Required (alt.): If absent, an alternative (e.g. git diff) is used automatically.
    • Optional: Missing files are tolerated; related skills are skipped or degraded.
    • Optional (rec.): Missing is allowed, but review quality drops meaningfully.
  • Format: Encoding and syntax. Multiple accepted formats are comma-separated.

Per-artifact Contract

pbi-input / plan / todo / test-cases

  • Format: UTF-8 Markdown. Heading structure and bullets are unconstrained.
  • Size guideline: 100 KB or less per file recommended. Beyond that, River Review may apply diff optimization (summarization / trimming).
  • When absent: Skills referencing the artifact skip their observation and record it in skippedSkills.

review-self / review-external

  • Format: UTF-8 Markdown. Existing AI reviewer (including River Review itself) or human review output may be stored verbatim.
  • When absent: Double-check (W-check) skills are skipped.
  • Compatibility: Content may follow the issue definition in schemas/output.schema.json, but this is not required.

See also: pages/guides/w-check.md — W-check Practical Guide

findings-pool

  • Format: UTF-8 JSON. An aggregation of findings[] collected from multiple Review Artifacts (execution history of river review exec / river review verify).

  • Size guideline: 5 MB or less recommended (typically hundreds of findings). When exceeded, apply rotation or time-window filtering on the CLI side.

  • Schema (provisional):

    {
    "version": "1",
    "entries": [
    {
    "timestamp": "2026-04-17T00:00:00Z",
    "phase": "exec",
    "skillId": "plangate-plan-integrity",
    "severity": "major",
    "file": "path/to/file.ts",
    "line": 42,
    "message": "description",
    "source": "path/to/review-artifact.json"
    }
    ]
    }
    • version: Fixed string "1" (bumped on incompatible changes).
    • entries[]: One entry per finding.
    • entries[].phase: exec or verify.
    • entries[].skillId: ID of the skill that produced the finding.
    • entries[].severity: External vocabulary (critical / major / minor / info).
    • entries[].file / entries[].line: Target location. Omittable for findings that reference outside the diff.
    • entries[].message: Human-readable description of the finding.
    • entries[].source (optional): Path of the originating Review Artifact. Recommended to preserve provenance.
  • Construction: CLI consumers are expected to build this artifact by reading multiple review-artifact.json files and concatenating their findings[] into entries[] (implementation tracked in follow-up issue).

  • When absent: Skills that require this artifact, such as plangate-rule-promotion, return NO_REVIEW at the Pre-execution Gate and skip the promotion-judgement process.

tdd-ledger

  • Format: UTF-8 JSON. A ledger recording each TDD (test-driven development) phase execution. Expected to be produced during exec by upstream workflows such as PlanGate.

  • Role: Records the command and result (exitCode) of the RED / GREEN / REFACTOR VERIFY phases, providing evidence that TDD was performed in the declared, correct order.

  • Schema (provisional):

    {
    "version": "1",
    "task": "TASK-1234",
    "phases": [
    {
    "phase": "tdd_red",
    "command": "npm test -- discount.test.ts",
    "exitCode": 1,
    "conclusion": "Fails as expected because applyDiscount is unimplemented",
    "testCaseRefs": ["TC2"]
    },
    {
    "phase": "tdd_green",
    "command": "npm test -- discount.test.ts",
    "exitCode": 0,
    "conclusion": "Minimal implementation makes TC2 pass",
    "testCaseRefs": ["TC2"]
    }
    ]
    }
    • version: Fixed string "1" (bumped on future incompatible changes).
    • task (optional): Identifier of the corresponding task.
    • phases[].phase: One of tdd_red / tdd_green / refactor_verify / verification.
    • phases[].command: The test/verification command executed.
    • phases[].exitCode: Exit code of the command (tdd_red expects != 0; tdd_green / refactor_verify / verification expect 0).
    • phases[].conclusion (optional): Explanation of the phase outcome or failure reason.
    • phases[].testCaseRefs (optional): Array of corresponding test-cases IDs.
  • When absent: Skills that require this artifact, such as plangate-tdd-evidence, return NO_REVIEW at the Pre-execution Gate and skip the TDD evidence review.

diff

  • Format: unified diff (git diff compatible). Binary diffs are ignored.
  • Requirement: A diff must be supplied by some channel. When no artifact is specified, River Review internally runs git diff <mergeBase>..HEAD and uses the result as the diff.
  • When the resulting diff is empty: If the supplied diff (explicit or fallback) is empty, status is set to no-changes and review skills are not executed.

junit

  • Format: JUnit XML compatible. Nested <testsuite> is permitted.
  • When absent: Test-pass/fail skills are skipped.

coverage

  • Format: One of Cobertura XML, LCOV, or Istanbul JSON.
  • When absent: Coverage skills are skipped.
  • Note: Threshold evaluation is the skill's responsibility; this contract only fixes schema passthrough.

lint / typecheck

  • Format: Prefer JSON (ESLint / stylelint / tsc JSON), fall back to plain text. Skills perform a tool-specific light parse on plain input.
  • When absent: Static-analysis skills are skipped.

Input Channels

River Review resolves artifacts in this order:

  1. CLI / GitHub Action arguments (defined in river review plan / river review exec CLI spec). Example: --artifact pbi-input=./path/to/pbi-input.md
  2. Configuration file (defined in river review plan / river review exec CLI spec). artifacts section in river.config.*.
  3. Current directory auto-detection (fallback). Searches the workspace root for the default filenames above.

Artifacts not resolved by any channel are treated as "absent" and follow the per-artifact absence behavior above.

Downstream Integration

CLI

  • river run records the resolved artifact set in the context / debug sections of the Review Artifact.
  • Failure to resolve required artifacts exits with code 1. See Stable Interfaces.

Skills

  • Individual skills declare the artifact IDs they require (implemented as part of the skill-pack design).
  • Skills requiring an unresolved artifact are auto-skipped and recorded in plan.skippedSkills.

CI

⚠️ GitHub Action limitation (not yet implemented)

The --artifact and --ensemble flags are not yet available as GitHub Action inputs. As a workaround, invoke the dist/index.mjs CLI directly. See the W-check Practical Guide for a concrete example. A dedicated artifact input is planned (see runners/github-action/action.yml).

  • CI should decide failure from the Review Artifact status and the severity mix of findings.

PlanGate Independence

This contract treats PlanGate as one of several possible producers and deliberately avoids:

  • Hard-coding PlanGate-specific directory layouts (e.g. plangate/<phase>/) as default paths.
  • Adopting artifact names tied to PlanGate-internal commands or execution models.
  • Assuming PlanGate versions and River Review skill versions are co-released.

This keeps River Review usable for workflows other than PlanGate or for artifacts generated manually.

Versioning

  • This contract is managed as document version 1 (when later formalized as JSON Schema, a version field will be added).
  • Adding artifacts or extending formats is a minor bump (backward compatible); removal is a major bump.

See Also