Skip to content

fix(noema): replay OIDC envelope repair on current main - #834

Open
seonghobae wants to merge 1 commit into
mainfrom
fix/noema-oidc-envelope-current-main-20260808
Open

fix(noema): replay OIDC envelope repair on current main#834
seonghobae wants to merge 1 commit into
mainfrom
fix/noema-oidc-envelope-current-main-20260808

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

RCA

The Noema OIDC exchange can successfully return its stable success envelope while the central consumer still fails because protected main reads the nonexistent top-level .token. The actual token is repository-bound under data.token; treating the resulting empty lookup as a missing credential misdiagnoses a producer/consumer schema mismatch.

Historical PR #822 contains the bounded repair but is no longer mergeable and is based on protected-main 1131b1bbafb24e455fc8619cdf316813e8721861. Protected main advanced to 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Checks, reviews, approvals, comments, and synthetic merge evidence from #822 do not transfer here.

Feasibility decision

A destructive rebase/force-push is unnecessary. The old base → current main delta touches only the Strix quality workflow, its doctoring/test, and one independent CHANGELOG.md entry; it does not modify noema-review.yml. This replacement is therefore rebuilt directly from exact current protected main and carries only the same four-file bounded OIDC contract, while preserving the intervening Strix changelog entry.

Bounded repair

  • require ok: true and object-valued data;
  • require non-empty data.token, exact target repository identity, and non-empty workflow-source/expiry metadata;
  • extract only .data.token after the full envelope validates;
  • mask the token immediately and never reflect the raw response;
  • preserve GitHub App/PAT fallbacks, reviewer identities, token names/scopes, LLM/model routing, NVIDIA behavior, permissions, branch protection, merge/release authority, and deployment authority;
  • retain the focused regression contract and APA 7 doctoring.

Exact replacement boundary

This branch is exactly four commits ahead and zero behind protected main at creation. The effective diff is limited to:

  • .github/workflows/noema-review.yml
  • tests/test_noema_oidc_exchange_contract.py
  • docs/doctoring/noema-oidc-exchange-envelope.md
  • CHANGELOG.md

No predecessor evidence transfers. Keep Draft until implementation/tests/docs/changelog are complete and every currently executable exact-head deterministic/security/supply-chain gate is green with zero current source-backed findings. At that point Ready status is permitted solely to obtain current-head automated and independent review; Ready is not merge evidence. Merge remains prohibited until current automated review is complete, zero valid unresolved findings remain, a qualifying non-author counted approval exists, and branch protection/repository policy allow the exact unchanged head.

Operational acceptance

After protected integration, execute a real Noema OIDC exchange and prove the stable response envelope reaches token extraction successfully without exposing the token. PR checks alone are not operational closure.

Supersedes #822 only after this replacement proves its own exact-head gates.

Summary by CodeRabbit

  • 버그 수정

    • OIDC 토큰 교환 응답을 엄격히 검증하여 잘못되거나 저장소 정보가 일치하지 않는 응답을 안전하게 거부합니다.
    • 표준 응답 형식에서 토큰을 추출하고, 진단 출력에 민감한 토큰이 노출되지 않도록 개선했습니다.
  • 문서

    • OIDC 응답 형식, 검증 기준, 토큰 보호 및 호환성 원칙을 문서화했습니다.
  • 테스트

    • 정상 응답 처리, 오류 검증, 토큰 마스킹 및 출력 저장 동작에 대한 회귀 테스트를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Aug 8, 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: 48 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: b25278fe-2ef9-426b-a696-355231e57733

📥 Commits

Reviewing files that changed from the base of the PR and between 7e3c9e5 and c94bd8a.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • docs/doctoring/noema-oidc-exchange-envelope.md
📝 Walkthrough

Walkthrough

Noema OIDC 교환 응답에 fail-closed 검증을 추가했습니다. 워크플로는 저장소에 바인딩된 data.token만 추출합니다. 테스트와 문서는 응답 계약, 오류 처리, 토큰 비노출을 검증합니다.

Changes

Noema OIDC 응답 검증

