Skip to content

fix(ci): bind verification to exact source heads - #88

Merged
seonghobae merged 7 commits into
mainfrom
fix/exact-source-ci-governance
Aug 11, 2026
Merged

seonghobae merged 7 commits into
mainfrom
fix/exact-source-ci-governance

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

RCA

Protected main CI checks out GitHub's synthetic pull_request merge ref by default, while repository acceptance needs independently attributable evidence from the exact pull-request source head. #88 is the bounded repository-local repair; scheduler hardening remains separately owned by #69.

Bounded implementation

  • every actions/checkout in .github/workflows/ci.yml binds with.ref to ${{ github.event.pull_request.head.sha || github.sha }};
  • every checkout keeps with.persist-credentials: false;
  • the immediately following Verify exact source head step compares git rev-parse HEAD with the same expected SHA;
  • push/manual execution retains github.sha fallback;
  • supported Python versions, tests, 100% owned production statement/branch coverage and public docstrings, Ruff, lock freshness, packaging, Compose/container builds, action pins, and permissions are unchanged; and
  • structural tests inspect actual step fields and reject comment/env/substring decoys for uses, with.ref, with.persist-credentials, name, and run.

Test-first and review repair

The original exact-source contract was test-first. CodeRabbit later found real assurance weaknesses in the contract harness: global string counting, substring field matching, and omission of the checkout credential-isolation invariant. Each was repaired narrowly. Current source a1c224c519a595341026392c989b023eeaa148a9 enforces both exact with.ref and with.persist-credentials: false; all currently returned inline review threads are resolved.

Three predecessor-head OpenCode CHANGES_REQUESTED submissions are dismissed as stale infrastructure-only evidence. Dismissal is not approval and waives no current-head gate.

Current exact-source proof

  • Source head: a1c224c519a595341026392c989b023eeaa148a9.
  • Independently resolved protected main: bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10.
  • GitHub reports Ready and mergeable.
  • Repository CI 31521712803: completed / success. Python 3.10/3.12/3.14, 351 non-integration tests with 3 deselected, exact 100% owned production statement/branch coverage, 100% public docstrings, Ruff, lock freshness, package builds, Compose validation, and both container builds passed. CI jobs checked out this exact contributor head and passed the immediate git rev-parse HEAD identity check with checkout credentials disabled.
  • Security Scan 31521712785: completed / success.
  • SAST Semgrep 31521712819: completed / success.
  • CodeQL 31521709437: completed / success.
  • Required Noema 31521711331: completed / success.
  • Required PR Review Merge Scheduler 31521711307: completed / success.
  • Required Strix 31521711298: completed / success.
  • Required OpenCode Review 31521711297: required-workflow-bootstrap, coverage-source-tree, and coverage-evidence are completed / success; the final required opencode-review job remains queued on GitHub-hosted ubuntu-latest with no runner assigned at the latest refetch. Queued evidence is not success.
  • Formal review state contains only COMMENTED CodeRabbit evidence plus dismissed predecessor OpenCode requests; live policy currently requires zero approving reviews. Every returned inline review thread is resolved.

The final OpenCode queue is a current control-plane/capacity wait, not evidence of a pg-llm-batch source defect. Do not retrigger, cancel, weaken, or replace it while the exact source remains unchanged.

Live review-policy classification

Fresh organization ruleset inspection reports required_approving_review_count: 0, require_code_owner_review: false, require_last_push_approval: false, and required_review_thread_resolution: true. Protected AGENTS.md separately keeps code-owner review disabled/on hold for the solo-maintainer state. Independent approval is therefore not a current repository-policy prerequisite. No COMMENTED/status/model/author evidence is treated as approval, and no review result substitutes for required quality/security/source-identity workflow evidence.

Read-only central dependency

ContextualWisdomLab/.github#790 remains read-only from this loop. Its historical review state does not establish a current pg-llm-batch source finding and does not add an approval requirement beyond live leaf policy. No leaf workaround or central mutation is permitted here.

Merge boundary

Do not merge until the unchanged current head has terminal-success for every live required workflow, including the currently queued final Required OpenCode opencode-review job, zero valid unresolved findings, and unchanged mergeability/ruleset state after a final exact-head/live-base refetch. Pending, queued, cancelled, skipped-required, absent, neutral-required, stale-head, predecessor, status-only, synthetic-only, author-only, infrastructure-only, or failed evidence is not acceptance.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

CI의 모든 actions/checkout 단계가 PR source head 또는 현재 커밋 SHA를 사용합니다. 각 작업은 checkout 직후 실제 Git HEAD를 검증합니다. 계약 테스트와 문서가 이 동작과 증거 기준을 명시합니다.

Changes

정확한 소스 커밋 CI

Layer / File(s) Summary
CI 체크아웃 및 HEAD 검증
.github/workflows/ci.yml
각 작업이 PR head SHA 또는 github.sha를 checkout ref로 사용합니다. 검증 단계가 실제 HEAD와 기대 SHA의 일치를 확인합니다.
CI 계약 테스트
tests/test_workflow_contracts.py
헬퍼가 각 job의 steps와 직접 필드를 추출합니다. 계약 테스트가 주석과 관련 없는 값을 제외하고, 모든 checkout의 정확한 ref와 다음 단계의 git rev-parse HEAD 검증을 검사합니다.
정확한 소스 증거 문서화
docs/doctoring/exact-source-ci-evidence.md, CHANGELOG.md
exact-source evidence 기준, 증거 분류, 무효화 조건, 롤백 절차와 변경 내용을 기록합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 CI 검증을 정확한 소스 커밋에 연결하는 변경 사항을 간결하고 구체적으로 요약합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/exact-source-ci-governance

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.

@seonghobae
seonghobae marked this pull request as ready for review August 9, 2026 08:36

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current source head e8e9d6ca82738eea2de9efb03ab78da068a225f7 against protected main bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10. Focus on exact-source checkout identity, immediate git rev-parse HEAD verification, push/manual fallback semantics, and whether this extraction cleanly decouples CI evidence from the independent scheduler work in #69. Do not reuse Draft/predecessor-head evidence.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="e8e9d6ca82738eea2de9efb03ab78da068a225f7"
base="bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10"

echo '== Repository and commit identities =='
git remote -v
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
printf 'HEAD checkout: '; git rev-parse HEAD
printf 'Requested head: '; git rev-parse "$head"
printf 'Requested base: '; git rev-parse "$base"

echo '== Changed files: requested base...head =='
git diff --name-status "$base" "$head"

echo '== Focused CI workflow diff =='
git diff --unified=80 "$base" "$head" -- .github/workflows/ci.yml

echo '== Current CI workflow with line numbers =='
git show "${head}:.github/workflows/ci.yml" | nl -ba

echo '== All checkout and verification lines at requested head =='
git show "${head}:.github/workflows/ci.yml" |
  rg -n -C 5 'actions/checkout|git rev-parse HEAD|github\.event\.pull_request\.head\.sha|persist-credentials'

echo '== PR `#69` metadata and changed files =='
gh pr view 69 --repo ContextualWisdomLab/pg-llm-batch \
  --json number,state,isDraft,headRefOid,baseRefOid,title,files \
  --jq '{number,state,isDraft,headRefOid,baseRefOid,title,files:[.files[].path]}'

echo '== PR `#69` workflow-related patch, if available =='
gh pr diff 69 --repo ContextualWisdomLab/pg-llm-batch -- .github/workflows/ci.yml 2>&1 || true

Length of output: 6697


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="e8e9d6ca82738eea2de9efb03ab78da068a225f7"
base="bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10"
repo="ContextualWisdomLab/pg-llm-batch"

echo '== Current CI workflow, line-numbered =='
git show "${head}:.github/workflows/ci.yml" | awk '{printf "%4d  %s\n", NR, $0}'

echo '== Checkout and verification contexts =='
git show "${head}:.github/workflows/ci.yml" |
  awk '
    /name: Checkout|uses: actions\/checkout|ref:.*github\.event\.pull_request\.head\.sha|persist-credentials|name: Verify exact source head|git rev-parse HEAD/ {
      printf "%4d  %s\n", NR, $0
    }'

echo '== Workflow contract test changes =='
git diff --unified=100 "$base" "$head" -- tests/test_workflow_contracts.py

echo '== Changelog and exact-source evidence document changes =='
git diff --unified=30 "$base" "$head" -- CHANGELOG.md docs/doctoring/exact-source-ci-evidence.md

echo '== Draft PR `#69` metadata and changed-file scope =='
gh api "repos/${repo}/pulls/69" \
  --jq '{number,state,draft,head_sha:.head.sha,base_sha:.base.sha,title,changed_files}'
gh api --paginate "repos/${repo}/pulls/69/files?per_page=100" \
  --jq '.[] | {filename,status,sha}'

echo '== Draft PR `#69` CI workflow patch =='
gh api "repos/${repo}/pulls/69/files?per_page=100" \
  --jq '.[] | select(.filename == ".github/workflows/ci.yml") | .patch // "No ci.yml patch"'

echo '== Requested-head check runs =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,head_sha,details_url,app:.app.slug}'

echo '== Requested-head commit statuses =='
gh api "repos/${repo}/commits/${head}/status" \
  --jq '{sha,state,statuses:[.statuses[] | {context,state,target_url,creator:.creator.login}]}'

Length of output: 30149


@seonghobae Reviewed e8e9d6ca82738eea2de9efb03ab78da068a225f7 against bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10.

I found no code issues in the requested scope.

  • All three checkout sites bind ref to ${{ github.event.pull_request.head.sha || github.sha }}. See .github/workflows/ci.yml Lines 30-36, 59-65, and 100-106.
  • Each checkout retains persist-credentials: false.
  • Each checkout has an immediately following git rev-parse HEAD equality check against the same event-derived identity.
  • For pull_request, the workflow uses github.event.pull_request.head.sha. This prevents default checkout of the synthetic merge ref.
  • For push and workflow_dispatch, the missing pull-request value falls back to github.sha.
  • tests/test_workflow_contracts.py enforces one exact-source binding and one verification step per checkout site.
  • This PR changes no hourly-maintenance workflow, scheduler credential, or scheduler test. Draft #69 contains those independent scheduler changes. The extraction is clean.

The completed CI, Security Scan, and SAST checks are attached to the requested source head. strix is still in progress, and the CodeRabbit commit status is pending. These pending checks remain outside this code-review finding set.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 1

🤖 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 `@tests/test_workflow_contracts.py`:
- Around line 44-55: 수정 대상은
test_ci_checks_out_and_verifies_the_exact_source_head_in_every_job입니다. 전역 문자열 개수
비교를 제거하고 YAML의 jobs.*.steps를 순회해 각 actions/checkout 단계별로 with.ref가
exact_source_expression과 일치하는지 검증하세요. 각 checkout 바로 다음 단계가 name: Verify exact
source head를 사용하고, run 명령이 동일한 git rev-parse HEAD 비교식을 포함하는지도 함께 검증하며, 모든
checkout이 계약을 만족해야 테스트가 통과하도록 하세요.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bf917e1e-8827-40c8-bda0-f94e0b6a2dd3

📥 Commits

Reviewing files that changed from the base of the PR and between bf2cc2e and e8e9d6c.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • docs/doctoring/exact-source-ci-evidence.md
  • tests/test_workflow_contracts.py

Comment thread tests/test_workflow_contracts.py Outdated

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review review

Review exact current head 9bd4d26c6f34a4bdba567beff5609423bc159cc6 against exact protected base bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10 only. CI 31304907744 completed successfully on the exact source head, including the structural checkout→immediate-head-verification contract, Python 3.10/3.12/3.14 tests, 100% production statement/branch coverage, 100% public docstrings, Ruff, lock freshness, packaging, Compose validation, and container builds. Security Scan 31304907726 and SAST 31304907693 completed successfully as integration/security evidence. CodeRabbit's sole actionable structural-test finding is resolved on this exact head and unresolved inline threads are zero.

Verify that every .github/workflows/ci.yml checkout is source-head-bound for pull requests, retains persist-credentials: false, and is immediately followed by a verification step that compares git rev-parse HEAD with the same expected SHA expression; also verify push/manual fallback, permissions, action pins, coverage/docstring/package behavior, rollback, and the evidence-classification doctoring. Do not reuse predecessor-head, generated-merge-only, queued, cancelled, skipped, absent, rate-limited, or author-only evidence. Submit a formal approval only if no blocker remains on this unchanged exact head.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 9bd4d26c6f34a4bdba567beff5609423bc159cc6.

  • Head SHA: 9bd4d26c6f34a4bdba567beff5609423bc159cc6

  • Workflow run: 31315169176

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: ci.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: exact-source-ci-evidence.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: exact-source-ci-evidence.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["Test: test_workflow_contracts.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_workflow_contracts.py"]
  R4 --> V4["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: a1c224c519a595341026392c989b023eeaa148a9
  • Workflow run: 31528245568
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head a1c224c519a595341026392c989b023eeaa148a9.

  • Head SHA: a1c224c519a595341026392c989b023eeaa148a9

  • Workflow run: 31528245568

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: ci.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: exact-source-ci-evidence.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: exact-source-ci-evidence.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["Test: test_workflow_contracts.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_workflow_contracts.py"]
  R4 --> V4["targeted test run"]
Loading

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 9bd4d26c6f34a4bdba567beff5609423bc159cc6.

  • Head SHA: 9bd4d26c6f34a4bdba567beff5609423bc159cc6

  • Workflow run: 31317015216

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: ci.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: exact-source-ci-evidence.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: exact-source-ci-evidence.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["Test: test_workflow_contracts.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_workflow_contracts.py"]
  R4 --> V4["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 1

🤖 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 `@tests/test_workflow_contracts.py`:
- Around line 100-109: The workflow contract checks in _workflow_job_steps must
validate parsed or strictly field-matched YAML rather than substring presence.
For each checkout step, inspect the actual uses field and with.ref value; for
the following step, inspect the actual name and run fields, excluding comments
and unrelated values while preserving the existing exact-source requirements.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d31385fe-216e-42fc-b50b-0198d312117a

📥 Commits

Reviewing files that changed from the base of the PR and between e8e9d6c and 9bd4d26.

📒 Files selected for processing (1)
  • tests/test_workflow_contracts.py

Comment thread tests/test_workflow_contracts.py Outdated
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="ab78e4744a0709edfe9a45d28ec29b80a05771d5"
base="bf2cc2e140dc3ff4a56c3203f80f41bb9fed5d10"

echo "== Commit identity =="
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
printf 'requested head: '; git rev-parse "$head"
printf 'requested base: '; git rev-parse "$base"

echo "== Changed files =="
git diff --name-status "$base" "$head"

echo "== Candidate-file outlines =="
ast-grep outline .github/workflows/ci.yml --items all || true
ast-grep outline tests/test_workflow_contracts.py --items all --type function

echo "== Focused diff =="
git diff --unified=100 "$base" "$head" -- \
  .github/workflows/ci.yml \
  tests/test_workflow_contracts.py \
  docs/doctoring/exact-source-ci-evidence.md

echo "== Requested-head workflow =="
git show "${head}:.github/workflows/ci.yml" | nl -ba

echo "== Requested-head exact-source contract contexts =="
git show "${head}:tests/test_workflow_contracts.py" |
  nl -ba |
  sed -n '/def _workflow_job_steps/,/^def /p; /def test_ci_checks_out_and_verifies_the_exact_source_head_in_every_job/,/^def /p; /def test_ci_workflow_contract_rejects_decoy/,/^def /p'

echo "== Parsed checkout and immediate-next-step fields =="
git show "${head}:.github/workflows/ci.yml" > /tmp/ci.yml
python3 - <<'PY'
from pathlib import Path
import yaml

workflow = yaml.safe_load(Path("/tmp/ci.yml").read_text())
expected = "${{ github.event.pull_request.head.sha || github.sha }}"
for job_name, job in workflow["jobs"].items():
    steps = job.get("steps", [])
    for index, step in enumerate(steps):
        if step.get("uses", "").startswith("actions/checkout@"):
            following = steps[index + 1] if index + 1 < len(steps) else {}
            print({
                "job": job_name,
                "ref": step.get("with", {}).get("ref"),
                "persist-credentials": step.get("with", {}).get("persist-credentials"),
                "next_name": following.get("name"),
                "next_run": following.get("run"),
                "expected": expected,
            })
PY

echo "== Exact-source documentation clauses =="
git show "${head}:docs/doctoring/exact-source-ci-evidence.md" |
  nl -ba |
  rg -n -C 2 'persist-credentials|checkout|verification|rollback|evidence|source head|source-head'

Length of output: 21590


@seonghobae I found one repository-local contract-test defect.

tests/test_workflow_contracts.py does not assert that each checkout has with.persist-credentials: false.

  • .github/workflows/ci.yml sets persist-credentials: false at all three checkout sites.
  • docs/doctoring/exact-source-ci-evidence.md defines this field as mandatory.
  • test_ci_checks_out_and_verifies_the_exact_source_head_in_every_job() checks parsed with.ref, the immediate next-step name, and the verification command.
  • The test does not call _step_nested_field(step, "with", "persist-credentials").
  • A future edit could remove persist-credentials: false from every checkout and still pass the exact-source contract test.

Add this assertion in the checkout loop:

assert _step_nested_field(step, "with", "persist-credentials") == "false"

Add a decoy assertion for persist-credentials in a comment or unrelated nested mapping. This will preserve the strict field-matching property.

The workflow itself correctly binds each checkout to ${{ github.event.pull_request.head.sha || github.sha }} and immediately verifies git rev-parse HEAD against the same expression. The fallback preserves push and manual workflow behavior. I did not classify the stated external OpenCode bootstrap failure as a pg-llm-batch source defect.

You are interacting with an AI system.

@seonghobae
seonghobae enabled auto-merge (squash) August 10, 2026 03:28
@seonghobae
seonghobae marked this pull request as draft August 10, 2026 03:37
auto-merge was automatically disabled August 10, 2026 03:37

Pull request was converted to draft

@seonghobae
seonghobae dismissed opencode-agent[bot]’s stale review August 11, 2026 18:08

Dismissed as stale infrastructure-only review evidence. This exact-head REQUEST_CHANGES recorded a central coverage-evidence failure, not a pg-llm-batch source finding. The read-only central review path has materially changed since that run, and its corresponding central failure review is now dismissed. Live pg-llm-batch policy currently requires zero approving reviews. This dismissal does not approve #88, does not transfer old evidence, and does not waive exact-source CI/security/merge gates; fresh final evidence remains required before merge.

@seonghobae
seonghobae marked this pull request as ready for review August 11, 2026 18:08

@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: 1

🤖 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 `@tests/test_workflow_contracts.py`:
- Line 181: Extend the checkout-step assertions in the workflow contract test to
require _step_nested_field(step, "with", "persist-credentials") to equal "false"
for every checkout, alongside the existing with.ref check. Add a decoy
regression case proving values in env or comments do not satisfy this contract,
so only the checkout with.persist-credentials setting is accepted.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10d54754-4828-43dc-b3d9-e9e6e4d54c2f

📥 Commits

Reviewing files that changed from the base of the PR and between 9bd4d26 and ab78e47.

📒 Files selected for processing (1)
  • tests/test_workflow_contracts.py

Comment thread tests/test_workflow_contracts.py
@seonghobae
seonghobae dismissed stale reviews from opencode-agent[bot] and opencode-agent[bot] August 11, 2026 19:06

Dismissed as predecessor-head infrastructure-only evidence: this review targeted 9bd4d26 and was blocked by the former central coverage-evidence path, not a current pg-llm-batch source finding. The PR is now at a1c224c with fresh repository CI/Security/SAST success and resolved current threads. Dismissal is not approval and does not waive required current-head workflows.

@seonghobae
seonghobae merged commit 545334a into main Aug 11, 2026
33 checks passed
@seonghobae
seonghobae deleted the fix/exact-source-ci-governance branch August 11, 2026 20:22

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head a1c224c519a595341026392c989b023eeaa148a9.

  • Head SHA: a1c224c519a595341026392c989b023eeaa148a9

  • Workflow run: 31528245568

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: ci.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: exact-source-ci-evidence.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: exact-source-ci-evidence.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["Test: test_workflow_contracts.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_workflow_contracts.py"]
  R4 --> V4["targeted test run"]
Loading

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant