Skip to content

security: remove autonomous repository-write publisher - #66

Open
seonghobae wants to merge 8 commits into
mainfrom
security/remove-autonomous-write-publisher
Open

security: remove autonomous repository-write publisher#66
seonghobae wants to merge 8 commits into
mainfrom
security/remove-autonomous-write-publisher

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Test-first workflow-trust repair

Closes #65 by removing the repository-local publisher from the hourly product-development scheduler without weakening the NVIDIA/OpenCode model boundary, zero-PR gate, or credential-free reverification.

Exact tree binding

  • Protected-main base: 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.
  • Immutable initial RED head: 7ace35a3129c426444ecd9f8fec90d87dcc03f16.
  • First CodeRabbit follow-up RED head: 21c3ecaea7506db3f2c4f887fb8837645cf41434.
  • Prior exact GREEN head: f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf.
  • Immutable final-handoff RED head: 2dc5a8a5d05a977244e8f06157ccf12ad65c604e.
  • Exact current GREEN head: c038a9509d1a8eae8561cc9081e67e12bd373d42.

Implemented boundary

  • retains SHA-256-pinned OpenCode 1.18.13, explicit nvidia/nemotron-3-super-120b-a12b, and NVIDIA_NIM_API_KEYNVIDIA_API_KEY mapping;
  • retains read-only model execution, deny-by-default tools, bounded patch capture, full REST pagination at both zero-open-PR gates, and offline credential-free reverification;
  • removes the complete publish job, repository-write and OIDC authority, GitHub App token exchange, model-patch reapplication under a write identity, branch push, PR creation, and auto-merge request;
  • uploads only a three-day independently verified handoff containing egressweave.patch, base-sha, and patch-sha256;
  • binds checkout HEAD, workflow output, uploaded handoff metadata, guard result, and the final sealed handoff to one exact base before and after patch application and immediately before artifact upload;
  • rejects every workflow *: write permission through the repository contract;
  • preserves both affected printf format strings as single indented YAML lines with literal \n escapes, superseding closed PR fix: restore hourly product workflow YAML parsing #71 without restoring the removed publisher;
  • documents that no repository-local promotion mechanism exists and that any future promotion must be external, independently reviewed, credential-separated, and reconstruct and verify the exact tree before repository write;
  • updates [Unreleased] without a version bump.

Test-first final-handoff repair

CodeRabbit's review of prior head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf found one valid residual integrity gap: the final Recheck the independently verified immutable patch step validated the sealed base-sha format but did not compare it again with needs.develop.outputs.base_sha immediately before upload.

Exact test-only RED head 2dc5a8a5d05a977244e8f06157ccf12ad65c604e changed only tests/test_hourly_opencode_nvidia_contract.py. CI run 31106746733 passed package acceptance and Ruff, while every Python 3.10–3.13 lane failed only in the new final-handoff contract (1 failed, 740 passed on Python 3.13). SAST run 31106748228 and Security Scan run 31106746211 otherwise succeeded.

Exact current commit c038a9509d1a8eae8561cc9081e67e12bd373d42 changes only .github/workflows/hourly-product-development.yml: the final recheck receives EXPECTED_BASE_SHA, retains lowercase 40-character validation, and fails closed unless the sealed base equals that exact expected base. The stable failure is The sealed base SHA does not match the exact handoff base.

Exact-head evidence

CI run 31108238186 succeeded on exact current head c038a9509d1a8eae8561cc9081e67e12bd373d42:

  • Python 3.10–3.13: success;
  • Ruff, compileall, and product-guard self-test: success;
  • 741 tests: success;
  • production coverage: 1,620 statements and 554 branches, 100%;
  • wheel and source-distribution package acceptance: success.

SAST Semgrep run 31108238093 and Security Scan run 31108241013 also succeeded on the same exact head. The two original inline CodeRabbit findings remain resolved.

Remaining gates

This PR is ready for review. A completed automated review of exact current head c038a9509d1a8eae8561cc9081e67e12bd373d42, independent non-author approval, branch protection, and every repository policy gate remain mandatory. Do not merge, enable auto-merge, release, publish, or treat the verified artifact as repository-write authorization.

Summary by CodeRabbit

  • 변경 사항

    • 시간별 제품 개발 작업이 저장소에 직접 쓰거나 브랜치·PR을 생성 및 병합하지 않고, 검증된 패치와 기준 커밋 정보만 전달하도록 변경되었습니다.
    • 패치, 기준 SHA, 패치 해시의 독립 검증과 단기 아티팩트 전달이 강화되었습니다.
    • 공개 PR 조회 시 모든 페이지를 정확히 확인합니다.
    • 수동 실행에도 동일한 읽기 전용 및 자격 증명 분리 정책이 적용됩니다.
  • 테스트

    • 자동 게시, 푸시, PR 생성 및 병합 방지 검증을 추가했습니다.
    • 외부 검증 및 승격 절차에 대한 운영 문서 검증을 추가했습니다.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

제품 개발 워크플로가 저장소 쓰기와 자동 게시 경로를 제거했다. 재검증 작업은 정확한 기준 SHA와 패치 해시를 확인한 뒤 패치, 기준 SHA, 패치 SHA-256 아티팩트를 전달한다. 문서와 테스트는 외부 승격 경계와 전체 PR 페이지 검사를 반영한다.

Changes

제품 스케줄러 핸드오프

Layer / File(s) Summary
기준 SHA 봉인과 패치 재검증
.github/workflows/hourly-product-development.yml
워크플로가 기준 SHA를 봉인하고 패치 적용 전후에 기준 SHA 형식과 값을 검증한다. 재검증 작업은 패치, 기준 SHA, 패치 SHA-256만 업로드한다.
워크플로 실행 경계 정리
.github/workflows/hourly-product-development.yml, CHANGELOG.md
publish 작업과 관련 출력값을 제거했다. OpenCode 결과 형식을 단일 행으로 정리했다. 전체 PR 페이지 검사의 실행 횟수와 기대값을 갱신했다.
운영 문서와 계약 테스트
docs/hourly-autonomous-maintenance.md, tests/test_hourly_opencode_nvidia_contract.py
저장소 쓰기, 브랜치·PR 생성, 자동 병합, 로컬 게시를 금지하는 경계를 문서화했다. 정확한 기준 트리, 패치 해시, 무자격 증명 핸드오프를 검증하는 테스트를 추가했다.

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

Sequence Diagram(s)

sequenceDiagram
  participant ProductScheduler
  participant ReverifyRunner
  participant ProtectedMain
  participant ArtifactStore
  participant ExternalPromotion
  ProductScheduler->>ReverifyRunner: patch와 sealed base SHA 전달
  ReverifyRunner->>ProtectedMain: protected-main head와 base SHA 비교
  ReverifyRunner->>ReverifyRunner: patch 적용 결과와 SHA-256 검증
  ReverifyRunner->>ArtifactStore: patch, base-sha, patch-sha256 업로드
  ExternalPromotion->>ArtifactStore: 검증 아티팩트 조회
  ExternalPromotion->>ProtectedMain: exact base 기준 트리 재구성 및 검증
Loading

Possibly related issues

  • ContextualWisdomLab/TEPP#2: 자격 증명 분리와 검증된 패치 핸드오프라는 목적이 일부 일치한다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 변경 사항은 #65의 게시 작업 제거, 검증된 패치 핸드오프, 권한 경계, 문서 및 테스트 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 #65에 필요한 워크플로, 테스트, 운영 문서 및 변경 로그 범위에 포함됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 자율 저장소 쓰기 게시자를 제거하는 PR의 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ 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 security/remove-autonomous-write-publisher

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

Copy link
Copy Markdown
Contributor Author

@opencode-agent Implement the bounded GREEN repair on exact current head 7ace35a3129c426444ecd9f8fec90d87dcc03f16 of branch security/remove-autonomous-write-publisher.

The immutable RED commit is intentional and must remain in history. It changes only tests/test_hourly_opencode_nvidia_contract.py and should fail because protected-main still retains a repository-write publisher in .github/workflows/hourly-product-development.yml.

Modify only:

  • .github/workflows/hourly-product-development.yml
  • tests/test_hourly_opencode_nvidia_contract.py only when a narrowly necessary correction preserves the RED contract
  • docs/hourly-autonomous-maintenance.md
  • CHANGELOG.md

Required GREEN implementation:

  1. Preserve the read-only develop job, SHA-256-pinned OpenCode 1.18.13 installation, explicit nvidia/nemotron-3-super-120b-a12b model, NVIDIA_NIM_API_KEY to NVIDIA_API_KEY mapping, deny-by-default model tools, full REST pagination, immutable action pins, bounded patch capture, and secret-free offline reverify job.
  2. Remove the complete repository-local publish job and every related write/OIDC path, including id-token: write, PR_REVIEW_MERGE_TOKEN, OPENCODE_APPROVE_TOKEN, the OpenCode App token exchange, model-patch reapplication under a write identity, branch creation/push, gh pr create, and gh pr merge --auto.
  3. Remove now-unused reverify job outputs that imply publication. After the sealed patch digest is independently rechecked, upload only a short-lived handoff artifact named hourly-verified-product-change-${{ github.run_id }}-${{ github.run_attempt }} containing exactly the root-owned read-only egressweave.patch, base-sha, and patch-sha256. Use the already reviewed immutable actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a pin, if-no-files-found: error, and three-day retention. Do not add repository, pull-request, release, package, ref, OIDC, or attestation write permission.
  4. Keep the two zero-PR checks—before model execution and before reverification—fully paginated and exact-base-bound. Do not add a third publication gate.
  5. Rewrite operator guidance so the scheduler ends at a verified patch handoff and explicitly states that it does not create a branch, pull request, or auto-merge request. A later external credential-separated promotion mechanism must independently acquire the artifact, verify base SHA and patch digest, reconstruct and verify the exact tree, recheck repository state, and obtain independent approval before any repository write. Do not claim such a mechanism currently exists.
  6. Remove product-scheduler configuration requirements for repository write tokens or OIDC exchange. Preserve the organization-owned pull-request review workflow and its inherited credential contracts unchanged.
  7. Add one concise [Unreleased] Security entry. Do not bump the version.

Do not add a replacement publisher, contents-write job, branch push, ref movement, self-modifying workflow, conflict strategy, direct-main write, release path, or auto-merge. Do not modify dependencies, package code, other workflows, central review-agent identities, or files outside the four-path allowlist. Run the focused contract first, then the complete Python 3.10–3.13 suite, Ruff, compileall, public-docstring checks, 100% production statement and branch coverage, package acceptance, SAST, and Security Scan on the resulting exact head. Keep the PR draft. Do not merge, publish, release, or enable auto-merge. Stop without writing if the exact head has changed.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Exact head advanced through the bounded GREEN implementation and documentation to e0f8547ccb367ca40d4d5ae7ec2e60db53638cff. The earlier exact-head request is superseded.

On that exact head, modify only CHANGELOG.md. Under [Unreleased]Security, prepend one concise entry stating that the hourly product-development scheduler now ends at a credential-free, exact-base- and SHA-256-bound verified patch handoff; it no longer obtains repository-write/OIDC authority, reapplies a model patch under a write identity, pushes branches, opens pull requests, or queues auto-merge; and any future promotion must be external, independently reviewed, credential-separated, and reverify the exact tree before repository write. Preserve all existing changelog content and formatting. Do not change the version, date, any other file, branch history, workflow, code, tests, dependencies, or release state. Stop without writing if the head differs from e0f8547ccb367ca40d4d5ae7ec2e60db53638cff.

Copy link
Copy Markdown
Contributor Author

The exact current head is now 52994ae4f512682e03869a5b0874e62afacc2f40. The prior @opencode-agent requests are fully superseded; do not modify the branch from either stale request.

@coderabbitai review

Review only exact head 52994ae4f512682e03869a5b0874e62afacc2f40. Prior draft-skip notices and any analysis of earlier heads are non-authoritative. Focus on workflow permissions, absence of repository-write/OIDC/ref/PR/merge paths, exact-base and patch-digest binding, artifact contents and retention, full pagination, immutable action pins, shell/YAML correctness, external-promotion documentation, test contract, and CHANGELOG accuracy. Do not treat queued checks as successful and do not approve or merge.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

@seonghobae I will review pull request #66 at exact head 52994ae4f512682e03869a5b0874e62afacc2f40.

I will check the specified workflow security boundary, digest and base binding, artifact contract, pagination, action pins, shell and YAML correctness, documentation, tests, and changelog. I will not treat queued checks as successful. I will not approve or merge.

✅ 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 @.github/workflows/hourly-product-development.yml:
- Around line 416-420: apply_patch에 handoff metadata의 base SHA 검증을 추가하십시오. git
apply 전에 현재 HEAD, metadata의 base_sha, EXPECTED_BASE_SHA가 모두 일치하는지 확인하고, 불일치하면 즉시
종료하십시오. 검증을 통과한 동일한 base SHA만 결과 파일의 base_sha로 기록하십시오.

In `@tests/test_hourly_opencode_nvidia_contract.py`:
- Around line 100-122: Extend
test_product_scheduler_never_publishes_a_model_modified_tree to reject any
workflow write permission, not only contents: write, including pull-requests:
write and other *: write forms. Add explicit assertions covering rejection of
malformed base-sha values and acceptance of the verified handoff upload with
if-no-files-found set to error and a three-day retention period. Keep the
existing credential-free and artifact-path checks intact.
🪄 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: 35cca649-8a2a-4b01-9e61-538b4771415c

📥 Commits

Reviewing files that changed from the base of the PR and between 10d0c51 and 52994ae.

📒 Files selected for processing (4)
  • .github/workflows/hourly-product-development.yml
  • CHANGELOG.md
  • docs/hourly-autonomous-maintenance.md
  • tests/test_hourly_opencode_nvidia_contract.py

Comment thread .github/workflows/hourly-product-development.yml
Comment thread tests/test_hourly_opencode_nvidia_contract.py

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review only exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf. The prior review of 52994ae4f512682e03869a5b0874e62afacc2f40 is superseded after test-first fixes for both actionable findings. Verify the uploaded base-SHA metadata binding before patch application, post-apply result binding, rejection of every workflow *: write permission, immutable action pins, full pagination, three-day exact three-file handoff, YAML/shell correctness, and absence of repository-write/OIDC/ref/branch/PR/merge/release/package publication paths. Do not approve, merge, or treat prior-head checks as current.

@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 08:38
@seonghobae
seonghobae marked this pull request as draft August 6, 2026 08:38
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
if [ "$actual" != "$expected" ]; then
  echo 'ERROR: checked-out commit does not match the requested commit' >&2
  exit 2
fi

echo '--- changed files against PR base ---'
git diff --name-status 'origin/main...HEAD' || git diff --name-status 'HEAD^...HEAD'

echo '--- workflow outline ---'
ast-grep outline .github/workflows/hourly-product-development.yml --items all || true

echo '--- targeted workflow content ---'
nl -ba .github/workflows/hourly-product-development.yml | sed -n '1,520p'

echo '--- all workflow write permissions and publication-path terms ---'
rg -n -i -C 3 \
  '(permissions:|(^|[[:space:]])[A-Za-z_-]+:[[:space:]]*write\b|id-token:[[:space:]]*write|contents:[[:space:]]*write|pull-requests:[[:space:]]*write|actions:[[:space:]]*write|gh[[:space:]]+pr[[:space:]]+(create|merge)|git[[:space:]]+(push|checkout[[:space:]]+-b|switch[[:space:]]+-c|branch)|refs/heads|createRef|merge.*auto|release|packages|attest)' \
  .github/workflows

echo '--- contract test outline and relevant test content ---'
ast-grep outline tests/test_hourly_opencode_nvidia_contract.py --items all || true
rg -n -C 4 \
  '(publish|handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- operator documentation and changelog excerpts ---'
rg -n -C 4 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md

echo '--- action references ---'
rg -n 'uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' .github/workflows/hourly-product-development.yml

Length of output: 2568


🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
test "$(git rev-parse HEAD)" = "$expected"

echo '--- workflow with line numbers ---'
awk '{ printf "%6d  %s\n", NR, $0 }' .github/workflows/hourly-product-development.yml

echo '--- write permissions and publication-path terms across workflows ---'
rg -n -i -C 3 \
  '(permissions:|(^|[[:space:]])[A-Za-z_-]+:[[:space:]]*write\b|id-token:[[:space:]]*write|contents:[[:space:]]*write|pull-requests:[[:space:]]*write|actions:[[:space:]]*write|gh[[:space:]]+pr[[:space:]]+(create|merge)|git[[:space:]]+(push|checkout[[:space:]]+-b|switch[[:space:]]+-c|branch)|refs/heads|createRef|merge.*auto|release|packages|attest)' \
  .github/workflows || true

echo '--- exact model-workflow action pins ---'
rg -n 'uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' .github/workflows/hourly-product-development.yml

echo '--- contract-test targets with line numbers ---'
awk '
  /def test_.*(publish|handoff|base|patch|pagination|permission|artifact|reverify)/ {show=1}
  show { printf "%6d  %s\n", NR, $0 }
  show && /^def / && NR != start { }
' tests/test_hourly_opencode_nvidia_contract.py | sed -n '1,700p'

echo '--- all test assertions about workflow contract ---'
rg -n -C 5 \
  '(publish|handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|apply)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- operator documentation excerpts ---'
rg -n -i -C 5 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|artifact)' \
  docs/hourly-autonomous-maintenance.md

echo '--- changelog excerpts ---'
rg -n -i -C 5 \
  '(hourly|handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish)' \
  CHANGELOG.md

echo '--- focused diff at exact HEAD ---'
git diff --unified=80 'origin/main...HEAD' -- \
  .github/workflows/hourly-product-development.yml \
  tests/test_hourly_opencode_nvidia_contract.py \
  docs/hourly-autonomous-maintenance.md \
  CHANGELOG.md

Length of output: 150855


🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
test "$(git rev-parse HEAD)" = "$expected"

echo '--- guard implementation map ---'
ast-grep outline scripts/ci/hourly_product_guard.py --items all || true

echo '--- apply and result-identity implementation ---'
rg -n -C 12 \
  '(def .*apply|def .*result|base_sha|patch_sha256|git apply|write_text|result_file|json)' \
  scripts/ci/hourly_product_guard.py

echo '--- exact whitespace and YAML-related static checks ---'
git diff --check 'origin/main...HEAD'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(".github/workflows/hourly-product-development.yml"); puts "YAML parse: OK"'
elif command -v yq >/dev/null 2>&1; then
  yq '.' .github/workflows/hourly-product-development.yml >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parse: no parser available in sandbox'
fi

echo '--- all exact product-workflow forbidden tokens ---'
rg -n -i \
  '(id-token:[[:space:]]*write|[A-Za-z_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|exchange_github_app_token|git[[:space:]]+push|git[[:space:]]+switch[[:space:]]+-c|git[[:space:]]+checkout[[:space:]]+-b|gh[[:space:]]+pr[[:space:]]+(create|merge)|gh[[:space:]]+release|git/refs|refs/heads|packages:[[:space:]]*write|attestations:[[:space:]]*write)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- PR metadata and exact-head check state ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{
    number,
    isDraft,
    headRefOid,
    autoMergeRequest,
    mergeStateStatus,
    checks: [.statusCheckRollup[]? | {
      name: .name,
      status: .status,
      conclusion: .conclusion,
      workflowName: .workflowName
    }]
  }'

Length of output: 13121


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf.

I found no blocking issue in the requested boundary.

  • The product scheduler has no *: write permission, OIDC write permission, publisher job, write-token exchange, branch/ref path, push, PR creation, auto-merge, release, package, or attestation publication path.
  • The downloaded base-sha is checked against both the develop output and the fresh protected-main checkout before patch application.
  • The guard validates the applied result and emits its base SHA and patch SHA-256. The workflow checks the result base SHA, seals root-owned read-only metadata, and rehashes the sealed patch before upload.
  • The verified handoff upload contains only egressweave.patch, base-sha, and patch-sha256. It uses the requested immutable action pin, if-no-files-found: error, and retention-days: 3.
  • Both zero-PR gates use full REST pagination.
  • The action references are immutable SHA pins. YAML parsing and git diff --check completed without errors.
  • The documentation, test contract, and [Unreleased] Security entry match the external-only promotion model.

PR #66 remains a draft. Auto-merge is not configured. I did not approve or merge.

The strix security check is still IN_PROGRESS. I do not treat it as successful.

⚠️ 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 exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. The two prior actionable findings were implemented test-first on this unchanged head, their threads are resolved, and CI, SAST Semgrep, and Security Scan succeeded. Do not treat the earlier rate-limited attempt or the review of head 52994ae4f512682e03869a5b0874e62afacc2f40 as review completion for this head.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'

head_actual="$(git rev-parse HEAD)"
base_actual="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$base_actual" "$base_expected"

test "$head_actual" = "$head_expected"
test "$base_actual" = "$base_expected"

echo '--- changed files ---'
git diff --name-status "$base_expected...$head_expected"

echo '--- whitespace check ---'
git diff --check "$base_expected...$head_expected"

echo '--- workflow ---'
nl -ba .github/workflows/hourly-product-development.yml | sed -n '1,520p'

echo '--- workflow forbidden authority and publication terms ---'
rg -n -i -C 3 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|release|packages|attest)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- action references ---'
rg -n 'uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' \
  .github/workflows/hourly-product-development.yml

echo '--- relevant guard implementation ---'
ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
rg -n -C 10 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|write_text|sha256)' \
  scripts/ci/hourly_product_guard.py

echo '--- contract tests ---'
ast-grep outline tests/test_hourly_opencode_nvidia_contract.py --items all || true
rg -n -C 5 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- documentation and changelog ---'
rg -n -i -C 4 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md

echo '--- YAML parse ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(".github/workflows/hourly-product-development.yml"); puts "YAML parse: OK"'
else
  echo 'YAML parser unavailable'
fi

echo '--- pull request metadata and check state ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}'

Length of output: 3409


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- workflow ---'
numbered .github/workflows/hourly-product-development.yml

echo '--- workflow authority and publication terms ---'
rg -n -i -C 3 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|release|packages|attest)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- action references ---'
rg -n 'uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' \
  .github/workflows/hourly-product-development.yml

echo '--- guard implementation ---'
ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
rg -n -C 12 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|write_text|sha256)' \
  scripts/ci/hourly_product_guard.py

echo '--- contract tests ---'
rg -n -C 6 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- operator documentation and changelog ---'
rg -n -i -C 5 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md

echo '--- YAML parse ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(".github/workflows/hourly-product-development.yml"); puts "YAML parse: OK"'
elif command -v yq >/dev/null 2>&1; then
  yq '.' .github/workflows/hourly-product-development.yml >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR metadata and check state ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}'

Length of output: 73045


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • The product workflow has read-only permissions. It has no *: write permission, OIDC write permission, repository-write token exchange, publisher job, branch or ref operation, push, pull-request creation, auto-merge, release, package, or attestation publication path.
  • Both zero-open-PR gates paginate all REST response pages.
  • The reverifier validates the downloaded base-sha against the development output and fresh main checkout before patch application.
  • The guard validates the applied result. The workflow checks the resulting base SHA, seals the patch and metadata as root-owned read-only files, and rechecks the sealed patch SHA-256.
  • The final handoff has exactly the three required files: egressweave.patch, base-sha, and patch-sha256. It uses the required immutable actions/upload-artifact pin, if-no-files-found: error, and retention-days: 3.
  • Product-workflow actions use immutable commit SHA pins.
  • YAML parsing and git diff --check completed without errors.
  • The contract tests, operator documentation, and [Unreleased] Security entry describe the external, independently reviewed, credential-separated promotion boundary.

PR #66 remains a draft. Auto-merge is not configured. I did not approve or merge the pull request.

The strix check is still IN_PROGRESS. I do not treat that check as successful.

⚠️ 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 exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. The two actionable findings on earlier head 52994ae4f512682e03869a5b0874e62afacc2f40 were fixed test-first and their threads are resolved. CI, SAST Semgrep, and Security Scan have completed successfully on the exact current head. Verify the base-SHA handoff binding, rejection of every workflow write permission, three-day fail-closed artifact handoff, complete removal of repository-write/OIDC/push/PR/auto-merge paths, immutable OpenCode/NVIDIA model boundary, full pagination, and external credential-separated promotion contract. Do not approve, merge, publish, release, rebase, retarget, or enable auto-merge.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

@seonghobae I will review PR #66 at head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I will verify the handoff binding, permissions, artifact contract, publication-path removal, action pins, pagination, model boundary, and external-promotion documentation. I will not approve, merge, publish, release, rebase, retarget, or enable auto-merge.

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

Perform a complete review of exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact protected-main base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. Earlier review output covered predecessor head 52994ae4f512682e03869a5b0874e62afacc2f40 and the subsequent rate-limited incremental attempt is incomplete, not review success.

Focus on the final repository-local trust boundary: no *: write workflow permission, OIDC exchange, repository-local publisher, model-patch reapplication under a write identity, branch/PR creation, auto-merge request, or ref movement; exact handoff base binding before patch application; full paginated zero-PR gates; immutable OpenCode/action pins; NVIDIA_NIM_API_KEY credential contract; bounded credential-free handoff and re-verification; and documentation/test accuracy. Do not approve, merge, mark ready, publish, or infer success from green CI.

@coderabbitai

coderabbitai Bot commented Aug 6, 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_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'

head_actual="$(git rev-parse HEAD)"
base_actual="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$base_actual" "$base_expected"
test "$head_actual" = "$head_expected"
test "$base_actual" = "$base_expected"

echo '--- changed files ---'
git diff --name-status "$base_expected...$head_expected"
echo '--- diff check ---'
git diff --check "$base_expected...$head_expected"

echo '--- workflow ---'
nl -ba .github/workflows/hourly-product-development.yml

echo '--- workflow action pins ---'
rg -n '^\s*uses:\s*[^[:space:]#]+@[^[:space:]#]+' \
  .github/workflows/hourly-product-development.yml

echo '--- workflow authority and publication markers ---'
rg -n -i -C 4 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- guard module outline ---'
ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
echo '--- guard module handoff/apply logic ---'
rg -n -C 12 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown)' \
  scripts/ci/hourly_product_guard.py

echo '--- contract tests ---'
rg -n -C 6 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- documentation and changelog ---'
rg -n -i -C 5 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|NVIDIA)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(".github/workflows/hourly-product-development.yml"); puts "YAML parse: OK"'
elif command -v yq >/dev/null 2>&1; then
  yq '.' .github/workflows/hourly-product-development.yml >/dev/null
  echo 'YAML parse: OK'
else
  echo 'No YAML parser is available'
fi

echo '--- PR metadata and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}'

Length of output: 3542


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

show_numbered() {
  file="$1"
  echo "--- $file ---"
  sed = "$file" | sed 'N;s/\n/\t/'
}

show_numbered .github/workflows/hourly-product-development.yml

echo '--- workflow action pins ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' \
  .github/workflows/hourly-product-development.yml || true

echo '--- workflow authority and publication markers ---'
rg -n -i -C 4 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- workflow handoff, base, digest, pagination, and model markers ---'
rg -n -C 6 \
  '(base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|Link:.*rel="next"|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|git apply|reverify)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- guard module outline ---'
if command -v ast-grep >/dev/null 2>&1; then
  ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
fi
echo '--- guard module handoff and apply logic ---'
rg -n -C 12 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown)' \
  scripts/ci/hourly_product_guard.py || true

echo '--- contract tests ---'
rg -n -C 6 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA)' \
  tests/test_hourly_opencode_nvidia_contract.py || true

echo '--- documentation and changelog ---'
rg -n -i -C 5 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|NVIDIA)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md || true

echo '--- relevant diff ---'
git diff --unified=35 "$base_expected...$head_expected" -- \
  .github/workflows/hourly-product-development.yml \
  tests/test_hourly_opencode_nvidia_contract.py \
  docs/hourly-autonomous-maintenance.md \
  CHANGELOG.md

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(".github/workflows/hourly-product-development.yml"); puts "YAML parse: OK"'
elif command -v yq >/dev/null 2>&1; then
  yq '.' .github/workflows/hourly-product-development.yml >/dev/null
  echo 'YAML parse: OK'
else
  echo 'No YAML parser is available'
fi

echo '--- PR metadata and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 147261


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • The product workflow has no *: write permission or OIDC write permission.
  • The workflow has no publisher job, write-token exchange, branch or ref operation, push, pull-request creation, auto-merge, release, package, or attestation publication path.
  • The develop and reverify jobs use read-only permissions.
  • Both zero-open-PR gates paginate and aggregate all REST response pages.
  • Before patch application, the reverifier compares the downloaded base-sha, the develop output, and the fresh main checkout.
  • The guard validates the patch, applies it to the fresh checkout, and records the result base SHA and patch SHA-256.
  • The workflow rejects a result base SHA that differs from the expected base.
  • The workflow seals egressweave.patch, base-sha, and patch-sha256 as root-owned read-only files.
  • The workflow rehashes the sealed patch before upload.
  • The final artifact includes exactly those three files. It uses the required immutable actions/upload-artifact pin, if-no-files-found: error, and retention-days: 3.
  • The OpenCode boundary remains pinned to version 1.18.13 and its specified SHA-256. It uses nvidia/nemotron-3-super-120b-a12b and maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY.
  • Product-workflow action references are immutable commit SHA pins.
  • YAML parsing and git diff --check completed without errors.
  • The contract tests and operator documentation describe the external, independently reviewed, credential-separated promotion requirement. The changelog entry matches the implementation.

PR #66 remains a draft. Auto-merge is not configured. I did not approve, merge, mark ready, publish, release, rebase, retarget, or modify the pull request.

The returned PR check state shows no queued or in-progress checks. This review conclusion is based on the inspected repository content, not on CI status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. The two actionable findings from head 52994ae4f512682e03869a5b0874e62afacc2f40 were implemented test-first and their threads are resolved; prior rate-limited output is not exact-head review success. Recheck full REST pagination at both zero-open-PR gates, lowercase 40-character base binding, patch digest binding, credential-free offline reverification, before/after exact-tree checks, three-day fail-closed handoff, rejection of every workflow *: write permission, pinned OpenCode/NVIDIA model contract, and complete removal of repository-local push/PR/merge/release authority. Confirm docs and CHANGELOG match, and no model-modified tree executes under a write credential. Do not approve, merge, rebase, retarget, mark ready, publish, release, or infer success from existing CI alone.

@coderabbitai

coderabbitai Bot commented Aug 6, 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_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'

head_actual="$(git rev-parse HEAD)"
merge_base="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$merge_base" "$base_expected"

test "$head_actual" = "$head_expected"
test "$merge_base" = "$base_expected"

echo '--- changed files ---'
git diff --name-status "$base_expected...$head_expected"

echo '--- diff whitespace errors ---'
git diff --check "$base_expected...$head_expected"

echo '--- product workflow ---'
nl -ba .github/workflows/hourly-product-development.yml

echo '--- product workflow action references ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' \
  .github/workflows/hourly-product-development.yml

echo '--- product workflow authority/publication markers ---'
rg -n -i -C 4 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- product workflow handoff, pagination, model, and verifier markers ---'
rg -n -C 8 \
  '(base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|Link:.*rel="next"|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|git apply|sha256sum|chmod|chown)' \
  .github/workflows/hourly-product-development.yml

echo '--- verifier guard outline ---'
ast-grep outline scripts/ci/hourly_product_guard.py --items all || true

echo '--- verifier guard base/digest/result logic ---'
rg -n -C 14 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff)' \
  scripts/ci/hourly_product_guard.py

echo '--- workflow contract test assertions ---'
rg -n -C 8 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- operator documentation and changelog ---'
rg -n -i -C 6 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|NVIDIA|write)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md

echo '--- relevant diff ---'
git diff --unified=50 "$base_expected...$head_expected" -- \
  .github/workflows/hourly-product-development.yml \
  scripts/ci/hourly_product_guard.py \
  tests/test_hourly_opencode_nvidia_contract.py \
  docs/hourly-autonomous-maintenance.md \
  CHANGELOG.md

echo '--- pull request metadata and current check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}'

Length of output: 3998


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- product workflow ---'
numbered .github/workflows/hourly-product-development.yml

echo '--- product workflow action references ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' \
  .github/workflows/hourly-product-development.yml || true

echo '--- product workflow authority/publication markers ---'
rg -n -i -C 4 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- product workflow handoff, pagination, model, and verifier markers ---'
rg -n -C 8 \
  '(base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|Link:.*rel="next"|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|git apply|sha256sum|chmod|chown)' \
  .github/workflows/hourly-product-development.yml || true

echo '--- verifier guard outline ---'
if command -v ast-grep >/dev/null 2>&1; then
  ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
fi

echo '--- verifier guard base/digest/result logic ---'
rg -n -C 14 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff)' \
  scripts/ci/hourly_product_guard.py || true

echo '--- workflow contract test assertions ---'
rg -n -C 8 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode)' \
  tests/test_hourly_opencode_nvidia_contract.py || true

echo '--- operator documentation and changelog ---'
rg -n -i -C 6 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|NVIDIA|write)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md || true

echo '--- relevant diff ---'
git diff --unified=50 "$base_expected...$head_expected" -- \
  .github/workflows/hourly-product-development.yml \
  scripts/ci/hourly_product_guard.py \
  tests/test_hourly_opencode_nvidia_contract.py \
  docs/hourly-autonomous-maintenance.md \
  CHANGELOG.md

echo '--- pull request metadata and current check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 169582


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

workflow='.github/workflows/hourly-product-development.yml'

echo '--- YAML parse ---'
if command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- immutable action pin format ---'
awk '
  /^[[:space:]]*uses:[[:space:]]*/ {
    ref=$0
    sub(/^[[:space:]]*uses:[[:space:]]*/, "", ref)
    sub(/[[:space:]#].*$/, "", ref)
    split(ref, parts, "@")
    sha=parts[2]
    if (sha !~ /^[0-9a-f]{40}$/) {
      print "INVALID_ACTION_PIN: " ref
      invalid=1
    }
  }
  END {
    if (!invalid) print "All action references use lowercase 40-character SHA pins."
    exit invalid
  }
' "$workflow"

echo '--- declared workflow permission values ---'
awk '
  /^[[:space:]]*permissions:[[:space:]]*$/ { in_permissions=1; next }
  in_permissions && /^[[:space:]]{0,6}[A-Za-z][A-Za-z-]*:[[:space:]]*(read|write|none)[[:space:]]*$/ {
    print NR ": " $0
    next
  }
  in_permissions && /^[^[:space:]]/ { in_permissions=0 }
' "$workflow"

Length of output: 1766


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • The product workflow declares only read permissions. It contains no *: write permission.
  • The workflow contains no repository-local publisher, OIDC write permission or exchange, write-token path, branch or ref mutation, push, pull-request creation, auto-merge, release, package, or attestation publication path.
  • Both zero-open-PR gates use --paginate --slurp and aggregate every REST response page.
  • Before patch application, the workflow requires lowercase 40-character EXPECTED_BASE_SHA and downloaded base-sha values. It compares both values with the fresh protected-main checkout.
  • The trusted guard validates the untrusted patch before git apply. It revalidates the materialized diff after application. It emits the resulting base SHA and patch SHA-256.
  • The workflow rejects a result base SHA that differs from the expected base. It seals the patch and metadata as root-owned read-only files. It rehashes the sealed patch before upload.
  • The verified handoff contains exactly egressweave.patch, base-sha, and patch-sha256. It uses the required immutable actions/upload-artifact pin, if-no-files-found: error, and retention-days: 3.
  • All product-workflow action references use lowercase 40-character SHA pins.
  • The OpenCode boundary remains pinned to version 1.18.13 and its specified SHA-256. It uses nvidia/nemotron-3-super-120b-a12b and maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY.
  • The model job does not execute model-modified repository code while the NVIDIA credential is available. The offline verifier runs the modified tree without secrets.
  • The operator documentation and [Unreleased] Security entry describe the external, independently reviewed, credential-separated promotion requirement. They do not claim that a promotion mechanism exists.
  • git diff --check found no whitespace errors.

The YAML parser was unavailable in the sandbox. I could not independently parse the YAML syntax. The inspected YAML structure is consistent with the workflow contract.

PR #66 remains a draft. Auto-merge is not configured. I did not approve, merge, rebase, retarget, mark ready, publish, or release.

The observed check records have no queued or in-progress status. Some duplicate check records are SKIPPED. I did not treat those records as successful. This review conclusion is based on static repository inspection, not CI status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review only exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. The earlier rate-limited attempt is not review success. Verify the repository-local publisher, repository-write/OIDC authority, write-permission paths, model-patch reapplication under credentials, branch push, PR creation, and auto-merge request are absent; the SHA-256-pinned OpenCode/NVIDIA credential contract, full pagination, zero-open-PR gates, offline credential-free exact-tree reverification, and three-file handoff remain intact; all workflow write permissions are rejected; documentation and [Unreleased] accurately describe external credential-separated promotion; and no unrelated dependency, signing, release, publication, or protected-ref behavior changed. Do not approve, merge, mark ready, enable auto-merge, release, or publish.

@coderabbitai

coderabbitai Bot commented Aug 6, 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_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'

head_actual="$(git rev-parse HEAD)"
merge_base="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$merge_base" "$base_expected"
test "$head_actual" = "$head_expected"
test "$merge_base" = "$base_expected"

echo '--- changed files ---'
git diff --name-status "$base_expected...$head_expected"
echo '--- whitespace ---'
git diff --check "$base_expected...$head_expected"

echo '--- workflow ---'
nl -ba "$workflow"

echo '--- action pins and pin validation ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' "$workflow"
python3 - "$workflow" <<'PY'
import re, sys
text = open(sys.argv[1], encoding='utf-8').read().splitlines()
bad = []
for number, line in enumerate(text, 1):
    match = re.match(r'\s*uses:\s*([^#\s]+)', line)
    if match:
        ref = match.group(1)
        if not re.search(r'@[0-9a-f]{40}$', ref):
            bad.append(f'{number}: {ref}')
if bad:
    print('INVALID_ACTION_PINS')
    print('\n'.join(bad))
    raise SystemExit(1)
print('All action references use lowercase 40-character SHA pins.')
PY

echo '--- workflow authority and publication markers ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  "$workflow" || true

echo '--- workflow boundary, handoff, pagination, and model markers ---'
rg -n -C 8 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply)' \
  "$workflow"

echo '--- verifier structure and identity checks ---'
ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
rg -n -C 12 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff)' \
  scripts/ci/hourly_product_guard.py

echo '--- contract tests ---'
rg -n -C 7 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode)' \
  tests/test_hourly_opencode_nvidia_contract.py

echo '--- documentation and changelog ---'
rg -n -i -C 6 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR metadata and current checks ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 4279


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'

test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

show_numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- product workflow ---'
show_numbered "$workflow"

echo '--- product-workflow action pins ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' "$workflow" || true
python3 - "$workflow" <<'PY'
import re, sys
invalid = []
for n, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    m = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if m and not re.search(r"@[0-9a-f]{40}$", m.group(1)):
        invalid.append(f"{n}: {m.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS\n" + "\n".join(invalid))
    raise SystemExit(1)
print("All action references use lowercase 40-character SHA pins.")
PY

echo '--- authority and publication markers ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  "$workflow" || true

echo '--- handoff, binding, pagination, model, and isolation markers ---'
rg -n -C 9 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA)' \
  "$workflow" || true

echo '--- verifier implementation ---'
if command -v ast-grep >/dev/null 2>&1; then
  ast-grep outline scripts/ci/hourly_product_guard.py --items all || true
fi
rg -n -C 14 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff)' \
  scripts/ci/hourly_product_guard.py || true

echo '--- contract tests ---'
rg -n -C 8 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode)' \
  tests/test_hourly_opencode_nvidia_contract.py || true

echo '--- documentation and changelog ---'
rg -n -i -C 7 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write)' \
  docs/hourly-autonomous-maintenance.md CHANGELOG.md || true

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR metadata and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 111089


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • git diff --check found no whitespace errors.
  • The workflow YAML parses successfully.
  • All product-workflow actions use lowercase 40-character commit SHA pins.

The workflow has only read permissions. It has no *: write permission or id-token: write permission.

The workflow has no repository-local publisher job. It has no GitHub App token exchange. It has no repository-write token path. It has no branch or ref mutation, push, pull-request creation, auto-merge, package publication, release, or attestation publication path.

The model step uses OpenCode 1.18.13. It verifies the specified SHA-256 before installation. It uses nvidia/nemotron-3-super-120b-a12b. It maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY.

The model tool policy is deny-by-default. The credential-bearing job does not execute model-modified repository code. The separate reverification job has no model credential.

Both zero-open-PR gates use gh api --paginate --slurp and aggregate all REST response pages.

Before patch application, the reverifier requires lowercase 40-character values for EXPECTED_BASE_SHA and the downloaded base-sha. It compares both values with the fresh main checkout.

The trusted guard validates patch metadata before git apply. It revalidates the resulting materialized diff after application. The workflow rejects a guard result whose base SHA differs from EXPECTED_BASE_SHA.

The workflow seals the patch, base SHA, and patch SHA-256 in root-owned read-only files. It rehashes the sealed patch after offline verification.

The final artifact contains exactly:

egressweave.patch
base-sha
patch-sha256

The final artifact uses the required actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a pin. It fails when files are missing. Its retention is three days.

The documentation states that the scheduler does not create a branch, pull request, or auto-merge request. It requires any future promotion mechanism to be external, independently reviewed, credential-separated, and to reconstruct and verify the exact tree before a repository write. It does not claim that such a mechanism exists.

The [Unreleased] Security entry matches this boundary.

PR #66 remains a draft. autoMergeRequest is null. I did not approve, merge, mark ready, enable auto-merge, publish, or release.

The observed check records have no queued or in-progress status. I did not treat SKIPPED records as successful evidence.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review only exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. The earlier review on 52994ae4f512682e03869a5b0874e62afacc2f40, its two now-resolved findings, and the rate-limited incremental attempt are not exact-head review success. Focus on the complete removal of repository-write/OIDC/ref/branch/PR/merge paths; live base-SHA, uploaded metadata, workflow output, and guard-result agreement before and after patch application; exact three-file handoff contents; full REST pagination; immutable action and OpenCode pins; deny-by-default model tools; shell/YAML correctness; rejection of every workflow *: write permission; external credential-separated promotion boundary; tests and CHANGELOG accuracy. Do not approve, merge, mark ready, rebase, retarget, release, publish, or infer success from queued checks.

@coderabbitai

coderabbitai Bot commented Aug 6, 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_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

head_actual="$(git rev-parse HEAD)"
merge_base="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$merge_base" "$base_expected"
test "$head_actual" = "$head_expected"
test "$merge_base" = "$base_expected"

echo '--- changed files ---'
git diff --name-status "$base_expected...$head_expected"
echo '--- whitespace errors ---'
git diff --check "$base_expected...$head_expected"

echo '--- workflow with line numbers ---'
nl -ba "$workflow"

echo '--- workflow action pins ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' "$workflow" || true
python3 - "$workflow" <<'PY'
import re
import sys
invalid = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        invalid.append(f"{number}: {match.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS")
    print("\n".join(invalid))
    raise SystemExit(1)
print("All action references use lowercase 40-character SHA pins.")
PY

echo '--- workflow write authority and publication paths ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  "$workflow" || true

echo '--- workflow handoff, base binding, pagination, model, and isolation ---'
rg -n -C 10 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|pull-requests)' \
  "$workflow" || true

echo '--- guard outline ---'
if command -v ast-grep >/dev/null 2>&1; then
  ast-grep outline "$guard" --items all || true
fi
echo '--- guard base, patch, and result logic ---'
rg -n -C 16 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- contract assertions ---'
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential)' \
  "$contract" || true

echo '--- documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write)' \
  "$docs" "$changelog" || true

echo '--- relevant diff ---'
git diff --unified=45 "$base_expected...$head_expected" -- \
  "$workflow" "$contract" "$docs" "$changelog" "$guard"

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- pull request state and checks ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 4678


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- workflow with line numbers ---'
numbered "$workflow"

echo '--- action pins ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' "$workflow" || true
python3 - "$workflow" <<'PY'
import re
import sys
invalid = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        invalid.append(f"{number}: {match.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS")
    print("\n".join(invalid))
    raise SystemExit(1)
print("All action references use lowercase 40-character SHA pins.")
PY

echo '--- write authority and publication paths ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest)' \
  "$workflow" || true

echo '--- handoff, binding, pagination, model, and isolation ---'
rg -n -C 10 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|pull-requests)' \
  "$workflow" || true

echo '--- guard outline ---'
if command -v ast-grep >/dev/null 2>&1; then
  ast-grep outline "$guard" --items all || true
fi
echo '--- guard base, patch, and result logic ---'
rg -n -C 16 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- contract assertions ---'
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential)' \
  "$contract" || true

echo '--- documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write)' \
  "$docs" "$changelog" || true

echo '--- relevant diff ---'
git diff --unified=45 "$base_expected...$head_expected" -- \
  "$workflow" "$contract" "$docs" "$changelog" "$guard"

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- pull request state and checks ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 175525


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • git diff --check found no whitespace errors.
  • The workflow YAML parses successfully.
  • All workflow action references use lowercase 40-character commit SHA pins.

The workflow declares only read permissions. It has no *: write permission and no id-token: write permission.

The workflow has no repository-local publisher job. It has no repository-write token exchange. It has no branch or ref mutation, push, pull-request creation, auto-merge, package publication, release, or attestation publication path.

Both zero-open-PR gates use gh api --paginate --slurp. Each gate aggregates every REST response page.

Before patch application, the reverifier requires lowercase 40-character values for both the develop output and the downloaded base-sha. It compares both values with the fresh main checkout.

The trusted guard validates patch metadata before git apply. It validates the materialized diff after patch application. It emits the result base SHA and patch SHA-256. The workflow rejects a result base SHA that differs from EXPECTED_BASE_SHA.

The workflow seals these root-owned read-only files:

egressweave.patch
base-sha
patch-sha256

The workflow rehashes the sealed patch before upload. The final artifact includes only these three files. It uses actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a, if-no-files-found: error, and retention-days: 3.

The OpenCode boundary remains pinned to version 1.18.13 and the specified SHA-256. It uses nvidia/nemotron-3-super-120b-a12b. It maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY. The tool policy is deny-by-default. The credential-bearing job does not execute model-modified repository code. The offline reverifier has no model credential.

The documentation and the [Unreleased] Security entry state that the scheduler ends at a verified handoff. They require any future promotion mechanism to be external, independently reviewed, credential-separated, and to reconstruct and verify the exact tree before a repository write. They do not claim that such a mechanism exists.

PR #66 remains a draft. autoMergeRequest is null. I did not approve, merge, mark ready, rebase, retarget, release, publish, or modify the pull request.

The returned check records contain no queued or in-progress checks. Some records are SKIPPED. I did not treat skipped checks as successful evidence.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Review only exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d; do not modify the branch.

Independently verify that the hourly product-development scheduler has no repository-write, OIDC, ref, branch push, PR creation, merge, release, package, signing, attestation, or publication authority; that the untrusted patch is bound to a validated lowercase 40-character uploaded base SHA and SHA-256; that checkout HEAD, workflow output, handoff metadata, and guard result agree before and after application; that only egressweave.patch, base-sha, and patch-sha256 enter the three-day handoff; that both zero-open-PR gates paginate fully; and that immutable pins, deny-by-default model tools, external credential-separated promotion guidance, tests, and CHANGELOG remain accurate.

Exact-head CI 31085490700, SAST 31085490075, and Security Scan 31085490120 succeeded. The two CodeRabbit findings on earlier head 52994ae4f512682e03869a5b0874e62afacc2f40 were implemented test-first and their threads are resolved; do not treat that earlier review or a rate-limited incremental attempt as exact-head review success. Submit a current-head review outcome only after independently checking the exact tree and evidence. Keep the PR draft; do not merge, enable auto-merge, release, publish, rebase, or retarget.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review exact current head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf. The two earlier actionable findings were addressed test-first and their threads resolved. Treat the prior review of 52994ae4f512682e03869a5b0874e62afacc2f40 as stale except where a finding remains reproducible on this exact tree. Verify the complete removal of repository-local write/OIDC/publish authority, exact base-SHA handoff binding, rejection of every workflow *: write permission, three-day verified artifact semantics, and preservation of the pinned NVIDIA/OpenCode and credential-free reverification contracts. Do not report success for another head.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Perform a read-only exact-head review of f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf for PR #66. Do not modify files or refs.

Verify that the repository-local publisher, repository-write and OIDC authority, app-token exchange, model-patch reapplication under write identity, branch push, PR creation, and auto-merge request are fully removed; every workflow *: write permission is rejected; the handoff is exact-base-SHA and digest bound with three-day retention and fail-on-missing upload; NVIDIA/OpenCode pinning, existing review-agent credentials, full zero-PR pagination, read-only model execution, and offline credential-free reverification remain intact. Anchor any formal outcome to this exact head. Do not merge, mark ready, rebase, retarget, release, publish, or change branch state.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

head_actual="$(git rev-parse HEAD)"
merge_base="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$merge_base" "$base_expected"
test "$head_actual" = "$head_expected"
test "$merge_base" = "$base_expected"

echo '--- changed files and whitespace ---'
git diff --name-status "$base_expected...$head_expected"
git diff --check "$base_expected...$head_expected"

echo '--- workflow (numbered) ---'
nl -ba "$workflow"

echo '--- immutable action pin validation ---'
python3 - "$workflow" <<'PY'
import re
import sys
invalid = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        invalid.append(f"{number}: {match.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS")
    print("\n".join(invalid))
    raise SystemExit(1)
print("All action references use lowercase 40-character commit SHA pins.")
PY

echo '--- workflow write authority and publication paths ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest|cosign|sign)' \
  "$workflow" || true

echo '--- workflow handoff, binding, pagination, model, and isolation ---'
rg -n -C 12 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|pull-requests)' \
  "$workflow" || true

echo '--- guard structure and identity checks ---'
ast-grep outline "$guard" --items all || true
rg -n -C 14 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- workflow contract tests ---'
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential)' \
  "$contract" || true

echo '--- operator documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write)' \
  "$docs" "$changelog" || true

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR state and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 4355


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- workflow (numbered) ---'
numbered "$workflow"

echo '--- immutable action pin validation ---'
awk '
  /^[[:space:]]*uses:[[:space:]]*/ {
    reference=$0
    sub(/^[[:space:]]*uses:[[:space:]]*/, "", reference)
    sub(/[[:space:]#].*$/, "", reference)
    if (reference !~ /@[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/) {
      print "INVALID_ACTION_PIN at line " NR ": " reference
      invalid=1
    }
  }
  END {
    if (!invalid) print "All action references use lowercase 40-character commit SHA pins."
    exit invalid
  }
' "$workflow"

echo '--- workflow write authority and publication paths ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest|cosign|sign)' \
  "$workflow" || true

echo '--- workflow handoff, binding, pagination, model, and isolation ---'
rg -n -C 12 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|pull-requests)' \
  "$workflow" || true

echo '--- guard structure and identity checks ---'
ast-grep outline "$guard" --items all || true
rg -n -C 14 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- workflow contract tests ---'
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential)' \
  "$contract" || true

echo '--- operator documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write)' \
  "$docs" "$changelog" || true

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR state and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 115755


@seonghobae Review completed for exact head f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf.

I verified that the merge base is 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. I did not use results from another head.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • The workflow YAML parses successfully.
  • git diff --check found no whitespace errors.
  • All workflow action references use lowercase 40-character commit SHA pins.
  • The workflow declares only read permissions. It contains no *: write permission and no id-token: write permission.
  • The workflow has no repository-local publisher, GitHub App token exchange, repository-write credential path, branch or ref mutation, push, pull-request creation, auto-merge, release, package, signing, or attestation publication path.
  • Both zero-open-PR gates use gh api --paginate --slurp and aggregate every REST response page.
  • Before patch application, the reverifier requires lowercase 40-character EXPECTED_BASE_SHA and uploaded base-sha values. It checks both values against the fresh main checkout.
  • The trusted guard validates patch metadata before git apply. It validates the materialized diff after patch application. It emits the resulting base SHA and patch SHA-256.
  • The workflow rejects a guard result whose base SHA differs from EXPECTED_BASE_SHA.
  • The workflow seals and rechecks only egressweave.patch, base-sha, and patch-sha256.
  • The final handoff uses the required immutable actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a pin. It uses if-no-files-found: error and retention-days: 3.
  • The OpenCode boundary remains pinned to version 1.18.13 and the declared SHA-256. It uses nvidia/nemotron-3-super-120b-a12b and maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY.
  • The model tool policy is deny-by-default. The credential-bearing job does not execute model-modified repository code. The offline reverifier has no model credential.
  • The contract tests, operator documentation, and [Unreleased] Security entry match the external, independently reviewed, credential-separated promotion boundary.

Pull request #66 remains a draft. autoMergeRequest is null. I did not approve, merge, mark ready, publish, release, rebase, or retarget the pull request.

The returned check records have no queued or in-progress status. Some records are SKIPPED. I did not treat skipped records as successful evidence.

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

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)

441-445: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

봉인된 base-shaEXPECTED_BASE_SHA와 다시 비교하십시오.

현재 검사는 base-sha의 형식만 확인합니다. 다른 유효한 40자리 SHA도 최종 handoff에 포함될 수 있습니다. 이 단계에 EXPECTED_BASE_SHA를 전달하고, base_sha != EXPECTED_BASE_SHA이면 실패하십시오. 그러면 최종 아티팩트도 적용 전후에 검증한 정확한 기준 트리에 결속됩니다.

수정 예시
       - name: Recheck the independently verified immutable patch
         if: steps.gate.outputs.verify == 'true'
+        env:
+          EXPECTED_BASE_SHA: ${{ needs.develop.outputs.base_sha }}
         run: |
           set -euo pipefail
           sealed_dir="/opt/egressweave-reverify"
           observed="$(sha256sum "$sealed_dir/egressweave.patch" | awk '{print $1}')"
           expected="$(cat "$sealed_dir/patch-sha256")"
           if [ "$observed" != "$expected" ]; then
             echo "::error::The sealed patch changed during independent verification."
             exit 1
           fi
           base_sha="$(cat "$sealed_dir/base-sha")"
-          if [[ ! "$base_sha" =~ ^[0-9a-f]{40}$ ]]; then
-            echo "::error::The sealed base SHA is missing or malformed."
+          if [[ ! "$base_sha" =~ ^[0-9a-f]{40}$ ]] || \
+             [ "$base_sha" != "$EXPECTED_BASE_SHA" ]; then
+            echo "::error::The sealed base SHA does not match the exact handoff base."
             exit 1
           fi
🤖 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 441 - 445,
Update the sealed base SHA validation near base_sha to also compare it with
EXPECTED_BASE_SHA, failing the workflow when the values differ while retaining
the existing 40-character format check. Ensure EXPECTED_BASE_SHA is available to
this handoff step so the final artifact remains bound to the previously
validated base tree.
🤖 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.

Outside diff comments:
In @.github/workflows/hourly-product-development.yml:
- Around line 441-445: Update the sealed base SHA validation near base_sha to
also compare it with EXPECTED_BASE_SHA, failing the workflow when the values
differ while retaining the existing 40-character format check. Ensure
EXPECTED_BASE_SHA is available to this handoff step so the final artifact
remains bound to the previously validated base tree.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ce023ee2-3549-4a3a-80b5-46512be664a5

📥 Commits

Reviewing files that changed from the base of the PR and between 52994ae and f6df03c.

📒 Files selected for processing (2)
  • .github/workflows/hourly-product-development.yml
  • tests/test_hourly_opencode_nvidia_contract.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_hourly_opencode_nvidia_contract.py

Copy link
Copy Markdown
Contributor Author

@opencode-agent Implement the minimal GREEN repair on exact current test-only RED head 2dc5a8a5d05a977244e8f06157ccf12ad65c604e of branch security/remove-autonomous-write-publisher.

The immutable RED commit is valid. CI run 31106746733 passed package acceptance and Ruff, while every Python 3.10–3.13 lane failed only in test_product_scheduler_never_publishes_a_model_modified_tree because the final Recheck the independently verified immutable patch step lacks the exact-base binding (1 failed, 740 passed on Python 3.13). SAST 31106748228 and Security Scan 31106746211 succeeded.

Modify only .github/workflows/hourly-product-development.yml.

In the step named Recheck the independently verified immutable patch:

  1. Add step-level env: with EXPECTED_BASE_SHA: ${{ needs.develop.outputs.base_sha }}.
  2. Preserve the current SHA-256 recheck of egressweave.patch and the lowercase 40-character format validation of base-sha.
  3. Before the handoff upload, fail closed unless the sealed base_sha equals EXPECTED_BASE_SHA. Use the stable non-leaking error text The sealed base SHA does not match the exact handoff base. for a format or equality failure, so the final artifact cannot carry another syntactically valid SHA.
  4. Do not alter any other step, permission, action pin, output, artifact name/path/retention, pagination, model boundary, credential, test, documentation, CHANGELOG, dependency, branch/ref, release, publication, signing, attestation, or network behavior.

Run the focused contract first, then the full Python 3.10–3.13 suite, Ruff, compileall, product-guard self-test, 100% production statement/branch coverage, package acceptance, SAST, and Security Scan on the resulting exact head. Keep the PR draft. Stop without writing if the head differs from 2dc5a8a5d05a977244e8f06157ccf12ad65c604e. Do not rebase, retarget, merge, mark ready, enable auto-merge, release, or publish.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Apply the bounded GREEN implementation to exact current RED head 2dc5a8a5d05a977244e8f06157ccf12ad65c604e on branch security/remove-autonomous-write-publisher. Stop without writing if that is no longer the exact head.

Modify only .github/workflows/hourly-product-development.yml; the exact focused regression is already committed in tests/test_hourly_opencode_nvidia_contract.py.

In the Recheck the independently verified immutable patch step:

  1. Add step-scoped EXPECTED_BASE_SHA: ${{ needs.develop.outputs.base_sha }}.
  2. Retain the lowercase 40-character format check and additionally fail when the sealed base-sha is not exactly EXPECTED_BASE_SHA.
  3. Use a stable message stating that the sealed base SHA does not match the exact handoff base.
  4. Do not rewrite base-sha; the uploaded handoff must remain the same root-owned read-only file produced from the previously verified exact base.

Preserve the immutable patch digest recheck, exact checkout/handoff/result binding, full pagination, read-only NVIDIA/OpenCode execution, offline credential-free verifier, three-day fail-on-missing artifact upload, deny-all workflow write permissions, and the absence of publisher, OIDC, app-token, push, PR creation, merge, release, tag, or publication behavior.

Run the focused workflow contract test and full repository checks on the resulting exact head. Do not modify tests, docs, CHANGELOG, dependencies, permissions, credentials, protected refs, review-agent identities, or any other path. Do not rebase, retarget, merge, mark ready, enable auto-merge, release, or publish.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review only exact current head c038a9509d1a8eae8561cc9081e67e12bd373d42 against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d. All earlier reviews, including the valid final-handoff finding on f6df03ce2f07ec3f2907b1f9ce5f50889b3dcbcf, are not exact-current-head review success.

Focus on complete removal of repository-write/OIDC/ref/branch/PR/merge/release/package/signing/attestation/publication paths; full pagination at both zero-PR gates; exact agreement among checkout HEAD, workflow output, uploaded base-sha, guard result, sealed base-sha, and EXPECTED_BASE_SHA before application, after application, and immediately before upload; exact three-file handoff contents and three-day retention; immutable action/OpenCode pins; deny-by-default model tools; stable errors; external credential-separated promotion documentation; contract tests; and CHANGELOG accuracy. Exact-head CI 31108238186, SAST 31108238093, and Security Scan 31108241013 succeeded; Python 3.10–3.13 passed 741 tests with 1,620 statements and 554 branches at 100% production coverage. Do not approve, merge, mark ready, enable auto-merge, release, publish, rebase, retarget, or infer success from queued output.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Review only exact current head c038a9509d1a8eae8561cc9081e67e12bd373d42 against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d; do not modify the branch.

The immutable final-handoff RED head 2dc5a8a5d05a977244e8f06157ccf12ad65c604e failed every Python 3.10–3.13 lane only because the final sealed base-sha was not required to equal the exact captured base. Current commit c038a9509d1a8eae8561cc9081e67e12bd373d42 changes only the final workflow recheck, injects EXPECTED_BASE_SHA, preserves format and patch-digest checks, and rejects any equality mismatch before upload. Exact-head CI 31108238186, SAST 31108238093, and Security Scan 31108241013 succeeded; 741 tests passed with 1,620 statements/554 branches at 100% production coverage.

Independently verify the no-write authority boundary, full pagination, all exact-base and digest bindings, exact three-file handoff, immutable pins, model isolation, external-promotion documentation, tests, and CHANGELOG. Submit a current-head review outcome only after checking the exact tree and evidence. Keep the PR draft; do not merge, mark ready, enable auto-merge, release, publish, rebase, or retarget.

@coderabbitai

coderabbitai Bot commented Aug 6, 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_expected='c038a9509d1a8eae8561cc9081e67e12bd373d42'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

head_actual="$(git rev-parse HEAD)"
merge_base="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$merge_base" "$base_expected"
test "$head_actual" = "$head_expected"
test "$merge_base" = "$base_expected"

echo '--- changed paths and whitespace ---'
git diff --name-status "$base_expected...$head_expected"
git diff --check "$base_expected...$head_expected"

echo '--- workflow map and content ---'
ast-grep outline "$workflow" --items all || true
nl -ba "$workflow"

echo '--- action pin validation ---'
python3 - "$workflow" <<'PY'
import re, sys
invalid = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        invalid.append(f"{number}: {match.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS")
    print("\n".join(invalid))
    raise SystemExit(1)
print("All action references use lowercase 40-character commit SHA pins.")
PY

echo '--- authority and publication markers ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest|cosign|sign)' \
  "$workflow" || true

echo '--- workflow binding, artifact, pagination, and model contract ---'
rg -n -C 12 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|pull-requests|sealed base SHA)' \
  "$workflow" || true

echo '--- guard outline and binding logic ---'
ast-grep outline "$guard" --items all || true
rg -n -C 16 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- contract tests ---'
ast-grep outline "$contract" --items all || true
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential|sealed)' \
  "$contract" || true

echo '--- documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write|sealed)' \
  "$docs" "$changelog" || true

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR state and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 4504


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='c038a9509d1a8eae8561cc9081e67e12bd373d42'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- workflow ---'
numbered "$workflow"

echo '--- action pin validation ---'
python3 - "$workflow" <<'PY'
import re, sys
invalid = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        invalid.append(f"{number}: {match.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS")
    print("\n".join(invalid))
    raise SystemExit(1)
print("All action references use lowercase 40-character commit SHA pins.")
PY

echo '--- workflow authority and publication markers ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest|cosign|sign)' \
  "$workflow" || true

echo '--- workflow binding, artifact, pagination, and model contract ---'
rg -n -C 12 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|pull-requests|sealed base SHA)' \
  "$workflow" || true

echo '--- guard binding logic ---'
rg -n -C 16 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- contract tests ---'
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential|sealed)' \
  "$contract" || true

echo '--- documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write|sealed)' \
  "$docs" "$changelog" || true

echo '--- changed-file diff ---'
git diff --unified=45 "$base_expected...$head_expected" -- \
  "$workflow" "$contract" "$docs" "$changelog"

echo '--- YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- PR state and check states ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 175741


@seonghobae Review completed for exact head c038a9509d1a8eae8561cc9081e67e12bd373d42 against exact base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the requested scope.

  • The diff changes only the four allowed files.
  • The workflow YAML parses successfully.
  • git diff --check found no whitespace errors.
  • All workflow action references use lowercase 40-character commit SHA pins.

The product workflow declares only read permissions. It has no *: write permission. It has no id-token: write permission.

The workflow has no repository-local publisher job. It has no GitHub App token exchange. It has no repository-write credential path. It has no branch or ref mutation, push, pull-request creation, auto-merge, release, package, signing, attestation, or publication path.

Both zero-open-PR gates use gh api --paginate --slurp. Each gate aggregates all REST response pages.

Before patch application, the workflow requires the develop output, downloaded base-sha, and fresh main checkout SHA to agree. It also requires both base values to be lowercase 40-character SHA values.

After patch application, scripts/ci/hourly_product_guard.py records the checkout base SHA and patch SHA-256. The workflow rejects a guard result whose base SHA differs from EXPECTED_BASE_SHA.

Before the final upload, the workflow:

  • copies the verified patch into a root-owned read-only directory;
  • seals the expected base SHA and guard patch SHA-256;
  • rehashes the sealed patch;
  • validates the sealed base SHA format; and
  • rejects a sealed base SHA that differs from EXPECTED_BASE_SHA with the stable error text The sealed base SHA does not match the exact handoff base.

The final handoff contains only:

egressweave.patch
base-sha
patch-sha256

The final upload uses the required immutable actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a pin. It uses if-no-files-found: error and retention-days: 3.

The OpenCode boundary remains pinned to version 1.18.13 and its declared SHA-256. It uses nvidia/nemotron-3-super-120b-a12b and maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY. The tool policy is deny-by-default. The credential-bearing job does not execute model-modified repository code. The offline reverifier has no model credential.

The contract tests cover the removal of publication authority, write-permission rejection, base binding, sealed-base validation, pagination, and final artifact settings. The operator documentation and [Unreleased] Security entry accurately describe the external, independently reviewed, credential-separated promotion boundary.

Pull request #66 remains a draft. autoMergeRequest is null. I did not approve, merge, mark ready, publish, release, rebase, retarget, or modify the pull request.

The strix check is still IN_PROGRESS. I did not treat it as successful evidence.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Supersedes closed PR #71: this exact branch already stores both affected printf format strings as single indented YAML lines with literal \n escapes, so the hourly workflow is parseable without reintroducing the removed repository-local publisher. No code change was required on current head c038a9509d1a8eae8561cc9081e67e12bd373d42; exact-head CI, SAST, and Security Scan remain successful. Current-head automated review, independent approval, and branch protection remain mandatory.

@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 14:08

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review only exact current head c038a9509d1a8eae8561cc9081e67e12bd373d42. The earlier inline findings were fixed and resolved; prior-head review output is not current-head acceptance. Focus on removal of every repository-local write/publish authority, exact-base and patch-digest binding before and after application and immediately before upload, full PR pagination, immutable action/OpenCode pinning, NVIDIA_NIM_API_KEY mapping, credential-free offline reverification, absence of any *: write permission, YAML parseability of literal \n format strings, and preservation of the existing review-agent credential contract. Do not infer independent approval, merge, enable auto-merge, release, or publish.

@coderabbitai

coderabbitai Bot commented Aug 6, 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_expected='c038a9509d1a8eae8561cc9081e67e12bd373d42'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

head_actual="$(git rev-parse HEAD)"
merge_base="$(git merge-base "$base_expected" "$head_expected")"
printf 'HEAD=%s\nEXPECTED_HEAD=%s\nMERGE_BASE=%s\nEXPECTED_BASE=%s\n' \
  "$head_actual" "$head_expected" "$merge_base" "$base_expected"
test "$head_actual" = "$head_expected"
test "$merge_base" = "$base_expected"

echo '--- changed paths and whitespace ---'
git diff --name-status "$base_expected...$head_expected"
git diff --check "$base_expected...$head_expected"

echo '--- workflow YAML syntax ---'
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(ARGV[0]); puts "YAML parse: OK"' "$workflow"
elif command -v yq >/dev/null 2>&1; then
  yq '.' "$workflow" >/dev/null
  echo 'YAML parse: OK'
else
  echo 'YAML parser unavailable'
fi

echo '--- product workflow ---'
nl -ba "$workflow"

echo '--- immutable action references ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' "$workflow"
python3 - "$workflow" <<'PY'
import re
import sys
bad = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        bad.append(f"{number}: {match.group(1)}")
if bad:
    print("INVALID_ACTION_PINS")
    print("\n".join(bad))
    raise SystemExit(1)
print("All product-workflow action references use lowercase 40-character commit SHA pins.")
PY

echo '--- product-workflow write authority and publication paths ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest|cosign|sign)' \
  "$workflow" || true

echo '--- handoff, binding, pagination, model, isolation markers ---'
rg -n -C 12 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|sealed base SHA|tools)' \
  "$workflow" || true

echo '--- guard implementation map and identity checks ---'
ast-grep outline "$guard" --items all || true
rg -n -C 16 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- contract assertions ---'
ast-grep outline "$contract" --items all || true
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential|sealed)' \
  "$contract" || true

echo '--- documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write|sealed)' \
  "$docs" "$changelog" || true

echo '--- review-agent credential contract in other workflows ---'
rg -n -C 4 \
  '(PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|NVIDIA_NIM_API_KEY|pull.?request.?review)' \
  .github/workflows || true

echo '--- relevant diff ---'
git diff --unified=45 "$base_expected...$head_expected" -- \
  "$workflow" "$contract" "$docs" "$changelog"

echo '--- PR state and current check records ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 4899


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_expected='c038a9509d1a8eae8561cc9081e67e12bd373d42'
base_expected='10d0c51daf2ad278d66f43be479df8cf6b08ba6d'
workflow='.github/workflows/hourly-product-development.yml'
guard='scripts/ci/hourly_product_guard.py'
contract='tests/test_hourly_opencode_nvidia_contract.py'
docs='docs/hourly-autonomous-maintenance.md'
changelog='CHANGELOG.md'

test "$(git rev-parse HEAD)" = "$head_expected"
test "$(git merge-base "$base_expected" "$head_expected")" = "$base_expected"

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

echo '--- product workflow ---'
numbered "$workflow"

echo '--- immutable action references ---'
rg -n '^[[:space:]]*uses:[[:space:]]*[^[:space:]#]+@[^[:space:]#]+' "$workflow" || true
python3 - "$workflow" <<'PY'
import re
import sys
invalid = []
for number, line in enumerate(open(sys.argv[1], encoding="utf-8"), 1):
    match = re.match(r"\s*uses:\s*([^#\s]+)", line)
    if match and not re.search(r"@[0-9a-f]{40}$", match.group(1)):
        invalid.append(f"{number}: {match.group(1)}")
if invalid:
    print("INVALID_ACTION_PINS")
    print("\n".join(invalid))
    raise SystemExit(1)
print("All product-workflow action references use lowercase 40-character commit SHA pins.")
PY

echo '--- product-workflow write authority and publication paths ---'
rg -n -i -C 5 \
  '(id-token:[[:space:]]*write|(^|[[:space:]])[A-Za-z0-9_-]+:[[:space:]]*write\b|PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|github[ _-]?app|git[[:space:]]+push|git[[:space:]]+(switch|checkout)[[:space:]]+-[bc]|git[[:space:]]+branch|gh[[:space:]]+pr[[:space:]]+(create|merge)|refs/heads|git/refs|auto-merge|release|packages|attest|cosign|sign)' \
  "$workflow" || true

echo '--- workflow binding, artifact, pagination, model, and isolation ---'
rg -n -C 12 \
  '(permissions:|base-sha|patch-sha256|egressweave\.patch|upload-artifact|retention-days|if-no-files-found|paginate|per_page|NVIDIA_NIM_API_KEY|NVIDIA_API_KEY|nvidia/nemotron|opencode|reverify|sha256sum|chmod|chown|git apply|EXPECTED_BASE_SHA|sealed base SHA|tools)' \
  "$workflow" || true

echo '--- guard implementation ---'
numbered "$guard"
echo '--- guard binding markers ---'
rg -n -C 16 \
  '(base_sha|patch_sha256|result|git apply|apply.*patch|sha256|write_text|chmod|chown|rev-parse|diff|subprocess)' \
  "$guard" || true

echo '--- contract test markers ---'
rg -n -C 10 \
  '(handoff|base.?sha|patch.?sha|pagination|permission|write|artifact|reverify|post.apply|exact.tree|publish|NVIDIA|OpenCode|credential|sealed)' \
  "$contract" || true

echo '--- documentation and changelog ---'
rg -n -i -C 8 \
  '(handoff|credential|external|branch|pull request|auto-merge|base SHA|SHA-256|exact tree|publish|OIDC|write|sealed)' \
  "$docs" "$changelog" || true

echo '--- review-agent credential contract in workflows ---'
rg -n -C 4 \
  '(PR_REVIEW_MERGE_TOKEN|OPENCODE_APPROVE_TOKEN|NVIDIA_NIM_API_KEY|pull.?request.?review)' \
  .github/workflows || true

echo '--- reviewed-files diff ---'
git diff --unified=40 "$base_expected...$head_expected" -- \
  "$workflow" "$contract" "$docs" "$changelog"

echo '--- PR state and check records ---'
gh pr view 66 --repo ContextualWisdomLab/EgressWeave \
  --json number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,statusCheckRollup \
  --jq '{number,isDraft,headRefOid,baseRefOid,autoMergeRequest,mergeStateStatus,checks:[.statusCheckRollup[]? | {name,status,conclusion,workflowName}]}' || true

Length of output: 198027


@seonghobae Review completed for exact head c038a9509d1a8eae8561cc9081e67e12bd373d42 against base 10d0c51daf2ad278d66f43be479df8cf6b08ba6d.

I found no blocking issue in the reviewed workflow and documentation scope.

  • The diff changes only the four allowed files.
  • The workflow YAML parses successfully. The printf commands use literal \n escapes on one YAML line.
  • git diff --check found no whitespace errors.
  • All product-workflow actions use lowercase 40-character commit SHA pins.
  • The product workflow declares only read permissions. It has no *: write permission and no id-token: write permission.
  • The workflow has no repository-local publisher, repository-write credential path, GitHub App token exchange, OIDC exchange, branch or ref mutation, push, pull-request creation, auto-merge, release, package, signing, attestation, or publication path.
  • Both zero-open-PR gates use gh api --paginate --slurp and aggregate all REST response pages.
  • Before patch application, the workflow requires a lowercase 40-character EXPECTED_BASE_SHA, the uploaded base-sha, and the fresh main checkout SHA to agree.
  • The trusted guard validates the untrusted patch before git apply. It validates the materialized diff after application. It emits the result base SHA and patch SHA-256.
  • The workflow rejects a guard result with a base SHA that differs from EXPECTED_BASE_SHA.
  • Before upload, the workflow rehashes the sealed patch. It validates the sealed base SHA format and equality with EXPECTED_BASE_SHA. It uses the stable error text The sealed base SHA does not match the exact handoff base.
  • The verified handoff contains only egressweave.patch, base-sha, and patch-sha256. It uses the required immutable upload-artifact pin, if-no-files-found: error, and retention-days: 3.
  • OpenCode remains pinned to version 1.18.13 and its declared SHA-256. The workflow maps NVIDIA_NIM_API_KEY to NVIDIA_API_KEY and uses nvidia/nemotron-3-super-120b-a12b.
  • The OpenCode tool policy is deny-by-default. The credential-bearing job does not execute model-modified repository code. The separate reverification job has no model credential.
  • The product workflow does not change the review-agent workflow. The contract test and documentation preserve the inherited review-agent credential contract.
  • The documentation and [Unreleased] Security entry correctly describe external, independently reviewed, credential-separated promotion. They do not claim that a promotion mechanism exists.

One pull-request state issue remains: #66 is not a draft (isDraft: false). This conflicts with the stated draft-only requirement.

autoMergeRequest is null. I did not approve, merge, mark ready, enable auto-merge, publish, release, rebase, retarget, or modify the pull request.

The strix check is IN_PROGRESS. I did not treat it as successful evidence.

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.

security: remove autonomous repository-write publisher from product scheduler

1 participant