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.
| ID | Example filename | Format | Required | Schema / reference | Role |
|---|---|---|---|---|---|
pbi-input | pbi-input.md | Markdown | Optional (rec.) | Free-form | Input spec / background of the Product Backlog Item |
plan | plan.md | Markdown | Optional (rec.) | Free-form | Implementation plan and design rationale |
todo | todo.md | Markdown | Optional | Free-form (checklist) | Implementation tasks and progress |
test-cases | test-cases.md | Markdown | Optional | Free-form (bullets or tables) | Test case design |
review-self | review-self.md | Markdown | Optional | Free-form | Self-review by the author |
review-external | review-external.md | Markdown | Optional | Free-form | External review (AI or human) |
diff | diff.patch | unified diff | Required (alt.) | git diff compatible | Review target diff; falls back to git diff when absent |
junit | junit.xml | XML | Optional | JUnit XML | Unit/integration test results |
coverage | coverage.xml etc. | XML / JSON | Optional | One of Cobertura / LCOV / Istanbul JSON | Coverage report |
lint | lint.json etc. | JSON / plain | Optional | ESLint JSON, stylelint JSON, or tool-specific plain | Lint result |
typecheck | typecheck.txt etc. | plain / JSON | Optional | tsc --pretty=false or tool-specific plain | Type checker result |
findings-pool | findings-pool.json | JSON | Optional | findings-pool section in this document | Aggregated findings[] history from multiple Review Artifacts |
tdd-ledger | tdd-ledger.json | JSON | Optional | tdd-ledger section in this document | RED/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
issuedefinition inschemas/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 ofriver 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:execorverify.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.jsonfiles and concatenating theirfindings[]intoentries[](implementation tracked in follow-up issue). -
When absent: Skills that require this artifact, such as
plangate-rule-promotion, returnNO_REVIEWat 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 oftdd_red/tdd_green/refactor_verify/verification.phases[].command: The test/verification command executed.phases[].exitCode: Exit code of the command (tdd_redexpects!= 0;tdd_green/refactor_verify/verificationexpect0).phases[].conclusion(optional): Explanation of the phase outcome or failure reason.phases[].testCaseRefs(optional): Array of correspondingtest-casesIDs.
-
When absent: Skills that require this artifact, such as
plangate-tdd-evidence, returnNO_REVIEWat the Pre-execution Gate and skip the TDD evidence review.
diff
- Format: unified diff (
git diffcompatible). 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>..HEADand uses the result as the diff. - When the resulting diff is empty: If the supplied diff (explicit or fallback) is empty,
statusis set tono-changesand 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:
- CLI / GitHub Action arguments (defined in
river review plan/river review execCLI spec). Example:--artifact pbi-input=./path/to/pbi-input.md - Configuration file (defined in
river review plan/river review execCLI spec).artifactssection inriver.config.*. - 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 runrecords the resolved artifact set in thecontext/debugsections 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
--artifactand--ensembleflags are not yet available as GitHub Action inputs. As a workaround, invoke thedist/index.mjsCLI directly. See the W-check Practical Guide for a concrete example. A dedicatedartifactinput is planned (seerunners/github-action/action.yml).
- CI should decide failure from the Review Artifact
statusand the severity mix offindings.
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, aversionfield will be added). - Adding artifacts or extending formats is a minor bump (backward compatible); removal is a major bump.
See Also
- Review Artifact — Output schema for review runs
- Stable Interfaces — CLI / GitHub Actions stable contract
- Runner CLI Reference — Runner CLI usage
- Review Policy — AI review policy