Skip to content

fix(ci): replace conflicted fatal OpenCode process-group prerequisite - #821

Draft
seonghobae wants to merge 10 commits into
mainfrom
fix/opencode-fatal-process-groups-replacement
Draft

fix(ci): replace conflicted fatal OpenCode process-group prerequisite#821
seonghobae wants to merge 10 commits into
mainfrom
fix/opencode-fatal-process-groups-replacement

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Replacement purpose

Replace conflicted prerequisite #813 from the exact current protected main while preserving #813 and its fail-first history unchanged. #813 no longer descends from current main and GitHub reports it non-mergeable, so destructive repair is prohibited.

Exact boundary

  • exact protected base: 1131b1bbafb24e455fc8619cdf316813e8721861 (main);
  • exact current head: f92784f389317d512376a0725cbd78606b2e832c;
  • branch ancestry is non-forced and descends from that exact protected base;
  • fix(ci): reap fatal OpenCode process groups #813 remains preserved with its branch and fail-first history.

No checks, reviews, approvals, comments, or other evidence from #813 transfer to this replacement. Any earlier replacement-head evidence is stale after a head change.

Test-first evidence

The permanent replacement regression was committed before the production repair. Exact-head run 31179003656, job 92867529694, checked out 4c1e763a9dea3a60e29344556c7201ac62c6b383 with persisted checkout credentials disabled and failed exactly the two intended contracts: a fake curl emitted HTTP 200 then exited 18 but the inherited probe returned success, and the inherited OpenCode launcher lacked a dedicated setsid process group and killed only the timeout-wrapper PID.

Exact head 148eeb2fd212196136efb3e75d4577a3780d20f7 subsequently produced GREEN focused exact-head evidence in run 31179647237, job 92869591286: literal-head checkout with persist-credentials: false, both permanent regressions passing, Python compilation passing, launcher Bash syntax passing, and a clean worktree. Those results became stale when the head advanced.

A replacement-diff review then found a documentation-provenance error: dependency-review doctoring named the superseded #813-only regression file. Corrective RED head 82667148c3051fad7a6a1157339f54e2ff47059e added the contract first. Exact-head run 31180019016, job 92870797249, checked out that literal head and failed exactly the new doctoring assertion while the two existing regressions remained green (1 failed, 2 passed). Current GREEN candidate f92784f389317d512376a0725cbd78606b2e832c changes only the doctoring test path to tests/test_fatal_provider_and_dependency_review_replacement.py. No acceptance evidence from the RED head transfers; the focused and central gates must rerun on this unchanged head.

Bounded implementation

  • scripts/ci/run_opencode_review_model_pool.sh starts each bounded provider attempt in its own session with setsid; fatal-provider cleanup sends TERM to the negative process-group identifier, waits boundedly, and escalates KILL to the same group.
  • Security Scan accepts dependency-review capability only when curl succeeds and the exact base/head compare endpoint returns HTTP 200; timeout, partial transfer, transport/TLS failure, authorization/support failure, malformed/empty status, and every non-200 result fail closed.
  • The central static dependency-review contract matches the fail-closed behavior; sandbox timeout evidence is deterministic rather than wall-clock-sensitive.
  • Permanent focused exact-head quality CI checks literal PR-head checkout, hash-pinned test dependencies, regressions, Python compilation, launcher Bash syntax, and a clean worktree with read-only repository permission.
  • Doctoring records incident, decision, rollback, operational interpretation, and APA 7th primary references; CHANGELOG.md preserves newer protected-main entries and adds only the bounded repairs.

Current gate state

Exact head f92784f389317d512376a0725cbd78606b2e832c has just been published as the corrective GREEN candidate. Absent, queued, pending, skipped-required, neutral-required, cancelled, failed, predecessor-head, generated-merge-only, or otherwise stale evidence is not passing. Do not mark ready, close #813, or advance #799 until the focused exact-head contract and every applicable security/supply-chain gate complete successfully on this unchanged head.

Independent non-author exact-head approval remains required after the final code and evidence are stable.

Dependency order

This replacement is the earliest repair boundary for scanner exact-head repair #799. Do not deepen, refresh acceptance, or merge #799 until this replacement is mergeable, its available exact-head CI/security/dependency/SBOM/status evidence passes, and it is protected-merged. After protected merge, #799 must be refreshed against new exact main; none of #799's predecessor-base checks, reviews, or approvals transfer.

Prohibited shortcuts

Keep Draft until current-head machine evidence is complete. Do not force-push, rewrite history, use -X ours/-X theirs, introduce a temporary write-capable repair workflow, synthesize approval, bypass branch protection, weaken a test, or reuse stale evidence.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: da978f9d-89da-47df-aa42-4fe0af7d3bbe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Copy link
Copy Markdown
Contributor Author

Exact-current-head review request for f92784f389317d512376a0725cbd78606b2e832c against protected main 1131b1bbafb24e455fc8619cdf316813e8721861.

Current exact-head focused quality CI, Security Scan, CodeQL, Python Security, Semgrep, Secret Scan, OSV, Scorecard, SBOM, and CodeRabbit status are successful; the rerun of the cancelled Strix Changed Path Quality CI is still in progress and is not counted as passing until terminal success. Review this exact head only; predecessor #813 evidence does not transfer.

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

Review-only. Do not update the branch, create repair automation, approve from the author identity, merge, or bypass protection. Submit only an exact-head verdict.

@coderabbitai

coderabbitai Bot commented Aug 7, 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

expected_base='1131b1bbafb24e455fc8619cdf316813e8721861'
expected_head='f92784f389317d512376a0725cbd78606b2e832c'

printf '%s\n' '== Checkout and commit identity =='
git rev-parse HEAD
git rev-parse "$expected_base"
git rev-parse "$expected_head"
git merge-base --is-ancestor "$expected_base" "$expected_head"
printf 'base_is_ancestor=%s\n' "$?"

printf '%s\n' '== Changed files =='
git diff --name-status "$expected_base" "$expected_head"
printf '%s\n' '== Stat =='
git diff --stat "$expected_base" "$expected_head"

printf '%s\n' '== GitHub exact-head check runs =='
gh api "repos/ContextualWisdomLab/.github/commits/$expected_head/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

Length of output: 7744


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='1131b1bbafb24e455fc8619cdf316813e8721861'
head='f92784f389317d512376a0725cbd78606b2e832c'

printf '%s\n' '== Structural outlines =='
ast-grep outline scripts/ci/run_opencode_review_model_pool.sh --items all || true
ast-grep outline tests/test_fatal_provider_and_dependency_review_replacement.py --items all
ast-grep outline tests/test_required_workflow_queue_contract.py --items all
ast-grep outline tests/test_sandboxed_verify.py --items all

printf '%s\n' '== Final workflow and launcher sources =='
for file in \
  .github/workflows/fatal-provider-dependency-review-quality-ci.yml \
  .github/workflows/security-scan.yml \
  scripts/ci/run_opencode_review_model_pool.sh \
  tests/test_fatal_provider_and_dependency_review_replacement.py \
  tests/test_required_workflow_queue_contract.py \
  tests/test_sandboxed_verify.py \
  CHANGELOG.md \
  docs/doctoring/dependency-review-support-probe.md \
  docs/doctoring/opencode-process-group-termination.md
do
  printf '\n===== %s =====\n' "$file"
  cat -n "$file"
done

printf '%s\n' '== Complete patch =='
git diff --find-renames --find-copies --no-ext-diff "$base" "$head"

Length of output: 192689


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='f92784f389317d512376a0725cbd78606b2e832c'

printf '%s\n' '== Fatal-provider behavioral regression definitions and workflow coverage =='
rg -n -C 8 --glob '*.py' \
  '\btest_fatal_provider_error_kills_hung_opencode_run_early\b|\brun_one_model_attempt\b|OPENCODE_FATAL_ERROR_POLL_SECONDS' \
  tests scripts .github || true

printf '%s\n' '== Workflows that execute the behavioral test file or model-pool contracts =='
rg -n -C 5 --glob '*.yml' \
  'test_fatal_provider_error_kills_hung_opencode_run_early|run_opencode_review_model_pool|model_pool' \
  .github/workflows || true

printf '%s\n' '== Pull request and current exact-head checks =='
gh pr view 821 --repo ContextualWisdomLab/.github \
  --json number,state,isDraft,mergeable,mergeStateStatus,headRefOid,baseRefOid,statusCheckRollup \
  --jq '{
    number, state, isDraft, mergeable, mergeStateStatus, headRefOid, baseRefOid,
    checks: [.statusCheckRollup[] | {
      name: .name,
      status: .status,
      conclusion: .conclusion,
      workflowName: .workflowName,
      detailsUrl: .detailsUrl
    }]
  }'

printf '%s\n' '== Commit check runs refreshed =='
gh api "repos/ContextualWisdomLab/.github/commits/$head/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

Length of output: 33864


@seonghobae Exact-head verdict for f92784f389317d512376a0725cbd78606b2e832c: no source-level findings.

The checked-out head and PR head match the requested commit. The protected base matches 1131b1bbafb24e455fc8619cdf316813e8721861. The base is an ancestor of the head.

The dependency-review probe now fails closed for a nonzero curl exit and for every status other than exact HTTP 200. The OpenCode launcher now creates a dedicated session and terminates the complete attempt process group. The existing behavioral regression is present in tests/test_opencode_model_pool_runner.py. The focused exact-head contract and the OpenCode coverage evidence both succeeded.

This PR is not ready. strix and exact-head-path-policy are still in progress on this exact head. GitHub reports the PR as Draft and BLOCKED. Do not treat the pending checks as passing.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Reconcile this existing Draft branch with protected main only after refetching live identities. The required pre-write identities are current PR head f92784f389317d512376a0725cbd78606b2e832c and protected main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba; abort without writing if either changed.

The branch is now exactly one protected-main commit behind (#823, fix(strix): bound quality timeout fixtures). All exact-head focused/security/supply-chain gates on f92784f... are successful except Strix Changed Path Quality CI, whose rerun again cancelled in Verify exact-head path policy and syntax; protected main now contains the permanent 3-second/5-second deterministic Strix fixture budget specifically introduced after this branch's cancellation evidence. Do not treat the cancellation as a product/source failure and do not weaken Strix tests or timeouts.

Perform one ordinary non-forced merge of exact protected main 6eb06cdd... into fix/opencode-fatal-process-groups-replacement, preserving both histories and the complete #823 protected-main tree. Resolve only genuine textual overlap, if any, by retaining both authoritative [Unreleased] CHANGELOG entries; do not use -X ours, -X theirs, rebase, force-push, history rewriting, temporary/write-capable workflows, encoded patches, or another branch/PR. The effective feature slice must remain the fatal-provider process-group + fail-closed dependency-review replacement plus inherited protected-main changes.

After the merge commit, rerun the focused Fatal Provider and Dependency Review Quality CI, Strix Changed Path Quality CI, complete central tests/coverage/docstrings, and all applicable security/supply-chain gates on the exact new head. Keep Draft. Do not close #813, advance #799, approve, merge, or release from this task. Any check/review evidence from f92784f... becomes stale after the merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Reconcile this replacement with the exact current protected main without rewriting history. Exact branch head is f92784f389317d512376a0725cbd78606b2e832c; exact protected main is 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. git compare shows the branch is ahead 10 / behind 1 with merge base 1131b1bbafb24e455fc8619cdf316813e8721861. Before any write, refetch the PR head, protected main, and relevant blobs; if either head moved, do not write.

The one protected-main commit is #823's bounded Strix quality timeout-fixture repair. This branch's product diff does not touch those Strix production/test files; the only expected textual overlap is CHANGELOG.md. Observed branch CHANGELOG.md blob is 6cfe4c3070922798994934605b5ac13ea2625091; protected-main blob is bf30091dd6df4551f211142b4828b5c674362bb8. Preserve both this PR's two bounded fixes (dependency-review transport must require curl success + HTTP 200; fatal OpenCode provider cleanup must terminate the whole process group) and protected main's Strix timeout-fixture changelog entry.

Create a normal non-forced merge of exact protected main into the existing branch. Do not force-push, rebase away fail-first history, use -X ours/-X theirs, drop either side's changelog evidence, change production semantics beyond conflict reconciliation, or close predecessor #813. After reconciliation, run the focused replacement tests, complete central suite, Strix quick gate (now benefiting from protected-main bounded fixtures), Python/Bash syntax, exact 100% production statement/branch/docstring gates, and normal security/supply-chain workflows. Keep Draft until the new exact head is fully green, reviewed, and independently approved. Do not approve, merge the PR, or introduce temporary/write-capable workflows.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Reconcile this earliest scanner/OpenCode prerequisite onto current protected main without rewriting history. Exact PR head is f92784f389317d512376a0725cbd78606b2e832c; current protected main tip is 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Relevant exact-head blobs are scripts/ci/run_opencode_review_model_pool.sh=226e8d038e319e8a2bbdb42be48c5a4a60640bd4 and .github/workflows/security-scan.yml=0c54bb1e10fd91de2c53c0b284289caaebbaba73; current-main counterparts are 986982e9af3e65cf468f993d8e858d9e1edfc5c1 and c3b8fa5dbbb21a684209683a3d4b6d29c8e0d536. Do not write if any head/base/blob identity has moved.

Use a trusted checkout and normally merge exact protected main into this existing replacement branch. Resolve conflicts by retaining every newer protected-main behavior plus only this PR's validated bounded contracts:

  • each OpenCode provider attempt runs in its own setsid session/process group; a trusted fatal-provider event terminates the negative process-group ID with bounded TERM then KILL escalation while ordinary timeout behavior remains intact;
  • dependency-review capability is accepted only when curl itself succeeds and the exact base/head compare endpoint yields exact HTTP 200; partial transfer, timeout, TLS/transport failure, malformed/empty status, 403/404/000 or any other non-200 remains fail-closed;
  • preserve current-main credentials, model/provider behavior, exact-head source materialization, output/evidence bounds, scanner pins, branch protection, and all unrelated security controls.

Do not force-push, use -X ours/-X theirs, create temporary/self-modifying/write-capable workflows, or touch downstream #799 yet. After the merge commit, rerun Fatal Provider and Dependency Review Quality CI, actual Security Scan including the dependency-review action, complete central tests/Strix quick gate, exact 100% production statement/branch/public-docstring gates, CodeQL, Python Security, SAST, Secret Scan, OSV, Scorecard, and SBOM. Keep Draft until the resulting exact head is fully green and current-head reviews are clean; do not merge or synthesize approval.

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