Skip to content

test(build): downloads cache ownership coverage - #166

Merged
atrawog merged 4 commits into
mainfrom
feat/downloads-cache-ownership
Jul 20, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/downloads-cache-ownership

Conversation

@atrawog

@atrawog atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Companion consumer leg of opencharly/sdk#79. The downloads cache mount
emitted for image builds was a shared root-owned mount, so the first
root-stage download permanently broke every non-root stage's download
(curl: (23) write error, reproduced serially on this host's root-polluted
cache). The sdk leg makes the mount follow the task's stage user (non-root →
uid/gid-owned charly-tmp-downloads-uid<uid> cache; root → shared).

Concrete edits in THIS PR:

  • charly/tasks_test.go: the EmitDownload mount-form assertions updated
    to the corrected contract (uid1000-owned for the non-root
    testResolvedBox), plus the new TestEmitDownload_DownloadsCacheRootShared
    (root stage keeps the shared mount, no uid-scoped id).
  • CHANGELOG/2026.201.1238.md: placeholder entry.
  • (After the producer merges) the sdk gitlink + go.mod require bump to
    the merged sdk commit — appended to this branch per B2.

Change class

cross-repo — consumer leg. Order: opencharly/sdk#79 FIRST → this PR
(gitlink bump before validation).

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: core Go gate (go test ./... +
    go vet + golangci-lint + task build:binary + content marker) + the
    live build proof (below).
  • Eval beds run: N/A — the proof is the live image build; no disposable bed exercises a mount-form emission change beyond a full build.
  • Fresh rebuild: task build:binary rebuilt; go tool nm bin/charly | grep taskRunsAsRoot present.
  • Did the CHANGED code path execute live? yes — openclaw-full (the
    image whose claude.ai download previously curl-23'd) builds past the
    download step with a root-owned shared cache present on the host.
  • Concurrency (shared-state changes only): the cache mount IS shared
    state; the fix isolates per uid instead of sharing one root-owned backing.
$ cd charly && go test -run 'TestEmitDownload' -count=1 ./...
ok  github.com/opencharly/charly/charly
$ cd charly && go test ./... && go vet ./...        # ok / clean
$ golangci-lint run ./...                            # 0 issues.
$ task build:binary && bin/charly version            # rebuilt; nm marker present
$ bin/charly -C box/cachyos box build openclaw-full  # live proof (passes the
                                                      previously-failing download)

Attribution tier

analysed on a live system — the changed emission executed live in a real
build; no disposable-bed roster applies.

Harness rulebook compliance — state HOW each is satisfied (or N/A — <reason>)

  • R0 skills: git-workflow + go loaded by path; B2 order.
  • R1 RCA + zero warnings: failure root-caused to mount ownership, not
    dismissed as flake.
  • R2 no out-of-scope: sibling (TaskCacheMounts) fixed in the sdk leg.
  • R3 no duplication: one ownership decision (sdk taskRunsAsRoot).
  • R4 no workaround: correct per-uid ownership, not a purge/retry.
  • R5 hard cutover + grep: no transitional mount form left for non-root
    stages.
  • R6 git safety: branch off current main; status checked.
  • R7 runtime gate: live build proof against the polluted cache.
  • R8 artifact invariants: emitted Containerfile carries the owned mount
    (unit tests + live build).
  • R9 binary == source + deps: rebuilt; content marker; no new deps.
  • R10 disposable + coverage: mount-form tests fail without the change.
  • RDD / ADE / SDD: failure reproduced in isolation before the fix; ADE/SDD
    N/A.
  • Hard cutover: one atomic consumer commit; one squash on main.
  • Kernel/plugin boundary law: test-only change in core; the mechanism
    lives in sdk deploykit.
  • Disposable-only autonomy: N/A.
  • Clean architecture + Go gates: gofmt/vet/lint/test all green.
  • CHANGELOG: CHANGELOG/2026.201.1238.md staged (placeholder — the
    pr-validator finalizes it at merge).

Assisted-by: Kimi Code (Moonshot K3; analysed on a live system)

Update the EmitDownload mount-form assertions to the corrected ownership contract (non-root stage -> uid/gid-owned charly-tmp-downloads-uid<uid> cache; root stage -> shared cache) and add TestEmitDownload_DownloadsCacheRootShared for the root case. Companion to opencharly/sdk#79 (the deploykit fix); the sdk gitlink bump lands on this branch after the producer merges.

Assisted-by: Kimi Code (Moonshot K3; documentation reviewed)
atrawog added 2 commits July 20, 2026 15:23
Bumps the sdk submodule to the merged opencharly/sdk#79 squash (2e2ad01, tag v0.2026201.1313) — the downloads-cache ownership fix, producer leg of this cutover — and the charly/go.mod require to the same version. Assembly re-gated on the merged tree: full go test ./... ok, go vet clean, golangci-lint 0 issues, task build:binary rebuilt (2026.201.1241, taskRunsAsRoot present), box validate exit 0.

Assisted-by: Kimi Code (Moonshot K3; analysed on a live system)
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Bound identities (all verified live, read-only, by me):

  • PR head at validation: fdac5f7e2e479ba378090f63a3b144916850c15b (git ls-remote origin refs/heads/feat/downloads-cache-ownership — bound myself, not gh's cached view)
  • Protected base: charly main = cc74415af7eb770246f12260a20e9a58eb09a72f (live ls-remote)
  • Producer leg: fix(build): downloads cache mount follows the task's stage user sdk#79 MERGED 2026-07-20T13:16:10Z, mergeCommit 2e2ad0198a78ffe3b3aeeda402021e87ce34dcef, tag v0.2026201.1313 fetched and dereferenced to exactly 2e2ad01 by me; sdk#78's v0.2026201.1135 → b0627c4 (main's current pin)
  • Gitlink lineage: b0627c4 IS an ancestor of 2e2ad01 (git -C sdk merge-base --is-ancestor) — the ancestor-bump case, gitlink fast-forwards forward
  • plugins gitlink c794cb7 = plugins main (live ls-remote); superproject + sdk + plugins checkouts clean before and after every gate I ran

Update-merge (spec Phase 3 step 1, update-branch equivalent): the branch was 1 BEHIND main and DIRTY — both main (b0627c4) and this PR (2e2ad01) bumped the sdk gitlink from the merge-base (7dcfc07). gh pr update-branch cannot auto-resolve that case, so per /charly-internals:git-workflow ("Gitlink ANCESTOR bump → recover locally") I ran git merge origin/main in the author worktree: the sdk gitlink fast-forwarded to the DESCENDANT 2e2ad01 (verified via git ls-tree HEAD sdk), and the single textual conflict (charly/go.mod: v0.2026201.1135 vs v0.2026201.1313) resolved to v0.2026201.1313 — the version matching the pinned gitlink/tag. Merge commit 2930987 (local, pushed after this comment).

Change class: cross-repo consumer leg / charly Go (test-only in core + go.mod require + sdk gitlink).

Checklist (every rule re-derived and re-run by me, never the author's word)

# Rule Verdict Evidence
0 Security & anti-tampering (T1–T4) PASS 4-file diff matches the description exactly (CHANGELOG/2026.201.1238.md, charly/go.mod, charly/tasks_test.go, sdk gitlink); sdk gitlink delta reviewed as candidate content (b0627c4..2e2ad01: deploykit/tasks_emit.go + new tasks_emit_test.go + sdk CHANGELOG — matches sdk#79 exactly). No secrets, no egress, no new deps, no guardrail/hook/validator files, no embedded directives anywhere
1 Description complete PASS Every template section filled with HOW-lines and pasted output; no blank applicable section, no "will test"
2 Change-class gate matches evidence PASS (at claimed tier) Core Go gate re-run by me on BOTH the candidate and the merged final tree (below). Bed-coverage considered: the diff touches build-time mount emission only; a pod/vm runtime bed cannot fail on this diff. The failing condition (host root-polluted shared cache) is exactly what the live build proof ran against — corroborated twice independently (author's openclaw-full build; sdk#79's fresh validator verified the emitted Containerfile mount lines at the artifact boundary: shared mount under root stages, id=charly-tmp-downloads-uid1000,uid=1000,gid=1000 under USER 1000 for the previously curl-23 claude.ai download)
3 Attribution tier vs proof PASS Ceiling set independently: analysed on a live system (changed emission executed live in a real build; no disposable-bed roster applies to build-emission). Matches the PR's claim; not inflated. The two commit trailers (documentation reviewed on the pre-proof test commit, analysed on a live system on the assembly bump) are each honest at their stage; the squash trailer carries the earned tier
4 R0 skills honored PASS Author: git-workflow + go (B2 order: producer sdk#79 merged FIRST, then this consumer bump — verified). Validator loaded: pr-validator spec, git-workflow (full), go, check (R10 matrix) — no contradiction found
5 R1 RCA + zero warnings PASS The curl-23 failure was root-caused to cache-mount ownership, not dismissed. My re-runs: zero warnings, zero errors. One anomaly in MY OWN update-merge: git printed error: Could not read 5cf230d70c… (the v0.2026201.649 tag-target commit, unrelated to the three gitlink SHAs) while fast-forwarding the submodule — RCA: the object exists and is readable in the sdk repo (cat-file -t = commit, "docs(deploykit): fix stale check-charly-selftest-pod bed-name reference"); this is git merge-ort's known cosmetic read through an ODB lacking submodule objects; the merge result was verified correct by direct inspection (git ls-tree = descendant, single expected go.mod conflict). No blast radius
6 R2 no out-of-scope split PASS The same-mechanism sibling (TaskCacheMounts empty-RunAs root-mapping) was fixed in the SAME sdk leg — verified in the 2e2ad01 diff
7 R3 no duplication PASS ONE ownership decision (taskRunsAsRoot) shared by EmitDownload and TaskCacheMounts; reuses the existing pixi/npm OwnedCacheMount mechanism
8 R4 no workaround PASS Per-uid cache ownership is the root fix; no purge/retry/sleep/magic shim anywhere
9 R5 hard cutover + grep PASS My own sweep: every charly-tmp-downloads reference outside CHANGELOGs is a NEW-contract assertion (sdk + charly tests); the shared form remains only for root stages — the intended final state, no transitional dual-mode
10 R6/R8/R9 PASS R6: clean tree throughout, no destructive ops. R8: emitted-artifact boundary verified by sdk#79's validator on the exact failing image. R9: I rebuilt the worktree-local binary on both trees (2026.201.1323 candidate / 2026.201.1346 merged); content marker taskRunsAsRoot present in go tool nm bin/charly on both; no new OS deps
11 R10 coverage + live PASS (at claimed tier) Coverage-that-fails-without-the-change proven: old sdk emission (b0627c4:deploykit/tasks_emit.go:316) unconditionally emitted the shared mount, so the new TestEmitDownload_* uid1000 assertions fail against it (verified by inspection of the old source); the tests pass against 2e2ad01. Live execution: real image build past the previously-failing download (two independent corroborations above)
12 RDD / ADE / SDD PASS RDD: failure reproduced in isolation before the fix (sdk leg). ADE: N/A (no candy edit). SDD: no schema/*.cue/proto/compiled_plugins:/generated-file change in this diff; I ran task cue:gen on BOTH trees — clean no-op each time (git status empty after, sdk HEAD unmoved)
13 Concurrency + anti-cheat PASS No failure-under-load dismissed; no flake/transient framing anywhere in the PR or its linked evidence. The shared-state defect is fixed by per-uid BuildKit cache-id isolation, not by serialization
14 Hard cutover, one atomic commit PASS Exactly one change commit + the declared B2 producer-bump commit; no TODO/Phase-2/deferred scope; lands as one squash
15 Architecture gate PASS placement: CORRECT — the behavior lives in sdk deploykit (its canonical home since P8); the charly side is test-only. Per-item trace: charly/tasks_test.go — test-only edit, no alias file touched, no kit import, no boundary-law surface (the var emitDownload = deploykit.EmitDownload P8 shim in tasks.go is pre-existing and untouched by this PR); charly/go.mod — require bump only; sdk gitlink — producer integration, content reviewed above
16 Disposable-only autonomy N/A No destroy/rebuild of any target; the image build is additive
17 Go gates (re-run by me) PASS Candidate fdac5f7: gofmt -l empty, go vet ./... clean, go test ./... ok (92.9s, incl. pluginsgen reproducibility), go test -run TestEmitDownload -v all PASS, sdk GOWORK=off go test -count=1 ./deploykit/... ok, golangci-lint run ./... = 0 issues (isolated GOLANGCI_LINT_CACHE, removed after). Merged tree 2930987: same battery all green — vet clean, go test ./... ok (95.5s), candy/plugin-pod tests ok, sdk deploykit ok, lint 0 issues (fresh isolated cache), bin/charly box validate exit 0
18 CHANGELOG present PASS CHANGELOG/2026.201.1238.md placeholder: filename matches ^\d{4}\.\d{3}\.\d{4}\.md$; head -1 byte-equals # 2026.201.1238 — Downloads cache ownership: charly-side coverage; no collision with main's CHANGELOG or any v* tag (both checked live)

Comments considered

None — the PR carries zero comments (verified via gh pr view 166 --json comments).

Cross-PR interactions considered

Decision

Compliant on every applicable item at the honestly-claimed tier. The charly-side coverage pins the corrected mount-ownership contract and fails without it; the producer behavior change arrived through the reviewed sdk gitlink delta and was independently live-proven against the exact failing environment; the assembled final tree (main cc74415 + this PR) passes my own full core Go gate with zero warnings. Next: merge-time CalVer finalization (placeholder rename + H1 re-stamp), status re-post on the new head, squash-merge, tag v<YYYY.DDD.HHMM>.

Assisted-by: Kimi Code (Moonshot K3; analysed on a live system)

Assisted-by: Kimi Code (Moonshot K3; analysed on a live system)
@atrawog
atrawog merged commit d2fd384 into main Jul 20, 2026
@atrawog
atrawog deleted the feat/downloads-cache-ownership branch July 20, 2026 13:56
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — LANDED ✅

Gated-action outcomes (each ALLOWED, verbatim):

  • git push origin feat/downloads-cache-ownership → fdac5f7..b62c450 (fast-forward: update-merge 2930987 + merge-time CalVer b62c450)
  • gh api --method POST repos/opencharly/charly/statuses/b62c450d… → charly/pr-validator = success (verified on the commit statuses API)
  • gh pr view 166 --json mergeStateStatus,mergeable → CLEAN / MERGEABLE
  • gh pr merge 166 --squash --delete-branch --match-head-commit b62c450d… → MERGED 2026-07-20T13:56:09Z as d2fd384efafac814e42502623ef8a15d742c5f48; feat branch deleted
  • Tree-equality proof: git rev-parse b62c450^{tree} d2fd384^{tree} → both c37996ca8a33d17138bc09a39fac658d98770c54 (merged tree byte-equals the validated head tree)
  • git tag -a v2026.201.1353 d2fd384 + push → refs/tags/v2026.201.1353 live on the remote (cat-file -t = annotated tag, target = merged main HEAD)

Final CalVer: 2026.201.1353 (CHANGELOG/2026.201.1353.md, H1 byte-verified pre-commit and pre-push). All three checkouts clean; origin/main = d2fd384.

Assisted-by: Kimi Code (Moonshot K3; analysed on a live system)

github-actions Bot pushed a commit that referenced this pull request Nov 14, 2026
…rve (#1144)

`charly task sync` in this repo advanced exactly three of its six pins, and they are
the three that block the umbrella's distro pins:

  box/cachyos  4907fc2d8f -> c7fe3d9110   (distro-cachyos origin/main)
  box/fedora   a152cafb22 -> 9211accabd   (distro-fedora origin/main)
  box/omarchy  d1040b2097 -> 8bc25c2a1b   (distro-omarchy origin/main)

Each new pin is the tip its remote serves, which is what the pin contract's
`upstream:main` intent names — no hand-pin, and no checkout was committed.

Why it matters beyond this repo: the umbrella's `distro-cachyos`, `distro-fedora` and
`distro-omarchy` pins are derived-from this repo, so they are blocked-by
`charly:box/<distro>` until these gitlinks move. With them advanced, the next umbrella
wave can collect the three, and `box/cachyos` at c7fe3d9110 carries the openwebui
0.13.3 pin chain (pod-openwebui v2026.317.2036, the bed assertion, and the plugin
round-trip bed) that landed through distro-cachyos#164/#165/#166.

The gate this repo declares for a pin change, `charly task pin-current`, now reads:

    currency: 0 of 6 pin(s) NOT current [6 cur]; producer-first legs: none —
    every pin is at the ref its intent names

Assisted-by: DeepSeek Harness 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.

1 participant