Layer / File(s) Summary
OIDC 응답 envelope 검증
.github/workflows/noema-review.yml, docs/doctoring/noema-oidc-exchange-envelope.md
워크플로가 성공 상태, data 객체, 저장소 일치 여부, workflow reference, 만료 시각과 비어 있지 않은 data.token을 검증합니다. 응답 계약과 토큰 비노출 규칙을 문서화했습니다.
계약 회귀 검증
tests/test_noema_oidc_exchange_contract.py, CHANGELOG.md
표준 성공 응답 소비, 잘못된 응답 오류 처리, 토큰 마스킹과 GitHub Actions 출력 기록을 검증합니다. 변경 사항을 changelog에 기록했습니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant NoemaOIDC
  participant GitHubWorkflow
  participant jq
  NoemaOIDC->>GitHubWorkflow: OIDC 교환 응답 반환
  GitHubWorkflow->>jq: 응답 envelope 및 저장소 메타데이터 검증
  jq-->>GitHubWorkflow: 검증 결과와 data.token 반환
Loading

Possibly related PRs

Suggested reviewers: opencode-agent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 제목은 Noema OIDC envelope 소비자 수정과 현재 main 기준 재적용이라는 변경 목적을 명확히 설명합니다.
✨ 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/noema-oidc-envelope-current-main-20260808

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the unchanged exact head 97276da73c3b5d7312ce01eb88f8260ff75f3930 against protected-base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Focus on the bounded four-file Noema OIDC response-envelope repair; do not infer evidence from predecessor #822.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will review exact head 97276da73c3b5d7312ce01eb88f8260ff75f3930 against protected-base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. I will limit the review to the four-file Noema OIDC response-envelope repair. I will not use evidence from #822.

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

Re-review only the unchanged exact head 97276da73c3b5d7312ce01eb88f8260ff75f3930 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The previous request was rate-limited several hours ago. Review only the bounded four-file Noema OIDC success-envelope repair and do not reuse evidence from superseded #822.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will review exact head 97276da73c3b5d7312ce01eb88f8260ff75f3930 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I will limit the review to the four-file Noema OIDC response-envelope repair. I will not use evidence from superseded PR #822.

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

Re-review only unchanged exact head 97276da73c3b5d7312ce01eb88f8260ff75f3930 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. All exposed exact-head machine gates are terminal-success and there are zero review threads. Prior review attempts were capacity-limited; this request is sent only after the published cooldown window elapsed. Limit review to the four-file Noema OIDC success-envelope repair and do not use predecessor #822 evidence.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will review exact head 97276da73c3b5d7312ce01eb88f8260ff75f3930 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I will limit the review to the four-file Noema OIDC success-envelope repair. I will not use evidence from superseded PR #822.

✅ 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: 2

🤖 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_noema_oidc_exchange_contract.py`:
- Around line 41-44: Update the assertions in the exchange contract test to
verify that the `echo "::add-mask::$app_token"` command appears before `echo
"token=$app_token" >>"$GITHUB_OUTPUT"` within `exchange`, while preserving the
existing presence checks.
- Line 24: Update the assertion in the noema OIDC exchange contract test so it
rejects the `.token // empty` jq pattern regardless of whether the filter uses
single or double quotes; prefer checking the quote-independent pattern itself.
🪄 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: 8cc60992-3a83-462d-b8da-6169c065e230

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb06cd and 97276da.

📒 Files selected for processing (4)
  • .github/workflows/noema-review.yml
  • CHANGELOG.md
  • docs/doctoring/noema-oidc-exchange-envelope.md
  • tests/test_noema_oidc_exchange_contract.py

Comment thread tests/test_noema_oidc_exchange_contract.py Outdated
Comment thread tests/test_noema_oidc_exchange_contract.py Outdated

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@cwl-noema-review @opencode-agent Review only exact current head 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b. All exact-head deterministic/security/supply-chain workflows are successful and both prior CodeRabbit threads are resolved/outdated. Verify the OIDC response envelope requires ok:true, object data, repository identity, workflow source, expiry, and non-empty data.token; top-level .token is rejected quote-independently; token masking occurs before any $GITHUB_OUTPUT write; the raw response is never printed; and App/PAT fallback plus reviewer/model/permission boundaries are unchanged. Review only; do not modify, merge, retarget, or alter credentials.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

@seonghobae I will review exact head 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b only.

I will verify the specified OIDC envelope validation, token handling, diagnostic safety, and unchanged fallback and permission boundaries. I will not modify, merge, retarget, or alter credentials.

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

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Evaluate exact current head 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b against independently resolved live main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. All nine observed exact-head pull-request workflows are terminal-success, GitHub reports the ready head mergeable, and unresolved threads are zero. Review the Noema OIDC envelope replay, token audience/subject binding, and fail-closed credential-exchange behavior only on this head. Submit only a current-head semantic verdict; keep automated judgment separate from qualifying independent human approval, merge authority, and protected-main operational acceptance.

Copy link
Copy Markdown
Contributor Author

Exact-current-head review request for 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b over protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

Review the bounded four-file Noema OIDC consumer repair: accept only ok: true with object-valued data; require non-empty data.token, exact target repository identity, and workflow-source/expiry metadata; extract only .data.token after full envelope validation; mask before writing to GITHUB_OUTPUT; never reflect the raw response; and preserve existing GitHub App/PAT fallbacks, reviewer identities, model routing, NVIDIA behavior, permissions, and merge/release authority. Both CodeRabbit contract findings are addressed and resolved. Strix Changed Path Quality CI, CodeQL PR, Python Security, Security Scan, SAST Semgrep, Secret Scan, OSV-Scanner PR, Scorecard PR, and SBOM Generation are terminal-success on this exact head.

Keep the exact head unchanged. Do not transfer #822 evidence, synthesize author approval, accept the old top-level token shape, expose response/token data, alter credential fallbacks or reviewer identity, update the branch, merge, release, or bypass protection. After protected integration, operational acceptance still requires a real OIDC exchange proving the validated envelope reaches extraction without disclosure.

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

@coderabbitai

coderabbitai Bot commented Aug 12, 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_sha='7e3c9e581f981bd2ceaa37c7b9bde16b452b899b'
base_sha='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'

echo '== revision verification =='
git rev-parse HEAD
git cat-file -e "${head_sha}^{commit}"
git cat-file -e "${base_sha}^{commit}"
git merge-base --is-ancestor "$base_sha" "$head_sha"
git diff --name-status "$base_sha" "$head_sha"
echo
echo '== bounded diff =='
git diff --no-ext-diff --unified=80 "$base_sha" "$head_sha" -- \
  .github/workflows/noema-review.yml \
  tests/test_noema_oidc_exchange_contract.py \
  docs/doctoring/noema-oidc-exchange-envelope.md \
  CHANGELOG.md
echo
echo '== workflow outline =='
ast-grep outline .github/workflows/noema-review.yml --items all || true
echo
echo '== test outline =='
ast-grep outline tests/test_noema_oidc_exchange_contract.py --items all || true
echo
echo '== workflow references relevant to credentials, outputs, diagnostics, and OIDC =='
rg -n -i -C 8 \
  '(oidc|noema|token|github_output|github app|app[_ -]?token|pat|permissions|reviewer|nvidia|model|curl|jq)' \
  .github/workflows/noema-review.yml
echo
echo '== contract test source =='
cat -n tests/test_noema_oidc_exchange_contract.py

Length of output: 35934


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
pr_number='834'
head_sha='7e3c9e581f981bd2ceaa37c7b9bde16b452b899b'

echo '== response-contract references =='
rg -n -C 5 \
  '(token_expires_at|workflow_ref|target_repository|response envelope|data\.token)' \
  . \
  -g '!docs/doctoring/noema-oidc-exchange-envelope.md' \
  -g '!tests/test_noema_oidc_exchange_contract.py' \
  -g '!CHANGELOG.md' \
  -g '!**/.git/**' || true

echo
echo '== PR identity and exact-head state =='
gh api "repos/${repo}/pulls/${pr_number}" \
  --jq '{number, state, draft, mergeable, merge_commit_sha, base_sha: .base.sha, head_sha: .head.sha, changed_files, review_comments, commits}'

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

echo
echo '== statuses attached to exact head =='
gh api --paginate "repos/${repo}/commits/${head_sha}/status?per_page=100" \
  --jq '.statuses[] | {context, state, target_url, updated_at}' || true

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

Length of output: 63301


@seonghobae No blocking findings in the bounded review.

I verified exact head 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b against base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The diff contains the specified four files only.

The OIDC consumer now requires ok == true, object-valued data, a non-empty data.token, exact data.repository, and non-empty workflow_ref and token_expires_at metadata. It extracts only .data.token after the envelope validation.

The workflow masks app_token before it writes token to GITHUB_OUTPUT. The inspected OIDC step does not print token_response. The App/PAT fallback order, reviewer identity, model routing, NVIDIA behavior, permissions, and merge authority remain unchanged.

GitHub reports this exact head as mergeable with zero unresolved review threads. The inspected security and supply-chain checks are associated with this head and have successful conclusions where applicable. I did not treat skipped or neutral jobs as passing evidence.

The expiry field has presence and string-type validation. A real post-integration exchange is still required to verify the provider envelope, extraction path, and token non-disclosure in the GitHub Actions environment.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/.github PR: 0
File: :0-0
Timestamp: 2026-08-05T13:44:10.007Z
Learning: For PR `#782`, only successful checks associated with the exact current head are valid merge evidence. Do not treat queued, in-progress, cancelled, predecessor-head, temporary-workflow, or administrative-bypass results as passing evidence. Before a formal approval, verify that the direct security and supply-chain workflows, the permanent hourly NVIDIA NIM contract, current-head reviews, unresolved-thread checks, and an independent approval have completed successfully.

Learnt from: CR
Repo: ContextualWisdomLab/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-07-29T06:47:25.581Z
Learning: Applies to opencode.jsonc : All reviewer agents in `opencode.jsonc` must keep `"edit": "deny"`; reviewers must never implement changes.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Live sole-collaborator canary for the OIDC response-envelope repair

EmbedRelay PR #3 at exact head 88e54a3b934e2fa255305d3a1e9ecfe68aaf5b3f is ready for independent review after successful SAST/Security checks and resolved CodeRabbit findings. The repository collaborators API returns only the author, seonghobae; there is no independent human collaborator to request through the standard review-request endpoint.

The supported non-author review path therefore depends on the installed Noema/OpenCode reviewer App chain. This makes the .data.token envelope repair operationally material: a successfully minted token that is read from the wrong JSON path leaves a sole-collaborator repository unable to satisfy independent-review policy even though every code and security gate is green.

After this PR reaches protected central main, use EmbedRelay #3 as an exact-head end-to-end canary together with the mention-concurrency repair. Acceptance requires a formal review submission from the reviewer identity, not merely a successful workflow status or comment. Preserve review-only authority; do not grant contents write, merge, release, or deployment permissions.

Copy link
Copy Markdown
Contributor Author

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

Review-only request for exact current head 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. All nine observed exact-head quality, security, and supply-chain workflows are terminal-success; both CodeRabbit findings are resolved/outdated. Verify the stable ok:true / object-valued data envelope, exact repository binding, workflow/expiry metadata, .data.token extraction, immediate masking before output, and unchanged review-only credential authority. Do not mutate or merge. Submit a formal non-author APPROVE only if this unchanged exact head is clean.

@coderabbitai

coderabbitai Bot commented Aug 12, 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_sha='7e3c9e581f981bd2ceaa37c7b9bde16b452b899b'
base_sha='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
repo='ContextualWisdomLab/.github'
pr_number='834'

echo '== revision and scope =='
printf 'checked-out HEAD: '; git rev-parse HEAD
git cat-file -e "${head_sha}^{commit}"
git cat-file -e "${base_sha}^{commit}"
git merge-base --is-ancestor "$base_sha" "$head_sha"
git diff --name-status "$base_sha" "$head_sha"
git diff --no-ext-diff --unified=80 "$base_sha" "$head_sha" -- \
  .github/workflows/noema-review.yml \
  tests/test_noema_oidc_exchange_contract.py \
  docs/doctoring/noema-oidc-exchange-envelope.md \
  CHANGELOG.md

echo '== workflow relevant context =='
rg -n -i -C 12 \
  '(oidc|noema|token_response|app_token|data\.token|github_output|github app|app[_ -]?token|pat|permissions|reviewer|nvidia|model|curl|jq)' \
  .github/workflows/noema-review.yml

echo '== contract tests =='
ast-grep outline tests/test_noema_oidc_exchange_contract.py --items all
cat -n tests/test_noema_oidc_exchange_contract.py

echo '== reviewer edit boundary =='
if [ -f opencode.jsonc ]; then
  rg -n -C 4 '"edit"\s*:\s*"(deny|allow)"' opencode.jsonc
else
  echo 'opencode.jsonc is absent'
fi

echo '== exact-head PR state, check runs, and review threads =='
gh api "repos/${repo}/pulls/${pr_number}" \
  --jq '{state, draft, mergeable, base_sha: .base.sha, head_sha: .head.sha, changed_files, review_comments}'

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

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

Length of output: 44773


@seonghobae No blocking findings in this review.

I verified exact head 7e3c9e581f981bd2ceaa37c7b9bde16b452b899b against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The PR changes only the four requested files.

The OIDC exchange accepts only ok == true and object-valued data. It requires a non-empty string data.token, exact data.repository binding to TARGET_REPOSITORY, and non-empty string data.workflow_ref and data.token_expires_at metadata. It extracts only .data.token after validation.

The workflow applies ::add-mask:: before it writes the token to GITHUB_OUTPUT. The OIDC step does not print token_response.

The GitHub App and PAT fallback order is unchanged. The reviewer/model routing, NVIDIA behavior, workflow permissions, and reviewer "edit": "deny" boundary are unchanged.

GitHub reports this exact head as mergeable. The current-head review threads are resolved. The inspected terminal-success checks belong to this exact head. I did not count skipped or neutral checks as passing evidence.

A real post-integration OIDC exchange remains necessary to prove the provider response, extraction path, and token non-disclosure in GitHub Actions.

This request invoked @coderabbitai review. A formal approval requires the separate explicit @coderabbitai approve command. I used the repository review-evidence guidance from the retrieved learnings.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/.github PR: 0
File: :0-0
Timestamp: 2026-08-05T13:44:10.007Z
Learning: For PR `#782`, only successful checks associated with the exact current head are valid merge evidence. Do not treat queued, in-progress, cancelled, predecessor-head, temporary-workflow, or administrative-bypass results as passing evidence. Before a formal approval, verify that the direct security and supply-chain workflows, the permanent hourly NVIDIA NIM contract, current-head reviews, unresolved-thread checks, and an independent approval have completed successfully.

Learnt from: CR
Repo: ContextualWisdomLab/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-07-29T06:47:25.581Z
Learning: Applies to opencode.jsonc : All reviewer agents in `opencode.jsonc` must keep `"edit": "deny"`; reviewers must never implement changes.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Fresh policy RCA is tracked in #948. Protected main requires two qualifying approvals, but the repository currently has only the author as a human collaborator and the Noema review identity repaired by this PR is not yet operational. This exact head has successful observed checks and resolved review threads, but cannot bootstrap its own second independent approval. Do not weaken the ruleset or self-approve; a minimally privileged independent human/team reviewer or a separate review-only App identity is required.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Re-evaluate exact current head 526e7c284c4cb60979516935f3fb930319aed5de. 리뷰 확인 for the bounded-include increment; do not treat Checks wait as a blocker.

@seonghobae
seonghobae marked this pull request as draft August 14, 2026 08:35
auto-merge was automatically disabled August 14, 2026 08:35

Pull request was converted to draft

Copy link
Copy Markdown
Contributor Author

Returned to Draft because the exact current diff no longer satisfies the stated bounded replacement contract.

The body promises only four OIDC files, but head 526e7c284c4cb60979516935f3fb930319aed5de is seven commits ahead of protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba and changes nine files. In addition to the intended Noema workflow, contract test, doctoring, and changelog, it carries unrelated AGENTS.md, ARCHITECTURE.md, CLAUDE.md, scripts/ci/materialize_base_python_requirements.py, and tests/test_materialize_base_python_requirements.py changes.

Reconcile or rebuild from protected main so the effective diff contains only the four declared OIDC surfaces. Preserve the unrelated materializer work in its authoritative PR. Then rerun exact-head checks and obtain fresh independent review. Do not merge this contaminated tree or reuse predecessor evidence.

@seonghobae
seonghobae marked this pull request as ready for review August 14, 2026 13:07

Copy link
Copy Markdown
Contributor Author

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

Review only exact current head 526e7c284c4cb60979516935f3fb930319aed5de against live protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The OIDC success-envelope consumer now requires ok: true, object-valued data, exact repository identity, non-empty workflow source/expiry metadata, extracts only data.token, and masks the token before output. All prior CodeRabbit threads are resolved and all directly observed exact-head PR workflows were terminal-success before the Ready transition; any newly queued Ready-cycle checks are not acceptance. Review read-only; do not mutate source, synthesize author approval, expose credentials, weaken protection, or merge.

@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 13:07
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

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

Copy link
Copy Markdown
Contributor Author

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

Re-review the unchanged exact head 526e7c284c4cb60979516935f3fb930319aed5de. Verify the repository-bound data.token envelope, target repository/workflow/expiry binding, mask-before-output ordering, fallback preservation, least privilege, and absence of token disclosure. Submit a formal exact-head verdict rather than status-only evidence.

@coderabbitai

coderabbitai Bot commented Aug 15, 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_SHA='526e7c284c4cb60979516935f3fb930319aed5de'
BASE_SHA='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
REPO='ContextualWisdomLab/.github'
PR='834'

echo '== exact revisions and effective scope =='
printf 'checked-out HEAD: '; git rev-parse HEAD
git cat-file -e "${HEAD_SHA}^{commit}"
git cat-file -e "${BASE_SHA}^{commit}"
git merge-base --is-ancestor "$BASE_SHA" "$HEAD_SHA"
git diff --name-status "$BASE_SHA" "$HEAD_SHA"
echo '-- commit count --'
git rev-list --count "${BASE_SHA}..${HEAD_SHA}"

echo
echo '== bounded OIDC diff =='
git diff --no-ext-diff --unified=100 "$BASE_SHA" "$HEAD_SHA" -- \
  .github/workflows/noema-review.yml \
  tests/test_noema_oidc_exchange_contract.py \
  docs/doctoring/noema-oidc-exchange-envelope.md \
  CHANGELOG.md

echo
echo '== workflow outline and security-relevant context =='
ast-grep outline .github/workflows/noema-review.yml --items all || true
rg -n -i -C 16 \
  '(permissions:|id-token:|contents:|pull-requests:|oidc|noema|token_response|app_token|data\.token|github_output|add-mask|github app|app[_ -]?token|pat|reviewer|nvidia|model|curl|jq|echo|printf)' \
  .github/workflows/noema-review.yml

echo
echo '== contract-test outline and source =='
ast-grep outline tests/test_noema_oidc_exchange_contract.py --items all || true
cat -n tests/test_noema_oidc_exchange_contract.py

echo
echo '== changed unrelated-file contents and references =='
for path in AGENTS.md ARCHITECTURE.md CLAUDE.md scripts/ci/materialize_base_python_requirements.py tests/test_materialize_base_python_requirements.py; do
  if git diff --quiet "$BASE_SHA" "$HEAD_SHA" -- "$path"; then
    continue
  fi
  echo "-- $path --"
  git diff --no-ext-diff --unified=30 "$BASE_SHA" "$HEAD_SHA" -- "$path"
done

echo
echo '== PR identity, head, base, and review state =='
gh api "repos/${REPO}/pulls/${PR}" \
  --jq '{number,state,draft,mergeable,base_sha:.base.sha,head_sha:.head.sha,changed_files,commits,review_comments}'

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) {
      headRefOid
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) { nodes { author { login } body path line } }
        }
      }
    }
  }
}' \
  --jq '.data.repository.pullRequest | {
    headRefOid,
    unresolvedThreads: [
      .reviewThreads.nodes[]
      | select(.isResolved == false)
      | {isOutdated, comment: .comments.nodes[0]}
    ]
  }'

Length of output: 69396


@seonghobae Formal exact-head verdict: REQUEST CHANGES.

I reviewed 526e7c284c4cb60979516935f3fb930319aed5de against main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

The OIDC consumer correctly requires ok == true, object-valued data, non-empty data.token, and exact data.repository == TARGET_REPOSITORY. It extracts only .data.token. It masks app_token before it writes the token to GITHUB_OUTPUT. The OIDC step does not print token_response. The PAT and GitHub App fallback order is unchanged. The workflow keeps its existing least-privilege top-level permissions.

Two issues prevent a clean verdict:

  1. The effective diff violates the declared four-file scope.
    This head changes nine files across seven commits. It includes unrelated changes to AGENTS.md, ARCHITECTURE.md, CLAUDE.md, scripts/ci/materialize_base_python_requirements.py, and tests/test_materialize_base_python_requirements.py. Rebuild or reconcile the branch so the effective diff contains only the four declared OIDC files. Do not use prior checks or review evidence after the head changes.

  2. The workflow-source and expiry fields are presence checks, not bindings.
    The predicate accepts any non-empty data.workflow_ref and any non-empty data.token_expires_at. An exchange response for the target repository but for a different workflow source, or with an expired timestamp, passes validation. Bind data.workflow_ref to the expected trusted workflow identity. Parse and require data.token_expires_at to be a valid future expiry before extraction. Add regression coverage for both rejection cases.

I did not approve the pull request.

You are interacting with an AI system.

@opencode-agent
opencode-agent Bot disabled auto-merge August 16, 2026 10:20
The PR had no merge-base with main. Re-apply only the Noema OIDC
audience/subject contract, workflow check, tests, and doctoring
without replaying a stale materializer tree.
@seonghobae
seonghobae force-pushed the fix/noema-oidc-envelope-current-main-20260808 branch from 526e7c2 to c94bd8a Compare August 16, 2026 14:19
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@seonghobae
seonghobae enabled auto-merge (squash) August 16, 2026 14:19
@opencode-agent
opencode-agent Bot disabled auto-merge August 18, 2026 01:27
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