fix(test): hand over a kept benchmark runtime only after its daemon stopped

With CBM_BENCH_KEEP_RUNTIME=1, bench_finish ran `daemon stop` with its
output and exit status discarded and wrote runtime-root.txt regardless.
`daemon stop` refuses while a committed client still uses the daemon and
fails when the daemon does not answer; the handoff then promised a
stopped daemon that was still running.

A refused stop now prints the explanation of the product, writes no
handoff, keeps the root without cleaning it up (the daemon may still be
using it) and exits non-zero. A stop with nothing to stop still exits 0,
so a clean run is unaffected.

Section 7 step 8 of the evaluation plan follows the same rule: the kept
root is removed only if its daemon stopped, and is kept with a message
otherwise.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel committed 2026-11-02 00:06:52 +01:00
1 parent b9851700a4
commit 78bf6a2745
2 files changed
+19 -5

No files matched your search

+7 -3
View File
@@ -299,9 +299,13 @@ for lang in $ALL_LANGS; do # ALL_LANGS = full 159-name list
# --- step 8: delete THIS language's index so the next is cold, then mark done ---
# The graph session (steps 4-7) may still have a daemon running under the kept
# CBM_RUNTIME_DIR (exported above); stop it before its root goes away.
~/.local/bin/codebase-memory-mcp daemon stop || true
rm -rf -- "$CBM_BENCH_RUNTIME_ROOT"
# CBM_RUNTIME_DIR (exported above); stop it before its root goes away. A refused
# stop (a session still attached) means the root is still in use: keep it.
if ~/.local/bin/codebase-memory-mcp daemon stop; then
rm -rf -- "$CBM_BENCH_RUNTIME_ROOT"
else
echo "$lang: daemon under $CBM_RUNTIME_DIR did not stop; keeping $CBM_BENCH_RUNTIME_ROOT" >&2
fi
manifest_mark_done "$lang" "$index_ms"
done
```