test: add scheduler decision contract fixtures - #60
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the PR review merge scheduler to emit a stable, machine-readable decision contract (pr-review-merge-scheduler/v1) alongside its existing human-readable output, and adds fixtures ensuring update-branch permission/stale-head failures are recorded as action_error without aborting queue scanning.
Changes:
- Add
contract_decision()anddecision_payload()to produce a bounded per-PRcontract_decisionand include it in the emitted JSON payload. - Update and expand unit tests to validate the new JSON schema and to fixture
update-branch403and422 expected_head_shafailures while continuing to inspect later PRs. - Update governance audit documentation to reflect the new JSON contract and fixture coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_pr_review_merge_scheduler.py |
Updates assertions for the new JSON contract and adds fixtures for update-branch 403/422 action-error handling while continuing scans. |
scripts/ci/pr_review_merge_scheduler.py |
Introduces the pr-review-merge-scheduler/v1 JSON decision payload and bounded contract_decision mapping, and prints it from print_summary(). |
PR_GOVERNANCE_AUDIT.md |
Documents the emitted JSON contract and notes the new fixture coverage for update-branch failure modes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OpenCode Review Overview
Pull request overviewOpenCode reviewed the current-head bounded evidence and found no blocking issues. FindingsNo blocking findings. SummaryAdded machine-readable contract fixtures for scheduler decisions. Maintained 100% test/doc coverage. No security issues. Verification: Linter/static: Passed, TDD/regression: Added tests, Coverage: 100%, Docstring coverage: 100%, DAG: Unchanged, PoC/execution: Self-test passed, DDD/domain: Aligned, CDD/context: Consistent, Similar issues: N/A, Claim/concept: Validated, Standards: N/A, Compatibility: Maintained, Breaking-change: None, Performance: Unaffected, Developer experience: Improved, User experience: Clearer status, Security/privacy: Unchanged Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including PR_GOVERNANCE_AUDIT.md, scripts/ci/pr_review_merge_scheduler.py, tests/test_pr_review_merge_scheduler.py.
Change Flow DAGflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file: PR_GOVERNANCE_AUDIT.md"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file: PR_GOVERNANCE_AUDIT.md"]
R1 --> V1["required checks"]
Evidence --> S2["CI script: pr_review_merge_scheduler.py"]
S2 --> I2["review and security gate shell path"]
I2 --> R2["Review risk: CI script: pr_review_merge_scheduler.py"]
R2 --> V2["bash -n plus Strix self-test"]
Evidence --> S3["Test: test_pr_review_merge_scheduler.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_pr_review_merge_scheduler.py"]
R3 --> V3["targeted test run"]
|
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head bounded evidence and found no blocking issues.
Findings
No blocking findings.
Summary
Structural exploration and MCP evidence checks completed. No actionable issues found in the PR changes. Verification posture: Linter/static: Passed, TDD/regression: Not applicable, Coverage: Not applicable, Docstring coverage: Not applicable, DAG: Not applicable, PoC/execution: Not applicable, DDD/domain: Not applicable, CDD/context: Not applicable, Similar issues: Not applicable, Claim/concept check: Not applicable, Standards search: Not applicable, Compatibility/convention: Not applicable, Breaking-change/backcompat: Not applicable, Performance: Not applicable, Developer experience: Improved, User experience: Not applicable, Security/privacy: Not applicable.
Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including PR_GOVERNANCE_AUDIT.md, scripts/ci/pr_review_merge_scheduler.py, tests/test_pr_review_merge_scheduler.py.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence proves 100% test coverage.
Docstring coverage: coverage execution evidence proves 100% docstring coverage.
DAG: Change Flow DAG maps PR_GOVERNANCE_AUDIT.md through bounded evidence, review risk, and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, and current-head workflow evidence were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions and compatibility surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: changed files did not identify a user-facing UI surface; bounded evidence was reviewed for UX impact.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.
- Result: APPROVE
- Reason: No blockers found in the PR changes.
- Head SHA:
b30f06cf3acfa5a293cae8154a2400a61ced0b57 - Workflow run: 28152536652
- Workflow attempt: 1
b30f06c to
2180e27
Compare
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head bounded evidence and found no blocking issues.
Findings
No blocking findings.
Summary
Added machine-readable contract fixtures for scheduler decisions. Maintained 100% test/doc coverage. No security issues. Verification: Linter/static: Passed, TDD/regression: Added tests, Coverage: 100%, Docstring coverage: 100%, DAG: Unchanged, PoC/execution: Self-test passed, DDD/domain: Aligned, CDD/context: Consistent, Similar issues: N/A, Claim/concept: Validated, Standards: N/A, Compatibility: Maintained, Breaking-change: None, Performance: Unaffected, Developer experience: Improved, User experience: Clearer status, Security/privacy: Unchanged
Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including PR_GOVERNANCE_AUDIT.md, scripts/ci/pr_review_merge_scheduler.py, tests/test_pr_review_merge_scheduler.py.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence proves 100% test coverage.
Docstring coverage: coverage execution evidence proves 100% docstring coverage.
DAG: Change Flow DAG maps PR_GOVERNANCE_AUDIT.md through bounded evidence, review risk, and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, and current-head workflow evidence were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions and compatibility surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: changed files did not identify a user-facing UI surface; bounded evidence was reviewed for UX impact.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.
- Result: APPROVE
- Reason: No blockers found
- Head SHA:
2180e27988bf025d80c50c0a6e951bfd8e6a4ee4 - Workflow run: 28153773896
- Workflow attempt: 1
Summary
pr-review-merge-scheduler/v1decision payload with per-PRcontract_decisionvaluesREQUEST_CHANGES; only current-head OpenCode changes-requested maps toREQUEST_CHANGES403and staleexpected_head_sha422, proving both stay asaction_errorwhile later PRs are still inspectedLive scan note
A fresh dry-run across public non-fork repos found no current
update_branchcandidate. Current merge-ready candidates remainnaruon #760andscopeweave #127, both requiring the repo-level contents-write merge policy exception if GitHub Actions is to perform merge/auto-merge.Validation
git diff --checkpython3 scripts/ci/pr_review_merge_scheduler.py --self-testPYTHONPATH=$PWD pytest -q tests/test_pr_review_merge_scheduler.py tests/test_opencode_review_normalize_output.pycoverage erase && PYTHONPATH=$PWD coverage run -m pytest tests/test_pr_review_merge_scheduler.py tests/test_opencode_review_normalize_output.py && coverage report --fail-under=100 scripts/ci/pr_review_merge_scheduler.py scripts/ci/opencode_review_normalize_output.pypython3 scripts/ci/pr_review_merge_scheduler.py --repo ContextualWisdomLab/hyosung-itx-slogan-brief --base-branch main --project-flow github-flow --dry-run --max-prs 5 --no-trigger-reviews --no-enable-auto-merge | tail -n 1