Skip to content

fix(ci): make hourly RCA recovery feasible - #15

Open
seonghobae wants to merge 61 commits into
mainfrom
fix/hourly-deterministic-gates
Open

fix(ci): make hourly RCA recovery feasible#15
seonghobae wants to merge 61 commits into
mainfrom
fix/hourly-deterministic-gates

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fleet incident

OriginWeave's protected-main Hourly Product Development workflow had five coupled failure modes:

  1. deterministic open-PR, release-blocker, and dry-run decisions were mixed with the optional model credential decision;
  2. even after moving the key check lower in the shell branch, NVIDIA_NIM_API_KEY was still materialized in the deterministic gate step's environment before that branch ran;
  3. three advertised 35-minute OpenCode model attempts were placed inside a 55-minute job, so the fallback sequence could not physically complete before independent verification;
  4. fallback models inherited the mutable source tree left by a failed predecessor, making later output and root-cause attribution non-independent;
  5. failures were reduced to a generic nonzero exit without distinguishing a model timeout, model/tool failure, or dead local credential broker, so the scheduler could not decide whether another attempt was realistic.

A later governance audit found a sixth failure mode: maintenance could identify a blocker and report it without proving whether any proposed corrective action had actual tool support, sufficient actor permissions, an eligible reviewer, compatible branch/ruleset policy, an uncontested writer lease, and enough remaining runtime to complete and verify the action.

A fresh exact-head review found a seventh failure mode: post-model bundle validation rematerialized the raw NVIDIA key only to detect accidental disclosure, so a non-model validation step still received the credential after the broker stopped.

A subsequent validator audit found an eighth failure mode: changed-file discovery called read_bytes() on every model-controlled workspace file before applying the nominal one-mebibyte per-file bound. A malicious or accidental oversized file could therefore force unbounded trusted-runner I/O and allocation before the validator reached its size rejection.

Repair

  • preserve Harden Runner egress-policy: block and the exact reviewed endpoint allowlist;
  • keep api.github.com:443 explicit and do not add broad *.github.com:443 egress;
  • run a credential-free deterministic gate for open PR, release blocker, and dry-run state;
  • materialize NVIDIA_NIM_API_KEY only in a separate credential step conditioned on steps.gate.outputs.develop == 'true' and in the loopback broker that actually needs it;
  • replace post-model raw-key rematerialization with a root-readable length, SHA-256, and 64-bit rolling-hash fingerprint; use the rolling hash only to locate candidate windows and SHA-256 to confirm exact equality, then delete the fingerprint before scanning the candidate bundle;
  • stat-size-check every model-controlled workspace file against the one-mebibyte per-file bound before any full byte read used to discover the changed-file set, then retain the existing post-read size, path, file-count, line-count, binary, and credential-disclosure validation;
  • execute every model, broker, bundle, and publication-preparation step only when the conditional credential step reports ready == true;
  • require the agent to follow RCA → reproduce → feasibility check → bounded corrective action → exact-command revalidation for every failed command or unexpected result;
  • expand the job budget from 55 to 180 minutes, accommodating all three declared 35-minute model attempts plus setup and at least 30 minutes of independent verification;
  • recreate the source workspace from exact checked-out HEAD before every model attempt so fallback models never inherit partial edits;
  • classify model_timeout, model_or_tool_failure, and credential_broker_unavailable separately;
  • retry only while the loopback credential broker is healthy and the retry remains feasible;
  • require every blocker to trigger exact live-state refetch, root-cause confirmation, candidate enumeration, tool/permission/reviewer/policy/lease/runtime feasibility validation, immediate execution of the first safe feasible action, and authoritative state-transition verification;
  • classify absence of an eligible counted reviewer as a reviewer-provisioning gap, not ordinary approval latency;
  • retain one hourly single-flight concurrency group with cancel-in-progress: false, no competing branch writer, and no temporary write-capable repair workflow.

TDD evidence

  • 73dd8a27a7e926b9059d77d3be85e7dcb63aa5e1 first introduced the deterministic ordering and exact-egress regression while the inherited workflow still failed it.
  • cece5844077633019e84ef4f1c20eb678b997458 added the RCA, realistic-runtime, pristine-retry, and broker-aware feasibility contracts first. Exact-head CI run 31258067839, job 93104444325, failed for all four intended reasons.
  • 80409575134a31df22e42cb44db2d39e6f2c8208 implemented those scheduler contracts; exact-head CI, production coverage, SAST, and Security Scan subsequently passed at 2780ad381c72749763fb707f1726e1e39b61bfd7.
  • CodeRabbit then identified that the secret remained in the deterministic step environment despite the shell branch ordering.
  • e0e2e895c6aa6e2460823751f775bccb8fe559de added the step-level secret-boundary contract first. Exact-head CI run 31258507967, job 93105557709, failed because the new deterministic and credential steps did not yet exist.
  • 0a8a1835cfdbcdcfd0c9bc2cf590a55e2503d624 separated deterministic governance from conditional secret materialization.
  • 057607206111f2bf9bf69c334c164e6e4e01f984 updated the authoritative changelog contract.
  • bd2d6377998a93948153f49db0386a3d85eb3b6c added the generalized blocker-resolution contract before the governing agent policy existed. Exact-head CI run 31259517074, job 93108034124, failed exactly 13 assertions for the absent RCA, feasibility, action, state-transition, and reviewer-provisioning terms.
  • b132d0955ced35d5121f227e4aba8d45acbb40dd added the smallest governing AGENTS.md policy. Exact-head CI run 31259595580 then passed 40 Python repository contracts, formatting, locked workspace checks, all Rust tests, strict Clippy, rustdoc, and exact 100% production function/line/region/branch coverage. Exact-head SAST Semgrep run 31259595585 and Security Scan run 31259595575 also completed successfully.
  • CodeRabbit's exact-head approval probe then demonstrated that raw-key rematerialization still existed in Validate and seal the credential-free change bundle.
  • 5ab936ab1ed72507a3646ffee681a1c5fc789b98 added the fingerprint-only post-model leak-scanning contract first. Exact-head CI run 31260342137, job 93110071371, failed at the Python repository-contract step as intended.
  • 678a3f1033605bebe130cc1782a98c527d58491e implemented the bounded fingerprint scanner and removed raw secret materialization from bundle validation.
  • a83e5732e5c35af9a547c7c1015d52286301afed recorded the corrected credential boundary. Exact-head CI run 31260876378, SAST Semgrep run 31260876376, and Security Scan run 31260876369 all completed successfully; CI includes exact 100% production function, line, region, and branch coverage.
  • 1c11de9c5212d68e58cb8692499f5944d5ba1b5d added the pre-read workspace-size contract before changing the validator. Exact-head CI run 31275891448, Rust-contracts job 93149223124, ran 54 Python repository contracts and failed exactly the new assertion because changed-file discovery still had no pre-read size guard.
  • 2aa0c0a8865fa262f843d7418895d76987526dd5 implemented the smallest root-cause repair: collect model workspace metadata, reject files larger than 1,048,576 bytes, and only then perform full byte comparison for changed-file discovery.
  • 933950b980d4a76dd163a84d45d41ecf690e58ae and bbce6970880c1cc78111b9fde4fb68c5969a4c7d aligned ADR 0009 and the changelog with the pre-read bound. On exact head bbce697..., CI run 31276172147, SAST Semgrep run 31276172213, and Security Scan run 31276172141 completed successfully. Rust-contracts job 93149967734 ran 54 Python contracts with zero failures, then passed formatting, locked workspace checks, all Rust tests, strict Clippy, and rustdoc. Production-coverage job 93149967776 independently reported that production functions, lines, regions, and branches are 100% covered.

Corrective-action realism evidence

The scheduler may not infer that an approval route exists merely because a team or bot name is known. A live formal review request to the organization team independent-reviewers was attempted on the unchanged PR and GitHub rejected it with HTTP 422 because the team is not a collaborator on ContextualWisdomLab/OriginWeave. The request produced no reviewer assignment and no formal review. Until repository access is provisioned for an eligible non-author reviewer or team, this condition is a reviewer-provisioning gap. Repeating the same request, posting a comment, invoking an unsupported bot command, self-approving, or weakening the approval requirement is not a feasible corrective action.

The fingerprint repair was selected only after checking the operational boundary. Removing leak detection would weaken the security gate; retaining the raw key in bundle validation would preserve the boundary violation; moving the scan into the untrusted model workspace would expose the credential. The selected design derives a one-way runner-owned fingerprint while the credential is already authorized, keeps it unreadable to UID 65532, deletes it before candidate scanning, uses a rolling hash only as a prefilter, and confirms exact candidate bytes with SHA-256. This preserves exact leak detection without extending raw-key authority.

