Skip to content

refactor(deploykit,kit): every per-host config writer reads inside the shared lock - #632

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/perhost-writers
Nov 24, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
fix/perhost-writers

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #631. The per-host charly.yml (~/.config/charly/charly.yml) has four
section writers that run in different charly processes — the deploy overlay, the install ledger,
the host snapshot and the git-ref cache. opencharly/spec#437 published spec/perhost as that
file's ONE reader/writer (Lock, Apply, Update, Read, Get, Set); this routes the three
SDK writers through it and fixes the lost update the ledger had kept.

The ledger read outside the lock (a real data loss, found by this migration).
WriteDeployRecord, WriteCandyRecord, DeleteDeployRecord, DeleteCandyRecord and
AddCandyDeployment/RemoveCandyDeployment read the ledger, mutated that snapshot, and handed it
to writeLedger, which locked and replaced the whole ledger: section with the snapshot it had
been given. Two concurrent ledger writes therefore each dropped the other's record — measured
against the pre-change tree with the new test: 21 of 24 concurrently-added candy records lost,
on 5 of 5 runs
. They now call ONE mutateLedger, which decodes the ledger: section from the
document spec/perhost's lock just read and runs the mutation on THOSE maps: read inside the
lock, own key only, atomic replace.

The deploy writer's second copy. SaveDeployConfig kept its own
read/marshal/tempfile/chmod/rename. It is called INSIDE the deploy cycle
(deploykit.MutateDeployConfig), which already holds the lock and must not be re-entered —
flock is per-open-file-description, so a second acquire in one process waits for the first and
fails at perhost.LockWait. It now writes through perhost.Apply (the lock-held half of
perhost.Update), and the cycle takes its lock from perhost.Lock, so deployConfigLockWait (a
10 s copy of perhost.LockWait) and its second lock path are gone. The fail-safe re-read moves
INSIDE the locked mutation, so the check and the write are one critical section.

The reader. readLedger, readLedgerStrict and every writer decode through one
ledgerFromRoot over perhost.Read; the hand-rolled ledgerDoc decode of the same section is
deleted. ledgerFromRoot REFUSES a wrong-shape section (ledger: / ledger.deploys: /
ledger.candies: present but not a mapping) by name, so the strict reader keeps the strictness it
exists for: the strict path propagates the refusal, the best-effort path degrades to empty, and a
writer refuses to rewrite a malformed ledger.

The remaining per-host writer is kit.writeSystemInfo (system:), migrated in the same commit.

How tested

$ git rev-parse HEAD
08b83753239d6b0a72e5b74b1ebd95db1c4030b8
$ GOTOOLCHAIN=go1.26.8 go build ./... && GOTOOLCHAIN=go1.26.8 go vet ./... \
    && GOTOOLCHAIN=go1.26.8 go test ./... -timeout 1200s && test -z "$(gofmt -l .)" \
    && GOTOOLCHAIN=go1.26.8 golangci-lint run ./kit/... ./deploykit/... && echo SDK_GATE_OK
… 21 packages ok (1 with no test files), no FAIL …
0 issues.
SDK_GATE_OK

$ for a in amd64 arm64 arm 386; do GOOS=linux GOARCH=$a CGO_ENABLED=0 go build ./...; done
(no output)

Red proofs, measured, not assumed.

The concurrency test. With kit/install_ledger.go restored to its pre-change form and the new
test unchanged:

$ for i in 1 2 3 4 5; do go test ./deploykit/ -run TestConcurrentPerHostWriters -count=1 2>&1 | grep -c "was lost"; done
21
21
21
21
21

and with this branch's tree: ok on 5 of 5 consecutive runs.

The strictness tests. Against this PR's round-1 head 1613fd2 (same new test files):

--- FAIL: TestStrictReader_RefusesAWrongShapeLedger (0.00s)
    --- FAIL: TestStrictReader_RefusesAWrongShapeLedger/deploys-is-a-sequence (0.00s)
        install_ledger_shape_test.go:29: ListDeployIDsStrict: wrong-shape ledger returned nil error
    --- FAIL: TestStrictReader_RefusesAWrongShapeLedger/candies-is-a-scalar (0.00s)
        install_ledger_shape_test.go:29: ListDeployIDsStrict: wrong-shape ledger returned nil error
    --- FAIL: TestStrictReader_RefusesAWrongShapeLedger/ledger-is-a-sequence (0.00s)
        install_ledger_shape_test.go:29: ListDeployIDsStrict: wrong-shape ledger returned nil error
    --- FAIL: TestStrictReader_RefusesAWrongShapeLedger/ledger-is-a-scalar (0.00s)
        install_ledger_shape_test.go:29: ListDeployIDsStrict: wrong-shape ledger returned nil error
--- FAIL: TestWriter_RefusesAWrongShapeLedgerAndKeepsItsBytes (0.00s)

The fail-safe. With the recheck() call deleted from SaveDeployConfig (same test file):

--- FAIL: TestSaveDeployConfigRefusesAnUnloadableConfig (0.00s)
    deploy_failsafe_test.go:47: SaveDeployConfig wrote over a present-but-unloadable config

Test accounting, stated exactly:

  • NEW in this PR —
    • deploykit/perhost_concurrency_test.go (TestConcurrentPerHostWritersPreserveEverySection):
      all four real writers at once — the deploy cycle (MutateDeployConfig + SaveDeployConfig),
      eight concurrent kit.AddCandyDeployment installs released together per wave (three
      waves), refs.GitClient.SetBypass, and kit.PopulateSystemInfo — then asserts every deploy
      entry, every ledger record and the cache:/system: sections survive.
    • deploykit/deploy_failsafe_test.go: TestSaveDeployConfigRefusesAnUnloadableConfig (refusal +
      bytes untouched) and TestSaveDeployConfigWritesWhenTheConfigLoads (the refusal is not a
      broken save path).
    • kit/install_ledger_shape_test.go: four wrong-shape strict-reader cases, a writer refusal that
      leaves the bytes untouched, and an absent-section case that must stay a non-error.
  • PRE-EXISTING on main, kept and re-run here — the whole kit and deploykit suites,
    including TestSaveDeployConfig_RoundTrip, the strict-ledger contract tests
    (TestListStrict_MalformedLedgerIsAnError) and the ledger tx-lock tests.

Scope of one claim, stated exactly: the fail-safe test proves the re-check GATES the write and the
bytes survive; that the check sits inside the locked mutation is structural — the mutation runs
while perhost.Lock is held (pinned by spec/perhost's TestApplyWritesUnderTheCallersLock) —
which is what makes check-and-replace one critical section. It is not separately hookable from
outside.

Rulebook compliance

  • R0 — /charly-internals:go, /charly-internals:plugin, /charly-internals:design,
    /charly-internals:git-workflow, /charly-internals:strict-policy.

  • R1 — the ledger lost update is the anomaly; RCA: the missed control was that no test drove
    two writers at once, so every copy of the mechanics was validated only against itself. The root
    fix is both the read-inside-the-lock mutation and the cross-writer test that would have caught
    it; the red proof above is that test failing on the pre-change code. The round-1 strictness
    regression is RCA'd in this PR's round-2 comment (missed control: a body claim of "unchanged"
    with no test that fails when it is not).

  • R2 — this PR is the de-duplication the issue asked for: one lock path, one bound, one read,
    one decode, one atomic write.

  • R3 — no sleeps, retries or suppressions in production code; the test's channel gates are a
    barrier, not a delay.

  • R5 — writeLedger, ledgerDoc and deployConfigLockWait are deleted, not deprecated, and
    the stale comment naming writeLedger is corrected. Claim-keyed sweep, pasted verbatim:

    $ grep -rn --include=*.go "writeLedger\|ledgerDoc\|deployConfigLockWait" . | sort
    kit/install_ledger_enumerate_test.go:16:func writeLedgerFixture(t *testing.T, body string) *LedgerPaths {
    kit/install_ledger_enumerate_test.go:27:	paths := writeLedgerFixture(t, `
    kit/install_ledger_enumerate_test.go:47:	paths := writeLedgerFixture(t, `
    kit/install_ledger_enumerate_test.go:79:	paths := writeLedgerFixture(t, `
    kit/install_ledger.go:210:// This is the whole point of the shape: the previous readLedger-then-writeLedger pair read the
    kit/install_ledger_shape_test.go:7:// hand-rolled decode it replaced (yaml.Unmarshal into ledgerDoc) errored on valid-YAML-wrong-shape
    kit/install_ledger_txlock_test.go:11:// writeLedger, deploykit.MutateDeployConfig/SaveDeployConfig and spec/refs GitClient.save) were
    kit/install_ledger_txlock_test.go:26:	paths := writeLedgerFixture(t, "version: \"1\"\n")
    kit/install_ledger_txlock_test.go:45:	paths := writeLedgerFixture(t, "version: \"1\"\n")
    kit/install_ledger_txlock_test.go:59:	paths := writeLedgerFixture(t, "version: \"1\"\n")
    

    No live symbol remains: the matches are the pre-existing test helper writeLedgerFixture (two
    files) and three comments that describe the change.

  • R6 — no destructive action; the worktree was clean (git status) before the branch.

  • R7 — every new guard fails without its fix (three red proofs above) and the changed paths
    run live in go test ./....

  • R8/R9/R10 — N/A: library change, no live service, no binary, no bed. The consuming binary
    rebuild is charly's own pin-bump PR.

  • R11 — no shape, field, kind, verb or capability changes; the SDK keeps rendering the shapes
    DESIGN owns and adds no new one.

Change classification

  • Class: library refactor (three writers, three new test files, one dependency bump).
  • Impact: no exported signature changes. SaveDeployConfig's contract is now stated: it is
    the lock-held writer its cycle calls (deploykit.MutateDeployConfig, AcquireDeployConfigLock),
    writing through perhost.Apply. Every runtime caller is already inside that cycle. One
    behaviour change, deliberate and named: a malformed ledger: section is now REFUSED by a writer
    and by the strict reader instead of being read as empty.
  • Error text: the parse path still reports parse ledger <path>: …; an unreadable file now
    reports parse ledger <path>: per-host config <path>: … where the old code said read ledger <path>: ….
  • Rollback: revert the two commits and the spec pin; the writers return to their own copies.

Filed issues

Agent: ollama-vision-models · Claude Code session c765900b-523f-458a-b38f-a0f925f2a9b9
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

…e shared lock

The per-host charly.yml has FOUR writers that run in different charly processes — the deploy
overlay, the install ledger, the host snapshot and the git-ref cache. opencharly/spec#435 put
the cache on spec/perhost and made it that file's one reader/writer; this routes the other
three through it and fixes the lost update the ledger had kept.

THE LEDGER READ OUTSIDE THE LOCK (the data-loss bug). WriteDeployRecord, WriteCandyRecord,
DeleteDeployRecord, DeleteCandyRecord and AddCandyDeployment/RemoveCandyDeployment all read the
ledger, mutated the snapshot, and then handed it to writeLedger, which locked and replaced the
whole `ledger:` section with that stale snapshot. Two concurrent ledger writes therefore each
dropped the other's record. Measured with the new cross-writer test against the pre-change code:
21 of 24 concurrently-added candy records lost, on 5 of 5 runs. They now call ONE mutateLedger,
which decodes the `ledger:` section from the document spec/perhost's lock just read and lets the
mutation run on THOSE maps — read inside the lock, own key only, atomic replace.

THE DEPLOY WRITER'S SECOND COPY. SaveDeployConfig kept its own read/marshal/tempfile/chmod/rename
because it is called INSIDE the deploy cycle (deploykit.MutateDeployConfig), which already holds
the lock and must not be re-entered — flock is per-open-file-description, so a second acquire in
one process waits for the first and fails at perhost.LockWait. It now writes through
perhost.Apply (the lock-held half of perhost.Update, spec v0.2026328.1115) and the cycle takes
its lock from perhost.Lock, so deployConfigLockWait — a 10 s copy of perhost.LockWait — and the
second lock path are deleted. The fail-safe re-read moves INSIDE the locked section, so the
check and the write now see the same bytes.

THE READER. readLedgerStrict and readLedger both decode through one ledgerFromRoot over
perhost.Read; ledgerDoc (a second, hand-rolled decode of the same section) is deleted.

Coverage: deploykit/perhost_concurrency_test.go drives all four real writers at once (the deploy
cycle, eight concurrent ledger installs released together per wave, SetBypass, and
PopulateSystemInfo) and asserts every deploy entry, every ledger record and the cache/system
sections survive. It is red on the pre-change tree (21/24 records lost) and green here.

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 1613fd26eca7be508a11252c70e94a19abdb9da8 (branch: fix/perhost-writers)

Change class: library refactor — deploykit/kit per-host config writers routed through spec/perhost, one spec dependency bump, one new concurrency test. No runtime/binary change.

Blocks

  1. R1 + T3 — the strict reader silently lost its strictness; comment and body diverge from reality.
    In kit/install_ledger.go, readLedgerStrict now decodes via ledgerFromRoot, whose _ = dv.Decode(&deploys) / _ = cv.Decode(&candies) discard the decode error. The pre-change yaml.Unmarshal(data, &ledgerDoc) errored on a valid-YAML-but-wrong-shape ledger.deploys/ledger.candies (or a scalar ledger:). So a wrong-shape section now reads as empty with no error — exactly the corruption the strict reader and TestListStrict_MalformedLedgerIsAnError exist to surface, and which the new inline comment ("perhost.Read ... exactly this function's strict contract") and the body ("the strict reader's ... unchanged") claim is preserved. Fix: propagate the decode error in the strict path, add a wrong-shape (not merely unparseable-YAML) test, and correct the comment/body. Also, for an unreadable file the old text was read ledger <path>: …; the new code emits parse ledger <path>: …, so the body's "error text is unchanged" is false for the read-error path.

  2. CONC (d) — the dead-symbol sweep is described, not pasted.
    R2/R5 assert writeLedger/ledgerDoc/deployConfigLockWait are gone, evidenced only by a prose summary of grep -rn "writeLedger\|ledgerDoc\|deployConfigLockWait" --include=*.go ("finds … nowhere, and writeLedger only as writeLedgerFixture and one comment"). A described grep result is not evidence; the real command AND its real output must be pasted (including the unchanged test files where writeLedgerFixture allegedly lives). Paste the actual transcript.

  3. R10 — the relocated fail-safe re-read is untested.
    SaveDeployConfig now runs the fail-safe recheck() INSIDE perhost.Apply's locked section ("the check and the write now see the same bytes"), but deploykit/perhost_concurrency_test.go sets DeployStateHost = nil so recheck degrades to (nil, nil) and the relocated path never executes. No test would fail if the recheck were left outside the lock, so the claimed guarantee is unproven. Exercise the fail-safe path (a present-but-unloadable config, driven concurrently) or drop the claim.

  4. CONC (b) — a surfaced finding is dismissed with a future-rebuild remedy and no filed issue.
    ## Filed issues says "None" yet lists two "findings surfaced while measuring." The second (port-conflict warning) is a genuine measurement artifact — a grep -v filter hid the detail lines — and is correctly not an issue. The first (git metadata fetched every run) is attributed to a stuck cache: git: bypass: true, fixed only "by its own pin-bump rebuild" — i.e. an external follow-up — with no issue filed. The body itself frames it as a finding; per CONC (b) that is the forbidden follow-up split. Either file a real issue or show the symptom is fully closed by this PR's spec pin.

Comments considered: none — the thread is empty (0 comments).

Verdict: BLOCK


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

View action run

…fail-safe

Round-1 review fixes.

- Block 1 (R1): ledgerFromRoot discarded Decode's error and read a present-but-non-mapping
  `ledger:`/`ledger.deploys`/`ledger.candies` as an EMPTY ledger. The decode this replaced
  (yaml.Unmarshal into ledgerDoc) errored on exactly those, so readLedgerStrict had silently
  lost the strictness it exists for. It now returns (maps, error), refuses a wrong-shape
  section by name, mutateLedger propagates the refusal (bytes stay), readLedger keeps its
  best-effort degradation, readLedgerStrict propagates. Five new tests
  (kit/install_ledger_shape_test.go) — four wrong-shape cases and a writer refusal — all fail
  against 1613fd2 and pass here.
- Block 2 (CONC d): the dead-symbol sweep is now pasted, not summarized.
- Block 3 (R10): the fail-safe re-read moved into perhost.Apply's mutation and no test executed
  it (the concurrency test nulls DeployStateHost). deploykit/deploy_failsafe_test.go drives it:
  an erroring LoadUnifiedDeployConfig makes SaveDeployConfig refuse and leaves the file's bytes
  byte-identical, while the same call with a loadable config writes. Deleting the recheck() call
  makes the test fail ("wrote over a present-but-unloadable config").
- Block 4 (CONC b): the warm-up sweep finding is filed (opencharly/spec#438) instead of being
  explained away; the bypass disposition names the spec pin this PR carries.

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS

Round-2 RCA and fixes — all four blocks fixed in this round.

1. R1 + T3 — the strict reader lost its strictness (real defect, fixed)

Mechanism. readLedgerStrict moved onto ledgerFromRoot, which (a) discarded Decode's error
with _ = and (b) treated a present-but-non-mapping ledger:/ledger.deploys/ledger.candies as
absent. The pre-change yaml.Unmarshal(data, &ledgerDoc) errored on both. So a wrong-shape ledger
silently read as empty — the exact corruption the strict reader exists to surface — while the
inline comment and the body claimed the contract was unchanged.

Missed control. I checked only the one case the existing test pinned (unparseable YAML) and
never re-read the behaviour of the decode I deleted. The control that catches this class is:
for every sentence in the body that says "unchanged", name the test that fails if it is not — the
strict-reader sentence had no shape-case test, and that absence was the signal.

Fix. ledgerFromRoot now returns (maps, error) and refuses a non-mapping ledger:,
ledger.deploys: or ledger.candies: with a named error; mutateLedger propagates it (the write
is refused and the bytes stay), readLedger keeps its best-effort degradation to empty, and
readLedgerStrict propagates. Four wrong-shape cases plus a writer-refusal case are pinned in
kit/install_ledger_shape_test.go — all five fail against round-1's head 1613fd2 and pass
here. The error-text claim is corrected in the body: the parse path still says parse ledger <path>: …, and an unreadable file now also reports parse ledger <path>: … per-host config …
rather than the old read ledger <path>: ….

2. CONC (d) — a described sweep is not a sweep (fixed)

The body now pastes the command and its output verbatim; the transcript is in ## Rulebook compliance under R5. It shows ledgerDoc and deployConfigLockWait nowhere and writeLedger
only as the pre-existing test helper writeLedgerFixture (4 call sites, 2 files) and in three
comments describing the change.

3. R10 — the relocated fail-safe was unproven (fixed)

Correct: perhost_concurrency_test.go nulls DeployStateHost, so recheck degraded to
(nil, nil) and the moved path never ran.

Missed control. When code MOVES, the test that exercised it before the move must be re-aimed
at the new path; I moved the re-check into the mutation and only kept the test that covers the
surrounding write.

Fix. deploykit/deploy_failsafe_test.go: with a LoadUnifiedDeployConfig that returns an
error, SaveDeployConfig returns the refusing to overwrite refusal and the file's bytes are
byte-identical to the seeded ones; the same call with a loadable config writes (so the refusal is
not a broken save path). Non-vacuous: deleting the recheck() call makes
TestSaveDeployConfigRefusesAnUnloadableConfig fail with "wrote over a present-but-unloadable
config" (measured). Scope of the claim, stated exactly: the test proves the re-check GATES the
write and the bytes survive; its placement inside the mutation is structural — the mutation runs
while perhost.Lock is held (pinned by spec/perhost's own TestApplyWritesUnderTheCallersLock),
which is what makes the check and the atomic replace one critical section.

4. CONC (b) — a surfaced finding was dismissed (fixed)

Missed control. I decided the disposition of each finding by whether a narrative came to mind
("it is host state", "it is deliberate") instead of by whether the remedy lives in this diff. The
rule is mechanical: if the remedy is an external follow-up, it is filed.

  • Filed: the warm-up cold check re-probes every repo's default branch after 1 h, so a project load pays a full git ls-remote sweep spec#438 — the warm-up's cold check accepts an age-less persisted
    latest-tag entry but requires a ≤1 h IN-MEMORY default-branch answer, so once the persisted
    answers age out, every project load pays a full 32-repo git ls-remote sweep (the measured
    30:45 wall / 4:00 CPU). Filed with the transcript and a proposed remedy + test.
  • Not a finding (and now shown, not asserted): the cache: git: bypass: true that made the
    same run's every resolution fresh is host state, and its stale re-assertion is fixed by
    bypassOwned in spec v0.2026328.1009 — the pin this PR carries. The flag itself is cleared
    through the operator surface (charly cache bypass --off), not by code.
  • Withdrawn: the port-conflict warning. It was my own grep -v '^\s' filter hiding the indented
    detail lines; FormatPortConflicts emits them.

Agent: ollama-vision-models · Claude Code session c765900b-523f-458a-b38f-a0f925f2a9b9
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Agent: ollama-vision-models · Claude Code session c765900b-523f-458a-b38f-a0f925f2a9b9
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 08b83753239d6b0a72e5b74b1ebd95db1c4030b8 (branch: fix/perhost-writers)

Security screen: PASS — no secrets/egress, no weakened gate (the fail-safe and strict-reader refusals are preserved and now proven), spec pin is first-party.
Checklist: All applicable rules PASS or NA. R1 review-round findings all resolved against the current diff: (1) ledgerFromRoot now returns an error and readLedgerStrict/mutateLedger propagate it, with four shape cases + writer-refusal pinned and red-proven; (2) the writeLedger/ledgerDoc/deployConfigLockWait sweep is pasted verbatim and internally consistent (only the pre-existing writeLedgerFixture helper and descriptive comments remain); (3) the relocated fail-safe is exercised by deploy_failsafe_test.go and red-proven by deleting recheck(); (4) opencharly/spec#438 is filed under ## Filed issues and the bypass symptom is rebutted with the pin's bypassOwned + operator surface.
Placement: CORRECT — consolidation into spec/perhost (SDK mechanism); no charly/ core import, no alias-file growth, no capability pulled inward.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 24, 2026 11:30
@github-actions
github-actions Bot merged commit 56769c0 into main Nov 24, 2026
8 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 24, 2026
github-actions Bot pushed a commit to opencharly/charly that referenced this pull request Nov 24, 2026
…1265)

* chore(deps): bump spec to v0.2026328.1115 and sdk to v0.2026328.1130

The shipped binary must carry the per-host config writer fixes; neither pin had them yet.

- spec v0.2026328.1115 (opencharly/spec#437): spec/perhost is the ONE reader/writer of
  ~/.config/charly/charly.yml — one bounded lock, the read INSIDE it, own-key-only mutation,
  atomic replace — and exposes Lock/Apply for the wider typed overlay cycle.
- sdk v0.2026328.1130 (opencharly/sdk#632): the three remaining SDK writers (deploy overlay,
  install ledger, host snapshot) run through it. It also fixes a measured lost update: every
  ledger writer read the ledger OUTSIDE the lock and replaced the whole section with that stale
  snapshot, so two concurrent ledger writes each dropped the other's record — 21 of 24
  concurrently-added records lost, 5 of 5 runs, with the SDK's new cross-writer test against the
  pre-change tree.

No charly source changes: charly has no per-host config writer of its own (grep: os.WriteFile
only in internal/pluginsgen and one comment; the DeployConfigPath/DeployConfigEnv helpers are
referenced only by tests).

Gates on this tree: go mod tidy, go build ./..., go vet ./..., go test ./... (CORE_TEST_OK), and
the R9 worktree-local build — ./scripts/bootstrap-charly.sh -> bin/charly 2026.328.1114.

Live, with the pre-bump binary 2026.327.1010: `charly cache bypass --off` printed "git-ref cache
bypass cleared — the cache resumes" and the file read `bypass: true` again seconds later, written
by a concurrent long-lived charly process that had loaded the flag before the clear (the
bypassOwned defect). With the rebuilt binary the clear is written and read back as `false`.

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(deps): propagate the spec/sdk pins to the tools modules

Round-1 CI fix: the `go` job failed on tools/gomod-canonical's
TestContractPinsMatchShared — tools/generate-packages, tools/golden-cloudinit and
tools/golden-compile are separate GOWORK=off modules that mirror the contract pins, and the
bump touched only charly/go.mod:

  gomod_canonical_test.go:123: ../../tools/generate-packages/go.mod: requires sdk
  v0.2026327.1021, but the shared sdk pin is v0.2026328.1130 — run `charly task mods-tidy`

`charly task mods-tidy` propagated both pins into the three modules (go.mod + go.sum each).

Missed control: the gate I designed reproduced the CI job I remembered, not the one that runs.
ci.yml also carries `go test ./charly/...` from the repo root, the `tools/*` sweep, `gofmt -l
charly tools` and a per-module golangci-lint — and this repo ships `mods-tidy` for exactly this
propagation. The full job is now reproduced verbatim: CI_REPRO_OK (charly/ 241.9s, tools sweep
ok, gofmt empty, golangci-lint 0 issues in charly/ and in all five tools modules).

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (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.

refactor(config): route every per-host config writer through spec/perhost

1 participant