Repository navigation
fix(org-ci): never abort the candy-gate retirement wave on one repo - #142
Merged
Merged
Conversation
stub_meta() returned non-zero on ANY fetch/decode failure and the caller
turned that into a FATAL exit(1), so a single repo aborted the whole
~300-repo wave. Run 36455597712 died on layer-camsnap: its deploy.yml was
deleted at 17:05:37Z by the CONCURRENT run 36455573679 (one second ahead),
so the probe saw 200 and the metadata fetch one second later returned 404.
Now stub_meta() always returns 0 and reports one of three statuses:
- ok (sha\tname\tis_stub) — classified, eligible for the unchanged
name=candy + 'charly box validate' SAFETY gate;
- vanished (HTTP 404) — deleted between probe and fetch by a
concurrent run; counted absent, never failed (idempotent);
- failed — transient/technical error; recorded in a
distinct counter + FAILED-repos list, never deleted, loop
CONTINUES, run exits non-zero so it is never silent.
Also falls back to the git blob API (git/blobs/<sha>) when the Contents API
omits inline content (blobs > 1 MB, encoding 'none'), so a large deploy.yml
is classified, not failed.
Test: adds the per-repo-resilience assertion (a metadata failure is counted
failed, loop continues past it, summary lists it) + the vanished-race case
(the exact 36455597712 trigger; counted absent, run SUCCEEDS) + the
large-file blob fallback.
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Contributor
Review — PASSHead SHA: Security screen: PASS — no secrets/exfiltration, no supply-chain change, no weakened guardrail (the fail-closed delete gate —
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 28, 2026
* feat(org-ci): ONE-shot minimal-diff config version: strip cutover Add scripts/strip-config-version.sh + its one-shot App-token workflow, mirroring the retire-per-repo-candy-gates precedent (branch-protection bypass commit by the charly-auto-merge App). The schema-versioning-removal cutover deletes the authored config version: field; 393 repos still carry it on main. The host leg (opencharly/charly#716) is not landed, so no released charly accepts/needs the strip and `charly migrate` reformats the whole file (~100 cosmetic lines of churn, incl. trailing-whitespace changes inside description: block scalars) — unacceptable across 393 repos. The strip is a minimal-diff, parser-safe line filter (scripts/_strip-filter.py): delete a line ONLY when it matches ^ {0,8}version: (the indent-0 document stamp, or an entity-body stamp at indent 8 / indent 4 in the two 2-space manifests). A version: line at indent 16+ is a fenced YAML example inside a description: | block scalar and is PRESERVED (9 repos; layer-charly-hermes's code-block stamp MUST survive). The filter refuses loudly if a matched line ever sits inside a block scalar. Everything else is byte-identical. DRY_RUN=1 reports without committing; per-repo failures never abort the wave (#142 lesson). Also fix scripts/lib-org.sh api_status: `awk 'NR==1{print $2; exit}'` SIGPIPEs under pipefail when the response body exceeds 64 KiB (every charly.yml > ~64 KB, measured 100 KB on distro-arch), which killed the probe; drop the `exit`. Coverage: scripts/strip-config-version_test.sh (offline, mock gh) locks all four required cases incl. the REAL layer-charly-hermes charly.yml as a committed fixture (scripts/fixtures/), wired into validator-harness.yml. Assisted-by: opencode Ollama Cloud deepseek-v4.1-flash (analysed on a live system) * fix(org-ci): address validator round — consistent counts, injection-safe dispatch, pasted sweep Round-1 validator BLOCK fixes: 1. Documentation divergence (A1/B5): every surface (script header, workflow header, filter docstring, README) now states the SAME measured metrics over the org TARGET set (the 423 active, non-fork, main-default repos discover_repos enumerates, measured 2026-09-28): 402 carry a charly.yml; 394 would be STRIPPED; 2 carry ONLY a preserved code-block example; 21 have no charly.yml; equivalently 396 carry at least one version: line on main, 6 carry a charly.yml with none. 2. R5 (B14d): removed the described-but-unpasted sweep claim; the pasted `git grep -n 'strip-config-version' HEAD` output + exit status now live in the PR body. 3. T3 shell injection: the dispatch workflow no longer interpolates `${{ inputs.repos }}` into `run:`. It is passed via `env: REPOS` and expanded as a quoted array (`read -ra repo_args <<<"$REPOS"`), so a metacharacter in the input is one literal argv element, never shell code. Assisted-by: opencode Ollama Cloud deepseek-v4.1-flash (analysed on a live system) * docs: re-freeze the PR body against the final head (validator round 3) * docs: re-freeze the PR body against the final head (validator round 3, SHA-generic evidence) --------- Co-authored-by: Andreas Trawoeger <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The org-wide candy-gate retirement (
scripts/retire-per-repo-candy-gates.sh) aborted the entire ~300-repo wave on one repo. Run36455597712died at:RCA (executed).
stub_meta()returned non-zero on any fetch/decode failure and the caller turned that intoexit 1.layer-camsnap'sdeploy.ymlwas already deleted by commit3257d87(2026-09-28T17:05:37Z), authored by the concurrent run36455573679(dispatched 17:04:40, i.e. 13s before the failing run36455597712at 17:04:53). The failing run'sapi_statusprobe oflayer-camsnapreturned 200; itsstub_metafetch one second later returned 404:So the trigger is a probe→fetch 404 race between two concurrent runs of this same wave — a case the pre-fix script could not tell apart from a real failure. (Two runs in flight,
36455573679in_progress+36455597712failure; a third earlier one36454414844also failed the same way.)Fix
stub_meta()now always returns 0 and prints a leading status; the caller branches:okname: candyANDcharly box validatesafety gate; eligible for deletevanished(HTTP 404)absent, never failed, never deleted — idempotentfailedfailedcounter +FAILED reposlist, logged loudly, never deleted, loop continues; the run exits non-zero so it is never silentfailedand the loop proceeds;MAX_FAILURESstill guards a genuinely broken token/endpoint (failed > MAX_FAILURESaborts)..content(blobs > 1 MB,.encoding: "none"), the script falls back to the git blob API (repos/$ORG/$repo/git/blobs/$sha) to read the text — so a bigdeploy.ymlis classified, not failed.name: candyand thecharly box validatesignature; a mismatch is skipped, never touched.api_statusfailure remains FATAL (a probe transport failure must never read as "absent" org-wide).How tested
New assertions in
retire-per-repo-candy-gates_test.sh:36455597712regression): a repo whose metadata fetch fails is countedfailed, is loggedSKIPPED (technical), never deleted, the summary lists it, the loop CONTINUES past it (the later repos are still classified), and the run exits non-zero.absent(retired=0 absent=2 skipped=2 failed=0), the run SUCCEEDS.shabut no inlinecontentis read via the blob API and the stub is retired, not failed.Adjacent offline gates still green:
Rulebook compliance
/charly-internals:git-workflow(plus/charly-internals:repo-setupfor the org-CI surface) loaded before any edit.layer-camsnapfailure was root-caused (the concurrent-run 404 race) before the fix, with the commit timestamp and the two run IDs as evidence.feat/retire-candy-gates-per-repo-resilienceoff freshorigin/main; no direct push; no force-push.Change classification
ghtest suite (validator-harness.yml) — hermetic, runs in CI; no live service is faked (the mock is the boundary itself).fully tested and validated— the changed paths were executed live against the test harness on the final committed tree.Agent:
gh-retire-resilience· sessionses_f172dce50ffeT3KbvpfC89PD1cAssisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)