Skip to content

Resolve blocked_on against a card alias (v0.9.1) - #18

Merged
happyren merged 1 commit into
masterfrom
fix/alias-resolution
Aug 15, 2026
Merged

happyren merged 1 commit into
masterfrom
fix/alias-resolution

Conversation

@happyren

Copy link
Copy Markdown
Owner

Found by driving the whole scenario through a real dsh web host with real models, which is the only place it could have been found.

What happened

The docs session declared itself blocked on "checkout-client" — the alias that session publishes about itself. Resolution matched only folded display names and session ids, so the alias was stored verbatim:

docs-session-blocked-on-checkout   blocked  blockedOn=checkout-client        ← a string, not an id
peer-claim-on-api-directory        blocked  blockedOn=session-895ace79-…     ← resolved correctly

The wait chain dead-ended at a session that does not exist, so a genuine mutual wait went undetected. The model noticed the deadlock in prose and the tool did not — exactly the wrong way round.

Root cause

Same as the group-lead defect fixed in v0.5.0, in the one place that fix didn't reach. An alias is the handle a session publishes about itself, so it's the one a peer reads and repeats. Every resolution path has to honour it. Aliases are now checked first, before names and ids.

The test pins the failure, not the fix

Two sessions blocked on each other with one storing a name instead of an id must produce no cycle; the same pair with the id resolved must produce one. Asserting the broken shape keeps the test honest about what actually breaks.

Verified live, after the fix

published: blocked
DEADLOCK — you are in a mutual wait: peer-claim-on-api-directory →
docs-session-blocked-on-checkout → peer-claim-on-api-directory

The full run

Four sessions, real models, real files. It produced the same numbers the deterministic scenario test predicts:

3 receiver turns spent, 3 problems caught
  collisions avoided   1    checkout refused api/ — payments held api/charges.ts beneath it
  false claims caught  1    payments read the file and refuted a false currency claim
  deadlocks detected   1    docs and checkout, caught as the cycle closed

Plus a fourth session told nothing about the history, which found the deferral in the ledger and declined to reopen it.

327 tests.

Found by driving the full scenario through a real dsh host rather than a
test. The docs session declared itself blocked on "checkout-client" — the
alias that session publishes about itself — and resolution did not
recognise it, because it matched only folded display names and session ids.
The alias was stored verbatim, so the wait chain ended at a session that
does not exist and a genuine mutual wait went undetected. The model noticed
the deadlock in prose and the tool did not, which is the wrong way round.

An alias is the handle a session publishes about itself, and therefore the
one a peer reads and repeats. Every resolution path has to honour it: this
is the same root cause as the group-lead defect fixed in v0.5.0, in the one
place that fix did not reach. Aliases are now checked first, before names
and ids.

The regression test pins the failure rather than the fix: two sessions
blocked on each other, one storing a name instead of an id, must produce no
cycle — and the same pair with the id resolved must produce one. That keeps
the test honest about what actually breaks.

Re-run live against the fix: peer_status reported the full cycle at the
moment it closed.

327 tests. Version 0.9.1.
@happyren
happyren merged commit bf5b276 into master Aug 15, 2026
1 check passed
@happyren
happyren deleted the fix/alias-resolution branch August 15, 2026 08:53
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