Repository navigation
fix(test): three integration-suite fixes — scaffold_identity probe, airc-shaped fake PID, honest e2e skip - #456
Merged
Conversation
…ed fake + e2e_encryption honest skip
Three test fixes surfaced when canary→main CI ran the integration
suite. All three are about NOT swallowing errors (per Joel 2026-05-04
directive via Codex relay, mirroring CLAUDE.md "never swallow
errors"):
1. scaffold_identity walked `${AIRC_PYTHON:-python3}` and swallowed
errors via `2>/dev/null`, so when system python3 lacked the
`cryptography` module the bootstrap-ed25519 step silently failed
to write private.pem. Downstream tests then errored with the
opaque "ed25519 sign failed: [Errno 2] No such file or directory:
'…/identity/private.pem'" — caller never told that cryptography
was missing. Fix: probe candidate venvs (matching the same
resolution airc itself walks for AIRC_PYTHON), let stderr through,
fail loudly with explicit message if none have cryptography
importable.
2. scenario_send_dead_monitor_dies's "live-pid" negative control
wrote `$$` to airc.pid — the test harness's bash PID. Worked
under bare `kill -0` semantics; broke under #447's hardened
cmdline-shape verification (PID-reuse defense after sleep/wake).
Fix: spawn an airc-SHAPED fake via `( exec -a "airc connect"
sleep 60 ) &` — argv[0] now matches the
/airc[[:space:]]+(connect|join)/ regex.
_monitor_alive_with_bearer_fallback accepts it.
3. scenario_e2e_encryption gated on `$(dirname AIRC)/.venv-dev`,
which install.sh does NOT create (install.sh creates `.venv`,
inside its install dest — typically $HOME/.airc-src). Result:
silently skipping every CI run despite the suite reporting "ran."
Fixing the venv detection then surfaces the deeper issue: this
scenario was written when SSH was a registered bearer; Phase E /
post-3c removed it (`bearer_resolver.available_kinds` is gh +
LocalBearer only), so the test's @peer-name send path errors with
"no registered bearer can serve peer_meta=…" and the wire falls
back to plaintext gh-substrate, defeating the "wire is ciphertext"
assertion. Real fix is a rewrite via gh substrate; until then,
skip with the actual reason in the message (loud skip, not silent
pass-by-skip). Original test body preserved below `return` for
the eventual rewriter's reference.
Local: send_dead_monitor_dies 8/8 pass; e2e_encryption skips with
explicit message; all other scenarios unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR addresses three integration-suite reliability issues discovered in the canary→main CI flow by making test infrastructure fail loudly (instead of silently masking root causes), updating a negative-control PID to satisfy newer “airc-shaped” liveness checks, and converting a permanently-broken e2e encryption scenario into an explicit, honest skip.
Changes:
scaffold_identity: probe for a usable Python interpreter withcryptographyavailable, and stop suppressing bootstrap errors so missing deps are diagnosable.scenario_send_dead_monitor_dies: replace$$with an “airc connect”-shaped fake process for the pidfile negative control under hardened PID cmdline verification.scenario_e2e_encryption: convert a silently-skipped scenario into an explicit skip with a clear rationale; preserve legacy test body below an earlyreturn.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+301
to
+309
| local _py="" | ||
| for _candidate in \ | ||
| "${AIRC_PYTHON:-}" \ | ||
| "$HOME/.airc-src/.venv/bin/python" \ | ||
| "$HOME/.airc-src/.venv/bin/python3" \ | ||
| "$(cd "$(dirname "$AIRC")" && pwd)/.venv/bin/python" \ | ||
| "$(cd "$(dirname "$AIRC")" && pwd)/.venv/bin/python3" \ | ||
| "$(command -v python3 || true)"; do | ||
| [ -n "$_candidate" ] && [ -x "$_candidate" ] || continue |
| grep -q 'live monitor probe ascii' "$home/messages.jsonl" \ | ||
| && pass "live-pid scope: message appended to local log as expected" \ | ||
| || fail "live-pid scope: message NOT in log despite rc=0 (log=$(cat "$home/messages.jsonl" 2>/dev/null))" | ||
| kill "$fake_airc_pid" 2>/dev/null || true |
Comment on lines
3891
to
+3894
| section "e2e encryption: wire is ciphertext, receiver decrypts to plaintext" | ||
| echo " (skipped — test uses removed SSH-bearer transport path; needs rewrite to verify envelope encryption via gh substrate. Tracking: airc Phase E test debt.)" | ||
| return | ||
|
|
Comment on lines
+3893
to
3899
| return | ||
|
|
||
| # ── Below is the original SSH-bearer-based test, kept for context | ||
| # ── on the rewrite (preserved verbatim). | ||
|
|
||
| local _venv="$(cd "$(dirname "$AIRC")" && pwd)/.venv-dev" | ||
| if [ ! -x "$_venv/bin/python" ] && [ ! -x "$_venv/bin/python3" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three test fixes surfaced from the canary→main CI run (#454). All three boil down to never swallow errors (Joel 2026-05-04 directive via Codex relay, mirroring CLAUDE.md global rule).
1.
scaffold_identity— walk venvs, fail loudPre-fix invoked
\${AIRC_PYTHON:-python3} -m airc_core.identity bootstrap-ed25519 ... 2>/dev/null. When system python3 lackscryptography, the bootstrap silently fails →private.pemnever written → downstream tests error with the opaqueed25519 sign failed: [Errno 2] No such file or directory: '.../private.pem'. Caller never told that the actual problem was a missing module.Fixed: probe candidate venvs (the same resolution airc itself walks for AIRC_PYTHON), verify cryptography imports, fail loudly with explicit message if none qualify.
2.
scenario_send_dead_monitor_dieslive-pid control — airc-shaped fakePre-fix wrote
$$(the test harness's bash PID) toairc.pidfor the negative control. Worked under barekill -0semantics; broke under #447's hardened cmdline-shape verification —bash test/integration.shis correctly rejected as not airc-shaped (PID-reuse defense after sleep/wake).Fixed: spawn
( exec -a "airc connect" sleep 60 ) &. The actual binary is sleep, butps -o command=showsairc connect …and matches the/airc[[:space:]]+(connect|join)/regex.3.
scenario_e2e_encryption— honest skip with the real reasonPre-fix gated on
$(dirname AIRC)/.venv-dev, which install.sh does not create (it creates.venvinside its install dest — typically$HOME/.airc-src). So this scenario silently skipped every CI run for an unrelated reason.Fixing the venv detection then surfaces the deeper issue: this test was written when SSH was a registered bearer. Phase E / post-3c removed the SSH bearer entirely (
bearer_resolver.available_kindsis gh + LocalBearer only); the test's@peer-namesend path errors withno registered bearer can serve peer_meta={...host_target: 'user@host'...}, and the wire falls back to plaintext gh-substrate, defeating the "wire is ciphertext" assertion.Until a real rewrite via the gh substrate lands, the right answer is skip with the loud honest reason, not silent-pass-by-skip. Original test body preserved verbatim below the
returnfor the eventual rewriter's reference.Test plan
bash test/integration.sh send_dead_monitor_dies— 8/8 pass locallybash test/integration.sh e2e_encryption— clean skip with explicit messageCoordination
@airc-8a5e — these surfaced from the same canary→main bundle (#454) you and I have been iterating on. Honest-skip approach for #3 is intentional; the rewrite is real test debt for whoever takes it on next, not a one-line fix.
🤖 Generated with Claude Code