Skip to content

fix(routing): encode a zero-length band-hop seam leg as turn-less, not a bare assert - #1944

Open
pinin4fjords wants to merge 8 commits into
mainfrom
fix/1808-zero-length-seam-leg
Open

fix(routing): encode a zero-length band-hop seam leg as turn-less, not a bare assert#1944
pinin4fjords wants to merge 8 commits into
mainfrom
fix/1808-zero-length-seam-leg

Conversation

@pinin4fjords

@pinin4fjords pinin4fjords commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • _entry_wrap_record (layout/routing/inter_section_handlers.py) built a
    zero-length run leg whenever a left-entry band-hop's lead-out column
    coincided with its source station's X (the deliberate "drop at the junction
    column" fallback in _band_hop_geometry when no cell-mate gap resolves).
    _leg_direction then raised a bare, message-less AssertionError.
  • The zero-length case is legitimate, reachable geometry (a straight drop
    through an invisible fan-out junction with no station marker), so it is now
    encoded as a turn-less _SourceSeam (run direction stated, turn/launch/axis
    unstated), matching the existing _tb_bottom_exit_geometry precedent for
    coincident source/target X.
  • Any genuinely-unexpected residual zero-length leg now raises a typed
    ExitTurnInvariantError naming the source station and line, instead of a
    bare assert.
  • Adds a regression-lock test (tests/test_band_hop_zero_length_seam_1808.py)
    backed by an on-disk fixture
    (tests/fixtures/curve_invariant_repros/riboseq_band_hop_zero_length_seam.mmd)
    reproducing the failing edge from the nf-core/riboseq map.
  • Reconciles the routing gate-coverage baseline and prunes 7 triage-sidecar
    entries for gaps the fix and the new fixture close.
  • The new fixture joins the globbed test corpora, which required two more
    reconciliations: tests/test_route_topology.py's hardcoded resolved-graph
    digest was recomputed against the merged corpus (this branch merged in
    main, which had independently touched the same digest via other PRs), and
    the fixture was recorded in tests/test_reserved_claim_consumption.py's
    KNOWN_NOT_RENDERING allow-list, since it still aborts on a separate,
    already-tracked defect (see Scope note below).

Fixes #1808

Scope note

This fixture still aborts downstream on an unrelated, already-tracked defect
(a fan-overlay CurveInvariantError, #1806/#1809) - that is expected and out
of scope here; #1808 is specifically about the message-less assert.

Test plan

pinin4fjords and others added 6 commits September 5, 2026 21:27
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n column

A boxed-in fan-out junction feeding a LEFT entry via a two-band hop leads
out into a cell-mate gap before turning down; when no such gap resolves the
branch drops straight down the junction column, coinciding the seam's run
leg with the source column. Reading a heading off that zero-length leg fired
a bare, message-less AssertionError.

Build a turn-less _SourceSeam for the coincident-column case, stating only
the drop the centreline opens on, matching the bottom-exit precedent. The
exit-turn planner already classifies a turn-less requirement as a straight
continuation. Convert the residual _leg_direction assert into a typed
ExitTurnInvariantError naming the coincident endpoints and, where supplied,
the source station and line, so a genuinely-degenerate leg fails loud.

Closes #1808.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…skip ci]

The turn-less-seam branch and the typed leg-direction guard each add a routing
if-gate whose un-exercised arm no shipped corpus fixture reaches: the guard is
defensive, and the drop-at-junction branch only fires on a map that aborts
downstream on an unrelated curve defect. Acknowledge both in the baseline and
regenerate the matrix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…call site [skip ci]

Keep _leg_direction's shared two-endpoint signature, and augment the
ExitTurnInvariantError with the source and line only where the entry-wrap
drop reads a heading, by catching and re-raising at that one call site. The
context now formats on the error path alone rather than on every leg read.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…kip ci]

Move the ~150-line near-shipped riboseq partition out of the test module into
tests/fixtures/curve_invariant_repros/, the directory the sibling curve-repro
locks load from, and read it the same way. The fixture joins the globbed corpus,
so reconcile the two corpus consumers it feeds: refresh the route-topology
resolved-graph digest, and record the fixture in the reserved-claim
KNOWN_NOT_RENDERING allow-list (it aborts downstream on the unrelated
fan-overlay curve defect #1806/#1809).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…loses

The on-disk band-hop corpus fixture is swept into the gate-coverage
corpus and exercises 18 previously-uncovered gate arms before its known
downstream fan-overlay abort. Regenerate the baseline to record those as
covered and remove the seven now-stale triage sidecar entries whose gates
are no longer open gaps.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pinin4fjords

Copy link
Copy Markdown
Member Author

Nudging CI: no GitHub Actions check-suite registered for the head commit after 30+ minutes. Closing and reopening to re-fire the pull_request webhook.

@pinin4fjords pinin4fjords reopened this Sep 5, 2026
pinin4fjords and others added 2 commits September 6, 2026 00:22
Resolve the corpus-digest conflict in tests/test_route_topology.py by
recomputing the hash fresh against the merged corpus, which now carries
both this branch's band-hop fixture and the fixtures main added since the
branch point, rather than keeping either side's stale literal.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Render preview: no visual changes detected. All renders match main.

@pinin4fjords
pinin4fjords marked this pull request as ready for review September 6, 2026 07:24
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.

[bug]: bare message-less AssertionError from a zero-length seam leg in _entry_wrap_record

1 participant