Skip to content

fix(package): distinguish exec/infra failure from not-installed (deterministic token) - #11

Merged
atrawog merged 2 commits into
mainfrom
feat/package-verb-infra-distinction
Jul 8, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/package-verb-infra-distinction

Conversation

@atrawog

@atrawog atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The package check verb read the exit code of rpm -q || dpkg -s || pacman -Q: exit 0 = installed, anything else = installed=false. That conflated a genuine not-installed package with an exec/infra failure (the podman exec died — store-write error exit 255, killed signal), so a package that WAS installed got the false verdict installed=false, want true under container-exec contention (the check-debian-coder / check-jupyter-ml-pod store-contention mislabels the RCA surfaced). The exit code was also distro-fragile: a genuinely-absent package exits 1 on arch but 127 (command-not-found from the trailing pacman -Q) on fedora/debian.

Rewrote the probe to emit a deterministic INSTALLED/ABSENT token via an if … then … else … fi wrapper (always exits 0). Any other outcome — non-zero exit, missing token, or a RunCapture error — is surfaced as an exec/infra failure, never a false content verdict (matching how the file verb already reports a probe exec failure). Also de-staled the r.runPackage/resolvePackageName references (deleted when the verb was externalized) in the candy's .cue schema and regenerated its params (R5).

Change class + gate (R10, code + candy)

  • go test ./... green — new TestPackageVerb_InfraFailureNotContentFalse (happy INSTALLED→pass; genuine ABSENT→content fail installed=false; infra exit-255→exec/infra failure, asserts NOT installed=false), and the existing package tests updated for the token probe; golangci-lint 0 issues; task build:charly R9 (charly version 2026.189.0308).
  • Live: charly check box arch-test — the package=neovim / package=ripgrep checks PASS against the built image (happy path unchanged):
PASS  check package=neovim   [nvim-package]     installed
PASS  check package=ripgrep  [ripgrep-package]  installed

Single-repo (no submodule pointer change). The infra-failure path is unit-tested since a live podman store-write failure is non-deterministic to reproduce.

Tier: fully tested and validated.

Assisted-by: Claude (fully tested and validated)

atrawog added 2 commits July 8, 2026 05:23
…rministic token)

The package verb read the rpm||dpkg||pacman probe's EXIT CODE, conflating a
genuine not-installed result with a podman-exec INFRA failure (store-write error
exit 255) — so an installed package got the false verdict "installed=false, want
true" under container-exec contention (check-debian-coder / check-jupyter-ml-pod
mislabels). Exit was also distro-fragile (absent = 1 on arch, 127 on
fedora/debian). Emit a deterministic INSTALLED/ABSENT token via an if-wrapper
(always exit 0); anything else is surfaced as an exec/infra failure, never a
false content verdict (matching the file verb). Unit-tested happy/absent/infra
paths; live check box arch-test package checks PASS. De-staled the runPackage
cue-comment refs + regenerated the candy params.

Assisted-by: Claude (fully tested and validated)
…erb infra-failure distinction)

Assisted-by: Claude (fully tested and validated)
@atrawog

atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: code/config (charly Go test wiring + candy/plugin-package verb + candy schema/params comment)

