Skip to main content

Module bounded_query

Module bounded_query 

Source
Expand description

Read-only Git queries of the auto-push, each with a deadline and separate output streams. What: Run one read-only Git query with a deadline and separate output streams. Why: The auto-push asks Git a handful of questions before it pushes, and a question that never returns would hold the commit and the branch’s push lock for good. A query that outlives its deadline is stopped and reported, so the commit stays saved.

In TS you’d write (pseudocode):

const { exitCode, stdout, stderr } = await nanoSpawn(gitPath, args, { cwd, signal: AbortSignal.timeout(deadlineMs) });

Structs§

QueryOutput
What: What a finished query printed and how it ended. Why: Callers read an exit code as an answer (“not an ancestor”) or a failure, never both.

Constants§

QUERY_CEILING
The longest a query may run whatever the push deadline is: queries read local repository state and finish in milliseconds.

Functions§

query_deadline
What: The deadline of a query: the push deadline, but never more than the ceiling. Why: One setting bounds every Git child of the auto-push, and a long push deadline must not stretch queries.
run_bounded_query
What: Run a query command to its end or its deadline. Why: Both streams go to anonymous files, so no reader thread can outlive a stopped query. A query past its deadline is a coordination failure, not an answer.