Repository navigation
Open
Labels
maintainer-notesInternal observations and improvement notesInternal observations and improvement notespriority/normalStandard review queue; useful PR with ordinary maintainer urgency.Standard review queue; useful PR with ordinary maintainer urgency.securitySecurity vulnerabilities, hardeningSecurity vulnerabilities, hardeningstability/performanceServer crashes, OOM, hangs, high CPU/memoryServer crashes, OOM, hangs, high CPU/memorytaskUmbrella task grouping multiple related issuesUmbrella task grouping multiple related issues
Description
PR #1695 isolates the focused security, watchdog, worker, and hook entry points that reproduced the account daemon shutdown. The longer-running smoke, soak, profiling, and benchmark harnesses have different lifecycle and measurement contracts, so they should be audited separately instead of expanding that fix.
Scope
scripts/smoke-local.shandscripts/smoke-test.shscripts/soak-legs.shandscripts/soak-test.shscripts/memlab.sh,scripts/memlab-drive.py, andscripts/memlab-report.pyscripts/benchmark-index.sh,scripts/benchmark-search-graph.sh, andscripts/clone-bench-repos.sh
Invariants to check
- An inherited
CBM_RUNTIME_DIRorCBM_CACHE_DIRis never reused for a product process started by a harness. - Concurrent harness runs receive different private roots.
- Unix roots are owner-only. Windows runs use the repository's protected temp-root helper rather than duplicating ACL logic.
- Install, update, uninstall, restart, and daemon cleanup stay inside the harness runtime.
- A sentinel client in account runtime A remains connected with the same daemon PID and generation, and runtime A records no
activation_shutdown. - A harness stops its own child processes before cleaning its runtime. If its private daemon remains active, cleanup leaves the root for diagnosis.
- Runtime isolation does not alter benchmark coverage or invalidate timing comparisons. Any performance claim includes comparable setup, cache, and total wall-clock measurements.
Expected output
For each entry point, record whether it already satisfies these invariants. Add a focused fail-before reproduction for every confirmed gap, then submit scoped fixes separately from #1695.
Metadata
Metadata
Assignees
Labels
maintainer-notesInternal observations and improvement notesInternal observations and improvement notespriority/normalStandard review queue; useful PR with ordinary maintainer urgency.Standard review queue; useful PR with ordinary maintainer urgency.securitySecurity vulnerabilities, hardeningSecurity vulnerabilities, hardeningstability/performanceServer crashes, OOM, hangs, high CPU/memoryServer crashes, OOM, hangs, high CPU/memorytaskUmbrella task grouping multiple related issuesUmbrella task grouping multiple related issues
Activity
DeusData commentedon Aug 18, 2026
Thank you for separating this audit from the focused fix in #1695. The boundary is correct: smoke, soak, profiling, and benchmark harnesses have lifecycle and measurement contracts that should not be folded into the security-script repair.
Please keep this issue as the audit ledger. Each confirmed isolation failure should have its own deterministic reproduction and focused fix, especially where changing setup could affect benchmark comparability. That gives every harness change an attributable reason and prevents a broad test-infrastructure sweep from becoming one unreviewable PR.
astandrik commentedon Sep 13, 2026
Audit ledger — account daemon runtime isolation
Static audit of every entry point in the scope at
0b515554/339b3f40(2026-09-13). No harness was executed against a shared account; runtime reproductions are the fixture-driven contract tests linked below.Mechanism. The daemon rendezvous is selected by
CBM_RUNTIME_DIRalone:src/daemon/bootstrap.c:231-241("CBM_CACHE_DIRdoes not help either — it moves the cache, never the rendezvous"), the rendezvous key is a constant (src/daemon/service.c:144-161), the default parent is hard-coded/private/tmp(src/daemon/ipc.c:943) and on WindowsSHGetFolderPathW(CSIDL_LOCAL_APPDATA)(src/daemon/ipc.c:5164) — the known-folder API, not%LOCALAPPDATA%. A HOME/XDG/TMPDIR/APPDATA/LOCALAPPDATA/CBM_CACHE_DIRsandbox therefore does not isolate the daemon. None of the ten entry points sourcedscripts/test-runtime.shfrom #1695, and no workflow or venue script setsCBM_RUNTIME_DIR.Two failure shapes on a shared rendezvous: (1)
daemon stop(src/main.c:2509-2537) reaches whichever daemon is active, regardless of build, and is refused only while committed clients exist; (2) a client arriving with anotherCBM_CACHE_DIRis refused withCBM_DAEMON_HELLO_CACHE_CONFLICT(src/daemon/service.c:220-227), so the first process to arrive owns the account.scripts/smoke-test.shCBM_RUNTIME_DIR, no ownCBM_CACHE_DIR)retire_account_daemon()issuesdaemon stopon the shared rendezvous from 7 call sites; its own comment reads "Retire the shared account daemon"tests/test_smoke_runtime_isolation_contract.sh— #2199scripts/smoke-local.shCBM_CACHE_DIR+ HOME/XDG/TMPDIR/APPDATA/LOCALAPPDATA sandboxCBM_RUNTIME_DIRwas passed throughsmoke-test.sh, the process that starts every product process; wrappers unchangedscripts/soak-legs.shsoak-test.shscripts/soak-test.shCBM_CACHE_DIRonlytests/test_soak_runtime_isolation_contract.sh— #2196scripts/memlab.shCBM_CACHE_DIRonlycleanup()removed the cache without stopping any daemontests/test_memlab_runtime_isolation_contract.sh— #2197scripts/memlab-drive.pyPopenwithoutenv=)scripts/memlab-report.pyscripts/benchmark-index.shcli index_repositoryindexed the benchmark repository into the operator's live store; the timing shared the operator's daemontests/test_benchmark_runtime_isolation_contract.sh— #2198scripts/benchmark-search-graph.shscripts/clone-bench-repos.shgit cloneonly; starts no product processAgainst the invariants in the issue body:
CBM_RUNTIME_DIR/CBM_CACHE_DIRnever reused — violated by every entry point that starts the product;mktemp -dwithoutchmod 700); Windows via the shared protected-root helper — soak and memlab still carry their ownicaclsstamping (left in place by these PRs:tests/test_soak_daemon_recovery_contract.shpins those lines; deduplicating throughscripts/ci/new-protected-temp-root.ps1is a separate change if wanted);Fixes. Each harness sources
scripts/test-runtime.sh, callscbm_test_runtime_initand runscbm_test_runtime_cleanup "$BINARY"from its EXIT trap, so the daemon it starts is stopped before its root goes and the root is kept for diagnosis when it will not stop. Each PR carries a fail-before contract test that drives the harness with an environment-probe fixture; no daemon is started by the tests.Benchmark comparability.
benchmark-index.shnow starts its private daemon before timing and recordssetup-time.txtandtotal-time.txtnext toindex-time.txt, so activation stays attributable and the total remains comparable with runs that paid activation inside the index timing.benchmark-search-graph.shtakes a repository path and indexes into the private cache before timing the queries against a warm daemon.docs/EVALUATION_PLAN.md§7 assumes the index stays in the live store for its graph phase; that assumption no longer holds and is called out in #2198.Adjacent, outside the listed scope, same defect:
scripts/smoke-invariants.sh(no isolation at all) andtest-infrastructure/vm/vm-smoke.sh(mirrorssmoke-local.sh; covered by thesmoke-test.shfix).fix(test): isolate soak harness daemon runtime
fix(test): isolate memlab harness daemon runtime
fix(test): isolate smoke harness daemon runtime
fix(test): arm smoke runtime cleanup at init, retire the daemon first
fix(test): isolate benchmark harness daemon runtimes
fix(test): hand the benchmark index to the caller on request
fix(test): isolate soak harness daemon runtime
fix(test): isolate memlab harness daemon runtime
fix(test): isolate smoke harness daemon runtime
fix(test): arm smoke runtime cleanup at init, retire the daemon first
fix(test): isolate soak harness daemon runtime
fix(test): isolate memlab harness daemon runtime
fix(test): isolate smoke harness daemon runtime
fix(test): arm smoke runtime cleanup at init, retire the daemon first
fix(test): isolate benchmark harness daemon runtimes
fix(test): hand the benchmark index to the caller on request
fix(test): isolate benchmark harness daemon runtimes
fix(test): hand the benchmark index to the caller on request
docs(eval-plan): stop clearing the live cache before an isolated run
Merge origin/main into fix/1696-bench-runtime-isolation