Skip to content

Contract the passage, a transition the party walks through - #153

Merged
mmacy merged 1 commit into
mainfrom
passage-contract
Oct 16, 2026
Merged

mmacy merged 1 commit into
mainfrom
passage-contract

Conversation

@mmacy

@mmacy mmacy commented Oct 16, 2026

Copy link
Copy Markdown
Owner

This adds the contract for passages. A passage is a transition the party crosses by walking across one side of its cell, instead of taking it with UseStairs. osr-forge's map tracing needs it to join two levels whose floors meet on one map, and re-pod writes each passage as a FRUA transfer. The cross-project plan is docs/plans/map-tracing.md in re-pod, under "Passages".

What's here:

  • TransitionSpec.kind gains "passage", and TransitionSpec gains side: Direction | None = None.
  • LevelSpec.passage_at(position, side) is a stub that raises NotImplementedError("chunk: passage").
  • docs/spec.md describes the passage in the adventure model and adds phase 17 to the roadmap.
  • tests/test_passages.py has the acceptance tests, all marked xfail(reason="chunk: passage"). uv run pytest --runxfail tests/test_passages.py shows 32 failing on behavior and 5 that pass today.

The tests pin the order of a crossing's events, each move that fires nothing, the gate's refusal and toll, the player view's open side, a save and a replay through a passage, and the exact validate_adventure line for each refusal. osr-editor's diagnostics match osrlib's messages by pattern, so those lines are part of the contract.

Nothing moves SCHEMA_VERSION. A new kind value and an optional field are additive within schema 4, and main is unreleased at schema 4.

Checked locally: ruff format --check, ruff check, pyright (0 errors), pytest (2951 passed, 146 skipped, 32 xfailed, 5 xpassed), and mkdocs build --strict.

Adds the "passage" kind and a side field to TransitionSpec, a
LevelSpec.passage_at stub, the passage to the spec's adventure model,
and phase 17 to the roadmap. tests/test_passages.py holds the
acceptance tests, marked xfail with "chunk: passage". They pin the
crossing events in order, each move that fires nothing, the gate, the
player view, the save round trip, and the exact validate_adventure
lines, which osr-editor's diagnostics match by pattern.

osr-forge's map tracing and re-pod's level splitting need passages,
and they ship in osrlib 2.0.
@mmacy
mmacy merged commit 6b12e63 into main Oct 16, 2026
5 checks passed
@mmacy
mmacy deleted the passage-contract branch October 16, 2026 01:39
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