AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
Rust agent-memoryai-agentsbm25claude-codeclicode-searchcursordatabaseelasticsearchfull-text-searchhybrid-searchjsonllocal-firstmcpmcp-servermodel-context-protocolragrustsearch-enginevector-search
docs(air-gapped): state the safe envelope, not fragile signal mechanics
xerj-org077ebed3608e
diff --git a/docs/recipes/air-gapped-deployment.md b/docs/recipes/air-gapped-deployment.mdindex 538a61225..77f191d1b 100644--- a/docs/recipes/air-gapped-deployment.md+++ b/docs/recipes/air-gapped-deployment.md@@ -114,18 +114,16 @@ a different target, which means changing `TARGET` here **and** the triplewritten into `STAGE` in the enclave block below, because that one is spelled outrather than derived.-The extracted tree is removed by the `trap` on every exit this block can take-after the `cd` — success, `set -e`, a failed digest, and a dropped session,-because bash runs an `EXIT` trap when a non-interactive shell is killed by a-fatal signal. `SIGTERM` delivered to the whole process group is the exception-and the one worth knowing: `timeout`, a CI runner, an Ansible task and a-systemd unit all signal the group, so `rm -rf` is killed alongside the shell-and the tree survives — measured 10 times out of 10, with the trap entered and-interrupted mid-delete in 8 of them. Only the archive and its `.sha256` should cross the airgap,-so that no unverified binary travels beside the verified one. What else-survives is `SIGKILL`, an OOM kill and power loss, and what survives in all of-these cases is a *half-extracted* tree — so if the block did not print its `staged …` line, look-before transferring.+The extracted tree is removed by the `trap` after the `cd` on a clean exit —+success, `set -e`, and a failed digest. An **interrupted** run is the case to+be careful about: whether the trap gets to finish depends on how the interrupt+arrives, and a `SIGKILL`, an OOM kill, power loss, or a `SIGTERM` delivered to+the whole process group (which is how `timeout`, a CI runner and systemd send+it, killing `rm -rf` alongside the shell) can all leave a *half-extracted,+digest-unverified* tree behind. So do not rely on the trap to decide safety:+only the archive and its `.sha256` should cross the airgap, and **if the block+did not print its `staged …` line, treat the staging directory as unverified+and look before transferring.**Three earlier versions of this paragraph were wrong, and each is worth knowingbecause two of them are about where the trap sits and the third is about how@@ -148,15 +146,13 @@ this was measured:dropped session leaves the tree". Also false, and the interesting part is how:the measurement behind it signalled the wrapping `bash script.sh` processinstead of the forked subshell that actually owns the trap, so the trap was- never asked to run. Signal the subshell alone and it runs — `SIGTERM`,- `SIGHUP` and `SIGINT` all clean, verified in a real pty with the signal- landing provably mid-`tar`. The exception, and the reason the lead singles it- out, is `SIGTERM` to the whole process group — how `timeout`, a CI runner and- systemd deliver it — where `rm -rf` is killed alongside the shell and the tree- survives. Three of this page's wrong sentences trace to a harness that measured- the wrong thing rather than to the shell behaving unexpectedly; this last- distinction is a fourth thing the harness could not see, because it never- signalled the group.+ never asked to run. Signal the subshell alone and the trap runs; signal the+ whole process group and `rm -rf` is killed with it. That the answer depends on+ the delivery is exactly why the recipe does not lean on the trap for safety and+ keys on the `staged …` line instead. Several of this page's earlier wrong+ sentences trace to a harness that signalled the wrong process — a good reason+ to trust the printed line over any claim about what the trap does under+ signals.Hence the form above: the body is `"$STAGE"`, relative to the directory theblock already `cd`-ed into and never leaves, and the `trap` is installeddiff --git a/landing/docs/recipes/air-gapped-deployment.html b/landing/docs/recipes/air-gapped-deployment.htmlindex 636937b0c..eb3359f19 100644--- a/landing/docs/recipes/air-gapped-deployment.html+++ b/landing/docs/recipes/air-gapped-deployment.html@@ -109,7 +109,7 @@"$STAGE/xerj" --versionecho "staged $ASSET ($want) in $OUT")</pre>- <p>The checksum proves archive integrity against the digest published beside it in the same release; it is not a signature, provenance statement, or attestation. <code class="inline">"$STAGE/xerj" --version</code> executes the staged binary, so the staging host must match the target platform; drop that line, or stage a different target by changing <code class="inline">TARGET</code> here <strong>and</strong> the triple spelled out in the enclave block below. The extracted tree is removed by the <code class="inline">trap</code> on every exit this block can take after the <code class="inline">cd</code> — success, <code class="inline">set -e</code>, a failed digest, and a dropped session, because bash runs an <code class="inline">EXIT</code> trap when a non-interactive shell is killed by a fatal signal. <code class="inline">SIGTERM</code> delivered to the whole process group is the exception and the one worth knowing: <code class="inline">timeout</code>, a CI runner, an Ansible task and a systemd unit all signal the group, so <code class="inline">rm -rf</code> is killed alongside the shell and the tree survives — measured 10 times out of 10, with the trap entered and interrupted mid-delete in 8 of them. Only the archive and its <code class="inline">.sha256</code> should cross the airgap, so that no unverified binary travels beside the verified one. What else survives is <code class="inline">SIGKILL</code>, an OOM kill and power loss, and what survives in all of these cases is a <em>half-extracted</em> tree — so if the block did not print its <code class="inline">staged …</code> line, look before transferring. The trap body is <code class="inline">"$STAGE"</code> — relative to the directory the block already entered — and is installed before <code class="inline">tar</code>: an earlier version derived it from <code class="inline">$OUT</code> after the <code class="inline">cd</code>, which silently cleaned nothing when <code class="inline">OUT</code> was a relative path.</p>+ <p>The checksum proves archive integrity against the digest published beside it in the same release; it is not a signature, provenance statement, or attestation. <code class="inline">"$STAGE/xerj" --version</code> executes the staged binary, so the staging host must match the target platform; drop that line, or stage a different target by changing <code class="inline">TARGET</code> here <strong>and</strong> the triple spelled out in the enclave block below. The extracted tree is removed by the <code class="inline">trap</code> after the <code class="inline">cd</code> on a clean exit — success, <code class="inline">set -e</code>, and a failed digest. An <strong>interrupted</strong> run is the case to be careful about: whether the trap gets to finish depends on how the interrupt arrives, and a <code class="inline">SIGKILL</code>, an OOM kill, power loss, or a <code class="inline">SIGTERM</code> delivered to the whole process group (which is how <code class="inline">timeout</code>, a CI runner and systemd send it, killing <code class="inline">rm -rf</code> alongside the shell) can all leave a <em>half-extracted, digest-unverified</em> tree behind. So do not rely on the trap to decide safety: only the archive and its <code class="inline">.sha256</code> should cross the airgap, and <strong>if the block did not print its <code class="inline">staged …</code> line, treat the staging directory as unverified and look before transferring.</strong> The trap body is <code class="inline">"$STAGE"</code> — relative to the directory the block already entered — and is installed before <code class="inline">tar</code>: an earlier version derived it from <code class="inline">$OUT</code> after the <code class="inline">cd</code>, which silently cleaned nothing when <code class="inline">OUT</code> was a relative path.</p><p><strong>Transfer <code class="inline">$OUT</code> itself and land it in the enclave at <code class="inline">/opt/xerj-staging</code></strong>, so the archive sits at <code class="inline">/opt/xerj-staging/release/</code> — the fixed path the enclave blocks read. Then set the same approved <code class="inline">TAG</code> and verify before extracting:</p><pre class="code">(set -eu