Skip to content

⚡ Bolt: CI 스크립트 정규표현식 사전 컴파일(pre-compile) 최적화#386

Open
seonghobae wants to merge 6 commits into
mainfrom
bolt-regex-precompile-perf-16131737266904699911
Open

⚡ Bolt: CI 스크립트 정규표현식 사전 컴파일(pre-compile) 최적화#386
seonghobae wants to merge 6 commits into
mainfrom
bolt-regex-precompile-perf-16131737266904699911

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

💡 What: scripts/ci/opencode_review_normalize_output.pyscripts/ci/validate_opencode_failed_check_review.sh 내부에서 반복문마다 생성되던 정규표현식 객체(re.compile, re.sub, re.match 등)를 모듈 레벨에서 미리 컴파일하도록 최적화했습니다.

🎯 Why: 반복적으로 호출되는 루프 함수(changed_files_from_evidence, clean, starts_new_field 등) 내부에서 동적으로 정규식을 컴파일하면 객체 생성 오버헤드가 발생하며, 텍스트 스캐닝 성능 저하를 일으킬 수 있습니다. 모듈 레벨에서 이를 사전 정의하여 반복을 최소화하였습니다.

📊 Impact: CI 체크 실패 리뷰 스크립트의 텍스트 파싱 처리 속도와 메모리 할당 빈도를 향상시킵니다. (반복문 내 불필요한 regex 파싱 오버헤드 제거)

🔬 Measurement: 정규표현식 패턴과 사용 로직은 기존과 정확히 동일하며, pytest 테스트 및 bash 실행 확인 과정을 통과하여 기능적 차이가 없음을 증명합니다.


PR created automatically by Jules for task 16131737266904699911 started by @seonghobae

@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 8b78721d1ff29a135e9165ed3d7b24bd66dddfc1
  • Workflow run: 29057325695
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 8b78721d1ff29a135e9165ed3d7b24bd66dddfc1

  • Workflow run: 29057325695

  • Workflow attempt: 1

Coverage evidence

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (3 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (5 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading

Merge Conflict Guidance

  • Current merge state: DIRTY
  • Base branch: main
  • Head branch: bolt-regex-precompile-perf-16131737266904699911
  • Fix direction: merge or rebase origin/main into bolt-regex-precompile-perf-16131737266904699911, resolve conflict markers in the changed files, rerun the focused checks, then push the same branch.
  • Repair commands:
gh pr checkout 386 --repo ContextualWisdomLab/.github
git fetch origin main
git merge --no-ff origin/main  # or: git rebase origin/main
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:bolt-regex-precompile-perf-16131737266904699911
# rebase path only: git push --force-with-lease origin HEAD:bolt-regex-precompile-perf-16131737266904699911

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 9410194a5a62932892237341394b726632ef3581

  • Workflow run: 29055168828

  • Workflow attempt: 1

Coverage evidence

Coverage Evidence

  • Head SHA: 9410194a5a62932892237341394b726632ef3581
  • Required test evidence: supported repository test suites must pass.
  • Required docstring evidence: repository-owned docstring gates must pass when configured; otherwise docstring coverage is advisory.

Python project dependencies (.)

Using CPython 3.12.3 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Resolved 17 packages in 120ms
Downloading pygments (1.2MiB)
 Downloaded pygments
Prepared 13 packages in 100ms
Installed 13 packages in 12ms
 + attrs==26.1.0
 + click==8.4.2
 + colorama==0.4.6
 + coverage==7.15.0
 + iniconfig==2.3.0
 + interrogate==1.7.0
 + packaging==26.2
 + pluggy==1.6.0
 + py==1.11.0
 + pygments==2.20.0
 + pytest==9.1.1
 + pytest-cov==7.1.0
 + tabulate==0.10.0
  • Result: PASS

Python coverage with missing-line report (.)

============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-9.1.1, pluggy-1.6.0
rootdir: /home/runner/work/.github/.github/pr-head
configfile: pyproject.toml
plugins: cov-7.1.0
collected 174 items

tests/test_assert_opencode_reasoning_effort.py ........                  [  4%]
tests/test_codeql_pr_workflow_contract.py .                              [  5%]
tests/test_noema_review_gate.py .......F...                              [ 11%]
tests/test_opencode_agent_contract.py .....F...F...                      [ 18%]
tests/test_opencode_review_normalize_output.py ......................... [ 33%]
                                                                         [ 33%]
tests/test_opencode_workflow_shell_syntax.py .                           [ 33%]
tests/test_pr_governance_audit_contract.py ...                           [ 35%]
tests/test_pr_review_fix_scheduler.py ...................                [ 46%]
tests/test_pr_review_fix_scheduler_coverage.py ..                        [ 47%]
tests/test_pr_review_merge_scheduler.py ................................ [ 66%]
...............................                                          [ 83%]
tests/test_render_opencode_prompt_template.py ....                       [ 86%]
tests/test_required_workflow_queue_contract.py .......                   [ 90%]
tests/test_review_execution_contracts.py ..                              [ 91%]
tests/test_sandboxed_verify.py .........                                 [ 96%]
tests/test_sandboxed_web_e2e.py ......                                   [100%]

=================================== FAILURES ===================================
_______________ test_call_llm_handles_configuration_and_verdicts _______________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f61d1dad130>

    def test_call_llm_handles_configuration_and_verdicts(monkeypatch):
        pr = make_pr()
        monkeypatch.delenv("NOEMA_LLM_API_URL", raising=False)
        monkeypatch.delenv("NOEMA_LLM_API_KEY", raising=False)
        assert noema.call_llm("owner/repo", 1, pr, "diff", False) is None
    
        monkeypatch.setenv("NOEMA_LLM_API_URL", "file:///etc/passwd")
        monkeypatch.setenv("NOEMA_LLM_API_KEY", "secret")
>       with pytest.raises(ValueError, match="must start with http:// or https://"):
E       AssertionError: Regex pattern did not match.
E         Expected regex: 'must start with http:// or https://'
E         Actual message: 'URL scheme must be http or https'

tests/test_noema_review_gate.py:209: AssertionError
----------------------------- Captured stdout call -----------------------------
Noema LLM review unavailable: NOEMA_LLM_API_URL or NOEMA_LLM_API_KEY is not configured.
___________ test_workflow_provisions_sandbox_tool_and_reviewer_agent ___________

    def test_workflow_provisions_sandbox_tool_and_reviewer_agent():
        """Guard the runtime OpenCode workspace, not only repo-local config."""
        workflow = Path(".github/workflows/opencode-review.yml").read_text(
            encoding="utf-8"
        )
    
        assert "code-reviewer-prompt.md" in workflow
        assert "sandboxed_verify.py" in workflow
        assert "sandboxed_web_e2e.py" in workflow
        assert "review_execution_contracts.py" in workflow
        assert "SANDBOXED_VERIFY_RESULT" in workflow
        assert "SANDBOXED_WEB_E2E_RESULT" in workflow
        assert "Docker Compose, devcontainer, Nix, or temporary package-install sandbox" in workflow
        assert "scientific, statistical, simulation" in workflow
        assert "skewed true" in workflow
        assert "object naming" in workflow
        assert "connected code paths, rendering paths" in workflow
        assert "CHECK_LOOKUP_GH_TOKEN" in workflow
        assert "retrying with workflow github token" in workflow
        assert 'review_write_token="$GH_TOKEN"' in workflow
        assert 'review_write_token="$OPENCODE_APP_TOKEN"' in workflow
        assert 'review_write_token="$CHECK_LOOKUP_GH_TOKEN"' in workflow
        assert 'review_write_token="${OPENCODE_APP_TOKEN:-$GH_TOKEN}"' not in workflow
        assert "Review execution contracts" in workflow
        assert "Accessibility/i18n:" in workflow
        assert "Supply-chain/license:" in workflow
        assert "Packaging:" in workflow
        assert 'gsub("`"; "\'")' not in workflow
        assert 'gsub("`"; "&apos;")' in workflow
        assert '"code-reviewer"' in workflow
        assert workflow.count('"reasoningEffort": "high"') >= 10
        assert '"task": "allow"' in workflow
        assert 'cat >"$prompt_file" <<EOF' not in workflow
        assert 'cat >"$prompt_file" <<\'EOF\'' not in workflow
        assert "Run OpenCode PR Review model pool" in workflow
        assert "opencode_review_model_pool" in workflow
        assert "run_opencode_review_model_pool.sh" in workflow
        assert "OPENCODE_MODEL_CANDIDATES" in workflow
        model_pool_runner = Path("scripts/ci/run_opencode_review_model_pool.sh").read_text(encoding="utf-8")
        assert "assert_reasoning_effort_for_candidate" in model_pool_runner
        assert "assert_opencode_reasoning_effort.py" in model_pool_runner
        assert "--config opencode.jsonc" in model_pool_runner
        reasoning_effort_guard = Path("scripts/ci/assert_opencode_reasoning_effort.py").read_text(encoding="utf-8")
        assert 'options.reasoningEffort=high' in reasoning_effort_guard
        assert 'variants.high.reasoningEffort=high' in reasoning_effort_guard
        assert "deepseek/deepseek-r1" in reasoning_effort_guard
        assert "--config \"$OPENCODE_REVIEW_WORKDIR/opencode.jsonc\"" in workflow
        assert 'timeout --kill-after=15s "${export_timeout_seconds}s" opencode export' in model_pool_runner
        assert "session export did not complete within %ss" in model_pool_runner
        assert "Follow the complete review contract" in model_pool_runner
        assert "packet-first entry point" in model_pool_runner
        assert "Current-head evidence packet" in model_pool_runner
        assert "not a generic model-exhaustion message" in model_pool_runner
        assert "is_context_overflow_failure" in model_pool_runner
        assert "tokens_limit_reached" in model_pool_runner
        assert "skipping remaining attempts for this model" in model_pool_runner
        assert "approve_low_risk_review_fallback_after_model_exhaustion" not in workflow
        assert "changed_file_is_low_risk_review_fallback" not in workflow
        assert "approve_central_review_process_fallback" not in workflow
        assert "opencode.jsonc | \\" in workflow
        assert "scripts/ci/run_opencode_review_model_pool.sh | \\" in workflow
        assert "tests/test_opencode_agent_contract.py | \\" in workflow
        assert "ContextualWisdomLab/appguardrail:scripts/ci/collect_org_security_failures.py" in workflow
        assert "ContextualWisdomLab/appguardrail:.github/workflows/org-security-failure-collector.yml" in workflow
        assert "ContextualWisdomLab/appguardrail:tests/test_org_security_failure_collector.py" in workflow
        assert "appguardrail org-security failure collector" in workflow
        assert 'max_changed_count=3' in workflow
        assert "changed_count\" -gt \"$max_changed_count\"" in workflow
        assert "steps.central_review_process_fallback_scope.outputs.eligible != 'true'" not in workflow
        assert workflow.index("Detect central review-process scope") < workflow.index(
            "Initialize CodeGraph index for OpenCode"
        )
        assert "CENTRAL_REVIEW_PROCESS_FALLBACK_ELIGIBLE" in workflow
        assert "CENTRAL_REVIEW_PROCESS_FALLBACK_SCOPE_LABEL" in workflow
        assert "model pool was intentionally skipped" not in workflow
        assert "deterministic fallback" not in workflow
        assert "production source 또는 package manifest 변경이 없습니다" not in workflow
        assert "request_changes_for_coverage_evidence_failure" in workflow
        assert '"## Review outcome"' in workflow
        assert '"## Check outcome"' not in workflow
        assert "publish REQUEST_CHANGES when coverage-evidence blocker states" in workflow
>       assert re.search(r"opencode-review-target:[\s\S]{0,240}timeout-minutes: 360", workflow)
E       assert None
E        +  where None = <function search at 0x7f61d3690220>('opencode-review-target:[\\s\\S]{0,240}timeout-minutes: 360', 'name: Required OpenCode Review\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened, ready_for_r... The scheduled and PR-event scheduler paths remain authoritative.\\n\' "$GH_REPOSITORY" "$base_branch"\n          fi\n')
E        +    where <function search at 0x7f61d3690220> = re.search

tests/test_opencode_agent_contract.py:283: AssertionError
__________ test_merge_scheduler_uses_escalating_mutation_credentials ___________

    def test_merge_scheduler_uses_escalating_mutation_credentials():
        """Guard immediate merge/update execution credentials for central scheduling."""
        workflow = Path(".github/workflows/pr-review-merge-scheduler.yml").read_text(
            encoding="utf-8"
        )
    
        assert "id-token: write" in workflow
        assert "Exchange OpenCode app token for scheduler mutations" in workflow
        assert "secrets.PR_REVIEW_MERGE_TOKEN" in workflow
        assert "secrets.OPENCODE_APPROVE_TOKEN" in workflow
        assert "steps.scheduler_app_token.outputs.token" in workflow
        assert "SCHEDULER_READ_TOKEN: ${{ github.token }}" in workflow
        assert "SCHEDULER_MUTATION_TOKEN_SOURCE" in workflow
>       assert 'default: "-1"' in workflow
E       assert 'default: "-1"' in 'name: Required PR Review Merge Scheduler\n\non:\n  push:\n    branches: [main, develop, master]\n  pull_request_targe...  args+=(--no-update-branches)\n          fi\n          python3 scripts/ci/pr_review_merge_scheduler.py "${args[@]}"\n'

tests/test_opencode_agent_contract.py:415: AssertionError
=============================== warnings summary ===============================
tests/test_assert_opencode_reasoning_effort.py::test_module_entrypoint_success
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.assert_opencode_reasoning_effort' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.assert_opencode_reasoning_effort'; this may result in unpredictable behaviour

tests/test_render_opencode_prompt_template.py::test_module_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.render_opencode_prompt_template' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.render_opencode_prompt_template'; this may result in unpredictable behaviour

tests/test_review_execution_contracts.py::test_discovers_package_managers_java_r_json_and_main
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.review_execution_contracts' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.review_execution_contracts'; this may result in unpredictable behaviour

tests/test_sandboxed_verify.py::test_module_main_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.sandboxed_verify' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.sandboxed_verify'; this may result in unpredictable behaviour

tests/test_sandboxed_web_e2e.py::test_module_import_and_main_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.sandboxed_web_e2e' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.sandboxed_web_e2e'; this may result in unpredictable behaviour

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_noema_review_gate.py::test_call_llm_handles_configuration_and_verdicts - AssertionError: Regex pattern did not match.
  Expected regex: 'must start with http:// or https://'
  Actual message: 'URL scheme must be http or https'
FAILED tests/test_opencode_agent_contract.py::test_workflow_provisions_sandbox_tool_and_reviewer_agent - assert None
 +  where None = <function search at 0x7f61d3690220>('opencode-review-target:[\\s\\S]{0,240}timeout-minutes: 360', 'name: Required OpenCode Review\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened, ready_for_r... The scheduled and PR-event scheduler paths remain authoritative.\\n\' "$GH_REPOSITORY" "$base_branch"\n          fi\n')
 +    where <function search at 0x7f61d3690220> = re.search
FAILED tests/test_opencode_agent_contract.py::test_merge_scheduler_uses_escalating_mutation_credentials - assert 'default: "-1"' in 'name: Required PR Review Merge Scheduler\n\non:\n  push:\n    branches: [main, develop, master]\n  pull_request_targe...  args+=(--no-update-branches)\n          fi\n          python3 scripts/ci/pr_review_merge_scheduler.py "${args[@]}"\n'
================== 3 failed, 171 passed, 5 warnings in 5.78s ===================
  • Result: FAIL (exit 1)

Python docstring coverage advisory

RESULT: PASSED (minimum: 100.0%, actual: 100.0%)
  • Result: PASS

Coverage Decision

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (5 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script (5 files)"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (2 files)"]
  R3 --> V3["targeted test run"]
Loading

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 2f4dd0b3038369b8f4df9fad1b0220b2a900f5d9

  • Workflow run: 29055857289

  • Workflow attempt: 1

Coverage evidence

Coverage Evidence

  • Head SHA: 2f4dd0b3038369b8f4df9fad1b0220b2a900f5d9
  • Required test evidence: supported repository test suites must pass.
  • Required docstring evidence: repository-owned docstring gates must pass when configured; otherwise docstring coverage is advisory.

Python project dependencies (.)

Using CPython 3.12.3 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Resolved 17 packages in 200ms
Downloading pygments (1.2MiB)
 Downloaded pygments
Prepared 13 packages in 107ms
Installed 13 packages in 12ms
 + attrs==26.1.0
 + click==8.4.2
 + colorama==0.4.6
 + coverage==7.15.0
 + iniconfig==2.3.0
 + interrogate==1.7.0
 + packaging==26.2
 + pluggy==1.6.0
 + py==1.11.0
 + pygments==2.20.0
 + pytest==9.1.1
 + pytest-cov==7.1.0
 + tabulate==0.10.0
  • Result: PASS

Python coverage with missing-line report (.)

============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-9.1.1, pluggy-1.6.0
rootdir: /home/runner/work/.github/.github/pr-head
configfile: pyproject.toml
plugins: cov-7.1.0
collected 174 items

tests/test_assert_opencode_reasoning_effort.py ........                  [  4%]
tests/test_codeql_pr_workflow_contract.py .                              [  5%]
tests/test_noema_review_gate.py .......F...                              [ 11%]
tests/test_opencode_agent_contract.py .....F...F...                      [ 18%]
tests/test_opencode_review_normalize_output.py ......................... [ 33%]
                                                                         [ 33%]
tests/test_opencode_workflow_shell_syntax.py .                           [ 33%]
tests/test_pr_governance_audit_contract.py ...                           [ 35%]
tests/test_pr_review_fix_scheduler.py ...................                [ 46%]
tests/test_pr_review_fix_scheduler_coverage.py ..                        [ 47%]
tests/test_pr_review_merge_scheduler.py ................................ [ 66%]
...............................                                          [ 83%]
tests/test_render_opencode_prompt_template.py ....                       [ 86%]
tests/test_required_workflow_queue_contract.py .......                   [ 90%]
tests/test_review_execution_contracts.py ..                              [ 91%]
tests/test_sandboxed_verify.py .........                                 [ 96%]
tests/test_sandboxed_web_e2e.py ......                                   [100%]

=================================== FAILURES ===================================
_______________ test_call_llm_handles_configuration_and_verdicts _______________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f9c6b8c0710>

    def test_call_llm_handles_configuration_and_verdicts(monkeypatch):
        pr = make_pr()
        monkeypatch.delenv("NOEMA_LLM_API_URL", raising=False)
        monkeypatch.delenv("NOEMA_LLM_API_KEY", raising=False)
        assert noema.call_llm("owner/repo", 1, pr, "diff", False) is None
    
        monkeypatch.setenv("NOEMA_LLM_API_URL", "file:///etc/passwd")
        monkeypatch.setenv("NOEMA_LLM_API_KEY", "secret")
>       with pytest.raises(ValueError, match="must start with http:// or https://"):
E       AssertionError: Regex pattern did not match.
E         Expected regex: 'must start with http:// or https://'
E         Actual message: 'URL scheme must be http or https'

tests/test_noema_review_gate.py:209: AssertionError
----------------------------- Captured stdout call -----------------------------
Noema LLM review unavailable: NOEMA_LLM_API_URL or NOEMA_LLM_API_KEY is not configured.
___________ test_workflow_provisions_sandbox_tool_and_reviewer_agent ___________

    def test_workflow_provisions_sandbox_tool_and_reviewer_agent():
        """Guard the runtime OpenCode workspace, not only repo-local config."""
        workflow = Path(".github/workflows/opencode-review.yml").read_text(
            encoding="utf-8"
        )
    
        assert "code-reviewer-prompt.md" in workflow
        assert "sandboxed_verify.py" in workflow
        assert "sandboxed_web_e2e.py" in workflow
        assert "review_execution_contracts.py" in workflow
        assert "SANDBOXED_VERIFY_RESULT" in workflow
        assert "SANDBOXED_WEB_E2E_RESULT" in workflow
        assert "Docker Compose, devcontainer, Nix, or temporary package-install sandbox" in workflow
        assert "scientific, statistical, simulation" in workflow
        assert "skewed true" in workflow
        assert "object naming" in workflow
        assert "connected code paths, rendering paths" in workflow
        assert "CHECK_LOOKUP_GH_TOKEN" in workflow
        assert "retrying with workflow github token" in workflow
        assert 'review_write_token="$GH_TOKEN"' in workflow
        assert 'review_write_token="$OPENCODE_APP_TOKEN"' in workflow
        assert 'review_write_token="$CHECK_LOOKUP_GH_TOKEN"' in workflow
        assert 'review_write_token="${OPENCODE_APP_TOKEN:-$GH_TOKEN}"' not in workflow
        assert "Review execution contracts" in workflow
        assert "Accessibility/i18n:" in workflow
        assert "Supply-chain/license:" in workflow
        assert "Packaging:" in workflow
        assert 'gsub("`"; "\'")' not in workflow
        assert 'gsub("`"; "&apos;")' in workflow
        assert '"code-reviewer"' in workflow
        assert workflow.count('"reasoningEffort": "high"') >= 10
        assert '"task": "allow"' in workflow
        assert 'cat >"$prompt_file" <<EOF' not in workflow
        assert 'cat >"$prompt_file" <<\'EOF\'' not in workflow
        assert "Run OpenCode PR Review model pool" in workflow
        assert "opencode_review_model_pool" in workflow
        assert "run_opencode_review_model_pool.sh" in workflow
        assert "OPENCODE_MODEL_CANDIDATES" in workflow
        model_pool_runner = Path("scripts/ci/run_opencode_review_model_pool.sh").read_text(encoding="utf-8")
        assert "assert_reasoning_effort_for_candidate" in model_pool_runner
        assert "assert_opencode_reasoning_effort.py" in model_pool_runner
        assert "--config opencode.jsonc" in model_pool_runner
        reasoning_effort_guard = Path("scripts/ci/assert_opencode_reasoning_effort.py").read_text(encoding="utf-8")
        assert 'options.reasoningEffort=high' in reasoning_effort_guard
        assert 'variants.high.reasoningEffort=high' in reasoning_effort_guard
        assert "deepseek/deepseek-r1" in reasoning_effort_guard
        assert "--config \"$OPENCODE_REVIEW_WORKDIR/opencode.jsonc\"" in workflow
        assert 'timeout --kill-after=15s "${export_timeout_seconds}s" opencode export' in model_pool_runner
        assert "session export did not complete within %ss" in model_pool_runner
        assert "Follow the complete review contract" in model_pool_runner
        assert "packet-first entry point" in model_pool_runner
        assert "Current-head evidence packet" in model_pool_runner
        assert "not a generic model-exhaustion message" in model_pool_runner
        assert "is_context_overflow_failure" in model_pool_runner
        assert "tokens_limit_reached" in model_pool_runner
        assert "skipping remaining attempts for this model" in model_pool_runner
        assert "approve_low_risk_review_fallback_after_model_exhaustion" not in workflow
        assert "changed_file_is_low_risk_review_fallback" not in workflow
        assert "approve_central_review_process_fallback" not in workflow
        assert "opencode.jsonc | \\" in workflow
        assert "scripts/ci/run_opencode_review_model_pool.sh | \\" in workflow
        assert "tests/test_opencode_agent_contract.py | \\" in workflow
        assert "ContextualWisdomLab/appguardrail:scripts/ci/collect_org_security_failures.py" in workflow
        assert "ContextualWisdomLab/appguardrail:.github/workflows/org-security-failure-collector.yml" in workflow
        assert "ContextualWisdomLab/appguardrail:tests/test_org_security_failure_collector.py" in workflow
        assert "appguardrail org-security failure collector" in workflow
        assert 'max_changed_count=3' in workflow
        assert "changed_count\" -gt \"$max_changed_count\"" in workflow
        assert "steps.central_review_process_fallback_scope.outputs.eligible != 'true'" not in workflow
        assert workflow.index("Detect central review-process scope") < workflow.index(
            "Initialize CodeGraph index for OpenCode"
        )
        assert "CENTRAL_REVIEW_PROCESS_FALLBACK_ELIGIBLE" in workflow
        assert "CENTRAL_REVIEW_PROCESS_FALLBACK_SCOPE_LABEL" in workflow
        assert "model pool was intentionally skipped" not in workflow
        assert "deterministic fallback" not in workflow
        assert "production source 또는 package manifest 변경이 없습니다" not in workflow
        assert "request_changes_for_coverage_evidence_failure" in workflow
        assert '"## Review outcome"' in workflow
        assert '"## Check outcome"' not in workflow
        assert "publish REQUEST_CHANGES when coverage-evidence blocker states" in workflow
>       assert re.search(r"opencode-review-target:[\s\S]{0,240}timeout-minutes: 360", workflow)
E       assert None
E        +  where None = <function search at 0x7f9c6d194220>('opencode-review-target:[\\s\\S]{0,240}timeout-minutes: 360', 'name: Required OpenCode Review\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened, ready_for_r... The scheduled and PR-event scheduler paths remain authoritative.\\n\' "$GH_REPOSITORY" "$base_branch"\n          fi\n')
E        +    where <function search at 0x7f9c6d194220> = re.search

tests/test_opencode_agent_contract.py:283: AssertionError
__________ test_merge_scheduler_uses_escalating_mutation_credentials ___________

    def test_merge_scheduler_uses_escalating_mutation_credentials():
        """Guard immediate merge/update execution credentials for central scheduling."""
        workflow = Path(".github/workflows/pr-review-merge-scheduler.yml").read_text(
            encoding="utf-8"
        )
    
        assert "id-token: write" in workflow
        assert "Exchange OpenCode app token for scheduler mutations" in workflow
        assert "secrets.PR_REVIEW_MERGE_TOKEN" in workflow
        assert "secrets.OPENCODE_APPROVE_TOKEN" in workflow
        assert "steps.scheduler_app_token.outputs.token" in workflow
        assert "SCHEDULER_READ_TOKEN: ${{ github.token }}" in workflow
        assert "SCHEDULER_MUTATION_TOKEN_SOURCE" in workflow
>       assert 'default: "-1"' in workflow
E       assert 'default: "-1"' in 'name: Required PR Review Merge Scheduler\n\non:\n  push:\n    branches: [main, develop, master]\n  pull_request_targe...  args+=(--no-update-branches)\n          fi\n          python3 scripts/ci/pr_review_merge_scheduler.py "${args[@]}"\n'

tests/test_opencode_agent_contract.py:415: AssertionError
=============================== warnings summary ===============================
tests/test_assert_opencode_reasoning_effort.py::test_module_entrypoint_success
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.assert_opencode_reasoning_effort' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.assert_opencode_reasoning_effort'; this may result in unpredictable behaviour

tests/test_render_opencode_prompt_template.py::test_module_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.render_opencode_prompt_template' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.render_opencode_prompt_template'; this may result in unpredictable behaviour

tests/test_review_execution_contracts.py::test_discovers_package_managers_java_r_json_and_main
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.review_execution_contracts' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.review_execution_contracts'; this may result in unpredictable behaviour

tests/test_sandboxed_verify.py::test_module_main_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.sandboxed_verify' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.sandboxed_verify'; this may result in unpredictable behaviour

tests/test_sandboxed_web_e2e.py::test_module_import_and_main_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.sandboxed_web_e2e' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.sandboxed_web_e2e'; this may result in unpredictable behaviour

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_noema_review_gate.py::test_call_llm_handles_configuration_and_verdicts - AssertionError: Regex pattern did not match.
  Expected regex: 'must start with http:// or https://'
  Actual message: 'URL scheme must be http or https'
FAILED tests/test_opencode_agent_contract.py::test_workflow_provisions_sandbox_tool_and_reviewer_agent - assert None
 +  where None = <function search at 0x7f9c6d194220>('opencode-review-target:[\\s\\S]{0,240}timeout-minutes: 360', 'name: Required OpenCode Review\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened, ready_for_r... The scheduled and PR-event scheduler paths remain authoritative.\\n\' "$GH_REPOSITORY" "$base_branch"\n          fi\n')
 +    where <function search at 0x7f9c6d194220> = re.search
FAILED tests/test_opencode_agent_contract.py::test_merge_scheduler_uses_escalating_mutation_credentials - assert 'default: "-1"' in 'name: Required PR Review Merge Scheduler\n\non:\n  push:\n    branches: [main, develop, master]\n  pull_request_targe...  args+=(--no-update-branches)\n          fi\n          python3 scripts/ci/pr_review_merge_scheduler.py "${args[@]}"\n'
================== 3 failed, 171 passed, 5 warnings in 5.82s ===================
  • Result: FAIL (exit 1)

Python docstring coverage advisory

RESULT: PASSED (minimum: 100.0%, actual: 100.0%)
  • Result: PASS

Coverage Decision

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (5 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script (5 files)"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (2 files)"]
  R3 --> V3["targeted test run"]
Loading

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 66d69a5b779af10d8acb690283fb66398d50514c

  • Workflow run: 29056436254

  • Workflow attempt: 1

Coverage evidence

Coverage Evidence

  • Head SHA: 66d69a5b779af10d8acb690283fb66398d50514c
  • Required test evidence: supported repository test suites must pass.
  • Required docstring evidence: repository-owned docstring gates must pass when configured; otherwise docstring coverage is advisory.

Python project dependencies (.)

Using CPython 3.12.3 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Resolved 17 packages in 132ms
Downloading pygments (1.2MiB)
 Downloaded pygments
Prepared 13 packages in 98ms
Installed 13 packages in 18ms
 + attrs==26.1.0
 + click==8.4.2
 + colorama==0.4.6
 + coverage==7.15.0
 + iniconfig==2.3.0
 + interrogate==1.7.0
 + packaging==26.2
 + pluggy==1.6.0
 + py==1.11.0
 + pygments==2.20.0
 + pytest==9.1.1
 + pytest-cov==7.1.0
 + tabulate==0.10.0
  • Result: PASS

Python coverage with missing-line report (.)

============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-9.1.1, pluggy-1.6.0
rootdir: /home/runner/work/.github/.github/pr-head
configfile: pyproject.toml
plugins: cov-7.1.0
collected 174 items

tests/test_assert_opencode_reasoning_effort.py ........                  [  4%]
tests/test_codeql_pr_workflow_contract.py .                              [  5%]
tests/test_noema_review_gate.py .......F...                              [ 11%]
tests/test_opencode_agent_contract.py .....F...F...                      [ 18%]
tests/test_opencode_review_normalize_output.py ......................... [ 33%]
                                                                         [ 33%]
tests/test_opencode_workflow_shell_syntax.py .                           [ 33%]
tests/test_pr_governance_audit_contract.py ...                           [ 35%]
tests/test_pr_review_fix_scheduler.py ...................                [ 46%]
tests/test_pr_review_fix_scheduler_coverage.py ..                        [ 47%]
tests/test_pr_review_merge_scheduler.py ................................ [ 66%]
...............................                                          [ 83%]
tests/test_render_opencode_prompt_template.py ....                       [ 86%]
tests/test_required_workflow_queue_contract.py .......                   [ 90%]
tests/test_review_execution_contracts.py ..                              [ 91%]
tests/test_sandboxed_verify.py .........                                 [ 96%]
tests/test_sandboxed_web_e2e.py ......                                   [100%]

=================================== FAILURES ===================================
_______________ test_call_llm_handles_configuration_and_verdicts _______________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fab3410d100>

    def test_call_llm_handles_configuration_and_verdicts(monkeypatch):
        pr = make_pr()
        monkeypatch.delenv("NOEMA_LLM_API_URL", raising=False)
        monkeypatch.delenv("NOEMA_LLM_API_KEY", raising=False)
        assert noema.call_llm("owner/repo", 1, pr, "diff", False) is None
    
        monkeypatch.setenv("NOEMA_LLM_API_URL", "file:///etc/passwd")
        monkeypatch.setenv("NOEMA_LLM_API_KEY", "secret")
>       with pytest.raises(ValueError, match="must start with http:// or https://"):
E       AssertionError: Regex pattern did not match.
E         Expected regex: 'must start with http:// or https://'
E         Actual message: 'URL scheme must be http or https'

tests/test_noema_review_gate.py:209: AssertionError
----------------------------- Captured stdout call -----------------------------
Noema LLM review unavailable: NOEMA_LLM_API_URL or NOEMA_LLM_API_KEY is not configured.
___________ test_workflow_provisions_sandbox_tool_and_reviewer_agent ___________

    def test_workflow_provisions_sandbox_tool_and_reviewer_agent():
        """Guard the runtime OpenCode workspace, not only repo-local config."""
        workflow = Path(".github/workflows/opencode-review.yml").read_text(
            encoding="utf-8"
        )
    
        assert "code-reviewer-prompt.md" in workflow
        assert "sandboxed_verify.py" in workflow
        assert "sandboxed_web_e2e.py" in workflow
        assert "review_execution_contracts.py" in workflow
        assert "SANDBOXED_VERIFY_RESULT" in workflow
        assert "SANDBOXED_WEB_E2E_RESULT" in workflow
        assert "Docker Compose, devcontainer, Nix, or temporary package-install sandbox" in workflow
        assert "scientific, statistical, simulation" in workflow
        assert "skewed true" in workflow
        assert "object naming" in workflow
        assert "connected code paths, rendering paths" in workflow
        assert "CHECK_LOOKUP_GH_TOKEN" in workflow
        assert "retrying with workflow github token" in workflow
        assert 'review_write_token="$GH_TOKEN"' in workflow
        assert 'review_write_token="$OPENCODE_APP_TOKEN"' in workflow
        assert 'review_write_token="$CHECK_LOOKUP_GH_TOKEN"' in workflow
        assert 'review_write_token="${OPENCODE_APP_TOKEN:-$GH_TOKEN}"' not in workflow
        assert "Review execution contracts" in workflow
        assert "Accessibility/i18n:" in workflow
        assert "Supply-chain/license:" in workflow
        assert "Packaging:" in workflow
        assert 'gsub("`"; "\'")' not in workflow
        assert 'gsub("`"; "&apos;")' in workflow
        assert '"code-reviewer"' in workflow
        assert workflow.count('"reasoningEffort": "high"') >= 10
        assert '"task": "allow"' in workflow
        assert 'cat >"$prompt_file" <<EOF' not in workflow
        assert 'cat >"$prompt_file" <<\'EOF\'' not in workflow
        assert "Run OpenCode PR Review model pool" in workflow
        assert "opencode_review_model_pool" in workflow
        assert "run_opencode_review_model_pool.sh" in workflow
        assert "OPENCODE_MODEL_CANDIDATES" in workflow
        model_pool_runner = Path("scripts/ci/run_opencode_review_model_pool.sh").read_text(encoding="utf-8")
        assert "assert_reasoning_effort_for_candidate" in model_pool_runner
        assert "assert_opencode_reasoning_effort.py" in model_pool_runner
        assert "--config opencode.jsonc" in model_pool_runner
        reasoning_effort_guard = Path("scripts/ci/assert_opencode_reasoning_effort.py").read_text(encoding="utf-8")
        assert 'options.reasoningEffort=high' in reasoning_effort_guard
        assert 'variants.high.reasoningEffort=high' in reasoning_effort_guard
        assert "deepseek/deepseek-r1" in reasoning_effort_guard
        assert "--config \"$OPENCODE_REVIEW_WORKDIR/opencode.jsonc\"" in workflow
        assert 'timeout --kill-after=15s "${export_timeout_seconds}s" opencode export' in model_pool_runner
        assert "session export did not complete within %ss" in model_pool_runner
        assert "Follow the complete review contract" in model_pool_runner
        assert "packet-first entry point" in model_pool_runner
        assert "Current-head evidence packet" in model_pool_runner
        assert "not a generic model-exhaustion message" in model_pool_runner
        assert "is_context_overflow_failure" in model_pool_runner
        assert "tokens_limit_reached" in model_pool_runner
        assert "skipping remaining attempts for this model" in model_pool_runner
        assert "approve_low_risk_review_fallback_after_model_exhaustion" not in workflow
        assert "changed_file_is_low_risk_review_fallback" not in workflow
        assert "approve_central_review_process_fallback" not in workflow
        assert "opencode.jsonc | \\" in workflow
        assert "scripts/ci/run_opencode_review_model_pool.sh | \\" in workflow
        assert "tests/test_opencode_agent_contract.py | \\" in workflow
        assert "ContextualWisdomLab/appguardrail:scripts/ci/collect_org_security_failures.py" in workflow
        assert "ContextualWisdomLab/appguardrail:.github/workflows/org-security-failure-collector.yml" in workflow
        assert "ContextualWisdomLab/appguardrail:tests/test_org_security_failure_collector.py" in workflow
        assert "appguardrail org-security failure collector" in workflow
        assert 'max_changed_count=3' in workflow
        assert "changed_count\" -gt \"$max_changed_count\"" in workflow
        assert "steps.central_review_process_fallback_scope.outputs.eligible != 'true'" not in workflow
        assert workflow.index("Detect central review-process scope") < workflow.index(
            "Initialize CodeGraph index for OpenCode"
        )
        assert "CENTRAL_REVIEW_PROCESS_FALLBACK_ELIGIBLE" in workflow
        assert "CENTRAL_REVIEW_PROCESS_FALLBACK_SCOPE_LABEL" in workflow
        assert "model pool was intentionally skipped" not in workflow
        assert "deterministic fallback" not in workflow
        assert "production source 또는 package manifest 변경이 없습니다" not in workflow
        assert "request_changes_for_coverage_evidence_failure" in workflow
        assert '"## Review outcome"' in workflow
        assert '"## Check outcome"' not in workflow
        assert "publish REQUEST_CHANGES when coverage-evidence blocker states" in workflow
>       assert re.search(r"opencode-review-target:[\s\S]{0,240}timeout-minutes: 360", workflow)
E       assert None
E        +  where None = <function search at 0x7fab35a90220>('opencode-review-target:[\\s\\S]{0,240}timeout-minutes: 360', 'name: Required OpenCode Review\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened, ready_for_r... The scheduled and PR-event scheduler paths remain authoritative.\\n\' "$GH_REPOSITORY" "$base_branch"\n          fi\n')
E        +    where <function search at 0x7fab35a90220> = re.search

tests/test_opencode_agent_contract.py:283: AssertionError
__________ test_merge_scheduler_uses_escalating_mutation_credentials ___________

    def test_merge_scheduler_uses_escalating_mutation_credentials():
        """Guard immediate merge/update execution credentials for central scheduling."""
        workflow = Path(".github/workflows/pr-review-merge-scheduler.yml").read_text(
            encoding="utf-8"
        )
    
        assert "id-token: write" in workflow
        assert "Exchange OpenCode app token for scheduler mutations" in workflow
        assert "secrets.PR_REVIEW_MERGE_TOKEN" in workflow
        assert "secrets.OPENCODE_APPROVE_TOKEN" in workflow
        assert "steps.scheduler_app_token.outputs.token" in workflow
        assert "SCHEDULER_READ_TOKEN: ${{ github.token }}" in workflow
        assert "SCHEDULER_MUTATION_TOKEN_SOURCE" in workflow
>       assert 'default: "-1"' in workflow
E       assert 'default: "-1"' in 'name: Required PR Review Merge Scheduler\n\non:\n  push:\n    branches: [main, develop, master]\n  pull_request_targe...  args+=(--no-update-branches)\n          fi\n          python3 scripts/ci/pr_review_merge_scheduler.py "${args[@]}"\n'

tests/test_opencode_agent_contract.py:415: AssertionError
=============================== warnings summary ===============================
tests/test_assert_opencode_reasoning_effort.py::test_module_entrypoint_success
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.assert_opencode_reasoning_effort' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.assert_opencode_reasoning_effort'; this may result in unpredictable behaviour

tests/test_render_opencode_prompt_template.py::test_module_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.render_opencode_prompt_template' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.render_opencode_prompt_template'; this may result in unpredictable behaviour

tests/test_review_execution_contracts.py::test_discovers_package_managers_java_r_json_and_main
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.review_execution_contracts' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.review_execution_contracts'; this may result in unpredictable behaviour

tests/test_sandboxed_verify.py::test_module_main_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.sandboxed_verify' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.sandboxed_verify'; this may result in unpredictable behaviour

tests/test_sandboxed_web_e2e.py::test_module_import_and_main_entrypoint
  <frozen runpy>:128: RuntimeWarning: 'scripts.ci.sandboxed_web_e2e' found in sys.modules after import of package 'scripts.ci', but prior to execution of 'scripts.ci.sandboxed_web_e2e'; this may result in unpredictable behaviour

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_noema_review_gate.py::test_call_llm_handles_configuration_and_verdicts - AssertionError: Regex pattern did not match.
  Expected regex: 'must start with http:// or https://'
  Actual message: 'URL scheme must be http or https'
FAILED tests/test_opencode_agent_contract.py::test_workflow_provisions_sandbox_tool_and_reviewer_agent - assert None
 +  where None = <function search at 0x7fab35a90220>('opencode-review-target:[\\s\\S]{0,240}timeout-minutes: 360', 'name: Required OpenCode Review\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened, ready_for_r... The scheduled and PR-event scheduler paths remain authoritative.\\n\' "$GH_REPOSITORY" "$base_branch"\n          fi\n')
 +    where <function search at 0x7fab35a90220> = re.search
FAILED tests/test_opencode_agent_contract.py::test_merge_scheduler_uses_escalating_mutation_credentials - assert 'default: "-1"' in 'name: Required PR Review Merge Scheduler\n\non:\n  push:\n    branches: [main, develop, master]\n  pull_request_targe...  args+=(--no-update-branches)\n          fi\n          python3 scripts/ci/pr_review_merge_scheduler.py "${args[@]}"\n'
================== 3 failed, 171 passed, 5 warnings in 5.80s ===================
  • Result: FAIL (exit 1)

Python docstring coverage advisory

RESULT: PASSED (minimum: 100.0%, actual: 100.0%)
  • Result: PASS

Coverage Decision

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (5 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script (5 files)"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (2 files)"]
  R3 --> V3["targeted test run"]
Loading

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 8b78721d1ff29a135e9165ed3d7b24bd66dddfc1

  • Workflow run: 29057325695

  • Workflow attempt: 1

Coverage evidence

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (3 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (5 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant