Skip to content

fix(refs): a transient git fault class was spelled out of the vocabulary, so it was never retried - #285

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/transient-signature-284
Oct 29, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/transient-signature-284

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

What this changes. refs/git.go's transient-fault classifier — the vocabulary that decides whether a failed git subprocess is retried or given up on — missed an entire fault class, and the miss was invisible until a transient transport fault aborted a corpus regeneration at entity 253 of ~1400.

The classifier carried the pattern http/2 — with a slash. Git writes Error in the HTTP2 framing layer — without one. The two never met, so curl's HTTP/2 framing fault was classified permanent: runGitOp broke out of its bounded retry at attempt 0, and the whole operation failed.

Head 4f6b5b9f8aeba4c3273750ff3c556b0a134ad7f7 — 4 files changed, +393 -11.

What the fix is. The one hand-written pattern becomes a table of fault classes (gitOpTransientSignatures), and the class names are the key a recorded fixture table is keyed by:

  • refs/git_transient_signatures_test.go — new, +226 — the RECORD: one observed stderr string per fault class, with where it was seen, and the BEHAVIOUR the vocabulary must produce.
  • refs/git_transient_classes_test.go — new, +84 — the accountability half: every recorded fault is classified under its own class, every recorded permanent failure is not, every class in the production table is backed by a record, and the failure names the class it carries.
  • refs/git.go — +75 -11 — the class table, the classifier transientFaultClass, the retry decision, and the class named in the returned error.
  • AGENTS.md — +8 -0 — the build section now names the toolchain the pinned linter must run under.

The behavioural file references no new production symbol — only runGitOp, which has existed unchanged since the runner was introduced — so it runs against any revision of refs/git.go. That is what makes it the red proof, and it is why the accountability file, which necessarily asserts the new vocabulary's internals, is a separate file.

The widening is bounded on the other side: the recorded permanent failures — a missing repository, a 403, a 404, a credential challenge — keep failing fast with exactly ONE request (the run is pasted below).

Why it matters here. The corpus regeneration in opencharly/marketplace (run 40922093306, attempt 1, 2026-10-29T17:36:44Z) died on exactly this string, and with it the job that owns the corpus, its deployment, and the auto-merge arm. #284 carries the full RCA.

How tested

The R7 red proof — the behavioural coverage FAILS without the change. The behavioural test file was run against the PRE-FIX production code (origin/main's refs/git.go), with the accountability file moved aside because it asserts the new vocabulary's internals. Exactly one recorded fault turns red, and it is the HTTP/2 framing fault:

$ mv refs/git_transient_classes_test.go /tmp/spec284/   # it asserts the new vocabulary's internals
$ git show origin/main:refs/git.go > refs/git.go        # the pre-fix production code
$ go test ./refs/ -run 'TestRecordedTransientFaultsAreRetried|TestRecordedPermanentFailuresAreNotRetried' -v
=== RUN   TestRecordedTransientFaultsAreRetried
=== RUN   TestRecordedTransientFaultsAreRetried/rpc_failed
=== RUN   TestRecordedTransientFaultsAreRetried/http2_protocol_fault
    git_transient_signatures_test.go:199: the recorded transient fault "fatal: unable to access 'https://github.com/opencharly/layer-golang.git/': Error in the HTTP2 framing layer" was attempted 1 time(s) — a transient fault must be retried (seen in: opencharly/marketplace run 40922093306, 2026-10-29 — curl's framing fault, spelled WITHOUT a slash)
=== RUN   TestRecordedTransientFaultsAreRetried/connect_failed
=== RUN   TestRecordedTransientFaultsAreRetried/connection_reset
=== RUN   TestRecordedTransientFaultsAreRetried/host_unresolvable
=== RUN   TestRecordedTransientFaultsAreRetried/deadline_exceeded
=== RUN   TestRecordedTransientFaultsAreRetried/early_eof
=== RUN   TestRecordedTransientFaultsAreRetried/network_unreachable
=== RUN   TestRecordedTransientFaultsAreRetried/transfer_closed
=== RUN   TestRecordedTransientFaultsAreRetried/hung_up
=== RUN   TestRecordedTransientFaultsAreRetried/unexpected_disconnect
=== RUN   TestRecordedTransientFaultsAreRetried/empty_reply
=== RUN   TestRecordedTransientFaultsAreRetried/server_error
--- FAIL: TestRecordedTransientFaultsAreRetried (0.39s)
    --- PASS: TestRecordedTransientFaultsAreRetried/rpc_failed (0.03s)
    --- FAIL: TestRecordedTransientFaultsAreRetried/http2_protocol_fault (0.00s)
    --- PASS: TestRecordedTransientFaultsAreRetried/connect_failed (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/connection_reset (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/host_unresolvable (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/deadline_exceeded (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/early_eof (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/network_unreachable (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/transfer_closed (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/hung_up (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/unexpected_disconnect (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/empty_reply (0.03s)
    --- PASS: TestRecordedTransientFaultsAreRetried/server_error (0.03s)
=== RUN   TestRecordedPermanentFailuresAreNotRetried
=== RUN   TestRecordedPermanentFailuresAreNotRetried/fatal:_repository_'https://github.com/opencharly/does-not-exist.git/'_not_found
=== RUN   TestRecordedPermanentFailuresAreNotRetried/fatal:_unable_to_access_'https://github.com/opencharly/private.git/':_The_requested_URL_returned_error:_403
=== RUN   TestRecordedPermanentFailuresAreNotRetried/fatal:_unable_to_access_'https://github.com/opencharly/private.git/':_The_requested_URL_returned_error:_404
=== RUN   TestRecordedPermanentFailuresAreNotRetried/fatal:_unable_to_access_'https://github.com/opencharly/x.git/':_could_not_read_Username_for_'https://github.com':_terminal_prompts_disabled
--- PASS: TestRecordedPermanentFailuresAreNotRetried (0.00s)
    --- PASS: TestRecordedPermanentFailuresAreNotRetried/fatal:_repository_'https://github.com/opencharly/does-not-exist.git/'_not_found (0.00s)
    --- PASS: TestRecordedPermanentFailuresAreNotRetried/fatal:_unable_to_access_'https://github.com/opencharly/private.git/':_The_requested_URL_returned_error:_403 (0.00s)
    --- PASS: TestRecordedPermanentFailuresAreNotRetried/fatal:_unable_to_access_'https://github.com/opencharly/private.git/':_The_requested_URL_returned_error:_404 (0.00s)
    --- PASS: TestRecordedPermanentFailuresAreNotRetried/fatal:_unable_to_access_'https://github.com/opencharly/x.git/':_could_not_read_Username_for_'https://github.com':_terminal_prompts_disabled (0.00s)
FAIL
FAIL	github.com/opencharly/spec/refs	0.403s
FAIL
rc=1

The same coverage is GREEN against the changed code, together with the accountability half:

$ go test ./refs/ -run 'TestRecorded|TestTransient|TestEveryTransientClass' -v
--- PASS: TestRecordedTransientFaultsAreClassifiedUnderTheirOwnClass (0.00s)
--- PASS: TestRecordedPermanentFailuresAreNotClassifiedTransient (0.00s)
--- PASS: TestEveryTransientClassHasARecordedSignature (0.00s)
--- PASS: TestTransientFailureNamesItsClass (0.03s)
--- PASS: TestRecordedTransientFaultsAreRetried (0.42s)
--- PASS: TestRecordedPermanentFailuresAreNotRetried (0.00s)
PASS
ok  	github.com/opencharly/spec/refs	0.465s
rc=0

The change-class gate — this repo's own CI, on the committed tree. opencharly/spec's .github/workflows/ci.yml runs build, test, gofmt and golangci-lint; all four ran here, on commit 4f6b5b9:

$ GOWORK=off GOTOOLCHAIN=go1.26.8 go build ./...
rc=0

$ GOWORK=off GOTOOLCHAIN=go1.26.8 go test ./...
ok  	github.com/opencharly/spec/refs	(cached)
ok  	github.com/opencharly/spec/spec	(cached)
ok  	github.com/opencharly/spec/schema	(cached)
ok  	github.com/opencharly/spec/transport	(cached)
rc=0

$ gofmt -l .
(no output — nothing to rewrite)

$ GOTOOLCHAIN=go1.26.8 golangci-lint run ./...
0 issues.
rc=0

The toolchain is named because it is part of the gate: golangci-lint v2.13.2 embeds a type-checker that reads only export-data version 4, and go1.27's standard library writes version 5, so a newer local toolchain fails the lint in an unrelated package with export data version 5 is greater than maximum supported version 4. AGENTS.md's build section now says so.

The R5 sweep, claim-keyed — the retired symbol survives nowhere.

$ grep -rn 'gitOpTransientRe' --include='*.go' .
grep exit=1

The head this body describes.

$ git rev-parse HEAD
4f6b5b9f8aeba4c3273750ff3c556b0a134ad7f7

Rulebook compliance

  • R0 — the skills this change's area loads were loaded before the first edit: /charly-internals:go (the module's Go work) and this repo's own AGENTS.md, which adds the repo-specific rules on top of the umbrella rulebook. The change is Go source under refs/ plus one prose section, so that pair is the whole admission set.
  • R1 — two anomalies were raised by this change's own gate, and both are fixed in it. The first is the defect itself: the RCA is refs: the transient-signature classifier calls git's "Error in the HTTP2 framing layer" PERMANENT, so a transient transport fault kills the whole resolution instead of retrying #284, filed with the measured classifier output, and the root fix is this diff. The second is the linter's toolchain mismatch above, which made the gate unreproducible for a reader on a newer toolchain; it is fixed by naming the toolchain in AGENTS.md's build section. Zero warnings is the only pass, and the gate above reports 0 issues.
  • R2 — one implementation: the single gitOpTransientRe pattern is replaced by one table and one classifier, and the recorded fixture table is keyed by that same class name, so the vocabulary and its record share one key rather than two lists that can drift.
  • R3 — no workaround: no sleep, no blind retry, no suppression, no fallback branch. The fix is the classification decision itself, and the retry budget stays the bounded one the runner already had.
  • R4 — the product was fixed before the prose. The defect was fixed in the classifier — the code that decides — not in a description of it; the only prose touched is the build section that tells a contributor how to reproduce the gate.
  • R5 — the legacy symbol is deleted in the same phase, with the claim-keyed sweep pasted above.
  • R6 — git status was stated before the first edit and the tree was clean; the branch feat/transient-signature-284 is off origin/main; the red proof restored the committed tree (git checkout -- refs/git.go) and the tree was clean before the push; no amend, no force-push, no hook bypass, and no direct push to main.
  • R7 — the coverage fails without the change, and the failure is pasted above: exactly one recorded fault turns red against the pre-fix production code. The changed path executes live — the real runGitOp runs, driven through a fake git on PATH, so the retry decision is measured by the invocation count rather than asserted about.
  • R8 — no live service is crossed. The fault is transport-dependent and cannot be forced from inside the repo, so the coverage pins the CLASSIFIER over recorded stderr strings, offline, with no network and nothing mocked.
  • R9 — N/A — this change produces no binary and consumes none: opencharly/spec is a Go library module, not the charly binary, and the diff touches no packaging.
  • R10 — the change class is a Go library change, and the gate that owns it is this repo's own CI workflow — build, test, gofmt, golangci-lint — run on the committed tree above. This module declares no disposable: true target and no deployment surface: its charly.yml's disposable-skill node is a skill: routing node, not a deployment target, and the repo carries no .check/ directory, so there is no bed to realize.
  • Hard Cutover — one cutover, one PR. The old pattern is replaced by the table in the same change, with no shim, no compatibility branch and no second spelling left behind.

Change classification

Change class. A runtime change in a Go library module: the retry decision of runGitOp, the code path every remote-ref resolution in the org takes.

Impact. The transient-fault vocabulary widens: git's slashless HTTP2 spelling, and the other twelve recorded classes, are retried instead of given up on. The permanent classes are unchanged — a missing repository, a 403, a 404 and a credential challenge still fail fast with exactly one attempt.

Breaking change + rollback: none — no exported symbol, wire shape, schema key or CLI surface changes; gitOpTransientRe was unexported and is replaced by unexported equivalents, and the only observable difference in a failure message is the added (transient network fault: <class>) suffix. The rollback is this change's revert.

Downstream. opencharly/marketplace — the consumer that tripped over the defect — resolves through the charly binary that vendors this module, so it picks the fix up when the module's tag is consumed.

Filed issues

None filed by this change. Every finding this change's own gate raised is fixed in it. The defect this PR fixes was filed as #284 by the RCA that found it — from the red gate of opencharly/marketplace's corpus regeneration — and this PR closes it.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

…ary, so it was never retried

The classifier matched `http/2` — with a slash — while git writes `Error in the
HTTP2 framing layer` — without one. The two never met, so a transient
transport fault was classified PERMANENT, `runGitOp` broke out of its retry
loop at attempt 0, and one fault aborted a whole `charly marketplace generate`
at entity 253 of ~1400 (opencharly/marketplace run 40922093306, attempt 1).

The vocabulary is now a table of fault CLASSES, and the class names are the key
a RECORDED fixture table is keyed by: refs/git_transient_signatures_test.go
holds one observed stderr string per class, with where it was seen, and the
tests assert both directions — every recorded fault is retried, every recorded
permanent failure fails fast with exactly one attempt, and every class in the
table is backed by a record. A class added without a record behind it fails the
test, so the list can no longer miss a class again.

AGENTS.md's build section now names the toolchain the pinned linter must run
under: `golangci-lint` v2.13.2 reads only export-data version 4, and go1.27's
standard library writes version 5, so a newer local toolchain fails the lint
in an unrelated package — an environment mismatch a contributor must be able to
recognise.

Closes #284

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

Copy link
Copy Markdown
Contributor Author

STATUS — the fix for #284 is open; the gate is green on the committed tree.

What is done. The transient-fault vocabulary in refs/git.go is now a table of fault classes, and the class names are the key a recorded fixture table is keyed by. refs/git_transient_signatures_test.go (the record and the behaviour) references no new production symbol, so it runs against any revision of refs/git.go — which is what makes it the red proof: against origin/main's production code exactly one recorded fault turns red, git's slashless Error in the HTTP2 framing layer, the string that killed the corpus's regeneration at entity 253 of ~1400. refs/git_transient_classes_test.go holds the accountability half, including the rule that every class in the production table is backed by a record — a class added without one fails the test.

What was run. The repo's own CI gate on the committed tree: build, test, gofmt and golangci-lint v2.13.2, all green, zero issues. The linter must run under the toolchain go.mod declares (go1.26.x): v2.13.2 embeds a type-checker that reads only export-data version 4, and go1.27's standard library writes version 5, so a newer local toolchain fails the lint in an unrelated package. AGENTS.md's build section now says so.

Next. The org validator's verdict on this head. Every finding it raises is fixed in one appended commit, never filed away.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

@github-actions

Copy link
Copy Markdown

Review — PASS

I re-derived every claim in the body against the current diff and commit, and traced the classifier, the retry loop, and each recorded fixture by hand.

Per-file analysis

refs/git.go (+75/−11)

  • The single gitOpTransientRe is fully removed and replaced by the gitOpTransientSignatures table + transientFaultClass, a genuine one-to-one cutover with no shim or leftover spelling (R5 sweep is consistent — gitOpTransientRe matches none of the new gitOpTransientSignatures/gitOpTransientSignature names).
  • The actual defect is fixed: the old http/2 branch is now (?i)http/2|http2, and (?i) at the start of a Go/RE2 pattern applies to the whole (http/2|http2) alternation, so HTTP2 (slashless) now matches. This is the substantive fix, not a description of it.
  • Retry logic is preserved and correct: if !timedOut { if _, transient := transientFaultClass(lastDetail); !transient { break } } — permanent faults break after one attempt, transient faults continue. timedOut handling unchanged.
  • Error naming (%w (transient network fault: %s)) is unexported and only alters a failure-message suffix — matches the body's "breaking change: none" claim.
  • Class ordering is deliberate and tested: I checked every record against the table order and each classifies under its own class (e.g. connect failed precedes connection reset and wins for the "Failed to connect … Connection refused" fixture; rpc failed precedes server error for the "RPC failed; … error: 502" fixture). No misclassification.

refs/git_transient_signatures_test.go (+226) — the behavioural half

  • Uses only runGitOp (pre-existing) plus test helpers, so it is genuinely runnable against a pre-fix refs/git.go, which is what makes the red proof valid.
  • I re-derived the red proof against origin/main's regex: 12 of 13 recorded transients match the old pattern; only the HTTP/2 framing fault does not (old pattern has http/2 with a slash). Exactly one failure — matches the pasted output. Honest.
  • Behaviour is measured (invocation count via the fake git's counter file), not merely asserted about; permanent fixtures require exactly 1 call, transient require ≥ 2.

refs/git_transient_classes_test.go (+84) — the accountability half

  • Bidirectional contract verified: all 13 table classes have a record, and each record classifies under its own name. Counts line up (13 table entries = 13 records = 13 transient subtests shown in the pasted run).
  • TestTransientFailureNamesItsClass correctly asserts the transient network fault: http2 protocol fault suffix the production code now emits.

AGENTS.md (+8) — in-scope toolchain note; explains the pinned-linter export-data mismatch, consistent with the body's R1 anomaly #2.

Body honesty

  • File count (4) and line totals (+393/−11: 8+75+84+226 = 393, −11) match the diff exactly.
  • "other twelve recorded classes" + the HTTP/2 class = 13, matching table and test output.
  • Red-proof and green-run transcripts are internally consistent with the code; the grep 'gitOpTransientRe' sweep is a legitimate confirmation of removal.

Security / cleanliness

  • No secrets; the fake-git shell script is test-only and quotes paths via strconv.Quote (temp-dir paths contain no shell metacharacters). No injection, privilege, or dependency risk. No dead code or duplicated path left behind.

Comments

  • None present (0 comment threads), so no sign-off to weigh and nothing stale to disposition.

All claims are reproduced by the diff, the fix is the classification decision itself, and the coverage fails without the change. No blocking findings.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 29, 2026 17:55
@github-actions
github-actions Bot merged commit b03be49 into main Oct 29, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 29, 2026
@aitrawog

Copy link
Copy Markdown
Contributor Author

RESOLVED — landed, tagged, and the issue is closed by hand.

The verdict. The org validator's report is ## Review — PASS (run on head 4f6b5b9), with every claim in the body re-derived against the diff: the cutover of the single pattern into the class table, the retry loop's break on a permanent fault, the deliberate class ordering, and the red proof — exactly one recorded fault red against the pre-fix code.

The merge. Squash commit b03be49d3bd35da3b165464a7d76e69949e670b0, merged 2026-10-29T17:56:20Z by the native auto-merge arm. Tag v0.2026302.1756 points at that squash commit; the served tip is 9d730c030e019c55f3fe3d8accff5852e9048719, the tag-on-merge CHANGELOG commit one commit above the tag.

The issue. opencharly/spec#284 is CLOSED — by hand, because the merge was performed by github-actions[bot], which does not close a Closes #N issue on its own.

What this unblocks. The corpus's regeneration (the consumer that tripped over the defect) is no longer exposed to a transient transport fault that was classified permanent. The umbrella's spec pin now advances to the served tip in its own consumer leg.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant