Skip to content

test+wip: substrate-truth scenarios + host-bootstrap find-first (partial) - #323

Merged
joelteply merged 1 commit into
canaryfrom
tdd-status-agrees-with-reality
Apr 29, 2026
Merged

joelteply merged 1 commit into
canaryfrom
tdd-status-agrees-with-reality

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Two new TDD scenarios catch real diagnostic-disagreement + stale-config-recovery gaps. status_agrees_with_send is green; stale_config_auto_resyncs is red and ships as a regression guard until the host-bootstrap helper unification lands. The clean-state convergence path #321 works in production (4 peers converged today).

…ial)

Two new TDD scenarios in test/integration_smoke.sh against real gh:

  scenario_status_agrees_with_send: catches the diagnostic-disagreement
  bug Joel hit live today — 'airc msg' lands in the gist but 'airc
  status' reports monitor: not running. If sends work, status MUST
  say running. (Helps catch the airc.pid incompleteness — pidfile
  only tracks parent, not the bearer_cli + formatter children.)

  scenario_stale_config_auto_resyncs: pre-seeds channel_gists with a
  bogus gist id (simulates a peer who paired with a non-canonical
  dup pre-#321), bounces, asserts the bogus is replaced with the
  canonical gist on next connect. CURRENTLY FAILING — host bootstrap
  path creates a 3rd duplicate instead of consulting find_existing.

Partial fix in cmd_connect.sh: added find-first logic before the
host bootstrap's gh gist create — adopts existing canonical if
found. The fix is structurally right but the test still fails
because (a) the discovery path on --as-host bypasses my find-first
gate and (b) the host bootstrap subscribe/set_channel_gist sequence
needs to be unified with ensure_channel_subscribed_with_gist's
helper to get auto-resync coverage.

Filing scenario_stale_config_auto_resyncs as a known-failing
regression guard. Shipping the test as red so the next iteration
makes it green. The convergence-on-clean-state path (#321) works
in production today — Joel's 4 peers all converged on
d469970250fce78d9413eb9639dcb052 — but stale-config recovery for
existing peers requires either manual channel_gists clear OR a
follow-up to thread the helper through the host-bootstrap path.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 64106e0 into canary Apr 29, 2026
@joelteply
joelteply deleted the tdd-status-agrees-with-reality branch April 29, 2026 16:31
joelteply added a commit that referenced this pull request Apr 29, 2026
fix: resolve retry + host bootstrap find-first (auto-resync infrastructure)

Two complementary changes for substrate convergence:

1. channel_gist.resolve() retries find_existing 3× with backoff
   (1.5s, 3s) to bridge gh's gist-listing eventual-consistency window.
   A peer reconnecting moments after another peer hosted previously
   missed the canonical because gh's listing hadn't propagated yet,
   resulting in a 3rd duplicate gist. Retry with backoff catches
   the propagation. AIRC_RESOLVE_NO_RETRY=1 opts out for callers
   that don't want to wait.

2. cmd_connect host bootstrap calls channel_gist.resolve before
   creating a new gist (#321 follow-up). Previously the host path
   bypassed find_existing and unconditionally created a new gist;
   if a canonical already existed on the gh account from a prior
   session, the host created a duplicate. Now adopts existing
   canonical when found.

Test scenario stale_config_auto_resyncs (introduced PR #323)
documents the regression class — pre-seeded bogus channel_gists
must be replaced on bounce. Currently red because of an orthogonal
bug (orphan subshells survive teardown and re-write airc.pid,
blocking the next spawn via #292 stomp guard) that needs its own
fix. The auto-resync mechanism is correct; the test harness needs
better orphan cleanup.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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