Skip to content

adapter seam: document the qualified-id obligation once, not per backend #311

Description

@dracic

Summary

#254 and #291 both landed the same shape — psmux qualifies its window ids to session:@N at the minting/listing seams — but the rule a backend author needs in order to do that safely is still spread across two backend-specific docstrings and a parenthetical in the authoring guide. The TerminalMultiplexer ABC states one half of it (list_window_ids must match new_window, because window_alive is a membership test) and, after #291, that current_window_id must match the window_id column of list_windows. What it does not state is the general obligation those two are instances of.

Split out of the #291 diff deliberately: correcting the stale text was in scope for that fix, writing cross-backend authoring guidance was not.

The rule that is currently undocumented

If a backend returns anything other than a bare native id from an id-minting seam, then every verb that backend's own callers replay the id through must accept that form — and where one cannot, the backend translates inside that verb rather than leaving the id bare.

psmux is the worked example in both directions:

Getting this wrong is quiet in both directions, which is why it is worth writing down:

Suggested scope

  • One paragraph in docs/adapter-authoring-guide.md's target-grammar section stating the obligation, with psmux's select_window translation named as the worked example of "the verb cannot take it, so translate".
  • A sentence on TerminalMultiplexer.new_parked_window noting the id is opaque and MAY be qualified, matching what new_window already says.
  • No behavior change, no test changes.

Relevant for the external adapter path too: the herdr adapter is the documented implement-fresh reference, and any native-id backend written against parse_target() faces the same question.

Refs: #291, #290, #254, #310

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions