Skip to content

fix(security): bind repository scanners to exact PR head - #799

Draft
seonghobae wants to merge 26 commits into
mainfrom
fix/security-scan-exact-head
Draft

fix(security): bind repository scanners to exact PR head#799
seonghobae wants to merge 26 commits into
mainfrom
fix/security-scan-exact-head

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Purpose

Restore exact-head security evidence for organization-required repository scanners and fail closed when dependency-review evidence is unavailable. DiskSage PR #137 exposed synthetic-merge scanner input; the public EgressWeave canary exposed a separate fail-open path where HTTP 403 skipped dependency review while the aggregate Security Scan remained green.

Exact current stack

  • exact head: a6cd746e86c07452d03e0f5cef8e8d13c22f28c6;
  • protected base/main: e71fdab2ab088001f218765ecb5e3b7fabfee11a;
  • main is an ancestor and GitHub reports the seven-file slice mergeable;
  • every temporary repair workflow, encoded patch, and unrelated process-group repair is absent;
  • predecessor-head checks and reviews are stale.

Implemented boundary

  • Dependency-review support, Trivy, and Scorecard check out the explicit pull-request head repository and immutable head SHA with persisted credentials disabled.
  • Trivy and Scorecard SARIF uploads bind refs/pull/<number>/head and that same exact head SHA.
  • The dependency-review support probe binds exact base and head SHAs and accepts only a transport-successful HTTP 200 response.
  • The support probe has a 10-second connection limit and 30-second total limit; timeout, partial transfer, transport failure, HTTP 403/404, 000, empty/malformed status, and every unexpected outcome fail closed.
  • The API response body is discarded to /dev/null; diagnostics expose only bounded repository, base/head identity, and status evidence.
  • Only the successful probe enables the immutable-pinned actions/dependency-review-action hard gate; no green supported=false path exists.
  • OSV, Trivy, CodeQL, Semgrep, Secret Scan, Scorecard, Dependabot, and dependency review remain independent controls.
  • Fork pull requests remain read-only and supported through their explicit head repository.

Exact-head acceptance evidence

For a6cd746e86c07452d03e0f5cef8e8d13c22f28c6, all exact-head workflows completed successfully:

  • Security Scan Exact-Head Quality CI 31153100905;
  • Security Scan 31153100932;
  • CodeQL PR 31153100875;
  • Python Security 31153100955;
  • SAST Semgrep 31153100913;
  • Secret Scan 31153100874;
  • OSV-Scanner PR 31153101198;
  • Scorecard PR 31153100952;
  • SBOM Generation 31153100999;
  • CodeRabbit commit status: success.

All inline review threads are resolved or outdated; zero actionable unresolved thread remains. Formal exact-current-head OpenCode/Noema review and a qualifying independent non-author approval remain required. Queued, cancelled, predecessor-head, synthetic-merge, status-only, author-only, local-only, or repair-workflow evidence is not accepted.

Stack order

This scanner repair overlaps the fail-closed dependency-review subset carried by .github#813, whose primary purpose is the OpenCode fatal-process-group prerequisite. Keep this PR Draft until #813 reaches protected main. Then rebase or merge the new protected base, remove any base-identical overlap from the effective diff, and regenerate every exact-head quality, security, review, and approval surface. No evidence transfers across that base change.

Operator and merge contract

For a public GitHub.com repository, unavailable dependency-review evidence is a repository/organization configuration or capability problem until proven otherwise. Correct dependency graph, GitHub security capability, organization policy, entitlement, or token access and rerun; do not manufacture a green check by weakening the hard gate. Private/internal exceptions require explicit organization policy and independently reviewable entitlement evidence.

docs/doctoring/security-scan-exact-head.md records exact-head authorization, SARIF identity, fail-closed behavior, bounded execution, rollback, operator remediation, and APA 7 primary sources. After #813 integration and this PR's base refresh, merge only after exact-current-head automated review, qualifying independent non-author approval, zero unresolved valid findings, and every branch-protection rule succeed without bypass.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 650d2b21-017d-4498-bb16-37da80f52b78

📥 Commits

Reviewing files that changed from the base of the PR and between e71fdab and a6cd746.

📒 Files selected for processing (7)
  • .github/workflows/security-scan-exact-head-quality-ci.yml
  • .github/workflows/security-scan.yml
  • CHANGELOG.md
  • README.md
  • docs/doctoring/security-scan-exact-head.md
  • tests/test_security_scan_exact_head.py
  • tests/test_security_scan_sarif_exact_head.py
📝 Walkthrough

Walkthrough

PR의 실제 head 저장소와 SHA를 보안 스캔 입력과 SARIF 식별자에 고정했습니다. Dependency Review API는 HTTP 200에서만 성공하며, 관련 계약 테스트와 quality CI를 추가했습니다. 운영 계약과 rollback 절차도 문서화했습니다.

Changes

Exact-head 보안 스캔

Layer / File(s) Summary
Exact-head 스캔 워크플로
.github/workflows/security-scan.yml
Dependency Review, Trivy, Scorecard가 PR head 저장소와 SHA를 checkout합니다. Dependency Review는 HTTP 200이 아니면 실패합니다. Trivy와 Scorecard SARIF는 head ref와 SHA에 연결됩니다.
계약 테스트와 CI 검증
.github/workflows/security-scan-exact-head-quality-ci.yml, tests/test_security_scan_exact_head.py, tests/test_security_scan_sarif_exact_head.py
계약 테스트가 exact-head checkout, dependency-review probe, SARIF attribution을 검사합니다. 전용 quality CI가 관련 변경에서 두 테스트 파일을 컴파일하고 실행합니다.
운영 계약 문서화
README.md, docs/doctoring/security-scan-exact-head.md, CHANGELOG.md
Exact-head 입력, HTTP 200 규칙, 응답 본문 비기록, SARIF identity, 검증 및 rollback 절차를 문서화했습니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant DependencyReviewAPI
  participant Trivy
  participant Scorecard
  participant SARIFUpload
  PullRequest->>GitHubActions: head repository와 head SHA 제공
  GitHubActions->>DependencyReviewAPI: base SHA와 head SHA 비교 요청
  DependencyReviewAPI-->>GitHubActions: HTTP 200 또는 실패 상태 반환
  GitHubActions->>Trivy: head repository와 head SHA checkout
  GitHubActions->>Scorecard: head repository와 head SHA checkout
  Trivy->>SARIFUpload: head ref와 head SHA를 포함한 SARIF 업로드
  Scorecard->>SARIFUpload: head ref와 head SHA를 포함한 SARIF 업로드
Loading

Possibly related issues

  • 이슈 810: .github/workflows/security-scan.yml의 fail-closed dependency-review와 exact-head 계약을 직접 구현합니다.
  • 이슈 76: HTTP 200-only 지원 확인, 정확한 base/head 바인딩, unavailable 응답 테스트와 문서화를 포함합니다.

Suggested labels: needs-revision, do-not-merge

🚥 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 제목은 저장소 스캐너를 PR의 정확한 head에 연결하는 주요 변경 사항을 간결하고 명확하게 설명합니다.
✨ 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/security-scan-exact-head

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

@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 07:02

Copy link
Copy Markdown
Contributor Author

@opencode-agent Extend this exact-current-head security-scan repair test-first to address #810, and do nothing if PR #799 branch head is no longer aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae.

A downstream exact-head canary exposed a valid organization-level fail-open defect in the same workflow. ContextualWisdomLab/EgressWeave is public. On EgressWeave PR #66 exact head c038a9509d1a8eae8561cc9081e67e12bd373d42, Security Scan run 31108241013, dependency-review job 92638903658, the exact compare 10d0c51daf2ad278d66f43be479df8cf6b08ba6d...c038a9509d1a8eae8561cc9081e67e12bd373d42 returned HTTP 403; central security-scan.yml warned that dependency review was unavailable, set supported=false, skipped actions/dependency-review-action, and returned a green job/workflow. GitHub currently documents dependency review/action as available for public GitHub.com repositories when dependency graph is enabled, and the public-resource REST compare does not require authentication. Treat this as unavailable security evidence, not a clean dependency review. Do not guess the root cause of the 403.

Use two auditable commits in order:

  1. Immutable RED test-only commit. Modify only tests/test_security_scan_exact_head.py (or add one tightly focused tests/test_security_scan_dependency_review.py if substantially clearer). Add a deterministic static/contract regression that fails on current head because 403/404 are converted to supported=false + exit 0 / success and because the hard action is conditionally skipped. Require the central contract to distinguish an executed clean review from API unavailability and to fail closed for public-repository unavailability. Preserve all existing exact-head checkout and SARIF contracts.

  2. GREEN bounded repair. Modify only .github/workflows/security-scan.yml, the focused test above, docs/doctoring/security-scan-exact-head.md, and CHANGELOG.md. For the dependency-review support probe:

    • keep exact BASE_SHA/HEAD_SHA, exact PR-head checkout, read-only permissions, persisted credentials disabled, and the immutable actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 pin;
    • 200 may continue to the hard dependency-review action;
    • 403, 404, empty/malformed status, curl/transport failure, timeout, and any unexpected status must not yield a successful dependency-review result for a public repository; fail closed with a concise actionable error that identifies repository plus exact base/head and HTTP status but does not print auth material or an untrusted response body;
    • do not use OSV, Trivy, Scorecard, CodeQL, or another scanner as a semantic substitute for dependency review;
    • do not introduce branch-controlled opt-outs or infer not-applicable from 403/404. If private/internal repository exceptions are required, leave that as the separately governed policy decision in security: make central dependency-review unavailability fail closed #810 rather than weakening this public-repository canary repair.

Update doctoring so its claimed fail-closed behavior matches production and include current APA 7 primary references to GitHub Dependency Review, Dependency Graph, and Dependency Review REST API. Add one concise [Unreleased] Security entry; no version/release bump.

Do not change .github/workflows/security-scan-exact-head-quality-ci.yml unless the existing permanent exact-head quality job cannot discover the new focused test without a minimal dependency-free update. Do not modify any other workflow, OpenCode/Noema/Strix credentials or identities, dependencies, repository protections, publication/release/tag/ref behavior, model provider, or caller. Never add a temporary/self-modifying/write-capable repair workflow, contents: write, OIDC, branch push, merge/rebase, auto-merge, -X ours/theirs, or execution of model-modified source under a write credential.

After GREEN, run the focused dependency-free contract and the complete central Python test/100% statement+branch coverage/public-docstring/compile contract available on the branch. Then leave PR #799 unmerged and request fresh exact-GREEN CodeRabbit/OpenCode/Noema review plus every required security workflow; do not claim queued, absent, skipped, predecessor-head, or synthetic-merge evidence as current-head success. Report immutable RED and GREEN SHAs in this PR conversation.

@seonghobae
seonghobae marked this pull request as draft August 6, 2026 21:21

Copy link
Copy Markdown
Contributor Author

@opencode-agent Extend this existing security-scan repair test-first on exact current head aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae; stop without writing if the head differs.

Fresh downstream evidence from ContextualWisdomLab/EgressWeave#66 exact head c038a9509d1a8eae8561cc9081e67e12bd373d42 exposed a still-valid organization-level fail-open dependency-review path. Security Scan run 31108241013, job 92638903658, queried exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d and exact head c038a9509d1a8eae8561cc9081e67e12bd373d42; the dependency-graph compare endpoint returned HTTP 403. The current central step then emitted Dependency review is unavailable for ContextualWisdomLab/EgressWeave; skipping dependency-review hard gate., set supported=false, skipped actions/dependency-review-action, and allowed the dependency-review job and aggregate Security Scan to conclude success. This is tracked as ContextualWisdomLab/EgressWeave#76. PR #66 does not change dependency inputs, so do not claim it introduced a vulnerable dependency; repair the assurance semantics instead.

Use the existing PR #799 rather than creating a competing PR because it already owns .github/workflows/security-scan.yml, its exact-head contracts, doctoring, and CHANGELOG. Preserve the exact-head checkout/SARIF repair already present.

Required RED → GREEN extension:

  1. First commit immutable test-only RED evidence in the existing security-scan contract tests proving that HTTP 403/404 from dependency-review support cannot be represented as a passed dependency-review gate.
  2. Preserve 200 as the only path that may execute the pinned dependency-review action.
  3. For unavailable 403/404, classify the exact PR base..head conservatively and deterministically. If any supported dependency manifest, lock, dependency-submission definition, package-resolution input, or an unknown/truncated classification state is present, fail closed. If and only if the complete exact diff proves no dependency-sensitive path changed, emit an explicit exact-base/exact-head not-applicable outcome; never call that passed.
  4. Any GitHub API enumeration used for classification must paginate fully, bind repository/PR/base/head identities, reject stale heads, and fail closed on malformed responses, page/record limits, truncation, rate/permission failures, or identity drift. Prefer an already-authenticated exact-tree method if it gives stronger completeness evidence. Do not rely on the capped compare-file list as complete evidence.
  5. Keep contents/pull-requests read-only, persist-credentials: false, immutable action pins, fork-read-only behavior, OSV, Trivy, Scorecard, CodeQL/GHAS, Semgrep, Dependabot and existing scanner semantics unchanged except for the corrected dependency-review outcome.
  6. Add focused positive/negative/adversarial tests for dependency-sensitive paths, dependency-neutral paths, stale-head refusal, pagination/completeness, malformed/unavailable responses, and the exact EgressWeave 403 shape. Maintain 100% production statement/branch coverage and beginner-readable public docstrings for any helper added.
  7. Update docs/doctoring/security-scan-exact-head.md with passed vs exact-bound not-applicable vs unavailable/fail-closed, administrator remediation for enabling GitHub dependency graph/Code Security when entitlement permits, and APA 7 primary GitHub references. Prepend one [Unreleased] Security entry; do not bump a version.

Modify only the already-owned PR #799 security-scan workflow/contract/helper/documentation/CHANGELOG surface needed for this repair. Do not add any repository-write, OIDC, branch/ref publication, PR creation/merge, release/package/signing authority, temporary write-capable workflow, self-modifying workflow, model-modified-tree publication, or conflict strategy. Do not merge or mark Ready. After GREEN, require fresh exact-current-head central quality/security/review evidence and preserve independent non-author approval and branch protection as mandatory gates.

@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 23:19
@seonghobae
seonghobae enabled auto-merge (squash) August 6, 2026 23:19

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review @coderabbitai review

Review-only request for exact current head aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae against protected main f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae. Exact-head Security Scan Exact-Head Quality CI, Security Scan, CodeQL, Python Security, Semgrep, Secret Scan, OSV, Scorecard, and SBOM are complete and successful; unresolved threads are zero. Validate explicit head-repository/SHA checkout for dependency review, Trivy, and Scorecard; exact-head SARIF ref/SHA binding; fork read-only support; and preservation of existing scanner severity and least-privilege policy. Do not mutate the branch or merge; submit actionable findings or a formal exact-head review.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested_head='aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae'
protected_main='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

printf '%s\n' '== Current commit =='
git rev-parse HEAD
printf '%s\n' '== Requested commit exists =='
git rev-parse "${requested_head}^{commit}"
printf '%s\n' '== Requested protected commit exists =='
git rev-parse "${protected_main}^{commit}"
printf '%s\n' '== Merge base =='
git merge-base "$protected_main" "$requested_head"
printf '%s\n' '== Changed files =='
git diff --name-status "$protected_main" "$requested_head"
printf '%s\n' '== Workflow outline =='
ast-grep outline .github/workflows/security-scan.yml --items all || true
printf '%s\n' '== Focused test candidates =='
fd -t f 'security.*scan.*exact.*head|exact.*head.*security.*scan|security.*scan.*dependency.*review' tests . 2>/dev/null || true
printf '%s\n' '== Workflow security-sensitive lines =='
rg -n -C 4 --glob '.github/workflows/security-scan.yml' \
  'actions/checkout|dependency-review-action|upload-sarif|head\.repo|head\.sha|refs/pull|persist-credentials|permissions:|security-events|contents:|pull-requests:|trivy|scorecard|severity|fail-on-severity' .

Length of output: 2385


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
head='aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae'

for file in \
  .github/workflows/security-scan.yml \
  .github/workflows/security-scan-exact-head-quality-ci.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  docs/doctoring/security-scan-exact-head.md \
  CHANGELOG.md
do
  printf '\n== %s ==\n' "$file"
  nl -ba "$file"
done

printf '\n== Complete diff ==\n'
git diff --no-ext-diff --unified=80 "$base" "$head" -- \
  .github/workflows/security-scan.yml \
  .github/workflows/security-scan-exact-head-quality-ci.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  docs/doctoring/security-scan-exact-head.md \
  CHANGELOG.md

Length of output: 1191


🏁 Script executed:

#!/bin/bash
set -u

base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
head='aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae'

print_file() {
  file="$1"
  printf '\n== %s ==\n' "$file"
  if command -v awk >/dev/null 2>&1; then
    awk '{ printf "%6d  %s\n", NR, $0 }' "$file"
  else
    cat "$file"
  fi
}

for file in \
  .github/workflows/security-scan.yml \
  .github/workflows/security-scan-exact-head-quality-ci.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  docs/doctoring/security-scan-exact-head.md \
  CHANGELOG.md
do
  print_file "$file"
done

printf '\n== Complete scoped diff ==\n'
git diff --no-ext-diff --unified=80 "$base" "$head" -- \
  .github/workflows/security-scan.yml \
  .github/workflows/security-scan-exact-head-quality-ci.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  docs/doctoring/security-scan-exact-head.md \
  CHANGELOG.md || true

Length of output: 65118


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
pr='799'

printf '%s\n' '== Pull request identity =='
gh pr view "$pr" --repo "$repo" \
  --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus \
  --jq '{number, headRefOid, baseRefOid, isDraft, mergeStateStatus}'

printf '%s\n' '== Check runs for the requested head =='
gh api "repos/${repo}/commits/aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae/check-runs?per_page=100" \
  --jq '.check_runs[] | {name, status, conclusion, details_url}'

printf '%s\n' '== Workflow-run conclusions for the requested head =='
gh run list --repo "$repo" \
  --commit aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae \
  --limit 100 \
  --json databaseId,name,status,conclusion,event,headSha,url \
  --jq '.[] | {databaseId, name, status, conclusion, event, headSha, url}'

Length of output: 23567


@seonghobae Formal exact-head review completed for aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae against main f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

Finding — P1: dependency-review can succeed without dependency-review evidence

In .github/workflows/security-scan.yml, Line 292 through Line 295 convert dependency-graph compare HTTP 403 or 404 into supported=false and exit successfully. Line 302 then skips the pinned actions/dependency-review-action. The dependency-review job and the required Security Scan workflow can therefore pass without a dependency review.

Treat unavailable support as unavailable security evidence. Fail the job with a concise error that identifies the repository and exact base/head. Do not print the response body. This behavior is relevant to the reported EgressWeave public-repository 403 case.

The remaining requested controls are present:

  • Dependency review, Trivy, and Scorecard check out github.event.pull_request.head.repo.full_name at github.event.pull_request.head.sha.
  • These checkouts set persist-credentials: false.
  • Trivy and Scorecard SARIF uploads bind refs/pull/${{ github.event.pull_request.number }}/head and github.event.pull_request.head.sha.
  • Trivy preserves the fixable CRITICAL,HIGH,MEDIUM hard gate.
  • Scorecard remains a soft job.
  • Workflow permissions remain least-privilege for the scanner roles.
  • GitHub reports the named quality, security, review, and SBOM workflows as successful for the requested head.

I cannot approve while the dependency-review fail-open path remains.

⚠️ 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

@opencode-agent

Review-only request for exact current head aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae. Validate that dependency-review, Trivy, and Scorecard check out the explicit PR head repository and immutable SHA, SARIF binds refs/pull/799/head plus the same SHA, fork PRs stay read-only, and the existing scanner severity/policy semantics are unchanged. Do not update or merge.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Independently review exact current head aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae, focusing on exact-head authorization, explicit fork head-repository checkout, SARIF ref/SHA integrity, permission scope, and whether the doctoring claims are supported by current workflow evidence. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@opencode-agent review
@cwl-noema-review review

Final read-only exact-head review for aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae. Security Scan Exact-Head Quality CI 31079215588 and the current complete security/supply-chain suite are successful, including Security Scan, CodeQL, Python Security, Semgrep, Secret Scan, OSV, Scorecard, and SBOM; CodeRabbit status is successful, zero inline threads remain, and auto-merge is armed. Verify that dependency review, Trivy, and Scorecard bind to the literal PR head repository/SHA; SARIF binds refs/pull/<number>/head and the same SHA; credentials stay unpersisted; fork PRs remain read-only; and OSV/severity/permissions behavior is unchanged. Submit formal exact-head APPROVE only if no actionable defect remains. Do not mutate, manually merge, release, or alter protections.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 12 minutes and 20 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Review exact head aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae read-only. Security Scan Exact-Head Quality 31079215588, current Security Scan 31131595872, Python Security 31131595911, CodeQL 31131595820, Semgrep 31131595832, Secret Scan 31131597658, OSV 31131596407, Scorecard 31131595786, SBOM 31131593849, and CodeRabbit are successful, with zero unresolved threads. Verify dependency-review support, Trivy, and Scorecard check out the explicit pull-request head repository and immutable head SHA; SARIF uploads bind refs/pull/<number>/head and that same SHA; fork PRs remain read-only; persisted credentials remain disabled; and OSV comparison, severity/findings policy, permissions, and immutable action/scanner pins are unchanged. Submit a qualifying non-author approval only if exact-head authorization evidence is complete.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review review

Independently review exact head aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae read-only, focusing on literal contributor-head authorization, fork-safe repository selection, SARIF ref/SHA binding, persisted credential removal, immutable pins, and preservation of existing scanner semantics. Submit a current-head verdict only; do not mutate or merge.

@opencode-agent
opencode-agent Bot force-pushed the fix/security-scan-exact-head branch from aee317b to 323c07b Compare August 7, 2026 00:15

