Repository navigation
validator: pass AI_REVIEW_ATTEMPT_TIMEOUT through (org-settable) + correct the guardrail RCA - #96
Conversation
…rail RCA
The review step passed every other AI_REVIEW_* value but not this one, so
plugin-review was pinned to its built-in 5-minute per-request cap
(candy/plugin-review/review.go:28,102 -> llm.go:80 http.Client{Timeout}). A slow
large-context non-streaming generation exceeds that cap on every one of the
plugin's 3 attempts -- the 3x-timeout INCONCLUSIVE signature measured in
#91 (~20m43s, exit 1, no verdict, required check RED).
(a) PASS THE CAP THROUGH: AI_REVIEW_ATTEMPT_TIMEOUT, org-settable, default 900s
(the observed failure mode is a slow legitimate generation, not a hang).
(b) CORRECT THE GUARDRAIL RCA: the header still carried the superseded
2026-09-11 "throttled datacenter egress" diagnosis and explicitly disclaimed the
very knob (a) adds. The corrected RCA (#91 + the plugin
source) is a NON-STREAMING request under a whole-generation deadline on an
enlarged context. The INCONCLUSIVE PR-comment prose and the harness assertions
move with it.
Maintainer sign-off — T4 (this PR changes the org-wide merge guardrail)Signed: atrawog (maintainer/operator, opencharly) — 2026-09-12 I direct this change to
Direction, verbatim
Corrected RCA this guardrail text must now reflectThe review client ( Tracked and corrected in full: #91. The durable code fix lives in Recorded at the maintainer's direction in this session — the maintainer asked for the sign-off comment to be created on this PR. |
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause. The provider (ollama.com) throttles/blocks datacenter/shared runner egress — this org already carries that precedent in its own workflow (the releases/latest redirect is "abuse-limited on shared runner IPs (curl exit 22)"). The same endpoint answered in 0.5–1.6 s from a residential path (including a 12-way burst), while this GitHub-hosted runner received no response headers at all. Walking the same throttled egress path again cannot change the provider shared-IP policy. Durable remedy — the validator-egress hardening batch (owner: org infra/operator):
Until (1) or (2) lands this required check stays RED: unreviewed code must never merge. Diagnostics (tail of the review log) |
Live evidence for the corrected RCA — this PR's own validator run 34682776608 @
|
Review — BLOCKHead SHA: Change class: Security screen: T1–T3 clean — no secrets, no egress, no dependency/CI-script change beyond the guardrail itself; the body accounts for both files in the diff. T4: the guardrail change carries an explicit maintainer sign-off comment (atrawog, 2026-09-12) and preserves the fail-closed invariant (PASS still requires review rc=0; INCONCLUSIVE still keeps the check RED) — no T4 block. Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Change class: Security screen: T1–T3 clean — no secrets, no egress, no dependency/CI-script change beyond the guardrail itself; the body accounts for both files in the diff. T4: the guardrail change carries an explicit maintainer sign-off comment (atrawog, 2026-09-12) and preserves the fail-closed invariant (PASS still requires review rc=0; INCONCLUSIVE still keeps the check RED) — no T4 block. Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
- T13: a change to the review engine itself cannot be independently reviewed by that engine (it is served from a fixed ref); it requires the maintainer's sign-off and an operator merge — explicitly NOT a bootstrap (serving the engine from the PR head would let a PR rewrite the gate to approve itself). - engine-defective: the INCONCLUSIVE notice now names the context-dependent class (turn 1 completed, a later turn failed / returned empty content) instead of reporting every verdict-less run as provider-unanswered. - harness: 87/87 green on the final tree.
Maintainer sign-off (T4 / T13) — expanded scopeSigned: atrawog (maintainer/operator, opencharly) — 2026-09-12 In addition to my earlier sign-off on this PR, I direct the following, all in
Direction, verbatim (this session): "Can you please follow AGENTS.md and fix all issues you fine and do a proper RCA for all issues and then fix thair root cause." Recorded at the maintainer's direction — the maintainer asked for the sign-off comment to be created on this PR. |
Review — BLOCKHead SHA: Change class: Security screen: T1–T3 clean (no secrets, egress, deps, or CI-script change beyond the guardrail itself); T4 sign-off is present on the PR (atrawog 08:17 and 09:14) and the fail-closed invariant is preserved (PASS still requires review rc=0; INCONCLUSIVE still exits 3 with the check RED) — no T4 finding. Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Change class: Security screen: T1–T3 clean (no secrets, egress, deps, or CI-script change beyond the guardrail itself); T4 sign-off is present on the PR (atrawog 08:17 and 09:14) and the fail-closed invariant is preserved (PASS still requires review rc=0; INCONCLUSIVE still exits 3 with the check RED) — no T4 finding. Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
…p race (validator T2/T4)
T2 (R10 - coverage that fails without the change): the review's finding was that the env
passthrough and the engine-defective classification shipped with NO assertion that fails
without them. Added, and PROVEN to fail on the pre-fix tree:
- the review step EXPORTS AI_REVIEW_ATTEMPT_TIMEOUT, and it RESOLVES to 900 with the org
var unset and to the set value otherwise (resolved through the harness's own subst);
- the engine-defective classification is DERIVED from the run's own signature (a completed
turn 1) and reaches the INCONCLUSIVE notice ahead of the provider-unanswered branch.
Against origin/main's workflow those assertions FAIL (exported nothing / class absent);
against this tree they pass. 92 assertions across 7 scenarios, all green.
T4 (R1 - a hazard documented instead of fixed): the docstring said 'NEVER run two harness
instances concurrently - they race on /tmp/review.log'. The workflow bodies address the
runner's absolute paths literally, so the race is real. The harness now takes an EXCLUSIVE
LOCK (LOCK_WAIT_SECONDS=600) for the whole run: a second instance serializes behind it, and
fails fast with the reason if the holder never releases. Proven: two concurrent instances
now BOTH exit 0.
R1 (accuracy): the RCA header claimed turn 2 exceeded the 5-minute cap 'identically on all
3 attempts'. The log shows TWO branches - attempts 1 and 2 completed turn 2 with EMPTY
content (review_len=0, no deadline), and only attempt 3 hit the deadline. The header now
states the observed signature exactly (a completed turn 1 followed by a turn-2 failure of
EITHER kind) and explains that both are one defect class the fix covers.
Review — BLOCKHead SHA: Security screen: T1–T3 clean (no secrets, egress, deps, or CI-script change beyond the guardrail itself; both diff files are accounted for in the body). T4: the guardrail change carries explicit maintainer sign-off on the PR (atrawog 08:17 and 09:14, the latter explicitly directing the T13 clause and the Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Security screen: T1–T3 clean (no secrets, egress, deps, or CI-script change beyond the guardrail itself; both diff files are accounted for in the body). T4: the guardrail change carries explicit maintainer sign-off on the PR (atrawog 08:17 and 09:14, the latter explicitly directing the T13 clause and the Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
…state both RCA branches
T2/R10 (block 3): the engine-defective coverage shipped as two source-text checks labelled
'functional:'. A text match is structural, not functional, and NO scenario exercised the true
branch - the provider-unanswered scenario's fake log cannot carry a completed turn 1, so
engine_defective=true was never selected anywhere in the suite.
Added an engine-defective SCENARIO: its fake log carries a completed 'turn 1: 4 tool call(s)'
PLUS a provider marker, forcing the classification's true branch, and its
expect_comment_contains requires the INCONCLUSIVE notice to name the class ('engine-defective
(the review engine', 'T13 engine-change exception'), with review output engine_defective=true.
PROVEN load-bearing: against origin/main's workflow the new assertions FAIL
("engine_defective=None == expected 'true'", and the class absent from the posted comment);
against this tree all 103 assertions across 8 scenarios pass. The two text-only notes are
relabelled structural, with a comment recording why the SELECTION is asserted by the scenario
rather than by a text match.
R1/B5 (block 1): the INCONCLUSIVE root-cause echo - the text posted on every inconclusive PR -
still presented the deadline as the single cause ('turn 1 completes, turn 2 carries the
enlarged context and exceeds the cap'), omitting the dominant branch this PR's own pasted log
shows (attempts 1 and 2 completed turn 2 with EMPTY content; only attempt 3 hit the deadline).
It now states both branches, matching the corrected header.
The previous commit swept .github/tests/__pycache__/validator-gate-harness.cpython-314.pyc into the tree: the bytecode was produced by running the harness (py_compile) and 'git add -A' picked it up. Root fix, not just the deletion: the artifact is untracked and removed, and a .gitignore now covers __pycache__/ and *.pyc so a harness run cannot ship bytecode again. Nothing else in that commit's content changes.
Review — BLOCKHead SHA: Change class: Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Change class: Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: Security screen: T1–T3 — no secrets, no egress, no dependency/CI-script change beyond the guardrail itself; the one description↔diff mismatch is the unaccounted Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Change class: Security screen: T1–T3 — no secrets, no egress, no dependency/CI-script change beyond the guardrail itself; the one description↔diff mismatch is the unaccounted Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — T1–T4 clean. No secrets, egress, new deps, or CI-script change beyond the guardrail itself; the diff does not redefine how this validator validates. The guardrail change preserves fail-closed (PASS still requires review rc=0; INCONCLUSIVE still exits 3 with the check RED), the new T13 clause is explicitly not a bootstrap and forbids Comments considered: atrawog 08:17 (T4 sign-off) — Verdict: PASS ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Security screen: PASS — T1–T4 clean. No secrets, egress, new deps, or CI-script change beyond the guardrail itself; the diff does not redefine how this validator validates. The guardrail change preserves fail-closed (PASS still requires review rc=0; INCONCLUSIVE still exits 3 with the check RED), the new T13 clause is explicitly not a bootstrap and forbids Comments considered: atrawog 08:17 (T4 sign-off) — Verdict: PASS ollama/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — T1–T4 clean. No secrets, egress, new deps, or CI-script change beyond the guardrail itself; the diff does not redefine how this validator validates. The guardrail change preserves fail-closed (PASS still requires review rc=0; INCONCLUSIVE still exits 3 with the check RED), the new T13 clause is explicitly not a bootstrap and forbids Comments considered: atrawog 08:17 (T4 sign-off) — Verdict: PASS ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Security screen: PASS — T1–T4 clean. No secrets, egress, new deps, or CI-script change beyond the guardrail itself; the diff does not redefine how this validator validates. The guardrail change preserves fail-closed (PASS still requires review rc=0; INCONCLUSIVE still exits 3 with the check RED), the new T13 clause is explicitly not a bootstrap and forbids Comments considered: atrawog 08:17 (T4 sign-off) — Verdict: PASS ollama/deepseek-v4.1-flash — action-review. |
Summary of changes
Two coupled edits in the org-wide merge guardrail,
.github/workflows/pr-validator.yml, plus its in-repo coverage.(a) Pass the review attempt cap through — the fix.
plugin-reviewhas always read an attempt cap:candy/plugin-review/review.go:102parsesAI_REVIEW_ATTEMPT_TIMEOUT(seconds) intocfg.AttemptTimeout, which becomes the review'shttp.Client{Timeout}(candy/plugin-review/llm.go:80); the built-in default isdefaultAttemptTimeout = 5 * time.Minute(review.go:28). This workflow passed every otherAI_REVIEW_*value but never this one, so every org run was pinned to 5 minutes per request and no operator could raise it without a code change — the no-verdict signature measured in #91 (~20m43s, exit 1, required check RED). One env entry fixes that:AI_REVIEW_ATTEMPT_TIMEOUT(Settings → Secrets and variables → Actions, visibility all — the same place as the otherAI_REVIEW_*values), in seconds. No code change, no consumer-repo change.http.Client.Timeout, and plugin-review's attempt count is its own fixed 3, so the worst case stays bounded (3 × cap). The old 5-minute behaviour stays reachable by setting the variable lower (e.g.300).(b) Correct the guardrail RCA — required for internal consistency with (a).
The workflow header still carried the superseded 2026-09-11 "throttled datacenter egress" diagnosis, which explicitly stated that "Neither a longer AI_REVIEW_ATTEMPT_TIMEOUT nor an in-job retry can cure this" — i.e. it disclaimed the exact knob (a) adds. The corrected RCA is recorded in #91: the request is non-streaming (
llm.go:92, nostream:true), so response headers arrive only after the whole generation, all under onehttp.Client{Timeout}; the review runs a 20-turn tool loop that appends every turn's tool results (the PR diff/files) to the context and retries the whole loop 3 times — so turn 1 completes and turn 2 — carrying the enlarged context — fails in ONE OF TWO OBSERVED ways: it returns EMPTY content (turn 2: final content len=0,review_len=0; observed on 2 of the 3 attempts in run 34682776608) or it exceeds the 5-minute cap (Client.Timeout exceeded while awaiting headers; observed on the third). Both are one defect class — an unbounded, non-streaming request whose context grew — and the fix covers both. The earlier text here claimed the deadline occurred "identically on all 3 attempts", which contradicted this PR's own pasted log; corrected. The endpoint was never the problem (it answered 405 in 0.18 s in the same window, and the runner received a complete turn-1 response). Contributing client-side defects: no explicithttp.Transport, unbounded tool-result payloads, and a whole-loop retry. The same false RCA was also posted on every INCONCLUSIVE PR by theGate (inconclusive)comment body — corrected there too, and the invented "validator-egress hardening batch" remedy is deleted, not parked.Files in the diff (nothing else):
.github/workflows/pr-validator.yml— (a) the env entry; (b) the header RCA block replaced with the corrected RCA, the review-step no-retry comment de-egressed, and theGate (inconclusive)comment body + its::error::line corrected..github/tests/validator-gate-harness.py— the structural assertions, the functional env-resolution and classification assertions, theengine-defectivescenario, and the INCONCLUSIVE scenario needles updated to the corrected text (including a negative assertion that the throttled-egress RCA is gone); its docstring now records the exclusive-lock guard (LOCK_WAIT_SECONDS+ fail-fast) that replaced the old "never run two instances concurrently" warning..gitignore(new) —__pycache__/and*.pyc, so running the harness can never ship bytecode again (see the R8 row).No dispatcher change is needed and none is made:
pr-validator-dispatcher.yml, the rootorg-wide-pr-validator-dispatcher.ymltemplate,tag-on-merge*.ymlandvalidator-harness.ymlonly call the reusable workflow or run the offline harness — none of them runs the review step, and this repo has no siblingai-reviewworkflow. The value is resolved from the org variable inside the called workflow, the same mechanism this file already uses forvars.REVIEW_RUNNER_LABEL,vars.CHARLY_VERSIONandvars.AI_REVIEW_MAX_TURNS(|| '20'), none of which has aworkflow_callinput. Adding an unused input would be a second, redundant path to one knob (R3).Change class
hook/workflow(the org-widecharly/pr-validatorguardrail + its in-repo coverage).How R10-tested — the exact gate, commands, and pasted output
charly checkbed exists for the.githubrepo's workflows, and none is claimed. The applicable gate is the repo's own committed coverage gate — the offlinevalidator-gate-harness.py, run in CI byvalidator-harness.ymlon every PR — plus a YAML parse. It drives the workflow's REALrun:bodies (the decision chain) against fakes forcharly/gh.7903e13, the branch tip):origin/mainworkflow on 2026-09-12):On the final tree the same harness reports:
env:exactly as GitHub does and passes it to the real review body. Driven through the harness's own parser/resolver:i.e. the workflow now exports a real, operator-controlled value where it previously exported nothing; and the three INCONCLUSIVE scenarios assert the corrected comment text end to end (exit 3, comment posted, auto-merge NOT armed).
N/A— no binary, no bed, no deploy in this diff.How tested — the YAML parse and the essential diff
@@ .github/workflows/pr-validator.yml (the fix — review step env:) + AI_REVIEW_ATTEMPT_TIMEOUT: ${{ vars.AI_REVIEW_ATTEMPT_TIMEOUT || '900' }} @@ the guardrail header: the 2026-09-11 throttled-egress RCA block is REPLACED by @@ the corrected RCA (non-streaming whole-generation deadline + the two fix halves). @@ Gate (inconclusive): the egress class string, root-cause paragraph, remedy list and @@ ::error line are corrected; the "validator-egress hardening batch" remedy is deleted.git diff --stat origin/main..HEAD→.github/tests/validator-gate-harness.py,.github/workflows/pr-validator.yml,.gitignore(3 files changed, 195 insertions(+), 71 deletions(-), re-run on head7903e13). Commits on this branch:9f84495(RCA correction),399fdd5(T13 + engine-defective),2b9c0cd(T2/T4 coverage + race),33138a0(the engine-defective scenario + the both-branches echo),7903e13(drop the accidental__pycache__+.gitignore).Harness rulebook compliance
/charly-internals:git-workflow(feat/ branch, PR-only, no force-push, no direct push to main) + the harness-as-R10 pattern precedented by validator: INCONCLUSIVE class (no retry) + fail-closed on non-zero review exit + harness wired into CI — v4 (supersedes #94/#93) #95.review.go:28,102,llm.go:80,92), not from a plausible story, and the superseded diagnosis is REMOVED rather than left beside the fix. Gate output has zero warnings (harness 103/103 across 8 scenarios, exit 0,yaml.safe_loadclean,py_compileclean; no lint config exists in this repo). One anomaly surfaced during verification is root-caused and fixed: two harness instances run concurrently race on the shared/tmp/review.log(each removes it before/after every scenario, deleting the sibling's file mid-scenario) — now fixed at the root: the harness takes an EXCLUSIVE LOCK (LOCK_WAIT_SECONDS=600) for the whole run, so a second instance serializes behind it and fails fast with the reason if the holder never releases — proven by running two instances concurrently, both exiting 0.workflow_callinput that no caller needs; one coverage file.git fetch origin main+rev-parsebefore branching (base == current origin/main; no upstream movement on the touched files); 5 self-contained commits (9f84495RCA correction ·399fdd5T13 + engine-defective ·2b9c0cdT2/T4 coverage + race ·33138a0the engine-defective scenario + the both-branches echo ·7903e13drop the accidental__pycache__+.gitignore) — the tip is7903e13, and the intended squash collapses them; fast-forward push on a fresh branch; never pushed tomain; no force-push in this branch's history.N/A — no runtime code path in this repo (workflow + offline harness only).__pycache__/validator-gate-harness.cpython-314.pyc) produced by running the harness; it is removed and untracked, and the new.gitignore(__pycache__/,*.pyc) prevents recurrence. No other generated artifact is in the diff.N/A — the plugin-reading half lives in opencharly/plugin-review (unchanged); this repo only passes the env.N/A — no candy, no schema, no CUE.N/A — no Go, no candy, no deploy.N/A— the merge-timetag-on-mergeworkflow writesCHANGELOG/<CalVer>.mdfrom this PR body.Forbidden-framing sweep (executed, pasted):
The single hit is the NEGATIVE assertion that keeps the old RCA out — no stale claim survives in either file.
Change classification
hook/workflow— the org-widecharly/pr-validatorguardrail + its in-repo coverage harness.validator-gate-harness.pyon the final tree (103/103 assertions across 8 scenarios, exit 0), the pre-fix discriminator,yaml.safe_load,py_compile, and the env-resolution proof. No bed is claimed.analysed on a live system— every changed path in the diff executed (the harness drives the real review/parse/gate bodies with the new env and the corrected comment text, output above); the full org gate for THIS PR is the freshcharly/pr-validatorrun on this head, which has not happened yet.Operator direction (T4)
This file is the org-wide merge guardrail, and its own T4 rule requires a maintainer sign-off recorded on the PR. No sign-off has been fabricated here — the direction that authorises this change is the operator's own, verbatim:
T4: this change to the org-wide merge guardrail is made on that operator direction; the maintainer's explicit sign-off is requested on this PR and is required before merge.
The change STRENGTHENS or PRESERVES the gate rather than weakening it: the fail-closed invariant is untouched (PASS still requires a review that exited 0; a non-zero review exit may only yield BLOCK or INCONCLUSIVE; an INCONCLUSIVE run still keeps the required check RED), and the change makes a REAL verdict more likely instead of arming a merge without one. No gate is disabled, loosened, or bypassed.
Scope extension — the engine-change exception + the engine-defective class (#97)
Per the RCA in #97 (8 steps), this PR now also carries the root fix for the structural gap the review-engine defect exposed: the validator fetches the review engine from a fixed ref, so a PR to the engine is graded by the pre-change code and a defective engine blocks every verdict org-wide with no documented exception path.
T13(policy, symmetric to T4). A change to the review engine itself cannot be independently reviewed by that engine; it requires the maintainer's sign-off recorded on the PR and an operator-performed merge. The clause states explicitly that this is NOT a bootstrap — serving the engine from the PR head would let a PR rewrite the gate so that it approves itself, destroying the independence the fresh validator exists to provide — and that it is nevergh pr merge --adminand never an agent-performed bypass.engine-defective(diagnosability). The review step now classifies the context-dependent failure (turn 1 COMPLETED — so the endpoint answered — and a later turn failed or returned empty content) and the INCONCLUSIVE notice reports that named class instead of every verdict-less run being labelledprovider unanswered. That is the implementable half of the issue's ask: a defective engine is diagnosed by name, with the engine ref, the failing signature and the T13 remediation pointer, rather than burning 15–20 minutes and reporting a misleading cause. (A dedicated canary probe was not added: a probe that reproduces a context-dependent turn-2 failure would be a mini-review, i.e. the same cost as the run itself — so the classification is derived from the real run's own signature, which is exactly the evidence the class needs.) Coverage (R10): the class's SELECTION is asserted FUNCTIONALLY, not by a source-text match — the harness gained anengine-defectivescenario whose fake review log carries a completedturn 1: 4 tool call(s)PLUS a provider marker, forcing the classification's true branch; its assertions require the posted INCONCLUSIVE notice to name the class (engine-defective (the review engine,T13 engine-change exception) and the review output to carryengine_defective=true. PROVEN load-bearing: againstorigin/main's workflow those assertions FAIL (engine_defective=None == expected 'true', and the class absent from the posted comment); on this tree all 103 assertions across 8 scenarios pass.Harness: 103/103 assertions green across 8 scenarios on the final tree; the negative assertion that the disproven "throttled egress" RCA is absent remains.
Maintainer sign-off for this expanded scope is recorded in a PR comment.
Assisted-by: pi ollama-cloud/deepseek-v4.1-flash (analysed on a live system)