Files
Pulse/scripts/tests/test_relay_and_map_docs.py
rcourtman c9876dc0cd feat(release): promote Map and Machines VMs to Stage 5 released
Promote infrastructureMap (Map) and standaloneVms (Machines VMs) from
Stage 4 preview to Stage 5 released in featureReleases.json with Richard
approval dated 2026-12-02. Both features passed Stage 3 completeness
review and completed a full Stage 4 Preview beta cycle across
v6.10.0-beta.2, v6.10.0-beta.3, and v6.10.0-rc.1, and now enter
v6.11.0-beta.1 ahead of v6.11.0 stable without the Preview tag.

Restore the shipped Map guide links and references in docs/README.md,
docs/AVAILABILITY.md, docs/API.md, and their frontend-modern/public/docs/
mirrors. Keep cloudCompanion in Stage 4 preview and availabilityPushChecks
in Stage 2 build. Update feature-release, layout, standalone, action
review, documentation, and Playwright tests for the released stage.

Contract-Neutral: Stage 5 feature release promotion for infrastructureMap and standaloneVms in featureReleases.json with restored MAP.md guide links and matching unit, documentation, and E2E test updates.
2026-12-02 15:14:22 +00:00

72 lines
3.2 KiB
Python

#!/usr/bin/env python3
"""Verify Relay API reference and released Map inspector documentation against live source."""
import json
from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parents[2]
class RelayAndMapDocsTest(unittest.TestCase):
def test_shipped_mirrors_match_repo_docs(self) -> None:
for name in ("RELAY.md", "MAP.md", "README.md", "AVAILABILITY.md", "API.md"):
with self.subTest(doc=name):
self.assertEqual(
(ROOT / "docs" / name).read_bytes(),
(ROOT / "frontend-modern/public/docs" / name).read_bytes(),
)
def test_relay_api_reference_matches_router_routes(self) -> None:
relay_doc = (ROOT / "docs/RELAY.md").read_text(encoding="utf-8")
router = (ROOT / "internal/api/router_routes_ai_relay.go").read_text(encoding="utf-8")
scopes = (ROOT / "pkg/auth/scopes.go").read_text(encoding="utf-8")
routes = (
("GET", "/api/settings/relay"),
("PUT", "/api/settings/relay"),
("GET", "/api/settings/relay/status"),
("GET", "/api/onboarding/qr"),
("POST", "/api/onboarding/validate"),
("GET", "/api/onboarding/deep-link"),
)
for method, path in routes:
with self.subTest(route=f"{method} {path}"):
self.assertIn(f'"{method} {path}"', router)
self.assertIn(f"| `{method}` | `{path}` |", relay_doc)
self.assertIn('ScopeRelayMobileAccess = "relay:mobile:access"', scopes)
self.assertIn("ensureSettingsReadScope(r.config, w, req)", router)
self.assertIn("`relay` licence entitlement", relay_doc)
self.assertIn("administrator access for browser sessions", relay_doc)
self.assertIn("`relay:mobile:access` or `settings:read`", relay_doc)
def test_map_doc_describes_bottom_inspector_bar_and_is_linked_when_released(self) -> None:
map_doc = (ROOT / "docs/MAP.md").read_text(encoding="utf-8")
surface = (
ROOT / "frontend-modern/src/features/infrastructureMap/InfrastructureMapSurface.tsx"
).read_text(encoding="utf-8")
docs_readme = (ROOT / "docs/README.md").read_text(encoding="utf-8")
availability_doc = (ROOT / "docs/AVAILABILITY.md").read_text(encoding="utf-8")
releases = json.loads(
(ROOT / "frontend-modern/src/utils/featureReleases.json").read_text(encoding="utf-8")
)
self.assertEqual(releases["infrastructureMap"]["stage"], "released")
self.assertIn("data-testid=\"infrastructure-map-inspector\"", surface)
self.assertIn("data-map-inspector-anomaly=", surface)
self.assertIn("bottom inspector bar", map_doc)
self.assertIn("touch card", map_doc)
self.assertNotIn("hover tooltips", map_doc.lower())
self.assertNotIn("tile tooltips", map_doc.lower())
self.assertNotIn("host tooltips", map_doc.lower())
self.assertNotIn("guest tooltips", map_doc.lower())
self.assertNotIn("check tooltips", map_doc.lower())
self.assertIn("MAP.md", docs_readme)
self.assertIn("MAP.md#add-your-router-switch-or-access-point", availability_doc)
if __name__ == "__main__":
unittest.main()