Fresh, independent re-validation (new context; none of the author's claims trusted).

Item Verdict
Security & anti-tampering (T1–T4) PASS — no injected instruction / scope-mismatch / secret-exfiltration / weakened-gate / supply-chain finding. 6 files, all matching the description; probe is a benign if…fi package-presence shell.
Description complete PASS — Summary, change class + R10 gate, pasted live evidence, tier, single-repo note.
Change-class gate ↔ evidence PASS — go build/go test ./... green; task build:charly (R9, charly version 2026.189.0323); live charly check box arch-test re-run: package=neovim + package=ripgrep PASS/installed (exit 0). Infra-failure branch is unit-tested (a podman store-write exit-255 cannot be live-reproduced without an R4-forbidden hack).
Attribution tier justified PASS — fully tested and validated. The changed verb executed live against a freshly-built binary, and TestPackageVerb_InfraFailureNotContentFalse fails without the fix (check-coverage gate). Consistent with the repo's established pattern for host-side check-verb fixes (cf. 2026.189.0105, gated by charly check box).
R5 grep self-test PASS — git grep 'runPackage|resolvePackageName' returns only the CHANGELOG/ history reference; the stale .cue/generated-params comment refs were de-staled.
R1–R4 / clean architecture PASS — reuses kit.ResolvePackageName (R3); the deterministic-token fix is the root-cause fix, not a sleep/retry workaround (R4); mirrors the file verb's existing infra-failure reporting; no transitional/dual-mode path left.
CHANGELOG present PASS — finalized to CHANGELOG/2026.189.0333.md at merge.
Skills honored PASS — /charly-check:check: the token probe cleanly separates an exec/infra failure from a genuine ABSENT content verdict; generated params/cue_types_gen.go matches schema/package.cue (only the doc-comment tracks — no field drift).

Independent re-verification (verbatim):

  • go test -run 'TestPackageVerb_InfraFailure|TestRunner_Package|TestRelocatedPackageVerb' -v . → all PASS
  • go test ./... → ok (48.7s) · golangci-lint run ./... → 0 issues (charly + candy) · gofmt -l . → clean (both)
  • charly check box arch-test --filter package → 28 steps: 27 passed, 0 failed, 1 skipped (exit 0); package=neovim [nvim-package] installed, package=ripgrep [ripgrep-package] installed
  • No submodule/gitlink change (single-repo).

Decision: The probe rewrite correctly emits a deterministic INSTALLED/ABSENT token (wrapper always exits 0) and surfaces any non-zero exit / missing token / RunCapture error as an exec/infra failure — never the false installed=false content verdict that mislabeled installed packages under container-exec store-contention. Fresh CalVer 2026.189.0333, merging.

Assisted-by: Claude (fully tested and validated)

@atrawog
atrawog merged commit 8c590f5 into main Jul 8, 2026
@atrawog
atrawog deleted the feat/package-verb-infra-distinction branch July 8, 2026 03:36
github-actions Bot pushed a commit that referenced this pull request Sep 7, 2026
…s) (#558)

Consume the config:-verb wave: spec v0.2026250.957 (#117 config?/validate?
contract, #118, #119 VerbCatalog, #120 InstallVerbs), sdk v0.2026250.948
(#237 emitter), plugin-box v0.2026250.1030 (#11 config rules), plugin-egress
v0.2026250.951 (#3 crabbox-yaml egress schema). Add validate to the
uniform-API genericConceptCollisions with justification (ops.OpValidate
selector vs the config modifier — the venue precedent).

Co-authored-by: atrawog <[email protected]>
github-actions Bot pushed a commit that referenced this pull request Sep 27, 2026
… leg) (#703)

* test(check): add check-kindcluster-workload R10 bed (Phase 6 workload leg)

The Phase 6 workload witness: a disposable kind cluster on podman with the
locally-built `check-k8s-deploy-app` image loaded INTO the kind node via the
engine-aware path (`kind load image-archive` — `kind load docker-image` is broken
on podman, plan §2 #11) and applied through the SHARED kubernetes generator (the
kindcluster cluster-policy surface is projected onto a `#Kubernetes` body, R3).

Proves the `deploy:kindcluster` provider's workload preresolve
(`resolveWorkloadImage` + `materializeKustomize`), the engine-aware load, and
`kubectl apply -k` end to end. The `kube:` probes assert the workload Deployment
object landed. Reuses the shared `check-kindcluster-cluster` template (R3 — no
duplicated kindcluster block).

*Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*

* test(check): fix the workload bed's kube: probe (apps/v1 group+version) + assert the pod scheduled

The `kube: raw` probe needs the API group+version for a non-core resource:
`kube_resource: deployments` alone failed with
`list deployments: the server could not find the requested resource`. Add
`kube_group: apps` + `kube_version: v1` + `namespace`/`name` (mirror
check-k8s-deploy's own Deployment probe, R3), and add a `kube: pods` probe asserting
the applied Deployment's pod is scheduled — the engine-aware `kind load image-archive`
reached the node.

*Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*

* docs(packaging): note the kindcluster workload apply's kubectl dependency

The kindcluster deploy substrate's workload leg runs `kubectl apply -k`, so
kubectl is needed for a kindcluster deploy that carries an image (cluster-only
deploys do not). Updates the archlinux optdepends note.

*Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*

* chore(deps): adopt the kindcluster image-load + check-runner fixes

Bumps the pins the Phase 6 workload bed needs:
- compiled-in plugin-check `v0.2026269.859 → v0.2026270.151` (plugin-check#64:
  build the image for an external-in-place deploy too — the kindcluster workload
  leg's image was never built).
- the kindcluster beds' `plugin-kube` `@github` refs → `v2026.270.0155`
  (plugin-kube#10: `podman save -o -` writes a FILE named `-` rather than stdout,
  so `kind load image-archive` saw an empty archive).

*Assisted-by: OpenCode 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