Skip to content

fix(review): make capture-evidence transitions executable - #2640

Merged
Alan-TheGentleman merged 16 commits into
mainfrom
fix/2248-capture-evidence-tracker
Aug 6, 2026
Merged

fix(review): make capture-evidence transitions executable#2640
Alan-TheGentleman merged 16 commits into
mainfrom
fix/2248-capture-evidence-tracker

Conversation

@Alan-TheGentleman

@Alan-TheGentleman Alan-TheGentleman commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #2248

Summary

  • Advance review-integration v2 STATUS to a strict V5 submission descriptor for review.capture-evidence while preserving V4 readability and the v1 shape.
  • Bind provider-owned lineage, revision, target, operation, and opaque repository context; expose only closed outcome and raw evidence input substitution slots.
  • Prove ordinary and correction capture end to end through branch-built binaries from an unrelated working directory, including mutation-safe negative cases.

Chain

All child slices were independently verified and merged into this tracker. The tracker contains no additional functional commits beyond those reviewed slices and normal base integration.

Main Integration

  • Normal-merged origin/main@91645ffb480645b089c044ab61c7564986866c25 without rebase or force-push.
  • The stale local tracker required a normal merge of origin/fix/2248-capture-evidence-tracker@ff81508e04f6f1e058d721777ac0710209956c14; this surfaced the sole genuine conflict in bench/journeys_sdd_test.go.
  • Preserved fix(review): recover committed correction boundaries #2634 unchanged: j65-selectorless-committed-correction-continuation.
  • Renumbered only bug(review): advertised capture-evidence transition omits required parameters #2248 proof journeys: j65-v5-capture-evidence-descriptors-execute -> j66-v5-capture-evidence-descriptors-execute; j66-v5-capture-evidence-correction-descriptor-executes -> j67-v5-capture-evidence-correction-descriptor-executes.
  • The combined live corpus is 67 journeys; source-coupled j57 remains unchanged.

Verification

  • Selector-less committed correction STATUS/FINALIZE, operational reconstruction, genuine over-budget, remaining-budget TargetFixDiff, and frozen-boundary tests passed, including race coverage.
  • V5 descriptor, repository-context/direct---cwd, raw v1-to-bound-v2 record, and arbitrary-CWD binary positive/negative tests passed, including race coverage.
  • Driven core corpus: 67 completed, 0 unsupported, 0 failed.
  • Explicit j65 selector-less correction, j66 ordinary V5 capture, and j67 correction V5 capture completed.
  • Source-coupled j57 remained unsupported without its fixture and completed with the fixture.
  • Full Go tests, format, vet, deadcode/refusal ratchets, and Linux/Darwin/Windows builds passed.

RDD remained disabled/unmanaged. No Windows Full Suite, review action, merge, or release action was run.

Size Exception

The composed tracker changes 1,019 lines across 21 files (+923/-96) against current main. This is the already reviewed composition of three bounded child PRs plus the required proof-only journey renumbering. Splitting the final integration again would not reduce reviewer burden because the contract, runtime, and executable proof have already been reviewed separately; this PR verifies their exact composition against main.

Summary by CodeRabbit

  • New Features
    • Added Review Integration status schema v5 with verification evidence, corrections, targeted validation, and flexible transition submissions.
    • Added provider-issued repository context support for evidence capture, alongside direct working-directory resolution.
    • Added descriptor-driven evidence capture and correction verification workflows.
  • Bug Fixes
    • Improved validation for submission values, allowed values, repository contexts, and stale review targets.
    • Preserved compatibility with existing v4 status payloads.
    • Improved diagnostics when repository resolution options are missing or ambiguous.
  • Documentation
    • Added and updated v5 schemas and contract fixtures.

Copilot AI lite review requested due to automatic review settings August 6, 2026 09:53
@Alan-TheGentleman Alan-TheGentleman added size:exception Maintainer-approved exception for PRs above the 400 changed-line review budget type:bug Bug fix labels Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds the review.status v5 contract, provider-bound capture-evidence descriptors, repository-context resolution, and normal and correction evidence journeys. Existing v4 status payloads remain readable.

