Repository navigation
feat(org-ci): ONE-shot minimal-diff config version: strip cutover - #143
Conversation
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)
Review — BLOCKHead SHA: Change class: Security screen: one finding (T3, item 3 below). Blocks
Comment thread
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…afe 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)
Review — BLOCKHead SHA: Change class: Security screen: PASS on the re-derived state — the previously-flagged Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: Security screen: PASS — no secrets/exfil added; no guardrail disabled (the Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Change class: Security screen: PASS — no secrets/exfil added (the App id/key are referenced from Checklist: All applicable rules PASS or NA. Verified from the current state: body/prose counts agree everywhere (423/402/396/394/2/21/6; Comments (all re-derived against the current head):
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
ONE-shot, minimal-diff org cutover that deletes the schema-versioning-removal cutover's retired authored config
version:stamp from every repo'scharly.yml— mirroring theretire-per-repo-candy-gatesprecedent exactly (App-token, ruleset-bypass commit to protectedmain, per-repo resilience, offline mock-ghtest).The schema-versioning-removal cutover deletes the authored config
version:field, and theorg still carries it widely on
main. Measured over the org TARGET set — the 423active, non-fork,
main-default repos thatscripts/lib-org.sh'sdiscover_reposenumerates, on 2026-09-28:
charly.ymlcharly.yml(→absent)version:line onmainabsent)charly.ymlwith NOversion:line at all(396 = 394 stripped + 2 preserve-only. The corpus is being stripped CONCURRENTLY, so these
are a point-in-time snapshot; the docstrings, script header, workflow header and README all
state these same numbers and the same arithmetic.)
The host leg of the removal (
opencharly/charly#716) is NOT landed, so NO releasedcharly accepts or needs the strip — and
charly migrateREFORMATS the whole file (~100cosmetic lines of churn per file, incl. trailing-whitespace changes INSIDE
description:block scalars). Across ~400 repos that is an unreviewable diff for a one-field removal. This
PR strips with a MINIMAL-DIFF, parser-safe line filter instead.
scripts/strip-config-version.sh— the org-wave driver. Enumerates repos via theshared
discover_repos, fetches eachcharly.ymlthrough the Contents API (with thegit-blob fallback for > 1 MB bodies), runs the filter, and PUTs the stripped content
back with the App token and the message
chore(schema): drop the retired config version: stamp (org-wide cutover). Counters:stripped= absent= skipped= failed=. Idempotent;DRY_RUN=1reports what WOULD changewithout committing; a 403 aborts loudly with the
contents: writeremediation; aper-repo transient failure is counted
failedand the wave CONTINUES (the fix(org-ci): never abort the candy-gate retirement wave on one repo #142 lesson).scripts/_strip-filter.py— the filter. A line is deleted ONLY when it matches^ {0,8}version:— the document stamp (indent 0) or an entity-body stamp (indent 8, andindent 4 in the two 2-space manifests
action-review/eval-charly). Aversion:lineindented 16 or more is a fenced YAML example inside a
description: |block scalar andis PRESERVED (e.g.
layer-charly-hermesline 39version: 2026.156.1921 # mandatory CalVerMUST survive). It also tracksblock-scalar context and refuses LOUDLY (exit 3, nothing written) if a matched line
ever sits inside such a scalar. Every other byte is byte-identical.
.github/workflows/strip-config-version.yml— the one-shotworkflow_dispatch(optional
dry_run+reposinputs) that mints thecharly-auto-mergeApp token and runsthe script. Shell-injection-safe:
reposis passed viaenv: REPOSand expanded as aquoted array (
read -ra repo_args <<<"$REPOS"), never interpolated intorun:.contents: write(charly.yml is not a workflow file, so noworkflows: write).scripts/strip-config-version_test.sh— offline mock-ghtest covering all fourrequired cases + resilience, wired into
.github/workflows/validator-harness.yml.scripts/fixtures/layer-charly-hermes-charly.yml— the REALlayer-charly-hermescharly.yml(git blob988bdc946e548f79baeec61b6e88a4a8d9f9c534, sha256c5fc9280…b9e04) committed as a fixture to lock the code-block-preservation case.scripts/lib-org.sh— R1 fix:api_status()usedawk 'NR==1 { print $2; exit }', which underset -o pipefailsendsprintfSIGPIPE(exit 141) whenever the response body exceeds the 64 KiB pipe buffer — every
charly.ymlover ~64 KB (measured 100 KB on
distro-arch) killed the probe. Dropped theexit; awkconsumes the whole input (it still prints only line 1). Shared helper — proven
non-regressive against all four existing owner-script tests below.
README.md— documents the cutover; registers the new test in the harness list.Round-1 validator fixes. (1) A1/B5: every SHIPPED prose surface (script header, workflow
header, filter docstring, README) now states the same measured metrics — the table above
(no stale count remains anywhere in the shipped files). (2) R5/B14(d): the real
git grepcommand and its real output are pasted in this body (below), with its exit status. (3) T3:
the workflow interpolation is gone (
reposviaenv: REPOS+ quoted-array expansion); theround-2 security screen recorded it stale-superseded.
Round-2 validator fixes. Block 1 (the body still showed an earlier, different count
wording) is fixed: this body now states ONLY the canonical metrics in the table above,
matching the shipped prose exactly. Block 2 (no pasted sweep) is fixed: the
git grepoutput is below. Block 3 (a pasted command that could not produce its shown output) is
fixed: the evidence now shows the literal
| grep -ncommand that produces theline-numbered output, and the literal
diff <(…filter…)command. This body was finalizedBEFORE the push that produced this head, so the validator reads it, not an earlier revision
(the prior run raced an earlier body edit).
Closes / relates to: relates to
opencharly/charly#716(the schema-versioning-removalhost leg — this is the org-wide data leg it unblocks) and mirrors
scripts/retire-per-repo-candy-gates.sh(the authorization precedent for committing toprotected
mainvia thecharly-auto-mergeApp).Breaking change + rollback:
none— purely additive (a new script + filter + workflow +test + fixture, one shared-helper bugfix, README). The cutover only writes when its
App-token workflow is dispatched, and only when a repo's
charly.ymlactually contains astrippable stamp. Rollback: revert this PR.
Change class
hook/workflow(org CI cutover) +candy/box-config(thecharly.ymledit). Cross-repoconsumer: the dispatched App-token workflow writes
charly.ymlin every org repo — aone-shot operator-gated wave (NOT run on this PR). This PR does not edit any submodule.
How R10-tested — exact gate, commands, and pasted output
validator-harness.yml— everyscripts/*_test.sh(offline mock-gh),governance-reconcile.sh --self-test+ the live standalone reconcile, and thevalidator-gate harness. For the new script the gate is its own
scripts/strip-config-version_test.sh, which fails without the filter's safetypredicate (mutation-proven below). Plus the required live DRY_RUN.
N/A — no charly-managed runtime resource touched; the diff is shell / python / YAML / Markdown in opencharly/.github, and the changed script's control flow is covered by its offline mock-gh test + a live DRY_RUN against the real GitHub API. No candy/box/layer/Go code is in the diff, so no charly check run bed applies.N/A — no charly binary built or changed; the changed paths are shell/python/YAML in this repo and were executed directly (below).filter → report path executed live against the real GitHub API in
DRY_RUN=1(outputbelow), and the mutation proofs show the tests fail exactly when the fix is reverted. The
write path (the App-token PUT) is exercised by the mock only; the real one-shot App
commit is deliberately not dispatched on this PR (operator-gated).
N/A — no shared-state loader/ledger/store/lifecycle change.(The waveitself is race-tolerant: a probe→fetch 404 is counted
absent, per fix(org-ci): never abort the candy-gate retirement wave on one repo #142.)Evidence — put each item in the block whose label names it.
1. Fresh-rebuild gate output — `N/A — no binary; the gate is the repo's own self-tests on the final tree (this head):*
2. Each changed code path executing — the required LIVE DRY_RUN + the block-scalar proof + the R5 sweep + mutation proof:
The required live dry-run (
layer-charly-hermesstrips root + entity stamp; keeps line 39;pod-wayvncstrips both; already-cleandistro-arch→skipped):layer-charly-hermespost-strip — the indent-16 code-block line survives verbatim, andexactly the two stamp lines are gone:
R5 sweep — the real command and its real output (B14(d)):
Every hit is a reference to the NEW surface (the script, its workflow, its test, or the
README that documents them) — there is no stale/legacy/dual-mode path to delete.
Mutation proof A (the filter's preservation rule is load-bearing). Broaden the delete
regex to any indent and disable the block-scalar guard → the test FAILS on the exact
documentation-corruption assertion:
(With the guard left enabled, the same broaden instead trips the guard →
EXIT=3REFUSED.)Mutation proof B (the
lib-org.shfix is load-bearing). Revertapi_statusto theexitform → the live dry-run on a 100 KBcharly.ymldies with SIGPIPE; restore → itsucceeds:
3. Docs-only evidence —
N/A — not a docs-only change (shell/python/YAML + README).Attribution tier
analysed on a live system— the script's fetch → filter → report path executed LIVEagainst the real GitHub API in
DRY_RUN=1(output above), the block-scalar preservation islocked against the REAL
layer-charly-hermesfixture, and thelib-org.shfix ismutation-proven live. It is not
fully tested and validatedbecause the one-shotApp-token write path (
PUT contents) is exercised by the mock only — deliberately notdispatched on this PR (operator-gated, and it writes to protected
main).Assisted-by: opencode Ollama Cloud deepseek-v4.1-flash (analysed on a live system)
Harness rulebook compliance — state HOW each is satisfied (or
N/A — <reason>)/charly-internals:git-workflowbefore the first tool call; theorg-wide cutover mirrors the
retire-per-repo-candy-gatesprecedent it names.to a transient API status on a single repo (fail-closed by design, matching the
precedent's
api_statusdoctrine), never "flake". The real defect surfaced during thelive dry-run —
api_status's SIGPIPE on bodies > 64 KiB — was RCA'd (awkexitclosesthe pipe under
pipefail) and fixed in the shared helper, then mutation-proven. Allself-tests green, zero warnings.
lib-org.shfix that the live runsurfaced — required for the cutover to work at all (blocking), fixed here.
discover_repos/api_statusinscripts/lib-org.sharereused (not re-implemented); the filter is ONE python file used by the driver.
git-blob API rather than a retry; the SIGPIPE defect was fixed at the source, not papered
over with
|| true.git grep -n 'strip-config-version' HEADoutput above (exit 0) shows every hit is the NEW surface — no legacy/dual-mode path
exists.
N/A — no identifier removed or renamedbeyond the additive surface (the retiredversion:field is NOT this repo's; the wave is operator-gated).git status+git worktree listchecked before the commit; noforce-push, no hook bypass; the branch is add-only.
the mock harness — not merely
bash -n.N/A — no image/generation change.N/A — no charly binary or runtime OS dep involved.N/A — no disposable bed (no charly-managed resource).Coverage ship:
scripts/strip-config-version_test.shfails without the filter(mutation-proven) and is wired into
validator-harness.yml.N/A — no candy entity, no CUE schema, no composition-at-latest assumption.The high-risk assumption (the indent rule + code-block survival) was provenagainst the REAL corpus bytes and the real fixture, not doc-read.
N/A — no core/sdk change.N/A — no autonomous destroy/rebuild; DRY_RUN only.N/A — no Go.shell/pythonbash -n+py_compileclean.
N/A — the PR body IS the changelog; this repo's tag-on-merge workflow writes CHANGELOG/<CalVer>.md from this body at merge (no author-staged CalVer).Assisted-by: opencode Ollama Cloud deepseek-v4.1-flash (analysed on a live system)