Repository navigation
fix(canary): fail closed on a non-array run list; Zulu cut date; canonical agent-ingress.yml + registry lint - #1276
Conversation
…he local cut date (#1244 items 15, 17) Item 15: _repo_wf_runs_cached passed a 2xx body through unchecked, so on the legacy per-role path a non-array body was reduced to [] and read as 'no runs / no caller'. It now treats a non-array body like a failed fetch (retry, then fail closed with the fetch-failure flag) and never caches it. This subsumes the ingress-only check from #1250; that test now asserts the fetch failure. Item 17: candidate_cut_date's last-resort local fallback returned git's %cI verbatim, which can carry a non-Zulu offset, while the window filters compare timestamps as strings. It now goes through _to_z. Also fixes two retry-sleep test stubs whose printf-built payload was invalid JSON (they only asserted the sleep fallback, so it never mattered until the reader validated the body). Refs #1244 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MjXPsBTaL6WV9AhCH2ajuv
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@donpetry-bot please review. Generated by Claude Code |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request normalizes the local commit date fallback to Zulu time in candidate_cut_date and adds validation to ensure gh run list outputs a valid JSON array in _repo_wf_runs_cached to prevent failed fetches from being incorrectly interpreted as empty runs. Feedback on the tests suggests asserting the exact non-zero exit status in BATS to avoid false positives, and replacing the undefined INGRESS_RINGS variable with the globally defined $RINGS in the new candidate_cut_date test.
|
@don-petry I'm on it — starting a fresh review now. Results will appear in a few minutes. |
CodeAnt PR Risk: Low Risk
Assessed commit: |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-10T03:49:58Z. |
Dev-Lead — review-changes (applied)Changes committed and pushed. Requested items addressed:
|
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-10T03:59:26Z. |
|
No description provided. |
This comment has been minimized.
This comment has been minimized.
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
|
@donpetry-bot please review. The advisory-bot rate-limit window you noted (reset 03:59Z) has passed; the head is Generated by Claude Code |
|
@don-petry I'm on it — starting a fresh review now. Results will appear in a few minutes. |
|
No description provided. |
|
Qodo billing/trial-ended notice: reviews are paused, with no code finding. Acknowledged; nothing to change. |
|
CodeAnt reports Low Risk with no findings, only a summary of the fail-closed run-list handling and the Zulu date normalization. Acknowledged; nothing to change. |
|
SonarCloud Quality Gate passed with 0 new issues and 0 hotspots. Acknowledged; nothing to change. |
Dev-Lead — fix-reviews (no-changes)Agent reasoning |
|
No description provided. |
|
This is a rate-limit notice indicating CodeRabbit's free OSS review quota was reached during this PR's review cycle. No code changes are required — the rate-limit itself is not a code finding. All CI checks pass successfully. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
|
No description provided. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-10T18:08:28Z. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: dbbe1841808956eb0df76738069f6de128a0eea5
Review mode: triage-approved (single reviewer)
Summary
Fixes two canary-rollout fail-open edges (#1244 items 15/17) and implements the maintainer-recommended static registry lint for #1246 item 10. It publishes the canonical ADR-0007 agent-ingress.yml as a standard only (not in DEPLOYABLE_WORKFLOWS) and lints ingress_job values against it. Logic is correct, tests cover each change, and all CI is green.
Linked issue analysis
- #1244 item 15:
_repo_wf_runs_cachednow checks that a 2xx body is a JSON array (jq -e 'type == "array"'). A non-array body is written to the errfile and goes through the existing retry → fail-closed path, which sets_CANARY_FETCH_FAIL_FLAGand returns 1. The bad body is never cached. Because the error text is synthetic, it can't match the "could not find any workflow" no-runs branch. An empty body still becomes[], as before. - #1244 item 17:
candidate_cut_date's last-resortgit log %cIfallback now goes through_to_z. Empty input still passes through, and the new test checks that+05:00becomesZ. - #1246 item 10: implements option 1 (static registry lint), which the issue recommends. The lint reuses the existing
agent_ingress_has_role_job(indent-aware and prefix-safe). A fixture test covers a typo, a role-name prefix and an agent withoutingress_job. The canary test workflow now also triggers on the registry, the template andscripts/lib/agent-ingress.sh. - The PR says
Refsand correctly leaves both trackers open.
Findings
No blocking findings.
- Template pins verified: all five channel tags resolve (
dev-lead/v139-stable,pr-review/v1-stableandci-failure-analyst/v1-stablein .github-private;pr-auto-review/v1-stableandpr-review-mention/v2-stablein .github). All five registryingress_jobvalues (dev-lead,pr-auto-review,pr-review,pr-review-mention,ci-failure-analyst) match job keys in the template. - Secrets in the template: forwarded only to pinned first-party
petry-projects/*reusables (secrets: inherit/ explicit map). No secret reaches arun:step, and there are no third-party reusables. Top-levelpermissions: {}with per-job least privilege. Everyif:is a pure event filter. The template is published only, not deployed, so it doesn't change any repo's runtime. - Disclosed test changes (accepted): the #1250 ingress non-array test now expects a fetch failure (exit 1 + fetch-fail flag) instead of UNRESOLVED/exit 0. This fails closed harder and isn't one of the end-to-end tests #1246 says must stay unchanged. The two
RETRY_SLEEPstubs only got their invalid-JSON payload fixed. Thevform-pins.batsgeneralization pairs eachagent_refwith theuses:line before it, which still catches mismatches. - Nit (non-blocking): the template header says "full-file identical across every adopting repo, modulo the per-repo ring/channel pin". The pins shown (e.g.
dev-lead/v139-stable) are a snapshot that adopters will need to bump. The ci-standards.md text already covers this.
CI status
All checks pass or are skipped: bats ×2, Lint, Lint and bats, ShellCheck, CodeQL / Analyze (actions, python), SonarCloud (Quality Gate passed, 0 new issues), gitleaks, AgentShield, Agent Security Scan, duplicate-decl-gate and dependency-audit. Both Gemini review threads are resolved, and there are no unanswered human questions.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.
|
pr-review approved on PARTIAL advisory evidence: 3/5 required advisory bots reported before the gate's quiescence-timeout fallback proceeded. Recorded for the miss-rate metric (#1596). |



Refs #1244 (items 15, 17) and #1246 (item 10). Does not close either tracker.
1. #1244 items 15 and 17 (original scope of this PR)
_repo_wf_runs_cachedpassed a successfulgh run listbody through unchecked. On the legacy per-role path a non-array body (an error object, proxy HTML) was reduced to[]and read as "no runs / no caller". The shared reader now treats a non-array 2xx body as a failed fetch: retry, then fail closed with the existing fetch-failure flag. The bad body is never cached.candidate_cut_date's last-resort local-host fallback returnedgit log --format=%cIverbatim (can carry a non-Zulu offset) while the window filters compare timestamps as strings. It now goes through_to_z.2. #1246 item 10 (added to this PR at the owner's direction)
With the per-role workflow absent, the ingress present and no completed ingress run in the window, a misspelled
ingress_jobread as "no caller" andwaive_sample_if_no_callercould allow a dwell-only promotion. A runtime check cannot fail on "role absent from this member's ingress" (that is also what a legitimate non-consumer looks like), so the approved approach is a static registry lint in CI. Runtime behavior is unchanged.standards/workflows/agent-ingress.yml: the canonical ADR-0007 ingress (.github-privateinitiative doc §9b / AC11(a): authored here by the owner), one job per ring-registered role (dev-lead,pr-auto-review,pr-review,pr-review-mention,ci-failure-analyst). Based on the markets pilot (§3) with its two defective pins corrected to real moving channels:pr-review/stable→pr-review/v1-stable, bare SHA →ci-failure-analyst/v1-stable(both tags exist). Published as a standard only: not inDEPLOYABLE_WORKFLOWS, nothing is deployed by this change. Verified with the.github-privateguardsvalidate-ingress-if.sh(pure event-filterif:, bounded concurrency) andvalidate-caller-inputs.sh(inputs and concurrency groups against the reusables at the pinned refs); the two reusables hosted in this repo were checked by hand.tests/canary_rollout.bats):ingress_jobvalues are plain unique job keys; every one is a job of the canonical template; the lint logic is tested against a fixture (typo, role-name prefix, agent withoutingress_job).canary-rollout-tests.ymlnow also triggers onstandards/canary-rings.json, the canonical template andscripts/lib/agent-ingress.sh: a registry edit previously did not run the suite that would catch the typo.Existing tests touched (please look at these)
_agent_run_json: a non-array ingress run list …(fix(canary-rollout): close ingress fail-open gaps — decision-class read failures, run-list cap; pad cut-date line #1250): pinned the ingress-only handling. The shared reader now rejects the body first, so the same input is a fetch failure (non-zero, fetch-fail flag names the repo). Fails closed harder; a deliberate change to what the test asserts._run_json … RETRY_SLEEPtests: their stubghprinted invalid JSON; only the stub payload was fixed, assertions unchanged.test/scripts/standards-templates/vform-pins.bats([#850 Phase 1a] Re-pin 13 caller-stub templates to validated major-scoped v<M>-stable channels #860): assumed one channel pin per template file and a*-reusable.ymlfilename, so it failed on the five-job ingress. Generalized to per-pin / per-job checks (any workflow filename; eachagent_refpaired with theuses:channel preceding it). Verified it still fails on a bare pin and on a mismatchedagent_ref; the other templates behave as before.Tests
Canary suite 457/457 in both modes (also with
CANARY_PRELOAD_REGISTRY=1); standards-templates, compliance-audit S7637, seed-template, deploy-standard-workflows, standards-deploy-driver and persona-mention suites green;shellcheck --severity=warningclean. New tests fail without the change (items 15/17) or exercise the lint logic against a fixture (item 10).🤖 Generated with Claude Code
https://claude.ai/code/session_01MjXPsBTaL6WV9AhCH2ajuv
Problem
See the linked issue.
Risk
Medium — changes GitHub Actions workflow behavior, which is exercised only post-merge; verify via the affected workflow runs.
Test plan
Tests added/updated:
test/scripts/standards-templates/vform-pins.bats,tests/canary_rollout.bats. Verification:bash scripts/dev-lead-lint.sh(shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
Watch the affected workflow run(s) in the Actions tab and this PR's Lint check for regressions.