Skip to content

Run every qsv call through qsv-client - #19

Merged
jqnatividad merged 1 commit into
dathere:mainfrom
jqnatividad:qsv-client-adoption
Oct 9, 2026
Merged

jqnatividad merged 1 commit into
dathere:mainfrom
jqnatividad:qsv-client-adoption

Conversation

@jqnatividad

Copy link
Copy Markdown
Collaborator

Why

No qsv run during onboarding had a timeout. A stalled describegpt (an LLM that never answers) or a stats --everything on a huge CSV blocked the job forever. qsv-client kills a run's whole process group once it passes its timeout. It also returns typed errors and finds the binary in one place.

What changed

  • Timeouts per pass: describegpt 900 s, stats 900 s, frequency 600 s, count 120 s. Each one can be overridden with VERIKAN_QSV_<PASS>_TIMEOUT, e.g. VERIKAN_QSV_STATS_TIMEOUT=1800.
  • Same failure contract: run_qsv_describegpt / run_qsv_stats / run_qsv_frequency still return None on failure, now including a missing binary or a timeout. They log the error type and kind instead of truncated stderr.
  • No truncated outputs: stats and frequency stream to a sibling .part file that replaces the output only when the run succeeds. A failed run leaves the previous qsv_stats.csv / qsv_frequency.csv in place. The bytes on disk are still exactly qsv's stdout.
  • qsv_dict.json unchanged: it is still re-dumped with json.dump(indent=2), because it is published and hashed.
  • Binary discovery honours QSV_BIN, in the admin health warning too. Discovery can fall back to qsvlite/qsvdp, which have no describegpt. So after a describegpt failure the binary's command list is checked once, and a missing describegpt is reported.
  • run_qsv_count replaces the duplicated inline qsv count blocks in both onboarding scripts, which swallowed every exception.
  • Dockerfile moves from qsv 22.0.1 to 24.0.0. The release zip still has qsv at its root.

Tests

New fake-binary tests cover:

  • stats output bytes and parsing
  • frequency parsing
  • a failed run keeping the previous output
  • a hung run being killed, with the child process gone
  • count
  • a missing binary
  • a binary without describegpt

runtime_warnings is now tested via QSV_BIN. I broke each fix in turn and the matching test failed each time.

I also smoke-tested against a real qsv 24.0.0.

🤖 Generated with Claude Code

No qsv run during onboarding had a timeout, so a stalled describegpt (an
LLM that never answers) or a stats --everything on a huge CSV blocked the
job forever. qsv-client kills a run's whole process group once it passes
its timeout. The defaults are describegpt 900s, stats 900s, frequency 600s
and count 120s, and VERIKAN_QSV_<PASS>_TIMEOUT overrides each one.

The run_qsv_* helpers keep their contract: they return None on any
failure, now including a missing binary or a timeout, and they log the
error type and kind instead of truncated stderr. stats and frequency now
stream to a sibling .part file that replaces the output only after a run
succeeds, so a failed run leaves the previous qsv_stats.csv in place
instead of a truncated one. The bytes on disk are still exactly qsv's
stdout. qsv_dict.json is still re-dumped with indent=2, because it is
published and hashed.

Binary discovery honours QSV_BIN, in the onboarding health warning too.
Discovery can fall back to qsvlite/qsvdp, which have no describegpt, so
after a describegpt failure the binary's command list is checked once
and a missing describegpt is reported. A successful run pays nothing
for that check.

The two inline `qsv count` blocks, which swallowed every exception,
become run_qsv_count. The Dockerfile moves from qsv 22.0.1 to 24.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jqnatividad
jqnatividad merged commit 1e899a5 into dathere:main Oct 9, 2026
6 checks passed
@jqnatividad
jqnatividad deleted the qsv-client-adoption branch October 9, 2026 02:47
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