markpact-pololu

Plan refaktoryzacji — URI Router / markpact-pololu

Status na 2026-06-18. Powiązany model: URI-ROUTER.md.
Mapa mesh (centrum urisys): urisys/docs/MESH.md.

Cel

Jeden logiczny UriRouter (semantyka URI + resolver + transport), wiele adapterów i runtime’ów (ESP32 → cloud), bez jednego „Traefika dla wszystkiego”.

Implementacja: pakiet urirouter (uri_router), orchestracja przez urisys.

Fazy

Faza 0 — Fundament (✅)

Zadanie Artefakt
Kontrakt Markpact external runtime://resolver markpacts/pololu-tic-t249.stepper.markpact.md
Resolver (HTTP delegate) profiles/urisys.runtime.*.yaml
Hybrid flow PC + ESP32 tic-t249-hybrid-pc-esp32
machine-cycle → Pololu resolver markpact-contracts/.../urisys.runtime.machine-cycle-pololu.yaml
Docker registry labels docker-compose.yml
Dokumentacja UriRouter docs/URI-ROUTER.md

Faza 1 — Spójność schematów (✅)

Zadanie Artefakt
targets → resolver generator scripts/generate-urisys-runtime.py + make resolver
resolver_path względem config urisys/managers/markpact_run.py
Bez fałszywego MQTT bridge w resolverze generated HTTP-only dla urisys
Payload schema stepper profiles/stepper.payload.schema.yaml
UriTransportBinding markpact-contracts/.../uri-transport-binding.stepper.yaml
CI drift + smoke .github/workflows/ci.yml, make ci

Faza 2 — Transporty (✅)

Zadanie Status Artefakt
MQTT canonical tellmesh/… targets.yaml, uritic-host dual-base
Natywny MQTT uri_router.transport (paho-mqtt)
Resolver MQTT PC urisys.runtime.mqtt-pc.yaml (generated)
request_id / trace_id / deadline_ms uri_router.envelope, uritic-host
Integration test HTTP+MQTT+urisys scripts/integration-test.sh
NATS / Zenoh / serial 📋 Faza 4+

Faza 3 — Router docelowy (🔄 w toku)

Zadanie Status Artefakt
Pakiet urirouter wyodrębniony z uricore tellmesh/urirouter
Shimy uri_control.* w uricore re-export z uri_router
urisysuri_router bezpośrednio markpact_run.py, pyproject.toml
Dokumentacja mesh + diagramy urisys/docs/MESH.md
targets.profiles + context.runtime_profile uri_router.resolver, hybrid resolver
PyPI publish urirouter 📋 CI release
Centralna policy.operations 📋 handlerach + device_profile
urirouter-embedded / uri_routes.h 📋 marksync
Cloud registry + audit 📋 urisys-node

Faza 4 — Kontrakty cross-pack (📋)

Zadanie Opis
Payload direction vs accel_sps2 schema gotowa; normalizacja w handlerach — TODO
machine-cycle bez zmian flow resolver machine-cycle-pololu
CI docker-smoke z hardware opcjonalny job z USB — TODO

Komendy

make resolver          # generuj urisys.runtime.*.yaml
make resolver-check    # CI drift guard
make ci                # walidacja + smoke
make integration-test  # HTTP/MQTT/urisys/uri_router delegate

export TELLMESH_ROOT=~/github/tellmesh
pip install -e $TELLMESH_ROOT/urirouter -e $TELLMESH_ROOT/uricore
./scripts/run-urisys-flow.sh tic-t249-hybrid-pc-esp32

# MQTT delegate (broker + uritic-host)
export URISYS_RESOLVER_CONFIG=$PWD/profiles/urisys.runtime.mqtt-pc.yaml
urisys markpact run markpacts/pololu-tic-t249.stepper.markpact.md#tic-t249-smoke \
  --config profiles/edge.config.yaml --approve --dry-run --force

Metryki

Metryka Stan
Pakiet routera urirouter 0.1.0 (osobne repo)
Formatów resolvera 1 źródło (targets.yaml) + generator
Transportów http, mqtt-native, mqtt-bridge
Topic MQTT canonical tellmesh/ + legacy uritic/
CI GitHub Actions + make ci + integration-test