Skip to content

fix(#5669): align head_sha schema pattern with CLI regex - #5674

Closed
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/5669-tighten-head-sha-schema
Closed

fix(#5669): align head_sha schema pattern with CLI regex#5674
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/5669-tighten-head-sha-schema

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Aligns the head_sha validation in review-result.schema.json with the CLI's runtime regex (hexSHARe in postreview.go). The schema previously used minLength: 7, which accepted short or non-hex strings that the CLI would then reject at runtime — causing agent fix iterations.

Related Issue

Fixes fullsend-ai/agents#621

Changes

  • Replaced { "type": "string", "minLength": 7 } with { "type": "string", "pattern": "^[0-9a-fA-F]{40}$|^[0-9a-fA-F]{64}$" } in review-result.schema.json
  • Updated all 7-character SHA fixtures ("abc1234") in review-result-label-actions-test.sh to valid 40-character hex strings
  • Updated all 7-character SHA fixtures in validate-output-schema-test.sh review-result tests to valid 40-character hex strings

Testing

  • review-result-label-actions-test.sh — all 8 tests pass
  • validate-output-schema-test.sh — all review-result tests pass (pre-existing triage-schema infra failures unrelated to this change)
  • go test ./internal/scaffold/... passes
  • Secret scan clean

Closes fullsend-ai/agents#621

Post-script verification

  • Branch is not main/master (agent/5669-tighten-head-sha-schema)
  • Secret scan passed (gitleaks — a3dd597c77dc90dc183f844b5aa9badea57a7bd4..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

The review-result.schema.json validated head_sha with minLength: 7,
while the CLI (postreview.go) enforces a strict regex requiring 40 or
64 hex characters. This divergence let schema-valid values like
"0000000" pass pre-validation but fail at runtime.

Replace the loose minLength constraint with the same regex pattern
used by the CLI: ^[0-9a-fA-F]{40}$|^[0-9a-fA-F]{64}$. Update all
test fixtures in review-result-label-actions-test.sh and
validate-output-schema-test.sh that used 7-character SHAs to use
valid 40-character hex strings.

Closes #5669
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 28, 2026 12:02
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Jul 28, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 28, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:04 PM UTC · Completed 12:16 PM UTC
Commit: 088a195 · View workflow run →

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [test coverage gap] internal/scaffold/fullsend-repo/scripts/post-review-test.sh — Contains ~20 test fixtures with head_sha values of "abc123" (6-char, non-conforming to the tightened schema pattern). This file tests post-review.sh shell logic and does not validate against the JSON schema directly, so these values cause no test failures today. Updating them to valid 40-char hex strings would improve cross-file consistency with the canonical schema.

Labels: PR modifies harness validation schema and associated tests

@rh-hemartin

Copy link
Copy Markdown
Member

This change does not belong here. Closing.

@rh-hemartin rh-hemartin closed this Aug 3, 2026
@rh-hemartin
rh-hemartin deleted the agent/5669-tighten-head-sha-schema branch August 3, 2026 11:59
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 12:01 PM UTC · Completed 12:21 PM UTC
Commit: 088a195 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #5674 — Wrong-Repo PR Due to Cross-Repo Path Mismatch

Timeline

  1. Jul 28 11:48 — Retro agent analyzing PR #5654 found a head_sha schema/CLI validation divergence. Filed agents#621 (correct target repo) but referenced fullsend scaffold paths (internal/scaffold/fullsend-repo/schemas/review-result.schema.json) instead of agents-repo paths (schemas/review-result.schema.json).
  2. Jul 28 11:50–12:02 — Triage confirmed the bug, code agent produced the fix, and PR #5674 was opened in fullsend-ai/fullsend modifying scaffold copies.
  3. Jul 28 12:04–12:16 — Review agent approved ($2.52). The cross-repo-contracts sub-agent read the extraction plan and saw schemas fetched from fullsend-ai/agents at runtime, but returned no findings about the PR modifying deprecated scaffold copies.
  4. Aug 3 11:59 — Human closed the PR: "This change does not belong here." Re-triaged the issue for the agents repo.

Key Finding

The retro correctly chose the target repo but used file paths from the analyzed repo. The test file review-result-label-actions-test.sh referenced in the issue doesn't exist in the agents repo — the equivalents are scripts/post-review-test.sh and scripts/validate-output-schema-test.sh. This path mismatch caused the code agent to produce a technically correct fix in the wrong repository.

Evidence for Existing Issues

  • #4657: This PR is a concrete instance of the code agent not escalating when the fix target is in a different repo.
  • #3476: The review agent's cross-repo-contracts sub-agent read the extraction plan yet did not flag the PR as modifying deprecated scaffold paths.
  • #2631: The triage agent labeled ready-to-code on an issue whose file paths pointed to a different repo.

The behaviour test failure was a pre-existing infrastructure flake (IAM 409 conflicts) — unrelated to this change.

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/harness Agent harness, config, and skills loading ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch Review effort 1/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tighten head_sha validation in review-result.schema.json to match CLI requirements

1 participant