Changes

V5 status contract and compatibility

Layer / File(s) Summary
Status v5 contract and compatibility
contracts/review-integration/v2/..., internal/cli/review_status_contract.go, internal/cli/review_schema.go, internal/cli/review_provider_artifact_contract_test.go, internal/cli/review_status_contract_test.go
Adds the v5 schema, fixtures, schema negotiation, capture-evidence descriptor validation, and v4 compatibility coverage.

Descriptor publication and execution

Layer / File(s) Summary
Descriptor publication and execution
bench/journeys_wave1.go, internal/cli/review_next_transition.go, internal/cli/review_facade.go, internal/cli/review_artifact.go, internal/reviewtransaction/repository_locator.go, internal/cli/review_artifact_test.go
Publishes provider-bound descriptors, supports --repository-context or --cwd, builds evidence inputs, validates substitutions, and accepts validating-state repository bindings.

Journey coverage and acceptance validation

Layer / File(s) Summary
Journey coverage and acceptance validation
bench/journeys.go, bench/journeys_capture_evidence_v5.go, bench/journeys_id_collision_test.go, bench/journeys_sdd_test.go, internal/cli/review_binary_acceptance_test.go, internal/cli/review_submission_descriptor_test.go, internal/cli/review_next_transition_test.go
Adds normal and correction v5 journeys. Acceptance tests execute published descriptors, validate evidence output, and verify that rejected submissions preserve review state.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReviewFacade
  participant ReviewNextTransition
  participant CaptureEvidenceCLI
  participant RepositoryLocator
  ReviewFacade->>ReviewNextTransition: publish v5 capture-evidence descriptor
  ReviewNextTransition->>CaptureEvidenceCLI: pass bound arguments and substitutions
  CaptureEvidenceCLI->>RepositoryLocator: resolve repository context
  RepositoryLocator-->>CaptureEvidenceCLI: return matching repository
  CaptureEvidenceCLI-->>ReviewFacade: submit verification evidence
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: copilot, dnlrsls

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #2248 by publishing executable capture-evidence descriptors with required bindings and substitution slots.
Out of Scope Changes check ✅ Passed The schema, compatibility, validation, fixture, and test changes directly support executable capture-evidence transitions.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: making capture-evidence transitions executable.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2248-capture-evidence-tracker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/cli/review_artifact.go (1)

41-69: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Require an explicit repository resolver.

The validation at Line 53 claims that --repository-context or --cwd is required, but it does not test either flag. Because --cwd defaults to ".", a caller can omit both flags and resolve the process working directory at Line 68. This violates the provider-bound descriptor contract and can target an unrelated repository.

Require reviewFlagWasProvided(flags, "cwd") when contextHandle is empty.

Suggested validation change
+	contextHandle := strings.TrimSpace(*repositoryContext)
 	if flags.NArg() != 0 || strings.TrimSpace(*lineage) == "" || strings.TrimSpace(*target) == "" || strings.TrimSpace(*revision) == "" || strings.TrimSpace(*outcome) == "" || strings.TrimSpace(*input) == "" {
+		// Also reject an invocation with neither an opaque context nor an explicit cwd.
 	}
-	contextHandle := strings.TrimSpace(*repositoryContext)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cli/review_artifact.go` around lines 41 - 69, Require an explicit
repository resolver in the review capture-evidence preflight: when
repositoryContext is empty, validate reviewFlagWasProvided(flags, "cwd") before
calling resolveReviewMutationRoot. Preserve the existing mutually exclusive
handling for --repository-context and --cwd, while rejecting invocations that
omit both flags.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bench/journeys_wave1.go`:
- Around line 79-81: Restore the ArtifactSubject field, including its
SubjectHash member, in the decoded Inputs type used by
captureCorrectableFindingFor, while preserving its existing JSON mapping;
alternatively update captureCorrectableFindingFor to use an equivalent field
already defined by Inputs.

In `@internal/cli/review_binary_acceptance_test.go`:
- Around line 386-388: Update the assertion around
captureEvidenceSubmissionInput to compare the complete
ReviewTransitionSubmission before and after rejection, rather than joining only
ArgumentTokens. Capture both submissions and assert their full descriptors are
equal, preserving the existing failure context.

In `@internal/cli/review_schema.go`:
- Around line 20-26: Update reviewVerificationEvidenceSchema and its related
validation to match readFacadeBytes byte-based enforcement: publish a
conservative character maxLength derived from reviewResultArtifactLimit, or
otherwise enforce a byte-accurate contract. Update the schema test to assert the
resulting limit and preserve acceptance of non-empty evidence within the actual
artifact bound.

---

Outside diff comments:
In `@internal/cli/review_artifact.go`:
- Around line 41-69: Require an explicit repository resolver in the review
capture-evidence preflight: when repositoryContext is empty, validate
reviewFlagWasProvided(flags, "cwd") before calling resolveReviewMutationRoot.
Preserve the existing mutually exclusive handling for --repository-context and
--cwd, while rejecting invocations that omit both flags.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 512c20a8-9fa7-4a79-9b09-882dbd65aa18

📥 Commits

Reviewing files that changed from the base of the PR and between d256280 and ff81508.

📒 Files selected for processing (21)
  • bench/journeys.go
  • bench/journeys_capture_evidence_v5.go
  • bench/journeys_id_collision_test.go
  • bench/journeys_sdd_test.go
  • bench/journeys_wave1.go
  • contracts/review-integration/v2/fixtures/capabilities-v2.2.fixture.json
  • contracts/review-integration/v2/fixtures/status-v5.fixture.json
  • contracts/review-integration/v2/schemas/capabilities-v2.2.schema.json
  • contracts/review-integration/v2/schemas/status-v5.schema.json
  • internal/cli/review_artifact.go
  • internal/cli/review_artifact_test.go
  • internal/cli/review_binary_acceptance_test.go
  • internal/cli/review_facade.go
  • internal/cli/review_next_transition.go
  • internal/cli/review_next_transition_test.go
  • internal/cli/review_provider_artifact_contract_test.go
  • internal/cli/review_schema.go
  • internal/cli/review_status_contract.go
  • internal/cli/review_status_contract_test.go
  • internal/cli/review_submission_descriptor_test.go
  • internal/reviewtransaction/repository_locator.go

Comment thread bench/journeys_wave1.go
Comment on lines +79 to +81
Name string `json:"name"`
CaptureOperation string `json:"capture_operation"`
Submission *waveSubmissionDescriptor `json:"submission"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Restore ArtifactSubject in the decoded input type.

captureCorrectableFindingFor still evaluates input.ArtifactSubject.SubjectHash at Line 447. The new Inputs type does not declare ArtifactSubject. This file will not compile. Preserve the existing JSON field and its SubjectHash member, or update captureCorrectableFindingFor to use a field provided by the new type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bench/journeys_wave1.go` around lines 79 - 81, Restore the ArtifactSubject
field, including its SubjectHash member, in the decoded Inputs type used by
captureCorrectableFindingFor, while preserving its existing JSON mapping;
alternatively update captureCorrectableFindingFor to use an equivalent field
already defined by Inputs.

Comment on lines +386 to +388
if got := captureEvidenceSubmissionInput(t, after).Submission; strings.Join(got.ArgumentTokens, "\x00") !=
strings.Join(captureEvidenceSubmissionInput(t, before).Submission.ArgumentTokens, "\x00") {
t.Fatalf("rejected capture-evidence changed its pending descriptor: %#v", after.NextTransition)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Compare the complete pending descriptor after rejection.

Line 386 compares only ArgumentTokens. A rejected request could change operation_token or values while this test passes. Compare the complete ReviewTransitionSubmission before and after the refusal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cli/review_binary_acceptance_test.go` around lines 386 - 388, Update
the assertion around captureEvidenceSubmissionInput to compare the complete
ReviewTransitionSubmission before and after rejection, rather than joining only
ArgumentTokens. Capture both submissions and assert their full descriptors are
equal, preserving the existing failure context.

Comment on lines 20 to +26
// reviewVerificationEvidenceSchema describes the input review capture-evidence
// actually accepts and readCapturedFinalEvidence actually enforces: raw,
// non-empty final test/verification evidence content, not a structured JSON
// object, bounded by the same native artifact limit every captured artifact
// uses (reviewResultArtifactLimit).
var reviewVerificationEvidenceSchema = fmt.Sprintf(
`{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://gentle-ai.dev/schema/review/verification-evidence/v1","title":"Gentle AI captured final verification evidence","description":"Raw final test or verification evidence content captured by review capture-evidence. It is not a structured JSON document: any non-empty content up to the native artifact bound is accepted.","type":"string","minLength":1,"maxLength":%d}`,
`{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"`+reviewVerificationEvidenceSchemaID+`","title":"Gentle AI captured final verification evidence","description":"Raw final test or verification evidence content captured by review capture-evidence. It is not a structured JSON document: any non-empty content up to the native artifact bound is accepted.","type":"string","minLength":1,"maxLength":%d}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline internal/cli/review_schema.go --items all
rg -n -C 5 'reviewResultArtifactLimit|func\s+readCapturedFinalEvidence|len\(|LimitReader' internal/cli

Repository: Gentleman-Programming/gentle-ai

Length of output: 50388


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== review_schema.go outline =="
ast-grep outline internal/cli/review_schema.go --items all || true

echo "== targeted symbols =="
rg -n -C 8 'reviewVerificationEvidenceSchema|reviewResultArtifactLimit|readCapturedFinalEvidence|capture-evidence|OperationToken|submission' internal/cli internal/review transaction || true

echo "== likely files =="
git ls-files internal/cli | rg 'review.*(capture|finalize|submission|schema|artifact|transaction|command|start_contract|transition|scope|next_transition)' | sort

echo "== source slices =="
for f in internal/cli/review_schema.go internal/cli/review_capture.go internal/cli/review_finalize.go internal/cli/review_submission_descriptor.go internal/cli/review_start_contract.go internal/review/review.go; do
  if [ -f "$f" ]; then
    echo "--- $f $(wc -l < "$f") ---"
    sed -n '1,220p' "$f"
  fi
done

Repository: Gentleman-Programming/gentle-ai

Length of output: 50388


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== internal/cli file size list =="
for f in internal/cli/review_schema.go internal/cli/review_submission_descriptor.go internal/cli/review_schema_test.go internal/cli/review_submission_descriptor_test.go internal/cli/review_capture.go internal/cli/review.go internal/reviewtransaction/*.go; do
  [ -f "$f" ] || continue
  printf '%s=%s\n' "$f" "$(wc -l < "$f")"
done

echo "== review_schema.go =="
sed -n '1,80p' internal/cli/review_schema.go

echo "== review_schema_test.go evidence test =="
sed -n '70,115p' internal/cli/review_schema_test.go

echo "== targeted references limited to internal/cli/internal/reviewtransaction =="
rg -n -C 4 'reviewResultArtifactLimit|readCapturedFinalEvidence|VerificationEvidenceRecordSchema|verification-evidence|capture-evidence|OperationToken|LimitReader|Limit\(' internal/cli internal/reviewtransaction -g '*.go' | head -n 300

echo "== read function definitions =="
rg -n 'func\s+\w*[Rr]ead[A-Za-z]*Evidence|func\s+\w*[Aa]rtifact|func\s+read.*[Ll]imit|type\s+.*Limit' internal/cli/internal/reviewtransaction/* | sed -n '1,120p'
for f in $(rg -l 'func\s+\w*[Rr]ead[A-Za-z]*Evidence|reviewResultArtifactLimit|VerificationEvidenceRecordSchema' internal/reviewtransaction -g '*.go'); do
  echo "--- $f"
  ast-grep outline "$f" --items all | sed -n '1,120p'
done

Repository: Gentleman-Programming/gentle-ai

Length of output: 47695


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate readCapturedFinalEvidence and artifact limits =="
rg -n -C 6 'func readCapturedFinalEvidence|ReviewArtifactManifest|reviewResultArtifactLimit|AdmitArtifact|LimitReader|ReadAll\(file' internal/cli internal/reviewtransaction -g '*.go' | sed -n '1,260p'

echo "== read function implementation slices =="
for f in internal/cli/review_facade.go internal/reviewtransaction/artifact_admission.go internal/reviewtransaction/verification_evidence.go internal/cli/review_collection.go internal/cli/review_artifact.go; do
  [ -f "$f" ] || continue
  echo "--- $f ---"
  rg -n 'readCapturedFinalEvidence|ReviewArtifactManifest|readReviewerArtifactManifest|reviewResultArtifactLimit|ReadAll|LimitReader' "$f" || true
done

echo "== focused file slices =="
sed -n '4230,4288p' internal/cli/review_facade.go
sed -n '1,140p' internal/reviewtransaction/artifact_admission.go
sed -n '1,180p' internal/reviewtransaction/verification_evidence.go

echo "== static verifier for input limit contract vs acceptance implementation =="
python3 - <<'PY'
import re, pathlib
cli = pathlib.Path('internal/cli/review_facade.go').read_text()
adm = pathlib.Path('internal/reviewtransaction/artifact_admission.go').read_text()
ver = pathlib.Path('internal/reviewtransaction/verification_evidence.go').read_text()
schema = pathlib.Path('internal/cli/review_schema_test.go').read_text()

checks = {
    'limit_constant_name': 'reviewResultArtifactLimit: int8Limit',
    'read_all_limit_reader': 'io.LimitReader(file, reviewResultArtifactLimit+1)',
    'check_len_after_read': 'len(payload) > reviewResultArtifactLimit',
    'limit_reader_read_all_pattern': bool(re.search(r'io\.LimitReader\([^)]+, reviewResultArtifactLimit\+1\)', cli)),
}
for k,_ in checks.items():
    print(f'{k}: {checks[k]}')

m = re.search(r'func\s+readCapturedFinalEvidence\([^)]*\)\s*\{(?P<body>.*?)(?=\nfunc\s+\w+|\Z)', cli, re.S)
print('readCapturedFinalEvidence_found:', bool(m))
print('readCapturedFinalEvidence_mentions_limit_reader:', 'LimitReader' in (m.group(0) if m else ''))
print('readCapturedFinalEvidence_mentions_byte_check:', 'len(payload)' in (m.group(0) if m else ''))
print('schema_test_validates_character_bound_value:', 'schema["maxLength"]' in schema and 'reviewResultArtifactLimit' in schema)
print('artifact_admission_byte_check:', 'len(payload)' in adm and 'Acceptable' in adm)
PY

Repository: Gentleman-Programming/gentle-ai

Length of output: 40414


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== ReadCapturedVerificationEvidence implementation =="
rg -n -C 8 'func ReadCapturedVerificationEvidence|ReadCaptured.*Evidence|readCaptured.*Evidence' internal/reviewtransaction internal/cli -g '*.go' | sed -n '1,260p'

echo "== ReadCapturedVerificationEvidence implementation slice =="
for f in internal/reviewtransaction/final_verification_retry.go internal/reviewtransaction/verification_evidence.go internal/reviewtransaction/compact_result_reopen_test.go internal/reviewtransaction/reviewer_context_level.go; do
  [ -f "$f" ] || continue
  echo "--- $f ---"
  rg -n -C 8 'ReadCaptured.*Evidence|verificationEvidenceRecordLimit|validation\|ValidatePayload|Verify.*Evidence|record\]' "$f" || true
done

echo "== static verifier of readCapturedFinalEvidence call chain =="
python3 - <<'PY'
import pathlib, re
files = {
    'cli_facade': pathlib.Path('internal/cli/review_facade.go'),
    'cli_artifact': pathlib.Path('internal/cli/review_artifact.go'),
    'verification_evidence': pathlib.Path('internal/reviewtransaction/verification_evidence.go'),
}
def text(p): return p.read_text()
m = re.search(r'func\s+readCapturedFinalEvidence\([^)]*(state.*\*\w+\s*\*)?\)\s*\{(?P<body>.*?)(?=\nfunc\s+\w+|\Z)', text(files['cli_artifact']), re.S)
print('readCapturedFinalEvidence_body:', 'ReadCapturedVerificationEvidence' in m.group('body') if m else '')
if m:
    print('readCapturedFinalEvidence_body:', m.group('body').strip().replace('\n','  ')[:1500])
m2 = re.search(r'func\s+ReadCapturedVerificationEvidence\([^)]*\)\s*\{(?P<body>.*?)(?=\nfunc\s+\w+|\Z)', text(files['verification_evidence']), re.S)
print('ReadCapturedVerificationEvidence_body:', 'ValidatePayload' in m2.group('body') if m2 else '')
if m2:
    body = m2.group('body')
    for pat in [r'ValidatePayload', r'\blen\(payload\)', r'\blimited', r'iconversion\(len\(payload[\*\)\]\)']:
        print(pat, 'found:', bool(re.search(pat, body)))
PY

Repository: Gentleman-Programming/gentle-ai

Length of output: 29445


Make the published evidence limit byte-accurate.

readFacadeBytes(...-input) enforces reviewResultArtifactLimit as bytes. The published schema uses the same value as JSON Schema maxLength, which counts Unicode characters. A non-ASCII proof can satisfy the schema and then be rejected by review capture-evidence. Publish a byte-accurate length contract, or use a conservative character limit and update the schema test against it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cli/review_schema.go` around lines 20 - 26, Update
reviewVerificationEvidenceSchema and its related validation to match
readFacadeBytes byte-based enforcement: publish a conservative character
maxLength derived from reviewResultArtifactLimit, or otherwise enforce a
byte-accurate contract. Update the schema test to assert the resulting limit and
preserve acceptance of non-empty evidence within the actual artifact bound.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Advances the negotiated review integration v2 STATUS envelope to a strict v5 schema that publishes executable, provider-bound review.capture-evidence submission descriptors (using opaque repository context), while preserving v4 readability. This closes the gap from #2248 where the advertised capture-evidence transition was not directly invocable using only the advertised parameters.

Changes:

  • Introduces STATUS v5 contract artifacts (schema + fixture) and updates capabilities pins/fixtures to advertise v5.
  • Emits and validates v5 capture-evidence submission descriptors that bind lineage/revision/target/repository-context and expose only outcome + raw evidence input as substitution slots.
  • Adds end-to-end proof via CLI tests and bench journeys, including arbitrary-CWD built-binary execution and negative/refusal cases.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/reviewtransaction/repository_locator.go Extends live repository-context validation to validating-state authority snapshots.
internal/cli/review_submission_descriptor_test.go Updates descriptor execution tests to consume and execute the published v5 capture-evidence submission descriptor.
internal/cli/review_status_contract.go Adds v4/v5 schema support, validates capture-evidence descriptors/bindings, and extends transition validation to allow capture-evidence submissions.
internal/cli/review_status_contract_test.go Adds a regression test ensuring v4 STATUS payloads remain readable alongside v5 defaults.
internal/cli/review_schema.go Factors the verification-evidence schema $id into a constant for reuse across v5 surfaces.
internal/cli/review_provider_artifact_contract_test.go Pins v5 status schema/fixture digests and validates v5 artifacts alongside existing provider contract artifacts.
internal/cli/review_next_transition.go Publishes capture-evidence inputs as provider-bound submission descriptors (contract v2) with repository-context and outcome/input slots.
internal/cli/review_next_transition_test.go Adds a validator helper for v5 next_transition schema validation.
internal/cli/review_facade.go Publishes opaque repository context in validating and correction-required states and hardens finalize submission validation against wrong descriptor kinds.
internal/cli/review_binary_acceptance_test.go Proves built-binary descriptor execution from unrelated CWD, plus mutation-safe refusal cases for capture-evidence.
internal/cli/review_artifact.go Adds --repository-context resolver for capture-evidence, mutually exclusive with --cwd, with improved diagnostics.
internal/cli/review_artifact_test.go Adds unit coverage for capture-evidence resolver diagnostics and mutual-exclusion behavior.
contracts/review-integration/v2/schemas/status-v5.schema.json Adds STATUS v5 JSON Schema defining capture-evidence submission descriptors and strict next_transition shapes.
contracts/review-integration/v2/schemas/capabilities-v2.2.schema.json Updates capabilities v2.2 to advertise STATUS v5 instead of v4.
contracts/review-integration/v2/fixtures/status-v5.fixture.json Adds a v5 STATUS fixture for artifact validation and pinning.
contracts/review-integration/v2/fixtures/capabilities-v2.2.fixture.json Updates capabilities v2.2 fixture to include STATUS v5.
bench/journeys.go Registers the new capture-evidence descriptor journey source in the bench suite.
bench/journeys_wave1.go Extends wave status decoding to understand v5 schema and multi-slot submission descriptors.
bench/journeys_sdd_test.go Updates the core journey count pin to include the new journeys (64 → 66).
bench/journeys_id_collision_test.go Adds the new journey source to the global ID-collision guard.
bench/journeys_capture_evidence_v5.go Adds built-binary journeys proving normal + correction capture-evidence descriptors execute using only published tokens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
}
if len(submission.ArgumentTokens) != 6 || len(submission.Values) != 2 {
return errors.New("submission descriptor value substitution is malformed") // refusal:by-design world-action: only a provider code fix can restore the single value slot
…r' into fix/2248-capture-evidence-tracker

# Conflicts:
#	bench/journeys_sdd_test.go
Copilot AI review requested due to automatic review settings August 6, 2026 10:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
bench/journeys_wave1.go (1)

80-103: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Preserve ArtifactSubject in the decoded collect input.

captureCorrectableFindingFor still reads input.ArtifactSubject.SubjectHash at Line 447. Ensure the expanded NextTransition.Collect.Inputs type declares the existing artifact_subject JSON field and its SubjectHash member. Otherwise the bench package fails to compile.

This repeats the previous review finding. Verify the current type before merging.

#!/bin/bash
set -euo pipefail

ast-grep outline bench/journeys_wave1.go --items all
rg -n -C 8 'ArtifactSubject|captureCorrectableFindingFor|waveCorrectionStatus' bench/journeys_wave1.go
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bench/journeys_wave1.go` around lines 80 - 103, Add the missing
ArtifactSubject field to the expanded NextTransition.Collect.Inputs type,
including its SubjectHash member and correct artifact_subject JSON tag, so
captureCorrectableFindingFor can continue accessing
input.ArtifactSubject.SubjectHash.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@bench/journeys_wave1.go`:
- Around line 80-103: Add the missing ArtifactSubject field to the expanded
NextTransition.Collect.Inputs type, including its SubjectHash member and correct
artifact_subject JSON tag, so captureCorrectableFindingFor can continue
accessing input.ArtifactSubject.SubjectHash.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 13631d5a-b712-4139-a94a-1a9247c49904

📥 Commits

Reviewing files that changed from the base of the PR and between ff81508 and c6c7454.

📒 Files selected for processing (4)
  • bench/journeys_capture_evidence_v5.go
  • bench/journeys_sdd_test.go
  • bench/journeys_wave1.go
  • internal/cli/review_facade.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

@Alan-TheGentleman
Alan-TheGentleman merged commit 14d8e25 into main Aug 6, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:exception Maintainer-approved exception for PRs above the 400 changed-line review budget type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(review): advertised capture-evidence transition omits required parameters

2 participants