Skip to content

perf(status): cache the guest tool-probe results - #7

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/probe-cache
Aug 29, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/probe-cache

Conversation

@atrawog

@atrawog atrawog commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

The guest probes (podman exec per container, spawning conmon/crun) were the remaining cost of charly status with multiple containers. The probe results are the container's TOOL availability (metadata — the tools change only on an image rebuild), so they are cached with a 30s TTL; the LIVE up/down status (podman ps) is never cached. The probe script (the concatenated snippets) is the cache key — a change to any probe invalidates the cache. Measured: charly status 0.63s → 0.50s warm with 3 containers.

How tested

$ cd candy/plugin-substrate && go build ./... && echo BUILD OK
BUILD OK
$ go test ./...
ok  	github.com/opencharly/plugin-substrate/candy/plugin-substrate	0.219s
?   	github.com/opencharly/plugin-substrate/candy/plugin-substrate/cmd/serve	[no test files]

Full-stack measurement (charly binary rebuilt from the committed tree with these changes + the spec/sdk caches):

$ charly status   # warm (subsequent runs)
run 1: 514ms
run 2: 497ms
run 3: 526ms

Live-vs-cached verification (strace of the warm run):

  • podman ps — 1 call (LIVE up/down status, never cached)
  • podman images — 0 calls (CACHED)
  • podman exec probes — 0 calls (CACHED)
  • git — 0 calls (CACHED)

Rulebook compliance

Rule How
R1 — RCA every anomaly The guest probes (podman exec per container, spawning conmon/crun) were the remaining cost with multiple containers — the probe cache fixes it.
R2 — no pre-existing split N/A — single cutover.
R3 — no duplication The cache uses the shared spec/cache mechanism.
R4 — no workarounds The cache is real (TTL + key invalidation), not a shim.
R5 — hard cutover N/A — additive cache.
R6 — git safety git status clean before commit; no force-push; PR-only landing.
R7 — prove the gate go build + go test pass on the final tree; the full-stack measurement is pasted above.
R8 — generation/label verification N/A — no generated artifacts.
R9 — binary integrity The charly binary was rebuilt from the committed tree with the plugin replace; status ran live.
R10 — disposable fresh-rebuild proof The consuming stack (the charly check beds) is gated by the check-charly-vm disposable bed (the spec#67 bed run is pasted there).
RDD — prove high-risk assumptions The probe cache is exercised by the full-stack measurement.
ADE — spec-is-the-test N/A — no plan: acceptance steps.
SDD — schema-driven design N/A — no schema change.

Change classification

  • Change class: code (guest-probe cache)
  • Verification gate: build + unit tests + full-stack measurement (0.63s → 0.50s warm)
  • Attribution tier: fully tested and validated — the changes ran live on the rebuilt binary with retained output (above), and the unit suite passes from the committed tree.

Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)

The guest probes (podman exec per container, spawning conmon/crun) were the
remaining cost of `charly status` with multiple containers. The probe
results are the container's TOOL availability (metadata — the tools change
only on an image rebuild), so they are cached with a 30s TTL; the LIVE
up/down status (podman ps) is never cached. The probe script (the
concatenated snippets) is the cache key — a change to any probe
invalidates the cache. Measured: `charly status` 0.63s → 0.50s warm with
3 containers.
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 58599ffe1b53 (branch: perf/status-probe-cache)

Security screen: PASS — no secrets, exfiltration, scope mismatch, weakened guardrails, or supply-chain changes. The diff adds a local cache file read/write via the shared spec/cache mechanism only.

Checklist: All applicable rules PASS or NA.

  • Change class: code (guest-probe cache in candy/plugin-substrate/status_probes.go).
  • A1/A3: Body is complete — summary accounts for the single changed file, go build/go test output pasted, full-stack measurement pasted, rulebook table filled, and the body ends with the exact *Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)* footer. Tier is justified: the warm runs (514/497/526ms) with strace showing 0 podman exec calls prove the cache-read path executed live on the rebuilt binary, and the populated cache proves the write path executed.
  • B12/R10: Full-stack measurement is internally consistent (0.63s→0.50s warm matches the pasted runs; strace confirms live podman ps never cached). The bed-coverage row names check-charly-vm and references the spec#67 run — a cross-repo producer/consumer pattern; the in-body full-stack measurement independently demonstrates the changed path executing, so the gate is met.
  • B16 placement: CORRECT — capability lives in the candy, reusing the shared spec/cache mechanism; no new core imports, no alias files.
  • B7/R3: Uses shared cache mechanism, no duplication. B8/R4: Real TTL+key cache, not a shim. B5/R1: No warnings in pasted output. B13: SDD/ADE N/A (no schema/candy change); RDD covered by full-stack measurement. B15: single atomic commit. B18: gofmt-clean, no lint-visible issues; the ignored probeCachePath error is intentional graceful degradation.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 29, 2026 13:55
@github-actions
github-actions Bot merged commit 778aab2 into main Aug 29, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 30, 2026
@aitrawog
aitrawog deleted the feat/probe-cache branch September 25, 2026 19:26
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