Skip to content

Add a typed REST request/response contract for mscolab (mslib/mscolab/api/) #3208

Description

@ReimarBauer

REST/socket payloads between mslib/mscolab (server) and mslib/msui/mscolab.py (client) are ad-hoc dicts with no machine-checkable link between a client call site and its server route. A rename or shape change on one side currently has no compiler/linter/test signal on the other

  • This task is a wire-format migration only, behavior must not change.
  • Create mslib/mscolab/api/ package: schemas.py (stdlib @dataclass request/response shapes per REST route — no new runtime dependency), endpoints.py (named endpoint registry, replacing bare strings like "create_operation").
  • Migrate blueprint handlers and their client call sites route-by-route to build from / parse into these dataclasses, for every route that has a real msui caller. Convert any duplicate ad-hoc call sites onto the same schema as they're found.
  • Add tests/_test_api/ with a round-trip test per schema (serialize → parse → compare), wired into test-fast so it stays a fast tripwire.
  • Rework the server-isolation import-linter contract in setup.cfg so mslib.msui can reach mslib.mscolab.api without a growing list of per-symbol exceptions.
  • Move mslib/mscolab/events.py and message_type.py into mslib/mscolab/api/ alongside the new modules — one clearly-named location for "this is the contract" instead of scattered files.
  • Mark pre-existing bugs when you find them through the refactoring. by "NOTE: pre-existing bug"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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