Copy link
Copy Markdown
Contributor Author

@opencode-agent Exact-head correction for #810: extend only current PR #799 head 323c07b794d11f82c04db91544bc3a3f5cf5ad5c; stop without writing if the branch head differs. The prior #810 request was intentionally bound to stale predecessor aee317b3ecbfaad7cdb3898e603dfe5e69b8f7ae and therefore must not authorize a write now.

Preserve the existing exact-PR-head checkout/SARIF binding repair. Add the dependency-review availability repair test-first in two auditable commits:

  1. Immutable RED, test-only: add a focused deterministic contract proving the current 403/404supported=false/exit-0 → skipped hard action → green aggregate path is forbidden. Preserve all existing exact-head contracts.
  2. GREEN bounded repair: modify only .github/workflows/security-scan.yml, that focused test, docs/doctoring/security-scan-exact-head.md, and CHANGELOG.md (and leave the permanent quality workflow unchanged unless discovery truly requires a minimal dependency-free adjustment). A 200 support probe may continue to the immutable-pinned dependency-review action. For a public repository, 403, 404, empty/malformed status, transport/curl failure, timeout, truncated state, or any unexpected status must fail closed with concise repository + exact base/head + status diagnostics, without auth material or untrusted response bodies. Do not substitute OSV, Trivy, Scorecard, CodeQL, Semgrep, or another scanner for dependency review. Do not infer not-applicable from 403/404 or add a branch-controlled opt-out.

Keep exact BASE_SHA...HEAD_SHA binding, explicit head repo/SHA checkout, persist-credentials: false, read-only permissions, immutable action pins, and the independent scanner surfaces. Add current APA 7 primary GitHub references and one [Unreleased] Security entry; no version bump.

Do not add or use a temporary/self-modifying/write-capable workflow, contents: write, OIDC, branch push, merge/rebase, auto-merge, -X ours/theirs, or execution of model-modified source under a write credential. After GREEN, run the focused dependency-free contract and complete central test/100% statement+branch coverage/public-docstring/compile contract, then request fresh exact-GREEN review and required security workflows. Report immutable RED/GREEN SHAs and exact-head evidence; do not merge or publish.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Review-only exact-head request for 323c07b794d11f82c04db91544bc3a3f5cf5ad5c. Validate literal PR-head repository/SHA checkout for dependency review support, Trivy, and Scorecard; exact SARIF ref/SHA binding; fork read-only compatibility; unchanged scanner policies; and all successful exact-head quality/security/supply-chain gates. Do not mutate the branch or merge.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Independently review exact head 323c07b794d11f82c04db91544bc3a3f5cf5ad5c, focusing on exact-head authorization evidence, explicit head-repository handling for forks, SARIF identity, least privilege, and preservation of existing scanner severity/finding policy. Do not mutate the branch or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@opencode-agent review
@cwl-noema-review review
@strix review

Final read-only review for exact head 323c07b794d11f82c04db91544bc3a3f5cf5ad5c. Exact-head quality, CodeQL, Python Security, SAST, Security Scan, Secret Scan, OSV, Scorecard, and SBOM are successful. Verify literal contributor-head checkout and SARIF identity binding for dependency-review support, Trivy, and Scorecard, including fork read-only behavior and persisted-credential denial. Submit a qualifying non-author approval only if no actionable finding remains. Do not mutate the branch, bypass protections, or merge.

@coderabbitai

coderabbitai Bot commented Aug 7, 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

repo='ContextualWisdomLab/.github'
pr='799'
head='323c07b794d11f82c04db91544bc3a3f5cf5ad5c'

printf '%s\n' '== Pull request identity =='
gh pr view "$pr" --repo "$repo" \
  --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus \
  --jq '{number, headRefOid, baseRefOid, isDraft, mergeStateStatus}'

printf '%s\n' '== Local checked-out commit =='
git rev-parse HEAD
printf '%s\n' '== Requested commit =='
git rev-parse "${head}^{commit}"

printf '%s\n' '== Changed files against PR base =='
base="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"
git diff --name-status "$base" "$head"

printf '%s\n' '== Workflow structure =='
ast-grep outline .github/workflows/security-scan.yml --items all || true

printf '%s\n' '== Exact-head and policy-sensitive workflow lines =='
rg -n -C 5 \
  'actions/checkout|dependency-review-action|upload-sarif|head\.repo\.full_name|head\.sha|refs/pull|persist-credentials|permissions:|security-events:|contents:|pull-requests:|trivy|scorecard|severity|fail-on-severity|BASE_SHA|HEAD_SHA|supported=' \
  .github/workflows/security-scan.yml

printf '%s\n' '== Focused contract test candidates =='
fd -t f 'test_security_scan_exact_head.py|test_security_scan_sarif_exact_head.py|test_security_scan_dependency_review.py' tests 2>/dev/null \
  | sort \
  | xargs -r -n1 sh -c 'echo "== $0 =="; sed -n "1,260p" "$0"'

printf '%s\n' '== Scoped documentation and changelog changes =='
git diff --no-ext-diff --unified=50 "$base" "$head" -- \
  .github/workflows/security-scan.yml \
  .github/workflows/security-scan-exact-head-quality-ci.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  tests/test_security_scan_dependency_review.py \
  docs/doctoring/security-scan-exact-head.md \
  CHANGELOG.md

printf '%s\n' '== Check runs for requested head =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name, status, conclusion, details_url}'

printf '%s\n' '== Workflow runs for requested head =='
gh run list --repo "$repo" --commit "$head" --limit 100 \
  --json databaseId,name,status,conclusion,event,headSha,url \
  --jq '.[] | {databaseId,name,status,conclusion,event,headSha,url}'

Length of output: 58020


@seonghobae Formal exact-head review completed for 323c07b794d11f82c04db91544bc3a3f5cf5ad5c.

Finding — P1: dependency-review can pass without dependency-review evidence

In .github/workflows/security-scan.yml, Line 292 through Line 295 handle HTTP 403 or 404 by setting supported=false and exiting successfully. Line 302 then skips the pinned actions/dependency-review-action. The dependency-review job and the aggregate Security Scan workflow can therefore pass when dependency-review evidence is unavailable.

The exact head still contains the EgressWeave fail-open path from the prior review. Treat 403, 404, malformed status, transport failure, and unexpected status as unavailable security evidence. Fail the job with a concise diagnostic that includes the repository, BASE_SHA, HEAD_SHA, and HTTP status. Do not print credentials or the response body.

The requested exact-head controls are present:

  • Dependency review, Trivy, and Scorecard use github.event.pull_request.head.repo.full_name and github.event.pull_request.head.sha.
  • These checkouts set persist-credentials: false.
  • Trivy and Scorecard SARIF uploads bind refs/pull/${{ github.event.pull_request.number }}/head and github.event.pull_request.head.sha.
  • The workflow keeps read-only contents and pull-requests permissions for dependency review.
  • Trivy retains the fixable CRITICAL,HIGH,MEDIUM hard gate.
  • Scorecard remains a soft posture job.
  • The listed quality, security, and supply-chain workflows completed successfully for the requested SHA.

I cannot approve while the dependency-review fail-open path remains.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Supersede the immediately preceding review-only request at issue comment 5210969307 for current head 323c07b794d11f82c04db91544bc3a3f5cf5ad5c. It was generated against a tree that still contains the #810 fail-open dependency-review path and therefore must not be treated as a final-approval request or as evidence that all security/supply-chain gates are trustworthy.

Current-head inspection still shows .github/workflows/security-scan.yml converting dependency-review support-probe HTTP 403/404 into supported=false + exit 0 and conditionally skipping the pinned dependency-review action. The exact-head test-first repair request in comment 5210837930 remains the active mutation instruction for this branch. Do not approve, merge, auto-merge, release, or publish 323c07b794d11f82c04db91544bc3a3f5cf5ad5c as-is.

After a new exact GREEN head implements #810, request fresh CodeRabbit/OpenCode/Noema review and every required quality/security/supply-chain workflow against that new SHA only. Predecessor-head success and this superseded review request are stale evidence.

@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 a6cd746e86c07452d03e0f5cef8e8d13c22f28c6.

  • Head SHA: a6cd746e86c07452d03e0f5cef8e8d13c22f28c6

  • Workflow run: 31153541779

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

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

Copy link
Copy Markdown
Contributor Author

@opencode-agent Perform a read-only formal review of exact current head a6cd746e86c07452d03e0f5cef8e8d13c22f28c6 against exact base e71fdab2ab088001f218765ecb5e3b7fabfee11a for PR #799. Do not modify files, refs, PR state, credentials, or merge state. Treat predecessor-head REQUEST_CHANGES and checks as stale. Verify the durable diff binds dependency-review, Trivy, and Scorecard to the literal PR head, fails dependency-review availability closed unless the exact base/head probe returns HTTP 200, applies explicit connect/total timeouts, discards the response body, binds SARIF to the exact head identity, preserves independent scanner controls, and contains no temporary/encoded/write-capable repair workflow or patch payload. Exact-head Security Scan Exact-Head Quality CI, Security Scan, Python Security, CodeQL, Semgrep, Secret Scan, OSV, Scorecard, and SBOM runs are all successful on this head. Anchor any formal outcome to this exact PR/head.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Review exact current head a6cd746e86c07452d03e0f5cef8e8d13c22f28c6. Verify explicit PR-head repository/SHA checkout for dependency review, Trivy and Scorecard; exact ref/SHA SARIF binding; bounded curl transport-vs-HTTP handling; discarded response body; fail-closed non-200/timeout/partial-transfer behavior; fork read-only support; action pins; and the seven-file scope. Submit only a formal current-head verdict.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Review exact current head a6cd746e86c07452d03e0f5cef8e8d13c22f28c6. Check exact-head scanner identity, SARIF identity, dependency-review support evidence and fail-closed transport semantics, fork behavior, least privilege, and same-head test/security evidence. Publish only a formal current-head verdict.

@seonghobae
seonghobae marked this pull request as draft August 7, 2026 09:55

Copy link
Copy Markdown
Contributor Author

/oc Refetch the live pull request and stop without writing unless its exact head is a6cd746e86c07452d03e0f5cef8e8d13c22f28c6. Keep the PR Draft. Exact-head OpenCode run 31153541779 failed only because inherited tests/test_required_workflow_queue_contract.py::test_security_scan_skips_dependency_review_when_dependency_graph_is_unavailable still asserts the superseded fail-open 403/404 support path, while .github/workflows/security-scan.yml now correctly accepts only HTTP 200 and fails closed for every unavailable, malformed, timeout, transport, 403, 404, or unexpected result.

Apply the minimum test-only repair. Rename that test to describe fail-closed dependency-review evidence. Preserve assertions for id: dependency_review_support, the exact ${BASE_SHA}...${HEAD_SHA} dependency-graph endpoint, and the gated action condition. Replace the obsolete "$status" = "403" and "$status" = "404" assertions with bounded assertions proving: curl has 10-second connect and 30-second total timeouts; only if [ "$status" != "200" ]; then is accepted; the non-200 branch emits the bounded exact-base/head error and exits 1; supported=true is written only after that branch; and there is no supported=false output or green skip path. Do not add inert workflow strings merely to satisfy the old test and do not change production scanner behavior.

Run that focused test first, then tests/test_security_scan_exact_head.py, tests/test_security_scan_sarif_exact_head.py, the full repository suite, the exact PR quality workflow, 100% production statement/branch coverage and public docstrings where configured, compileall, and git diff --check. Update the PR body's exact-head evidence after the commit. Do not mark Ready, approve, merge, release, force-push, create another branch/PR/workflow, or alter reviewer credentials, NVIDIA_NIM_API_KEY, or any model-provider boundary. Never introduce COPILOT_GITHUB_TOKEN.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review

Re-read the exact current head and submit a formal review-only verdict for literal PR-head repository/SHA checkout in dependency review, Trivy, and Scorecard; exact SARIF ref/SHA binding; fork read-only compatibility; unchanged scanner severity/finding policy; least privilege; and every direct exact-head quality/security/supply-chain Check. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

Perform a fresh exact-current-head review of literal PR-head scanner checkouts, SARIF identity, fork read-only compatibility, and unchanged scanner policy. Submit the verdict without mutating or merging.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

@seonghobae I will perform a fresh read-only review of the current PR head. I will verify the requested scanner checkout, SARIF, fork-safety, and scanner-policy controls. I will not modify or merge the PR.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 4 minutes.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Submit a formal current-head GitHub review after the current checks settle. Approve only if all exact-head checks succeed and no actionable finding remains; otherwise post the concrete blocker. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai

Please submit the formal current-head review conclusion after the latest exact-head checks complete. Do not mutate or merge.

@coderabbitai

coderabbitai Bot commented Aug 7, 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

repo='ContextualWisdomLab/.github'
pr='799'

echo '== PR identity =='
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,headRefOid,baseRefOid,mergeStateStatus,url \
  --jq '{number,state,isDraft,headRefOid,baseRefOid,mergeStateStatus,url}'

head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
base="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"

echo '== Materialized commit identity =='
printf 'checked-out: '; git rev-parse HEAD
printf 'live-head: '; printf '%s\n' "$head"
printf 'live-base: '; printf '%s\n' "$base"
printf 'merge-base: '; git merge-base "$base" "$head"

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

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

echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          path
          line
          comments(first: 1) { nodes { author { login } body } }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {path,line,author:.comments.nodes[0].author.login,body:.comments.nodes[0].body}'

echo '== Dependency-review contract and scanner identity controls =='
rg -n -C 6 \
  'dependency_review_support|if \[ "\$status" != "200" \]|supported=false|supported=true|connect-timeout|max-time|-o /dev/null|BASE_SHA|HEAD_SHA|dependency-review-action|head\.repo\.full_name|head\.sha|persist-credentials|upload-sarif|refs/pull' \
  .github/workflows/security-scan.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  tests/test_required_workflow_queue_contract.py

echo '== Scoped diff =='
git diff --no-ext-diff --unified=40 "$base" "$head" -- \
  .github/workflows/security-scan-exact-head-quality-ci.yml \
  .github/workflows/security-scan.yml \
  CHANGELOG.md \
  README.md \
  docs/doctoring/security-scan-exact-head.md \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  tests/test_required_workflow_queue_contract.py

Length of output: 87268


@seonghobae Formal current-head review completed for PR #799 at a6cd746e86c07452d03e0f5cef8e8d13c22f28c6 against e71fdab2ab088001f218765ecb5e3b7fabfee11a.

I cannot approve this head.

P1 — The central test contract still asserts the removed fail-open behavior.

tests/test_required_workflow_queue_contract.py, Lines 829-838, still defines test_security_scan_skips_dependency_review_when_dependency_graph_is_unavailable. It requires the workflow to contain:

  • "$status" = "403"
  • "$status" = "404"

The live .github/workflows/security-scan.yml correctly contains neither condition. Its dependency-review support probe accepts only HTTP 200. It exits with failure for every other status. Therefore, the central contract contradicts the production fail-closed boundary. The complete central test suite can fail even though the focused exact-head contracts pass.

Replace the stale test with a fail-closed contract that requires:

  • id: dependency_review_support;
  • /dependency-graph/compare/${BASE_SHA}...${HEAD_SHA};
  • if [ "$status" != "200" ]; then;
  • the non-200 diagnostic with HTTP ${status:-unavailable};
  • supported=true only after the failing branch;
  • the immutable actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 action gated by the positive output; and
  • absence of supported=false and the green skip message.

The reviewed production controls are otherwise correct on this exact head:

  • Dependency review, Trivy, and Scorecard check out the explicit pull-request head repository and immutable SHA.
  • These checkouts set persist-credentials: false.
  • The dependency-review probe uses the exact base/head comparison, --connect-timeout 10, --max-time 30, and -o /dev/null.
  • Non-200, transport, timeout, malformed, and empty outcomes fail closed without printing the response body.
  • Trivy and Scorecard SARIF uploads bind refs/pull/<number>/head and the same head SHA.
  • The dependency-review action pin, read-only permissions, fork-compatible behavior, Trivy severity gate, and Scorecard soft role remain intact.
  • The exact-head checks are complete for this SHA. The unresolved-thread query returned no results.

The current successful checks are valid execution evidence. They do not correct the stale central test contract.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Use the newest exact head only. If every required check is green and there is no actionable finding, submit formal approval; otherwise state the blocker. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review review

Use exact-current-head evidence only. Approve formally only when required checks are green and no actionable finding remains; otherwise identify the blocker. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review

Do not post another top-level acknowledgement. Submit the formal exact-head review verdict through the GitHub review API when current-head checks are complete; approve only if no blocker remains. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

Use the exact current head only and submit the review verdict through the formal GitHub review surface; do not post another summary comment, mutate, or merge.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 6 minutes and 21 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Please use the GitHub review API rather than another comment for the final exact-head verdict. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Final action expected: use the GitHub review API for the exact current head. Approve only if current required checks are successful and no actionable finding remains; otherwise post one concrete blocking review. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Submit one formal exact-current-head review through GitHub's review API. Do not add another discussion comment, mutate, or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Do not acknowledge. Submit exactly one formal review on the exact current head through GitHub's review API after checks complete. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Do not acknowledge. Submit exactly one formal review on the exact current head through GitHub's review API after checks complete. Do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai

Do not acknowledge. Submit exactly one formal review on the exact current head through GitHub's review API after checks complete. Do not mutate or merge.

@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.

P1 — The central test contract still requires the removed fail-open path.

tests/test_required_workflow_queue_contract.py, Lines 829-838, defines test_security_scan_skips_dependency_review_when_dependency_graph_is_unavailable. It requires "$status" = "403" and "$status" = "404" in .github/workflows/security-scan.yml.

The reviewed workflow correctly accepts only HTTP 200. It fails the dependency-review job for every other status. The test contract therefore contradicts the fail-closed dependency-review boundary and can fail the complete central suite.

Replace the stale test with a fail-closed contract. Require id: dependency_review_support, the exact /dependency-graph/compare/${BASE_SHA}...${HEAD_SHA} endpoint, if [ "$status" != "200" ]; then, the HTTP ${status:-unavailable} diagnostic, and supported=true only after the failing branch. Require the immutable actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 action to remain gated by the positive output. Reject supported=false and the green skip path.

The other reviewed exact-head controls are present: explicit PR-head repository/SHA checkout with persisted credentials disabled; 10-second connection and 30-second total probe timeouts; response-body discard; fail-closed non-200 outcomes; exact-head Trivy and Scorecard SARIF binding; immutable action pins; read-only fork-compatible permissions; and unchanged Trivy hard-gate and Scorecard soft-role policy.

@coderabbitai

coderabbitai Bot commented Aug 7, 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

repo='ContextualWisdomLab/.github'
pr='799'

echo '== Pull request identity =='
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,headRefOid,baseRefOid,mergeStateStatus,url \
  --jq '{number,state,isDraft,headRefOid,baseRefOid,mergeStateStatus,url}'

head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
base="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"

echo '== Materialized identity =='
printf 'checked-out: '; git rev-parse HEAD
printf 'live-head: '; printf '%s\n' "$head"
printf 'live-base: '; printf '%s\n' "$base"
printf 'merge-base: '; git merge-base "$base" "$head"

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

echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          path
          line
          comments(first: 1) { nodes { author { login } body } }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {path,line,author:.comments.nodes[0].author.login,body:.comments.nodes[0].body}'

echo '== Dependency-review and scanner identity controls =='
rg -n -C 6 \
  'dependency_review_support|if \[ "\$status" != "200" \]|supported=false|supported=true|connect-timeout|max-time|-o /dev/null|BASE_SHA|HEAD_SHA|dependency-review-action|head\.repo\.full_name|head\.sha|persist-credentials|upload-sarif|refs/pull' \
  .github/workflows/security-scan.yml \
  tests/test_security_scan_exact_head.py \
  tests/test_security_scan_sarif_exact_head.py \
  tests/test_required_workflow_queue_contract.py

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

Length of output: 48293


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
pr='799'
head='a6cd746e86c07452d03e0f5cef8e8d13c22f28c6'

live_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)"
if [ "$live_head" != "$head" ]; then
  echo "Refusing to submit review: live head is ${live_head}, expected ${head}." >&2
  exit 1
fi

body=$(cat <<'EOF'
**P1 — The central test contract still requires the removed fail-open path.**

`tests/test_required_workflow_queue_contract.py`, Lines 829-838, defines `test_security_scan_skips_dependency_review_when_dependency_graph_is_unavailable`. It requires `"$status" = "403"` and `"$status" = "404"` in `.github/workflows/security-scan.yml`.

The reviewed workflow correctly accepts only HTTP `200`. It fails the `dependency-review` job for every other status. The test contract therefore contradicts the fail-closed dependency-review boundary and can fail the complete central suite.

Replace the stale test with a fail-closed contract. Require `id: dependency_review_support`, the exact `/dependency-graph/compare/${BASE_SHA}...${HEAD_SHA}` endpoint, `if [ "$status" != "200" ]; then`, the `HTTP ${status:-unavailable}` diagnostic, and `supported=true` only after the failing branch. Require the immutable `actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294` action to remain gated by the positive output. Reject `supported=false` and the green skip path.

The other reviewed exact-head controls are present: explicit PR-head repository/SHA checkout with persisted credentials disabled; 10-second connection and 30-second total probe timeouts; response-body discard; fail-closed non-200 outcomes; exact-head Trivy and Scorecard SARIF binding; immutable action pins; read-only fork-compatible permissions; and unchanged Trivy hard-gate and Scorecard soft-role policy.
EOF
)

gh api --method POST "repos/${repo}/pulls/${pr}/reviews" \
  -f "commit_id=${head}" \
  -f 'event=REQUEST_CHANGES' \
  -f "body=${body}" \
  --jq '{id,state,commit_id,html_url}'

Length of output: 2365


@seonghobae Formal blocking review submitted for exact head a6cd746e86c07452d03e0f5cef8e8d13c22f28c6: #799 (review)

You are interacting with an AI system.

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.

2 participants