Skip to content

fix(bed): assert the keep-id CDI contract, and pin a base tag the registry has - #105

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/bed-arch-image-pin
Nov 27, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/bed-arch-image-pin

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

check-pod-cdi-userns was red for two independent reasons, and both live in this one file.

1. Its subject could not be created. pod-cdi-keepid-bind pinned
ghcr.io/opencharly/arch:2026.323.1515, which the registry answers with MANIFEST_UNKNOWN
(opencharly/plugin-deploy-pod#103), so charly config died at ensure-image before the bed exercised
anything. The base is now 2026.307.1828, the tag the repo actually carries.

2. Its assertions described a retired contract. The bed required
UserNS=host and User=0:0, and FAILED on any unit carrying UserNS=keep-id — while the merged
contract (feat/keepid-cdi-spec-v2, D-HW-10, and layer-cdi's rule that a bind-mounting unit runs as
the image user under keep-id) emits keep-id with the image user against a derived devices-only CDI
spec
. The bed was green on the shape the plugin no longer emits, and red on the shape it does — it
asserted the wrong world in both directions.

The assertions now read the contract's own lines out of the emitted quadlet:

grep -q '^UserNS=keep-id:uid=1000,gid=1000$' "$UNIT"
grep -q '^PodmanArgs=.*--cdi-spec-dir '      "$UNIT"
if grep -q '^User=0:0$' "$UNIT"; then … exit 1; fi

The step's prose, its id: (pc-userns-host-root → pc-userns-keepid-user), the bed's header comment
and the "no keep-id" aside inside the step are rewritten with them, so the file states ONE contract
instead of two (R5's claim sweep: the aside asserted the opposite of the assertion beneath it).

One addition, measured, bounded. A readiness probe before the bind write. On a RESTARTED unit
charly start returns before the container's mounts are visible, so an immediate
charly cmd … test -d /data fails (opencharly/charly#1301); the loop polls to a 60 s deadline, never
a fixed sleep, and a bind that never appears still fails the step.

Head: 15d2fd224cad26e176e0da12eb956f150cfbbe83
Diff: 1 file changed, 43 insertions(+), 15 deletions(-) — charly.yml

How tested

The change class is a bed's own assertions, so its gate is the bed, run on the committed tree through
the worktree-local binary and the plugin built from this worktree (plugin-deploy-pod: served from …/.worktrees/cdi-audit/plugin-deploy-pod-pin/candy/plugin-deploy-pod):

$ charly box validate
charly box validate: OK — checked 3 candies, 2 boxes, 9 deploys, 6 distros, 7 builders; 0 warnings, 0 errors

$ charly check run check-pod-cdi-userns
charly check run check-pod-cdi-userns: [deploy-add] PASS after 4.667s
charly check run check-pod-cdi-userns: [bring-up-members] PASS after 4ms
charly check run check-pod-cdi-userns: [check-live] PASS after 41.163s
charly check run check-pod-cdi-userns: [update] PASS after 4.143s
charly check run check-pod-cdi-userns: [cleanup] PASS after 3.034s
charly check run check-pod-cdi-userns: [cleanup-members] PASS after 0s
charly check run check-pod-cdi-userns: PASS (steps=6)

summary.yml (2026.331.1556, driver 2026.330.2135): every phase skipped: 0, and the check itself
pc-userns-keepid-user … status: PASS, reason: exit=0.

The emitted artefact, from the step's own log — before AND after the fresh rebuild:

== the emitted unit's user-namespace and user lines
AddDevice=nvidia.com/gpu=all
UserNS=keep-id:uid=1000,gid=1000
== charly config rc=0
== start … charly start rc=0
== write the bind from INSIDE the container
-rw-r--r-- 1 1000 1000 0 Nov 27 15:57 probe          (inside the container)
== the file on the HOST
-rw-r--r-- 1 1000 1000 0 Nov 27 16:57 probe          (host side, same ownership)
== fresh rebuild: remove -> config -> start
== charly config (2) rc=0, charly start (2) rc=0
== the re-emitted unit, and the bind after the rebuild
AddDevice=nvidia.com/gpu=all
UserNS=keep-id:uid=1000,gid=1000
-rw-r--r-- 1 1000 1000 0 Nov 27 15:57 probe-after-update
== charly cmd (after rebuild) rc=0
== PC-USERNS-OK

The proof this change DISCRIMINATES — the RETIRED assertions, evaluated against exactly that
artefact:

$ L=.check/pod-cdi-userns.log
$ grep -cE '^UserNS=host$' $L                       → 0     (the old assertion would fail here)
$ grep -cE '^User=0:0$'    $L                       → 0     (and so would this one)
$ grep -cE '^UserNS=keep-id:uid=1000,gid=1000$' $L  → 2     (the new one holds twice: before and after the rebuild)

So the old bed was red on the current plugin and the new bed is green on it — the assertion changed
with the contract, not around it.

One warning in the run, dispositioned, not silenced. charly remove prints

preempt: could not set "nvidia-gpu" to vfio mode after releasing "pod-cdi-keepid-bind":
  switch-to-vfio REFUSED: nvidia still held by external process(es): Hyprland (pid 4053), nvtop (pid 3931103) …

rc=0, and the run ended PASS. It is the same mechanism as opencharly/plugin-preempt#15 (a SHARED
GPU claim's release attempts a device-wide vfio flip), on this host's live desktop session; the measured
occurrence and the fact that it is fatal in a roster bed but only a stray line here are added to that
issue, which is listed under ## Filed issues.

Spike

R12 applies here in its spike-equivalent form, which is the exemption I am naming: the change
rewrites a check's assertion set, so the instrument that settles it is the artefact the bed itself
emits, and that measurement is pasted above — the RETIRED assertions (^UserNS=host$, ^User=0:0$)
evaluate to 0 matches against the unit the current plugin emits, while the new ones hold twice
(before and after the fresh rebuild), with the live bed run 2026.331.1556 (PASS, steps=6, 0 skipped)
as the boundary proof. No candidate solution was in dispute: the emitted shape is fixed by D-HW-10 and
the already-merged plugin (feat/keepid-cdi-spec-v2), and the bed was asserting its predecessor — so
the work is to make the assertion match the measured artefact, and the measurement above is the evidence
that it now does.

Rulebook compliance

  • R0 — /charly-check:check (bed authoring, the R10 gate, the uppercase-token trap),
    /charly-internals:strict-policy (R1/R3/R5), /charly-internals:git-workflow, and this repo's own
    AGENTS.md loaded before editing.
  • R1 — both failures are RCA'd from measurement (MANIFEST_UNKNOWN for the tag; the emitted unit's
    UserNS= line for the assertions); the preempt: line is dispositioned onto
    opencharly/plugin-preempt#15, not described away.
  • R2 — no second bed and no sibling assertion set: the one bed that already owns this contract is
    corrected in place.
  • R3 — the readiness loop is a deadline-bounded probe, not a sleep; the product defect behind it
    (charly#1301) is filed, and the probe narrows no assertion.
  • R4 — no documented command changes.
  • R5 — the retired contract is deleted from the prose AND the assertions in the same file, including
    the "no keep-id" aside that contradicted the grep directly beneath it.
  • R6 — git status read before staging; work in a session worktree; the base is origin/main.
  • R7 — the bed is the coverage, it runs live on a disposable deploy, and the discrimination check
    above proves it would fail without the change.
  • R8 — no external service is mocked; the bed runs against the real registry, the real GPU and the
    real quadlet.
  • R9 — the run names its binary: /home/atrawog/claude3/opencharly/charly/bin/charly 2026.330.2135,
    recorded in summary.yml as driver/driver_version, with the plugin host-built from this worktree.
  • R10 — disposable: true only; the bed's own fresh-rebuild half (remove → config → start) is the
    R10 rebuild, and charly check run passed with 0 skipped steps.
  • R11 — no DESIGN shape, requirement or field changes: the bed now asserts the requirement D-HW-10
    already states.
  • R12 — the spike-equivalent exemption, named and evidenced above (the retired assertions fail
    on the emitted artefact, the new ones hold, plus the live bed run).
  • DISP — the subject deploy is disposable: true and the run tears it down.

Change classification

No breaking change. A test bed's assertions and its subject's base tag. No candy, plugin, schema,
deploy or documented command changes shape or name. Rollback is a revert of this one squash commit.

Filed issues

  • opencharly/plugin-deploy-pod#103 — filed earlier for the unpublished base tag; fixed here
    and closed on merge.
  • opencharly/charly#1301 — charly start returns before a RESTARTED pod's bind mounts are
    visible; filed earlier in this task (not by this diff, and not updated by it). It is listed
    because the readiness probe depends on it: the probe is the deadline-bounded replacement for the
    sleep R3 forbids, it narrows no assertion, and a bind that never appears still fails the step — the
    product fix itself is charly-side work with its own RCA and is not this PR's scope.
  • opencharly/plugin-preempt#15 — UPDATED with this run's occurrence of the preempt: vfio
    refusal (a plain pod deploy, rc=0, PASS, versus the fatal roster case the issue describes). Not a new
    issue: it is the same mechanism, so the evidence went onto the one that owns it.

Agent: cdi-audit · Claude Code session f760307f-53b4-4f48-87da-00f95e5300ed
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)

…istry has

check-pod-cdi-userns failed twice over.

Its subject pinned ghcr.io/opencharly/arch:2026.323.1515, a tag the registry
answers with MANIFEST_UNKNOWN, so charly config died at ensure-image before the
bed exercised anything (#103). The base is now the
tag the repo actually carries, 2026.307.1828.

And its assertions still described the RETIRED shape: userns=host with
User=0:0, failing on any unit carrying UserNS=keep-id - while the merged
contract (feat/keepid-cdi-spec-v2, D-HW-10, layer-cdi's rule that a
bind-mounting unit runs as the image user under keep-id) emits keep-id with the
IMAGE USER against a derived devices-only CDI spec. The bed was green on a
shape the plugin no longer emits.

The assertions now read the emitted quadlet for the contract's own lines:
UserNS=keep-id:uid=1000,gid=1000, PodmanArgs=... --cdi-spec-dir, and no
User=0:0. The header comment and the "no keep-id" aside are rewritten with
them, so the file states one contract instead of two.

One more, measured: a bounded readiness probe before the bind write. On a
RESTARTED unit charly start returns before the container's mounts are visible,
so an immediate "charly cmd ... test -d /data" fails (opencharly/charly#1301).
The loop is a deadline, not a fixed sleep, and a bind that never appears still
fails the step - it narrows nothing.

Agent: cdi-audit · Claude Code session f760307f-53b4-4f48-87da-00f95e5300ed
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 15d2fd224cad26e176e0da12eb956f150cfbbe83 (branch: fix/bed-arch-image-pin)

Change class: test-bed / check-definition change (charly.yml bed assertions + base image tag); no runtime product code.

Blocks

  1. R12 — the declared "N/A" is inapplicable; a ### Spike block or a named spike-equivalent exemption is required. The diff does not merely correct prose: it rewrites the bed's user-namespace assertions (UserNS=host / User=0:0 → UserNS=keep-id:uid=1000,gid=1000 + --cdi-spec-dir, and inverts the User=0:0 check) and adds a new bounded polling loop. That is changed runtime behaviour in the check, so R12 applies. R12's exemptions are a closed set (typo / comment / prose-only / revert / spike-equivalent); "N/A — no behaviour is fixed or implemented" is not one of them, and the claim is false as written. The body already carries the substance of a spike-equivalent — the discrimination grep proving the retired assertions fail on the current artefact and the new ones hold, plus the live bed run at the boundary — so name that exemption and point to it (or supply the ### Spike block). Do not leave it as N/A.

  2. A1 / R1 — ## Filed issues omits opencharly/charly#1301. The body cites charly#1301 as the filed product defect behind the readiness probe (R3: "the product defect behind it (charly#1301) is filed"; and the readiness comment names opencharly/charly#1301), yet ## Filed issues lists only plugin-deploy-pod#103 and plugin-preempt#15. Every filed/updated issue the PR relies on must appear under ## Filed issues with a one-line description. Add opencharly/charly#1301 — or, if it is genuinely pre-existing and not filed/updated by this PR, say so explicitly and state why the readiness workaround is still the correct in-tree disposition.

Verdict: BLOCK


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

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 15d2fd224cad26e176e0da12eb956f150cfbbe83 (branch: fix/bed-arch-image-pin)

Security screen: PASS — T1–T4 clear: test-bed assertion change (charly.yml), no secrets/exfiltration, no guardrail/DESIGN/rulebook weakening, no embedded directives, no scope mismatch (body accounts for the base-tag, assertion, prose and readiness-probe changes).

Checklist: All applicable rules PASS or NA. A1 (body complete, footer Agent:+Assisted-by: correct, ## Filed issues present), A2/A3 (bed-as-gate ran live, tier justified by discrimination proof), R0–R12 (R1 warnings dispositioned onto filed plugin-preempt#15; R3 readiness probe is a bounded, fail-closed wait on a filed deterministic defect charly#1301, not a flake-masking fixed sleep; R5 sweep coherent; R11 cites D-HW-10, no DESIGN change; R12 spike-equivalent exemption named + evidenced), PIL/ADE/SDD (no candy/schema/generated-file change), CONC/HC (one squash commit, no parking-without-issue), ARCH (placement: CORRECT — a bed lives in this repo's charly.yml, not core/sdk), DISP (disposable: true), QUAL/COORD (no Go, footer well-formed).

Comments considered:

  • Comment 7222769374 (@github-actions[bot]) — Finding 1 (R12 left as "N/A", needs ### Spike/named exemption): stale-superseded — the CURRENT body carries a ### Spike block explicitly naming the spike-equivalent exemption with pasted discrimination grep (UserNS=host→0, User=0:0→0, keep-id→2) plus the live bed run 2026.331.1556.
  • Same comment — Finding 2 (## Filed issues omits opencharly/charly#1301): stale-superseded — the CURRENT body lists opencharly/charly#1301 under ## Filed issues with its disposition (filed earlier, not this diff's scope, probe is bounded and narrows no assertion).

Verdict: PASS


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

View action run

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