For the workspace resource-bound defect, retaining the existing len(new_bytes) check was rejected because it executes only after the full allocation and cannot prevent the root cause. A streaming full-file comparison would reduce peak allocation but still permits unbounded trusted I/O and complicates the existing one-mebibyte contract. A metadata stat() gate before changed-file reads directly enforces the existing product limit, is deterministic and reversible, requires no new dependency or authority, and keeps the later byte-level validation as defense in depth.

Feasibility boundary

The scheduler does not treat every failure as repairable. A healthy broker plus a model timeout or model/tool failure permits the next clean model attempt. A failed broker is an infrastructure cause and stops model fallback immediately. Inside a successful model session, a corrective action is permitted only when it fits the allowed paths, permissions, dependencies, remaining runtime, and unchanged quality or security gates. Otherwise the workspace remains unchanged rather than manufacturing a successful patch.

For governance blockers, command acceptance is not completion evidence. The scheduler must refetch the authoritative PR, review, check, branch, workflow-run, or protected-main object and prove the intended state transition. If the first candidate fails, that evidence feeds the RCA and the next safe feasible candidate is evaluated in the same run. Only when no safe feasible candidate exists may an external blocker be reported.

The 180-minute job budget is deliberate rather than cosmetic: three model attempts consume at most 105 minutes, leaving 75 minutes for toolchain setup, broker startup, bundle sealing, Rust or Python verification, exact coverage, and publication rechecks. Hourly triggers remain serialized by the existing concurrency group rather than racing another writer.

Closure criteria

Merge only after exact-head CI, production coverage, SAST, Security Scan, CodeRabbit and other feedback cleanup, branch protection, repository policy, and qualifying independent non-author approval pass. After protected merge:

  1. a scheduled or manual run with an existing open PR must stop at open_pull_request without materializing the NVIDIA secret;
  2. a zero-PR run must reach the conditional credential step and then the model-backed path or an explicit deterministic product or release gate;
  3. a controlled failed model attempt must emit an RCA classification, reset the next attempt to pristine HEAD, and retry only when feasible;
  4. the protected run must retain the exact fail-closed egress contract;
  5. post-model bundle validation must receive only the fingerprint path and must reject an exact injected secret without receiving the raw secret as an environment value;
  6. a governance blocker must demonstrate candidate feasibility validation and authoritative state-transition verification rather than stopping at a blocker report;
  7. an oversized model-created workspace file must be rejected by the metadata size gate before changed-file comparison performs a full byte read.

No invented credential, no COPILOT_GITHUB_TOKEN, no synthesized approval, no bypassed protection, and no weakening or rewriting of failed tests or checks.

Summary by CodeRabbit

  • 개선 사항

    • 자동화 작업의 최대 실행 시간이 180분으로 연장되었습니다.
    • 필수 게이트 통과 후에만 NVIDIA 자격 증명이 제공됩니다.
    • 실패 분석, 재시도 및 안전한 중단 절차가 강화되었습니다.
    • 재시도마다 깨끗한 작업 환경을 사용하고 완료 후 정리합니다.
    • 비밀 정보는 원문 대신 안전한 지문으로 검증됩니다.
    • 게시 권한이 없으면 작업이 성공 처리되지 않습니다.
  • 문서

    • 자격 증명 보호 및 차단 해결 절차 안내가 추가되었습니다.
  • 테스트

    • 게이트 순서와 실패·보안 검증 회귀 테스트가 추가되었습니다.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Hourly 워크플로가 PR, release-blocker, dry-run 게이트를 NVIDIA NIM 자격 증명 검사보다 먼저 평가합니다. 자격 증명은 fingerprint로 검증합니다. 모델 재시도마다 pristine workspace를 복원합니다. 관련 ADR, 운영 절차 및 계약 테스트를 추가했습니다.

Changes

Hourly 게이트와 자격 증명 처리

Layer / File(s) Summary
결정적 게이트와 자격 증명 지문
.github/workflows/hourly-product-development.yml, docs/adr/0009-hourly-agent-credential-boundary.md, tests/test_hourly_product_development_contract.py, tests/test_repository_contract.py
실행 제한 시간을 180분으로 변경했습니다. PR, release-blocker, dry-run 게이트를 먼저 평가합니다. 통과 후에만 NVIDIA 자격 증명을 확인하고 fingerprint를 생성합니다.
지문 기반 번들 및 PR 발행 검증
.github/workflows/hourly-product-development.yml, tests/test_hourly_product_development_contract.py, docs/adr/0009-hourly-agent-credential-boundary.md
변경 파일과 PR 메시지를 원시 키 없이 검증합니다. fingerprint 스키마, 해시, UTF-8 및 메시지 크기를 확인합니다. 전용 OPENCODE_PR_TOKEN이 없으면 발행을 실패 처리합니다.

에이전트 실행과 운영 절차

Layer / File(s) Summary
에이전트 실행과 pristine workspace 재시도
.github/workflows/hourly-product-development.yml, AGENTS.md, tests/test_hourly_product_development_contract.py
실패 원인 분석, 재현, 실행 가능성 검증, 수정 및 명령 재실행 절차를 추가했습니다. 모델별로 임시 구성과 pristine workspace를 재생성합니다. 모델 실패와 자격 증명 브로커 실패를 구분합니다.
워크플로 및 차단 해결 계약 검증
tests/test_hourly_product_development_contract.py, tests/test_scheduler_blocker_resolution_contract.py, tests/test_repository_contract.py
게이트 순서, egress allowlist, timeout, 동시 실행 방지, fingerprint 누출 검사, 재시도, workspace 정리 및 ADR 내용을 검증합니다. 차단 해결 절차와 승인 조건도 검증합니다.
운영 기록과 ADR 반영
CHANGELOG.md, docs/adr/0009-hourly-agent-credential-boundary.md, AGENTS.md
자격 증명 경계, PR 발행 권한 분리, 실행 절차, 재시도 조건 및 fail-closed 동작을 기록합니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant GitHub as GitHub API
  participant Workflow as Hourly workflow
  participant CredentialGate as NVIDIA credential gate
  participant OpenCode
  participant Workspace as pristine workspace
  participant Broker as NIM credential broker

  GitHub->>Workflow: PR, release-blocker, dry-run 상태 제공
  Workflow->>CredentialGate: 결정적 게이트 결과 전달
  CredentialGate->>CredentialGate: credential fingerprint 생성
  CredentialGate->>Workspace: 통과 시 기준선 workspace 준비
  Workflow->>OpenCode: 임시 구성으로 모델 실행
  OpenCode->>Broker: 모델 요청
  Broker-->>OpenCode: 응답 또는 실패 상태
  OpenCode-->>Workflow: 종료 상태 반환
  Workflow->>Workspace: 재시도 시 pristine 상태로 복원
Loading

Possibly related issues

  • ContextualWisdomLab/keyverse#73: NVIDIA 자격 증명 검사 전에 결정적 게이트를 평가하고 fail-closed 동작을 유지하는 변경과 직접 관련됩니다.
  • ContextualWisdomLab/RankWeave#37: 동일한 hourly 워크플로의 게이트 순서 변경과 직접 관련됩니다.
  • ContextualWisdomLab/EgressWeave#65: hourly 발행 경로와 저장소 쓰기 권한 경계 변경과 관련됩니다.
  • ContextualWisdomLab/TEPP#2: 게이트된 NVIDIA NIM 실행, 독립 검증, fail-closed 발행 및 재시도 격리 변경과 직접 관련됩니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.91% 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 제목은 hourly RCA recovery 실행 가능성 개선이라는 변경의 주요 목적을 정확하고 간결하게 설명합니다.
✨ 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/hourly-deterministic-gates

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

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@opencode-agent @cwl-noema-review

Review-only request for exact current head 3cf49fd8e849236ad131c08057a439ea4ccb74d0 against protected base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Do not mutate the branch or merge. Independently verify that fail-closed Harden Runner remains egress-policy: block with the exact reviewed endpoint set, allowed-endpoints remains the runtime-safe folded scalar, the actual gh api open-PR/release-blocker gates and dry-run decision execute before NVIDIA_NIM_API_KEY is required, the NVIDIA credential is required only for the model-backed path, no broad GitHub wildcard or invented credential/COPILOT token is introduced, exact-head CI/SAST/Security Scan are successful, and no unresolved valid review finding remains. Submit a formal non-author GitHub APPROVE review only if this exact head satisfies repository policy.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
pr_number="15"
expected_head="3cf49fd8e849236ad131c08057a439ea4ccb74d0"
expected_base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Checked-out commit =="
git rev-parse HEAD

echo "== Requested commits exist locally =="
git cat-file -t "$expected_head"
git cat-file -t "$expected_base"

echo "== PR metadata =="
gh pr view "$pr_number" --repo "$repo" \
  --json number,state,isDraft,headRefOid,baseRefOid,mergeCommit,statusCheckRollup,reviews \
  --jq '{
    number, state, isDraft, headRefOid, baseRefOid, mergeCommit,
    statusCheckRollup: [.statusCheckRollup[] | {
      name: .name,
      status: .status,
      conclusion: .conclusion,
      detailsUrl: .detailsUrl
    }],
    reviews: [.reviews[] | {
      author: .author.login,
      state: .state,
      commit: .commit.oid,
      submittedAt: .submittedAt
    }]
  }'

echo "== Changed files for exact requested range =="
git diff --name-status "$expected_base" "$expected_head"

echo "== Candidate workflow and contract files =="
fd -HI -t f .github . 2>/dev/null | \
  rg '(^|/)([^/]*[Ww]orkflow[^/]*|.*\.(ya?ml|md|json|sh))$' | \
  head -n 300

echo "== Gate and egress references in the exact requested range =="
git diff --unified=80 "$expected_base" "$expected_head" -- \
  ':!**/package-lock.json' ':!**/pnpm-lock.yaml' | \
  rg -n -C 8 \
    'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|gh api' \
  || true

echo "== Exact-head check runs =="
gh api --paginate \
  "repos/$repo/commits/$expected_head/check-runs?per_page=100" \
  --jq '.check_runs[] | [
    .name, .status, .conclusion, .details_url,
    (.output.title // ""), (.output.summary // "")
  ] | `@tsv`'

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

Length of output: 8589


🏁 Script executed:

#!/bin/bash
set -uo pipefail

repo="ContextualWisdomLab/OriginWeave"
pr_number="15"
head="3cf49fd8e849236ad131c08057a439ea4ccb74d0"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"
workflow=".github/workflows/hourly-product-development.yml"
contract="tests/test_hourly_product_development_contract.py"

echo "== Workflow structure =="
ast-grep outline "$workflow" --items all 2>&1 || true

echo "== Changed workflow =="
cat -n "$workflow"

echo "== Contract test structure =="
ast-grep outline "$contract" --items all 2>&1 || true

echo "== Contract test =="
cat -n "$contract"

echo "== Exact-range diff =="
git diff --check "$base" "$head"
git diff --unified=12 "$base" "$head" -- "$workflow" "$contract" CHANGELOG.md

echo "== Sensitive tokens in exact head =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|nim_api_key_unavailable|allowed-endpoints|egress-policy|cafe\.github\.com|\*\.github\.com|api\.github\.com|open_pull_request|release_blocker|dry_run|dry-run' \
  "$head" -- . ':!CHANGELOG.md' || true

echo "== Required GitHub API gate calls in workflow =="
rg -n -C 6 -P \
  '\bgh\s+api\b|NVIDIA_NIM_API_KEY|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|allowed-endpoints|egress-policy' \
  "$workflow" || true

echo "== Exact-head check-run conclusions =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '.check_runs[] | select(.name != null) | [.name, .status, .conclusion, .details_url] | `@tsv`' \
  || true

echo "== Unresolved review threads =="
gh api graphql -F owner="ContextualWisdomLab" -F name="OriginWeave" -F number="$pr_number" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 20) {
            nodes {
              author { login }
              body
              commit { oid }
              path
              line
            }
          }
        }
      }
    }
  }
}' --jq '
  [.data.repository.pullRequest.reviewThreads.nodes[]
   | select(.isResolved == false)
   | {
       isOutdated,
       comments: [
         .comments.nodes[] | {
           author: .author.login,
           body,
           commit: .commit.oid,
           path,
           line
         }
       ]
     }]'
echo "== Branch protection and rulesets =="
gh api "repos/$repo/branches/main/protection" --jq '{
  required_pull_request_reviews,
  required_status_checks,
  enforce_admins,
  restrictions
}' 2>&1 || true
gh api --paginate "repos/$repo/rulesets?includes_parents=true" \
  --jq '.[] | {id, name, target, enforcement, conditions, rules}' 2>&1 || true

Length of output: 62592


🏁 Script executed:

#!/bin/bash
set -uo pipefail

repo="ContextualWisdomLab/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr_number="15"
head="3cf49fd8e849236ad131c08057a439ea4ccb74d0"
ruleset_id="18156473"

echo "== Pull request author and review decision =="
gh pr view "$pr_number" --repo "$repo" \
  --json author,reviewDecision,reviews,headRefOid,baseRefOid \
  --jq '{
    author: .author.login,
    reviewDecision,
    headRefOid,
    baseRefOid,
    reviews: [.reviews[] | {
      author: .author.login,
      state,
      commit: .commit.oid,
      submittedAt
    }]
  }' 2>&1 || true

echo "== Commit status contexts =="
gh api "repos/$repo/commits/$head/status" \
  --jq '{
    state,
    statuses: [.statuses[] | {
      context, state, target_url, description, created_at, updated_at
    }]
  }' 2>&1 || true

echo "== Active ruleset detail =="
gh api "repos/$repo/rulesets/$ruleset_id" \
  --jq '{
    id, name, target, enforcement, source_type, source,
    conditions, rules, bypass_actors
  }' 2>&1 || true

echo "== Repository merge-policy flags =="
gh api "repos/$repo" \
  --jq '{
    default_branch,
    allow_merge_commit,
    allow_squash_merge,
    allow_rebase_merge,
    allow_auto_merge,
    allow_update_branch,
    use_squash_pr_title_as_default,
    has_discussions
  }' 2>&1 || true

echo "== Exact head and range reconfirmation =="
printf 'checked_out='; git rev-parse HEAD
printf 'range_files=\n'
git diff --name-only \
  b228693f9e0a11d1794c1e4b0f7a3a38559a5491 \
  3cf49fd8e849236ad131c08057a439ea4ccb74d0

Length of output: 3993


@seonghobae Review complete for exact head 3cf49fd8e849236ad131c08057a439ea4ccb74d0 against base b228693f9e0a11d1794c1e4b0f7a3a38559a5491.

No valid unresolved finding was identified.

Verified:

  • Harden Runner keeps egress-policy: block.
  • allowed-endpoints remains a folded scalar with >-.
  • The endpoint set includes api.github.com:443.
  • The endpoint set does not include cafe.github.com:443 or *.github.com:443.
  • Open-PR, release-blocker, and dry-run gates execute before nim_api_key_unavailable.
  • NVIDIA_NIM_API_KEY is required only after deterministic stop gates permit the model-backed path.
  • The workflow does not introduce COPILOT_GITHUB_TOKEN or another model credential.
  • The added contract test protects both gate ordering and the exact endpoint set.
  • Exact-head CI, SAST, and security checks report success.
  • No unresolved review threads exist.
  • The active organization ruleset requires central workflows and resolved threads. It requires zero approving reviews.

I did not mutate the branch or merge the PR.

I did not submit a formal GitHub APPROVE review. Approval requires an explicit top-level @coderabbitai approve command. The post-merge scheduled/manual operational evidence remains required for fleet closure.

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

Review-only request for exact unchanged head 3cf49fd8e849236ad131c08057a439ea4ccb74d0 against protected base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Re-evaluate only current-head findings. Verify fail-closed Harden Runner remains egress-policy: block, the runtime-safe folded endpoint scalar and exact allowlist remain unchanged, open-PR/release-blocker/dry-run decisions precede the optional NVIDIA credential gate, no broad GitHub wildcard or invented credential is introduced, and exact-head CI/SAST/Security Scan remain successful. Do not mutate the branch or merge.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
pr="15"
head="3cf49fd8e849236ad131c08057a439ea4ccb74d0"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact revision =="
printf 'checked_out='
git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" --json headRefOid,baseRefOid,state,isDraft \
  --jq '{headRefOid, baseRefOid, state, isDraft}'

echo "== Exact range =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Workflow candidates =="
fd -HI -t f -e yml -e yaml .github 2>/dev/null | sort
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github 2>/dev/null | head -n 1)"
test_file="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . 2>/dev/null | head -n 1)"
printf 'workflow=%s\ntest_file=%s\n' "$workflow" "$test_file"

echo "== Workflow gate and egress configuration =="
if [ -n "$workflow" ]; then
  rg -n -C 8 -P 'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b' "$workflow"
fi

echo "== Contract assertions =="
if [ -n "$test_file" ]; then
  sed -n '1,260p' "$test_file"
fi

echo "== Sensitive terms in exact range =="
git diff --unified=30 "$base" "$head" | rg -n -C 5 'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b' || true

echo "== Exact-head check runs =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

echo "== Unresolved review threads =="
gh api graphql -F owner="ContextualWisdomLab" -F name="OriginWeave" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated, comments: [.comments.nodes[] | {author: .author.login, body, commit: .commit.oid, path, line}]}]'

Length of output: 23432


@seonghobae Review complete for exact head 3cf49fd8e849236ad131c08057a439ea4ccb74d0 against base b228693f9e0a11d1794c1e4b0f7a3a38559a5491.

No valid current-head finding was identified.

Verified:

  • Harden Runner retains egress-policy: block.
  • allowed-endpoints remains the folded scalar >-.
  • The exact endpoint contract retains api.github.com:443.
  • The endpoint contract does not contain cafe.github.com:443 or *.github.com:443.
  • The open-PR, release-blocker, and dry-run gates execute before nim_api_key_unavailable.
  • NVIDIA_NIM_API_KEY is required only after the deterministic stop gates permit the model-backed path.
  • The changed range does not introduce COPILOT_GITHUB_TOKEN, a broad GitHub wildcard, or another invented credential.
  • The added contract test fixes the endpoint set and the gate ordering.
  • Exact-head CI, SAST, and security checks succeeded. This includes Semgrep, Trivy, osv-scanner, Scorecard, dependency-review, Rust contracts, and production coverage.
  • No unresolved review threads exist.

I did not modify the branch or merge #15.

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

Exact-head formal approval request for 3cf49fd8e849236ad131c08057a439ea4ccb74d0 against base b228693f9e0a11d1794c1e4b0f7a3a38559a5491, following the completed clean full review. Submit APPROVED only if the PR is still open, non-draft, unchanged, all exact-head required checks and security gates remain successful, and no unresolved valid finding exists. Do not mutate the branch or merge.

@coderabbitai

coderabbitai Bot commented Aug 8, 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/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="3cf49fd8e849236ad131c08057a439ea4ccb74d0"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

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

echo "== Exact checked-out revision and diff integrity =="
printf 'checked_out='
git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
git diff --check "$base" "$head"

echo "== Gate and egress configuration at exact head =="
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github | head -n 1)"
test_file="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . | head -n 1)"
printf 'workflow=%s\ntest_file=%s\n' "$workflow" "$test_file"
rg -n -C 8 -P \
  'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b' \
  "$workflow"
sed -n '1,280p' "$test_file"

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

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

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated, comments: [.comments.nodes[] | {author: .author.login, body, commit: .commit.oid, path, line}]}]'

Length of output: 16851


@seonghobae Approved for exact head 3cf49fd8e849236ad131c08057a439ea4ccb74d0 against base b228693f9e0a11d1794c1e4b0f7a3a38559a5491.

The PR is open, non-draft, and unchanged. Required completed checks, SAST, and security checks succeeded. No unresolved review thread exists. The egress and gate-order contract satisfies the requested conditions.

I did not modify the branch or merge #15.

[approve]

You are interacting with an AI system.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

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

⚠️ Outside diff range comments (1)
.github/workflows/hourly-product-development.yml (1)

74-85: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

NIM 키를 결정적 gate 이후의 별도 step으로 이동하십시오.

elif는 키 검사를 뒤로 이동하지만, NIM_UPSTREAM_API_KEY는 gate step 시작 전에 환경 변수로 주입됩니다. 따라서 open PR, release blocker, 또는 dry-run이 중단되어도 해당 step은 NIM 키를 받습니다. 이는 PR의 credential boundary와 일치하지 않습니다.

  • .github/workflows/hourly-product-development.yml#L74-L85: 결정적 gate step에서는 NIM_UPSTREAM_API_KEY를 제거하십시오. develop == true일 때만 실행되는 별도 credential gate 또는 model step에 키를 주입하십시오.
  • CHANGELOG.md#L39-L39: 실제 step-level credential boundary를 구현한 뒤에만 현재 설명을 유지하십시오.
  • tests/test_hourly_product_development_contract.py#L105-L116: 결정적 gate step에 NIM secret 환경 변수가 없고, credential step이 gate 결과로 조건 실행되는지 검사하십시오.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/hourly-product-development.yml around lines 74 - 85, 결정적
gate step의 환경 변수에서 NIM_UPSTREAM_API_KEY를 제거하고, develop == true일 때만 실행되는 별도
credential gate 또는 model step에 해당 secret을 주입하십시오.
.github/workflows/hourly-product-development.yml의 gate 로직을 수정하고, CHANGELOG.md
39행의 설명은 실제 step-level credential boundary가 구현된 경우에만 유지하십시오.
tests/test_hourly_product_development_contract.py 105-116행에는 gate step에 NIM
secret이 없고 credential step이 gate 결과에 따라 조건 실행되는지 검증을 추가하십시오.
🤖 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_hourly_product_development_contract.py`:
- Around line 166-179: Update the retry loop in the scheduler flow exercised by
“Run OpenCode in an unprivileged no-Git workspace” to classify failures with the
required cause=model_timeout, cause=model_or_tool_failure, or
cause=credential_broker_unavailable contracts and emit
feasible_retry=true/false. Stop model fallback when the credential broker is
unavailable, while continuing to try the next model only for model or tool
failures; ensure the existing test assertions pass.
- Around line 134-150: Update the workflow text used by the “Prepare immutable
baseline and disposable workspace” step so it includes, in order, “Perform
root-cause analysis,” “Verify that the corrective action is feasible,”
“Implement only a feasible corrective action,” and “Rerun the exact failed
command.” Preserve the existing step structure and ensure the phrases are
present in the block inspected by
test_agent_prompt_requires_rca_feasibility_action_and_revalidation.
- Around line 152-164: Update the “Run OpenCode in an unprivileged no-Git
workspace” step so each model iteration calls reset_agent_workspace before
opencode run, recreating AGENT_WORKSPACE from the immutable HEAD baseline.
Ensure the reset removes the existing workspace and extracts git archive HEAD
into it, preventing failed attempts’ edits from reaching later models.

---

Outside diff comments:
In @.github/workflows/hourly-product-development.yml:
- Around line 74-85: 결정적 gate step의 환경 변수에서 NIM_UPSTREAM_API_KEY를 제거하고, develop
== true일 때만 실행되는 별도 credential gate 또는 model step에 해당 secret을 주입하십시오.
.github/workflows/hourly-product-development.yml의 gate 로직을 수정하고, CHANGELOG.md
39행의 설명은 실제 step-level credential boundary가 구현된 경우에만 유지하십시오.
tests/test_hourly_product_development_contract.py 105-116행에는 gate step에 NIM
secret이 없고 credential step이 gate 결과에 따라 조건 실행되는지 검증을 추가하십시오.
🪄 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: e136bde6-3381-4f2e-a69f-87715bdd2569

📥 Commits

Reviewing files that changed from the base of the PR and between b228693 and cece584.

📒 Files selected for processing (3)
  • .github/workflows/hourly-product-development.yml
  • CHANGELOG.md
  • tests/test_hourly_product_development_contract.py

Comment thread tests/test_hourly_product_development_contract.py
Comment thread tests/test_hourly_product_development_contract.py
Comment thread tests/test_hourly_product_development_contract.py
@seonghobae seonghobae changed the title fix(ci): evaluate deterministic hourly gates before NIM fix(ci): make hourly RCA recovery feasible Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Fresh exact-head review request for 057607206111f2bf9bf69c334c164e6e4e01f984 against protected base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Re-review the complete current three-file diff after the RCA/feasibility, pristine-retry, broker-failure classification, 180-minute budget, and step-level NVIDIA credential-boundary repairs. Verify that deterministic open-PR/release-blocker/dry-run gates receive no NVIDIA secret, the secret is materialized only in the conditional model-backed credential step, fail-closed Harden Runner remains egress-policy: block with the exact narrow endpoint set, each fallback starts from pristine exact HEAD, retry stops when the loopback credential broker is unavailable, and no test/security/review gate is weakened. Do not mutate the branch or merge. Report only findings applicable to this exact unchanged head.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="057607206111f2bf9bf69c334c164e6e4e01f984"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact revision and PR state =="
printf 'checked_out='
git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" \
  --json state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus \
  --jq '{state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus}'

echo "== Changed files and whitespace integrity =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Candidate file structure =="
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github | head -n 1)"
contract="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . | head -n 1)"
printf 'workflow=%s\ncontract=%s\n' "$workflow" "$contract"
ast-grep outline "$workflow" --items all 2>&1 || true
ast-grep outline "$contract" --items all 2>&1 || true

echo "== Complete changed workflow at checked-out exact head =="
cat -n "$workflow"

echo "== Complete contract test at checked-out exact head =="
cat -n "$contract"

echo "== Exact three-file diff =="
git diff --unified=20 "$base" "$head" -- "$workflow" "$contract" CHANGELOG.md

echo "== Boundary, egress, gate, retry, and budget references =="
rg -n -C 8 -P \
  'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b|credential broker|broker|127\.0\.0\.1|localhost|pristine|git reset|git clean|checkout|180|timeout|retry|RCA|feasibility' \
  "$workflow" "$contract" CHANGELOG.md || true

echo "== Sensitive credential references in the exact head =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|NIM_API_KEY|API_KEY|cafe\.github\.com|\*\.github\.com' \
  "$head" -- . ':!CHANGELOG.md' || true

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

echo "== Exact-head legacy status contexts =="
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,target_url,description}]}'

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated, comments: [.comments.nodes[] | {author: .author.login, body, commit: .commit.oid, path, line}]}]'

Length of output: 148886


@seonghobae I found one applicable credential-boundary issue on exact head 057607206111f2bf9bf69c334c164e6e4e01f984.

Credential materializes outside the conditional credential step.
.github/workflows/hourly-product-development.yml Line 210 passes secrets.NVIDIA_NIM_API_KEY to Start loopback-only NVIDIA NIM credential broker. Line 479 passes the same secret to Validate and seal the credential-free change bundle. Therefore, the secret is not materialized only in Require NVIDIA NIM credential for model-backed path at Line 89.

The deterministic open-PR, release-blocker, and dry-run gate at Line 63 does not receive the NVIDIA secret. Harden Runner remains fail-closed with the reviewed folded allowlist. Each fallback rebuilds the workspace from git archive HEAD. The retry loop stops when the loopback credential broker is unavailable.

The strix exact-head check is still in progress. Therefore, I cannot confirm that all security gates have succeeded.

I did not modify the branch or merge #15.

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

@opencode-agent @cwl-noema-review

Exact-head review-only request for b132d0955ced35d5121f227e4aba8d45acbb40dd over protected base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Treat every predecessor-head review and check as historical. Verify the complete five-file scheduler change, especially: deterministic gates receive no NVIDIA secret; model credentials materialize only on the permitted model-backed path; every failure follows RCA → reproduction → materially distinct remediation candidates → tool/permission/reviewer/policy/lease/runtime feasibility screening → smallest reversible feasible action → exact-command and authoritative state-transition revalidation; model fallbacks start from pristine exact HEAD; broker failure stops fallback; the 180-minute budget can physically accommodate all attempts and independent verification; no COPILOT_GITHUB_TOKEN, invented credential, protection weakening, self-approval, or competing writer is introduced. Exact-head CI, production coverage, SAST, Security Scan, CodeRabbit status, and all inline threads are currently successful/resolved. Submit a formal non-author APPROVED review only if this unchanged exact head satisfies repository policy. Do not mutate the branch or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

Formal exact-head approval request for b132d0955ced35d5121f227e4aba8d45acbb40dd over base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Approve only if the PR remains open, non-draft, mergeable, and unchanged; every exact-head required check and security gate remains successful; all review threads remain resolved; and the RCA/remediation-feasibility, credential isolation, pristine retry, broker fail-stop, runtime-budget, writer-lease, and state-transition verification contracts are satisfied. Do not modify the branch or merge.

@coderabbitai

coderabbitai Bot commented Aug 8, 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/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="b132d0955ced35d5121f227e4aba8d45acbb40dd"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact revision and pull request state =="
printf 'checked_out='
git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" \
  --json state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision,author \
  --jq '{state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision,author: .author.login}'

echo "== Exact range integrity and files =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Candidate workflow and contract files =="
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github | head -n 1)"
contract="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . | head -n 1)"
printf 'workflow=%s\ncontract=%s\n' "$workflow" "$contract"

echo "== Workflow contract references =="
rg -n -C 6 -P \
  'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|credential broker|broker|127\.0\.0\.1|localhost|git archive|pristine|180|timeout|RCA|reproduc|remedi|feasib|lease|lock|writer|revalid|gh api' \
  "$workflow" "$contract" CHANGELOG.md || true

echo "== Complete exact-range diff =="
git diff --unified=16 "$base" "$head" -- "$workflow" "$contract" CHANGELOG.md

echo "== Sensitive credentials and endpoint patterns at exact head =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|NIM_API_KEY|API_KEY|cafe\.github\.com|\*\.github\.com|egress-policy|allowed-endpoints' \
  "$head" -- . ':!CHANGELOG.md' || true

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

echo "== Exact-head legacy status contexts =="
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,target_url,description}]}'

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated, comments: [.comments.nodes[] | {author: .author.login, body, commit: .commit.oid, path, line}]}]'

Length of output: 108740


@seonghobae I cannot approve exact head b132d0955ced35d5121f227e4aba8d45acbb40dd.

Two approval conditions are not satisfied:

  1. The exact-head strix check is still in_progress. The request requires every required check and security gate to be successful.

  2. .github/workflows/hourly-product-development.yml Line 479 passes ${{ secrets.NVIDIA_NIM_API_KEY }} to FORBIDDEN_SECRET in Validate and seal the credential-free change bundle. This step runs after Stop credential broker. It is not the conditional model-backed credential step. This violates the requested credential-isolation contract.

The pull request is open, non-draft, mergeable, and unchanged. The reported review threads are resolved. I did not modify the branch or merge #15.

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="b132d0955ced35d5121f227e4aba8d45acbb40dd"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact revisions and changed files =="
printf 'checked_out='; git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Pull request state =="
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,author,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision \
  --jq '{number,state,isDraft,author:.author.login,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision}'

echo "== Changed-file outlines =="
while IFS=$'\t' read -r status path; do
  [ -n "$path" ] || continue
  printf '\n-- %s %s --\n' "$status" "$path"
  case "$path" in
    *.py|*.js|*.ts|*.tsx|*.go|*.rs|*.java|*.yml|*.yaml)
      ast-grep outline "$path" --items all 2>&1 || true
      ;;
    *)
      printf '%s\n' "No AST outline requested for this file type."
      ;;
  esac
done < <(git diff --name-status "$base" "$head")

echo "== Workflow and contract references =="
rg -n -C 6 -P \
  'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b|credential broker|broker|127\.0\.0\.1|localhost|git archive|pristine|RCA|reproduc|remediation|feasibility|permission|reviewer|policy|lease|runtime|reversib|revalidat|180|timeout|concurrency' \
  .github tests CHANGELOG.md 2>/dev/null || true

echo "== Exact range diff =="
git diff --unified=18 "$base" "$head"

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

echo "== Exact-head legacy statuses =="
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,target_url,description}]}'

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated,comments:[.comments.nodes[]|{author:.author.login,body,commit:.commit.oid,path,line}]}]'

echo "== Pull request reviews on the exact head =="
gh pr view "$pr" --repo "$repo" --json reviews \
  --jq '[.reviews[] | {author:.author.login,state,commit:.commit.oid,submittedAt}]'

Length of output: 3887


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="b132d0955ced35d5121f227e4aba8d45acbb40dd"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"
workflow=".github/workflows/hourly-product-development.yml"
hourly_contract="tests/test_hourly_product_development_contract.py"
blocker_contract="tests/test_scheduler_blocker_resolution_contract.py"

echo "== Structured-file outlines =="
ast-grep outline "$workflow" --items all 2>&1 || true
ast-grep outline "$hourly_contract" --items all 2>&1 || true
ast-grep outline "$blocker_contract" --items all 2>&1 || true

echo "== Complete workflow =="
cat -n "$workflow"

echo "== Complete hourly contract =="
cat -n "$hourly_contract"

echo "== Complete scheduler blocker contract =="
cat -n "$blocker_contract"

echo "== Changed documentation =="
cat -n AGENTS.md
cat -n CHANGELOG.md

echo "== Exact five-file diff =="
git diff --unified=24 "$base" "$head" -- \
  "$workflow" AGENTS.md CHANGELOG.md "$hourly_contract" "$blocker_contract"

echo "== Credential and scheduler boundary references =="
rg -n -C 10 -P \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|NIM_API_KEY|API_KEY|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b|egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|credential broker|broker|127\.0\.0\.1|localhost|git archive|git reset|git clean|pristine|RCA|reproduc|remediation|feasibility|permission|reviewer|policy|lease|runtime|reversib|revalidat|180|timeout|concurrency' \
  "$workflow" "$hourly_contract" "$blocker_contract" AGENTS.md CHANGELOG.md

echo "== Sensitive credential references at the exact head =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|NIM_API_KEY|[A-Z_]*API_KEY|cafe\.github\.com|\*\.github\.com' \
  "$head" -- . ':!CHANGELOG.md' || true

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

echo "== Exact-head legacy statuses =="
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,target_url,description}]}'

echo "== Current unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated,comments:[.comments.nodes[]|{author:.author.login,body,commit:.commit.oid,path,line}]}]'

echo "== Current branch protection and rulesets =="
gh api "repos/$repo/branches/main/protection" \
  --jq '{required_status_checks,required_pull_request_reviews,enforce_admins,restrictions}' \
  2>&1 || true
gh api --paginate "repos/$repo/rulesets?includes_parents=true" \
  --jq '[.[] | {id,name,target,enforcement,conditions,rules}]' \
  2>&1 || true

Length of output: 211054


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="b132d0955ced35d5121f227e4aba8d45acbb40dd"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact pull request state =="
gh pr view "$pr" --repo "$repo" \
  --json state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus \
  --jq '{state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus}'

echo "== Exact-head check summary =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '{
    non_success: [
      .check_runs[]
      | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
      | {name,status,conclusion,details_url}
    ],
    completed_success: [
      .check_runs[]
      | select(.status == "completed" and .conclusion == "success")
      | .name
    ]
  }'

echo "== Exact-head legacy status summary =="
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,description}]}'

echo "== Current unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {comments:[.comments.nodes[]|{author:.author.login,body,commit:.commit.oid,path,line}]}]'

echo "== Exact range unchanged =="
test "$(git rev-parse HEAD)" = "$head"
git diff --check "$base" "$head"

Length of output: 2971


@seonghobae I found one applicable finding on exact head b132d0955ced35d5121f227e4aba8d45acbb40dd.

RCA contract does not require materially distinct remediation candidates for every failure.
In .github/workflows/hourly-product-development.yml Line 172, the agent prompt requires RCA, one reproduction, feasibility validation, one feasible corrective action, and revalidation. It does not require enumeration or comparison of materially distinct remediation candidates. AGENTS.md Line 30 requires candidate enumeration for blockers, but it also does not require that candidates be materially distinct. This does not satisfy the requested failure sequence.

The remaining requested controls are present:

  • Deterministic gates receive no NVIDIA secret.
  • The model path is conditional on the credential gate.
  • Harden Runner remains fail-closed with the reviewed folded endpoint allowlist.
  • Each model retry starts from git archive HEAD.
  • Credential-broker failure stops the retry loop.
  • The 180-minute timeout covers the three 35-minute model caps plus the stated reserve.
  • The diff adds no COPILOT_GITHUB_TOKEN, broad GitHub wildcard, self-approval, protection weakening, or competing writer.
  • No unresolved inline review threads exist.

I did not submit approval. The exact-head strix check is still in_progress, so the all-checks-success condition is not met. I did not modify the branch or merge #15.

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

Comment thread .github/workflows/hourly-product-development.yml Fixed

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the exact current head 9bc89c1ab719d8a6601d7bc79a132138862a0e9f against current base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Focus on the broker /statusz preflight fail-closed classification, provider-generation retry evidence, credential boundary, publication fail-closed behavior, and regression-contract accuracy. Do not treat this automated review as independent non-author approval.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="9bc89c1ab719d8a6601d7bc79a132138862a0e9f"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact identity and PR state =="
printf 'checked_out='; git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,author,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision \
  --jq '{number,state,isDraft,author:.author.login,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision}'
test "$(git rev-parse HEAD)" = "$head"

echo "== Exact changed range =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Locate and map changed implementation and contract files =="
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github | head -n 1)"
hourly_contract="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . | head -n 1)"
blocker_contract="$(fd -HI -t f 'test_scheduler_blocker_resolution_contract\.py' . | head -n 1)"
printf 'workflow=%s\nhourly_contract=%s\nblocker_contract=%s\n' \
  "$workflow" "$hourly_contract" "$blocker_contract"
ast-grep outline "$workflow" --items all 2>&1 || true
ast-grep outline "$hourly_contract" --items all 2>&1 || true
ast-grep outline "$blocker_contract" --items all 2>&1 || true

echo "== Complete exact diff =="
git diff --unified=28 "$base" "$head"

echo "== Broker, retry evidence, credentials, publication, and contracts =="
rg -n -C 12 -P \
  '/statusz|broker|provider.?generation|generation|retry.evidence|attempt.evidence|remediation|materially distinct|pristine|git archive|NVIDIA_NIM_API_KEY|OPENCODE_PR_TOKEN|credential|fingerprint|FORBIDDEN_SECRET|publish|publication|authority|fail.closed|exit [01]|open_pull_request|release_blocker|dry.run|egress-policy|allowed-endpoints|diagnostic|SHA-?256|rolling' \
  "$workflow" "$hourly_contract" "$blocker_contract" AGENTS.md CHANGELOG.md 2>/dev/null || true

echo "== Workflow step map and relevant implementation slices =="
rg -n '^\s{6}- name:|^\s{8}id:|^\s{8}if:|timeout-minutes:|concurrency:|cancel-in-progress:' "$workflow"
rg -n -C 20 -P '/statusz|provider.?generation|retry.evidence|attempt.evidence|reset_agent_workspace|git archive|NVIDIA_NIM_API_KEY|OPENCODE_PR_TOKEN|Validate and seal|Publish|credential broker' "$workflow" || true

echo "== Exact-head sensitive names and endpoint patterns =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|NIM_API_KEY|[A-Z_]*API_KEY|OPENCODE_PR_TOKEN|FORBIDDEN_SECRET|cafe\.github\.com|\*\.github\.com|egress-policy|allowed-endpoints' \
  "$head" -- . ':!CHANGELOG.md' || true

echo "== Exact-head check state =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '{
    non_success: [.check_runs[]
      | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
      | {name,status,conclusion,details_url}],
    completed: [.check_runs[] | {name,status,conclusion,details_url}]
  }'
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,description,target_url}]}'

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated,comments:[.comments.nodes[]|{author:.author.login,body,commit:.commit.oid,path,line}]}]'

Length of output: 204368


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"
head="9bc89c1ab719d8a6601d7bc79a132138862a0e9f"
workflow=".github/workflows/hourly-product-development.yml"
provider_contract="tests/test_provider_retry_feasibility_contract.py"
hourly_contract="tests/test_hourly_product_development_contract.py"

echo "== Broker request generation and status endpoint =="
sed -n '266,407p' "$workflow"

echo "== Status reader and retry classification =="
sed -n '445,585p' "$workflow"

echo "== Provider retry regression contract =="
cat -n "$provider_contract"

echo "== Hourly regression assertions around retry and publication =="
sed -n '240,332p' "$hourly_contract"

echo "== Exact diff for provider retry implementation and tests =="
git diff --unified=40 "$base" "$head" -- \
  "$workflow" "$provider_contract" "$hourly_contract" \
  docs/adr/0009-hourly-agent-credential-boundary.md CHANGELOG.md

echo "== Focused consistency search for status counters and classification =="
rg -n -C 5 -P \
  'REQUEST_COUNTER|LAST_AUTH_REJECTED_REQUEST|LAST_RATE_LIMITED_REQUEST|request_counter|last_auth_rejected_request|last_rate_limited_request|record_provider_status|provider_before|provider_auth_rejected|provider_rate_limited|credential_broker_unavailable|read_provider_status' \
  "$workflow" "$provider_contract" "$hourly_contract"

echo "== Reconfirm current head and check state =="
test "$(git rev-parse HEAD)" = "$head"
gh pr view 15 --repo ContextualWisdomLab/OriginWeave \
  --json headRefOid,state,isDraft,mergeable \
  --jq '{headRefOid,state,isDraft,mergeable}'
gh api --paginate "repos/ContextualWisdomLab/OriginWeave/commits/$head/check-runs?per_page=100" \
  --jq '[.check_runs[]
    | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
    | {name,status,conclusion,details_url}]'

Length of output: 129766


@seonghobae Review complete for exact head 9bc89c1ab719d8a6601d7bc79a132138862a0e9f against base b228693f9e0a11d1794c1e4b0f7a3a38559a5491.

No valid code finding applies to the requested scope.

Verified:

  • The broker allocates request generations under a lock.
  • The broker records 401 and 403 as last_auth_rejected_request.
  • The broker records 429 as last_rate_limited_request.
  • The runner snapshots /statusz before each model attempt.
  • The runner compares post-failure provider outcome generations against the pre-attempt request counter.
  • A late outcome from an earlier request cannot classify a later model attempt as provider_auth_rejected or provider_rate_limited.
  • If /statusz is unavailable or malformed before a model starts, the workflow records credential_broker_unavailable, emits bounded diagnostics, and stops fallback.
  • If /statusz is unavailable or malformed after a failed model attempt, the workflow records credential_broker_unavailable and stops fallback.
  • The regression contract checks broker telemetry, preflight placement before opencode run, provider failure classifications, and the fail-closed broker path.
  • Deterministic gates run before NVIDIA_NIM_API_KEY materialization.
  • Raw NVIDIA_NIM_API_KEY remains limited to the conditional credential step and loopback broker.
  • The bundle validator receives only the credential fingerprint.
  • Missing OPENCODE_PR_TOKEN fails publication after a verified non-empty bundle.
  • Repository drift remains an intentional publication safe stop.
  • Harden Runner retains egress-policy: block and the reviewed narrow allowlist.

strix is still in progress on this exact head. I did not treat automated review status as independent non-author approval. I did not approve, modify the branch, or merge #15.

⚠️ Action not completed

Review rate limited.

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

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

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

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head bbce6970880c1cc78111b9fde4fb68c5969a4c7d against current base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Treat every predecessor-head review as historical. Focus on fail-closed scheduler semantics, the new pre-read one-mebibyte workspace file-size bound before changed-file byte comparison, credential and publication authority boundaries, provider-generation retry feasibility, and false-green or resource-exhaustion paths. Exact-head CI, Security Scan, SAST Semgrep, and exact production coverage are currently successful. Do not mutate the branch or merge. This automated review is evidence only and does not satisfy the required independent non-author formal approval.

@coderabbitai

coderabbitai Bot commented Aug 8, 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/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="bbce6970880c1cc78111b9fde4fb68c5969a4c7d"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact identity and pull request state =="
printf 'checked_out='; git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,author,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision \
  --jq '{number,state,isDraft,author:.author.login,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision}'
test "$(git rev-parse HEAD)" = "$head"

echo "== Exact-range integrity and changed files =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Candidate file map =="
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github | head -n 1)"
hourly_contract="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . | head -n 1)"
provider_contract="$(fd -HI -t f 'test_provider_retry_feasibility_contract\.py' . | head -n 1)"
printf 'workflow=%s\nhourly_contract=%s\nprovider_contract=%s\n' \
  "$workflow" "$hourly_contract" "$provider_contract"
ast-grep outline "$workflow" --items all 2>&1 || true
ast-grep outline "$hourly_contract" --items all 2>&1 || true
ast-grep outline "$provider_contract" --items all 2>&1 || true

echo "== Complete exact-range diff =="
git diff --unified=28 "$base" "$head"

echo "== File-size bound and changed-file comparison control flow =="
rg -n -C 16 -P \
  '1048576|1[ _-]?(MiB|mebibyte)|file.?size|stat |wc -c|changed.?file|read|bytes|bundle|workspace|AGENT_WORKSPACE|find |while read|mapfile|xargs' \
  "$workflow" "$hourly_contract" "$provider_contract" tests 2>/dev/null || true

echo "== Fail-closed scheduler, credential, retry, and publication controls =="
rg -n -C 12 -P \
  '/statusz|broker|provider.?generation|request_counter|auth_rejected|rate_limited|credential_broker_unavailable|NVIDIA_NIM_API_KEY|OPENCODE_PR_TOKEN|fingerprint|FORBIDDEN_SECRET|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|git archive|pristine|retry.evidence|materially distinct|feasibility|timeout|180|diagnostic|drift|authority|fail.closed|exit [01]' \
  "$workflow" "$hourly_contract" "$provider_contract" AGENTS.md CHANGELOG.md 2>/dev/null || true

echo "== Workflow step map =="
rg -n '^\s{6}- name:|^\s{8}id:|^\s{8}if:|timeout-minutes:|concurrency:|cancel-in-progress:' "$workflow"

echo "== Focused workflow slices =="
rg -n -C 24 -P \
  '1048576|changed.?file|Validate and seal|OPENCODE_PR_TOKEN|/statusz|read_provider_status|provider_before|credential_broker_unavailable|Start loopback|Require NVIDIA|reset_agent_workspace|git archive' \
  "$workflow" || true

echo "== Exact-head sensitive values and endpoint patterns =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|NIM_API_KEY|[A-Z_]*API_KEY|OPENCODE_PR_TOKEN|FORBIDDEN_SECRET|cafe\.github\.com|\*\.github\.com|egress-policy|allowed-endpoints' \
  "$head" -- . ':!CHANGELOG.md' || true

echo "== Exact-head check state =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '{
    non_success: [.check_runs[]
      | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
      | {name,status,conclusion,details_url}],
    completed: [.check_runs[] | {name,status,conclusion,details_url}]
  }'
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,description,target_url}]}'

echo "== Current unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated,comments:[.comments.nodes[]|{author:.author.login,body,commit:.commit.oid,path,line}]}]'

Length of output: 204804


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/OriginWeave"
pr="15"
head="bbce6970880c1cc78111b9fde4fb68c5969a4c7d"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"
workflow=".github/workflows/hourly-product-development.yml"
hourly_contract="tests/test_hourly_product_development_contract.py"

echo "== Exact file-size-related diff =="
git diff --unified=60 "$base" "$head" -- "$workflow" "$hourly_contract" CHANGELOG.md \
  | rg -n -C 24 'MAX_CHANGED_FILE_BYTES|1_048_576|oversized|read_bytes|changed =|changed.?file|workspace|PR_MESSAGE|stat'

echo "== Complete bundle-validation implementation =="
sed -n '597,780p' "$workflow"

echo "== Contract methods that cover bundle limits and ordering =="
rg -n -A80 -B4 -P \
  'def test_(pr_message_is_bounded|workspace|changed_file|bundle|file_size|size)' \
  "$hourly_contract" || true

echo "== All contract references for the workspace bound =="
rg -n -C 8 -P \
  'MAX_CHANGED_FILE_BYTES|1_048_576|oversized workspace|oversized|read_bytes\(\).*read_bytes|changed =|new_files|old_files' \
  "$hourly_contract" "$workflow"

echo "== Baseline preparation and metadata constraints =="
sed -n '167,247p' "$workflow"
sed -n '781,870p' "$workflow"

echo "== Exact current identity and check state =="
test "$(git rev-parse HEAD)" = "$head"
gh pr view "$pr" --repo "$repo" --json headRefOid,baseRefOid,state,isDraft \
  --jq '{headRefOid,baseRefOid,state,isDraft}'
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '[.check_runs[]
    | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
    | {name,status,conclusion,details_url}]'

Length of output: 104731


@seonghobae I found one applicable regression-contract finding on exact head bbce6970880c1cc78111b9fde4fb68c5969a4c7d.

The new workspace file-size control has no regression test.
.github/workflows/hourly-product-development.yml Lines 698-704 correctly reject workspace files larger than 1_048_576 bytes before Line 708 performs the full read_bytes() comparison. However, tests/test_hourly_product_development_contract.py tests the size-before-read order only for PR_MESSAGE.md. It does not assert the workspace-file bound, the new_files stat().st_size pass, or its order before the changed-file comparison.

Add a contract test that requires:

  • MAX_CHANGED_FILE_BYTES = 1_048_576;
  • rejection of oversized entries in new_files;
  • the oversize rejection before the first changed-file read_bytes() comparison.

This control protects the new resource-exhaustion boundary. It should not rely only on implementation review.

The remaining reviewed controls are present:

  • Deterministic gates run before NVIDIA credential materialization.
  • Raw NVIDIA_NIM_API_KEY is limited to the credential step and loopback broker.
  • Bundle validation receives the fingerprint only and deletes it before scanning.
  • Provider-generation evidence uses /statusz before and after each attempt.
  • Broker telemetry failure stops fallback with bounded diagnostics.
  • Each fallback starts from pristine HEAD.
  • Missing OPENCODE_PR_TOKEN fails publication after a verified non-empty bundle.
  • Repository-state drift remains an intentional safe stop.
  • Harden Runner retains egress-policy: block and the reviewed narrow allowlist.
  • No COPILOT_GITHUB_TOKEN, approval authority, merge authority, or competing writer was found.
  • No unresolved review threads exist.

strix remains in_progress on this exact head. I did not treat status success as formal approval. I did not approve, modify the branch, or merge #15.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head da90535c6b6bc4bea69195cc3f6d9a831e13e962 against current base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Treat predecessor-head reviews as historical. The only source change since the last exact-head review is the regression contract for the existing pre-read one-mebibyte workspace-file guard that your prior review found missing. Focus on whether the new contract actually locks MAX_CHANGED_FILE_BYTES, oversized new_files rejection, and ordering before the first changed-file read_bytes() comparison, without weakening the validator or other gates. Exact-head CI, Security Scan, and SAST Semgrep are successful. Do not mutate the branch or merge. This automated review is evidence only and does not satisfy the required independent non-author formal approval.

@coderabbitai

coderabbitai Bot commented Aug 8, 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/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="da90535c6b6bc4bea69195cc3f6d9a831e13e962"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"
workflow=".github/workflows/hourly-product-development.yml"
contract="tests/test_hourly_product_development_contract.py"

echo "== Exact PR identity and state =="
printf 'checked_out='; git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,author,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision \
  --jq '{number,state,isDraft,author:.author.login,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision}'
test "$(git rev-parse HEAD)" = "$head"

echo "== Exact range integrity and changed files =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== File outlines =="
ast-grep outline "$workflow" --items all 2>&1 || true
ast-grep outline "$contract" --items all 2>&1 || true

echo "== Exact delta since prior reviewed head =="
git diff --check "bbce6970880c1cc78111b9fde4fb68c5969a4c7d" "$head"
git diff --unified=60 "bbce6970880c1cc78111b9fde4fb68c5969a4c7d" "$head"

echo "== Workspace validator implementation =="
rg -n -C 35 -P \
  'MAX_CHANGED_FILE_BYTES|new_files|stat\(\)\.st_size|read_bytes\(\)|oversized workspace|changed-file|changed file|Validate and seal' \
  "$workflow"

echo "== Relevant regression-contract methods =="
rg -n -A110 -B8 -P \
  'def test_.*(workspace|changed_file|file_size|bundle|size)|MAX_CHANGED_FILE_BYTES|new_files|read_bytes' \
  "$contract"

echo "== Full focused diff against base =="
git diff --unified=45 "$base" "$head" -- "$workflow" "$contract"

echo "== Gate and credential controls at exact head =="
rg -n -C 6 -P \
  'egress-policy|allowed-endpoints|NVIDIA_NIM_API_KEY|OPENCODE_PR_TOKEN|COPILOT_GITHUB_TOKEN|open_pull_request|release_blocker|dry.run|credential broker|/statusz|git archive|timeout-minutes' \
  "$workflow"

echo "== Exact-head checks =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '{
    non_success: [.check_runs[]
      | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
      | {name,status,conclusion,details_url}],
    completed: [.check_runs[] | {name,status,conclusion,details_url}]
  }'

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated, comments:[.comments.nodes[] | {author:.author.login,body,commit:.commit.oid,path,line}]}]'

Length of output: 102216


@seonghobae Review complete for exact head da90535c6b6bc4bea69195cc3f6d9a831e13e962 against base b228693f9e0a11d1794c1e4b0f7a3a38559a5491.

No valid finding applies to the requested scope.

The new tests/test_hourly_workspace_size_contract.py locks the workspace-file guard:

  • It requires MAX_CHANGED_FILE_BYTES = 1_048_576.
  • It requires new_files = files(workspace).
  • It requires iteration over new_files.
  • It requires path.stat().st_size > MAX_CHANGED_FILE_BYTES.
  • It requires rejection with oversized workspace files rejected.
  • It requires that the size rejection occurs before changed.
  • It requires that changed occurs before the first changed-file read_bytes() comparison.

The workflow validator satisfies this order. It rejects every oversized workspace file before it compares changed-file bytes.

The delta from the prior reviewed head adds only this regression contract. It does not change the validator or weaken scheduler, credential, publication, retry, or egress controls.

No unresolved review thread exists.

strix is still in progress on this exact head. Therefore, this review is not formal approval. I did not modify the branch or merge #15.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review-only request for exact current head da90535c6b6bc4bea69195cc3f6d9a831e13e962 against protected base b228693f9e0a11d1794c1e4b0f7a3a38559a5491. Do not mutate the branch or merge. Review the full current range with emphasis on fail-closed scheduler behavior, provider-auth/rate-limit classification, bounded untrusted workspace and PR-message reads, credential fingerprint lifetime, publication authority and rollback behavior, exact GitHub API gate semantics, and regression-test strength. Treat prior reviewed commits as context only and surface only still-valid findings on this exact head. This request is automated-review evidence only and must not be treated as the independent non-author approval gate.

@coderabbitai

coderabbitai Bot commented Aug 8, 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/OriginWeave"
owner="ContextualWisdomLab"
name="OriginWeave"
pr="15"
head="da90535c6b6bc4bea69195cc3f6d9a831e13e962"
base="b228693f9e0a11d1794c1e4b0f7a3a38559a5491"

echo "== Exact PR identity and state =="
printf 'checked_out='; git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,author,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision \
  --jq '{number,state,isDraft,author:.author.login,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision}'
test "$(git rev-parse HEAD)" = "$head"

echo "== Exact-range integrity and changed files =="
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"

echo "== Candidate files =="
workflow="$(fd -HI -t f 'hourly-product-development\.ya?ml' .github | head -n 1)"
hourly_contract="$(fd -HI -t f 'test_hourly_product_development_contract\.py' . | head -n 1)"
provider_contract="$(fd -HI -t f 'test_provider_retry_feasibility_contract\.py' . | head -n 1)"
workspace_contract="$(fd -HI -t f 'test_hourly_workspace_size_contract\.py' . | head -n 1)"
printf 'workflow=%s\nhourly_contract=%s\nprovider_contract=%s\nworkspace_contract=%s\n' \
  "$workflow" "$hourly_contract" "$provider_contract" "$workspace_contract"

echo "== Complete exact-range diff =="
git diff --unified=32 "$base" "$head"

echo "== Focused implementation and contract controls =="
rg -n -C 12 -P \
  'egress-policy|allowed-endpoints|api\.github\.com|cafe\.github\.com|\*\.github\.com|NVIDIA_NIM_API_KEY|OPENCODE_PR_TOKEN|COPILOT_GITHUB_TOKEN|nim_api_key_unavailable|open_pull_request|release_blocker|dry.run|\bgh\s+api\b|/statusz|broker|provider.?generation|request_counter|auth_rejected|rate_limited|credential_broker_unavailable|fingerprint|SHA-?256|rolling|FORBIDDEN_SECRET|MAX_CHANGED_FILE_BYTES|1048576|PR_MESSAGE|read_bytes|stat\(\)\.st_size|git archive|pristine|retry.evidence|materially distinct|feasibility|rollback|revert|drift|authority|fail.closed|exit [01]' \
  "$workflow" "$hourly_contract" "$provider_contract" "$workspace_contract" AGENTS.md CHANGELOG.md 2>/dev/null || true

echo "== Workflow control map =="
rg -n '^\s{6}- name:|^\s{8}id:|^\s{8}if:|timeout-minutes:|concurrency:|cancel-in-progress:' "$workflow"

echo "== Validation, publication, and retry slices =="
rg -n -C 28 -P \
  'Validate and seal|MAX_CHANGED_FILE_BYTES|PR_MESSAGE|read_bytes|Start loopback|/statusz|read_provider_status|provider_before|credential_broker_unavailable|reset_agent_workspace|git archive|OPENCODE_PR_TOKEN|open_pull_request|release_blocker|dry.run|gh\s+api|Repository state changed|rollback|revert' \
  "$workflow" || true

echo "== Exact-head sensitive references =="
git grep -n -I -E \
  'COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY|NIM_API_KEY|[A-Z_]*API_KEY|OPENCODE_PR_TOKEN|FORBIDDEN_SECRET|cafe\.github\.com|\*\.github\.com|egress-policy|allowed-endpoints' \
  "$head" -- . ':!CHANGELOG.md' || true

echo "== Exact-head check state =="
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
  --jq '{
    non_success: [.check_runs[]
      | select(.status != "completed" or (.conclusion != "success" and .conclusion != "skipped"))
      | {name,status,conclusion,details_url}],
    completed: [.check_runs[] | {name,status,conclusion,details_url}]
  }'
gh api "repos/$repo/commits/$head/status" \
  --jq '{state,statuses:[.statuses[] | {context,state,description,target_url}]}'

echo "== Unresolved review threads =="
gh api graphql -F owner="$owner" -F name="$name" -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
          isOutdated
          comments(first: 20) {
            nodes { author { login } body commit { oid } path line }
          }
        }
      }
    }
  }
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | {isOutdated, comments:[.comments.nodes[] | {author:.author.login,body,commit:.commit.oid,path,line}]}]'

Length of output: 204657


@seonghobae I found one applicable finding on exact head da90535c6b6bc4bea69195cc3f6d9a831e13e962.

Publication does not roll back a pushed branch when PR creation fails.
At .github/workflows/hourly-product-development.yml Line 867, the publisher pushes nim-agent/product-dev-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}. At Line 868, it calls gh pr create. If that command fails, set -e fails the job, but the pushed branch remains in the repository.

This creates a partial publication state. The next scheduler run can see no open PR and continue, while the stale branch remains remotely published.

Add a bounded cleanup path after a failed gh pr create. The cleanup should delete only the branch created by this run. The cleanup should report failure if it cannot establish the final branch state.

The other reviewed controls are present:

  • Harden Runner uses egress-policy: block with the reviewed folded endpoint allowlist.
  • Deterministic GitHub gates run before NVIDIA credential materialization.
  • The credential is limited to the credential step and loopback broker.
  • The fingerprint file is deleted before workspace and PR-message scanning.
  • Workspace files and PR_MESSAGE.md are size-checked before full reads.
  • /statusz telemetry uses request-generation evidence for provider-auth and rate-limit classification.
  • Missing or malformed broker telemetry stops fallback with bounded diagnostics.
  • Publication fails when OPENCODE_PR_TOKEN is absent after a verified non-empty bundle.
  • Release-blocker gates paginate before filtering pull requests.
  • The exact-head checks are successful or intentionally skipped.
  • No unresolved review threads exist.

I did not approve, modify the branch, or merge #15.

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