Skip to content

R1: scripts/strip-config-version.sh cites a byte figure that is no longer true — layer-charly-internals/charly.yml is 6,692 bytes, not 1,038,418 #251

Closed

Description

@aitrawog

Problem

scripts/strip-config-version.sh justifies its > 1 MB fallback with a byte figure that is no longer true — in BOTH places that cite it:

scripts/strip-config-version.sh:124
# The Contents API omits inline `.content` for blobs > 1 MB (returns `.encoding:
# "none"`) — measured live: layer-charly-internals/charly.yml is 1,038,418 bytes, so
# its base64 body exceeds 1 MB. When the inline body decodes empty we fall back to the
# git blob API (`git/blobs/<sha>`) so a large charly.yml is still filtered, not failed.

scripts/strip-config-version.sh:220
    # via `--input -`: the base64 never touches argv, which would blow the OS ARG_MAX
    # on a > 1 MB content field (layer-charly-internals/charly.yml is 1,038,418 bytes
    # → a 1.39 MB base64). `-Rs` keeps the base64 byte-exact (no trailing newline).

layer-charly-internals/charly.yml is 6,692 bytes today. The skill prose moved out of it into the authored .agents/skills/… tree (AGENTS.md Part II #5) — the same move #246 repoints the governance manifest away from.

Measured

Over every charly.yml in the umbrella checkout (1,160 files):

$ find . -name 'charly.yml' -not -path './.worktrees/*' -printf '%s %p\n' | sort -rn | head -3
296468 ./charly/charly.yml
257083 ./pod-herdr/charly/charly.yml
257083 ./plugin-herdr/charly/charly.yml

$ awk '$1>1048576' <the same list> | wc -l
0

and the two files the comment names:

6692 ./layer-charly-internals/charly.yml
2860 ./layer-charly-internals-extra/charly.yml

Nothing in the org crosses 1 MB today. The largest is 296,468 bytes.

What is true and what is not

  • Still true: the API fact the comment relies on — the Contents API omits inline .content for blobs above 1 MB, so the script falls back to the git blob API. That is a property of the API, and the fallback is correct code.
  • No longer true: the example. The file it cites is 6,692 bytes, and no file in the org is above 1 MB, so the fallback is currently untriggered — the comment asserts a live measurement that no longer exists.

Root fix

  • Re-measure, and state the threshold with a figure that is live (the current maximum, 296,468 bytes at charly/charly.yml) instead of a dead one.
  • Decide — explicitly, in the comment — whether the > 1 MB fallback is still reachable (a charly.yml can grow back above 1 MB) or is now dead weight. If it is unreachable, R2/R5 apply and the fallback goes; if it is kept as a forward guard, the comment says so and says what would trigger it.

Either way the claim in the comment must be true when a reader runs it.

Why it is filed rather than folded into #246

It is non-blocking for #246: it changes no behaviour, #246's gate is green with or without the fix, and it is a different file with a different mechanism (a byte-count rationale for a fallback, not a pointer to a surface). The correction belongs with that script's own change, where its own test (scripts/strip-config-version_test.sh, already in this repo's workflow-checks gate) can prove it.

Agent: charly

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (analysed on a live system)

Activity

  1. aitrawog commented on Oct 27, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED

    The comment that justified the > 1 MB fallback cited a byte figure that is no longer true, and the repo it named is archived. The fallback is kept — it is a forward guard, and it is not dead code — and the comment now states the threshold, what triggers it, and a live measurement.

    Landed. #258 — squash commit b7e2a2c278f7d16ec03788ccfe5bd4cb42ae590d on main; the merge-time tag v2026.300.0451 points at the head 64a77de9441004e95538eb731071b543c941652a, and the tag-on-merge action wrote CHANGELOG/2026.300.0451.md from the PR body (follow-up commit d256175).

    The fix, in detail. scripts/strip-config-version.sh carries a branch that reads a blob through the git blob API when the Contents API omits the inline body — the API omits it above 1 MB. The comment explained the branch with a figure from a repo the org archived, so the justification pointed at a file that no longer exists. It now reads:

    # This is a FORWARD GUARD, not a live path: it triggers when a charly.yml grows past
    # 1 MiB (1,048,576 bytes). No file in the org is near that today — the largest is
    # charly/charly.yml at 316,230 bytes (measured 2026-10-27; re-measure before citing
    # it). The branch itself is not dead code: scripts/strip-config-version_test.sh
    # exercises it with a > 1 MB fixture on every run of this repo's gate.
    

    The figure is measured, not remembered: over the fully materialized org tree — 411 declared paths, 1,181 charly.yml files — the largest is charly/charly.yml at 316,230 bytes, and the next two are 306,499 bytes. Nothing in the org is within a factor of four of the 1 MiB threshold, so the branch is a guard and the comment says so.

    The branch is live, and the gate proves it on every run. This repo's own test drives the fallback with a > 1 MB fixture (scripts/strip-config-version_test.sh:361-365), so the branch is covered by the gate rather than merely present:

    # ---- > 1 MB fallback: Contents API omits content; the git blob API supplies it ---
    out="$(FORCE_BIGFILE=1 strip bigfile 2>&1)" || { echo "FAIL: the large-file fallback must classify, not fail" >&2; exit 1; }
    grep -q 'wrote bigfile:charly.yml' "$STATE/transcript" || { echo "FAIL: a > 1 MB charly.yml must still be stripped via the blob fallback" >&2; exit 1; }
    
    ### bash scripts/strip-config-version_test.sh
    strip-config-version_test: all assertions passed
    rc=0
    

    The RCA. A comment that justifies a branch with a figure from a retired repo is a claim that cannot be re-derived: the repo it names is gone, so nobody can check the number, and the number that was there described a file that no longer exists. The root fix is that the comment now states the threshold (which is a property of the API, not of any file), the trigger (a charly.yml above 1 MiB), and a dated live measurement with an instruction to re-measure before citing it again — so the next reader has a number they can reproduce, and knows when it went stale.

    Validator. The fresh charly/pr-validator run on head 64a77de returned PASS; the full report was read in full and it raised no blocking finding.

    Agent: charly

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions