From 1651514c8e74a7ecdaabb7f3b2b39550d8881ca8 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sat, 11 Jul 2026 10:20:54 -0400 Subject: [PATCH] Version browser context fixture contract --- ampg/health.py | 2 +- ampg/manifest.py | 6 +++--- ampg/preview.py | 3 ++- docs/architecture.md | 4 ++-- docs/fixture-manifests.md | 15 ++++++++++----- docs/visual-guide.md | 2 +- tests/test_fixture_manifest.py | 6 +++--- tests/test_preview.py | 7 +++++-- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/ampg/health.py b/ampg/health.py index ce2befe..d3528a5 100644 --- a/ampg/health.py +++ b/ampg/health.py @@ -67,7 +67,7 @@ def _health_check(site: SiteConfig, fixture: dict[str, Any], *, mode: str) -> He output_root = site.outputs.root / protocol route = str(fixture.get("route", {}).get("fixture_path", "/")) transport = str(fixture["checks"]["transport"]) - profile = str(fixture["checks"]["profile"]) + profile = str(fixture["checks"].get("context", fixture["checks"].get("profile", transport))) address_status = str(fixture["address_status"]) output_ready = (output_root / ".ampg-output").exists() preview_status = fixture.get("preview", {}).get("status") diff --git a/ampg/manifest.py b/ampg/manifest.py index 7f57447..ce1fe3f 100644 --- a/ampg/manifest.py +++ b/ampg/manifest.py @@ -10,7 +10,7 @@ from .config import GatewayConfig, ProtocolConfig, RoutePolicyConfig, SiteConfig from .route_policy import fixture_path, route_exposed -SCHEMA = "ampg.fixture-manifest.v1" +SCHEMA = "ampg.fixture-manifest.v2" @dataclass(frozen=True) @@ -83,8 +83,8 @@ def _fixture_entry( "output_path": _output_path_for_route(protocol.name, route_policy), "checks": { "transport": transport, - "profile": transport, - "isolation": "transport-profile", + "context": transport, + "isolation": "transport-context", }, "interaction": _interaction_policy(protocol, route_policy), } diff --git a/ampg/preview.py b/ampg/preview.py index 516c710..bd1b17b 100644 --- a/ampg/preview.py +++ b/ampg/preview.py @@ -97,7 +97,8 @@ def preview_fixture_manifest( fixture["address_status"] = "preview" fixture["checks"] = { "transport": "clearnet", - "profile": "clearnet", + "context": "clearnet", + "isolation": "transport-context", } return manifest diff --git a/docs/architecture.md b/docs/architecture.md index ee7ca73..1380ea8 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -95,8 +95,8 @@ Adapters must be conservative. They do not modify non-AMPG config without showin plan first, and managed config lives under AMPG-owned state directories. Fixture manifests are the AMPG-to-AMPB boundary. They declare the published URL, expected -transport, expected profile, and transport-profile isolation result. They do not prescribe -browser process management or local daemon ownership; those decisions remain inside AMPB. +transport, logical context, and transport-context isolation result. They do not prescribe +browser tabs, processes, or local daemon ownership; those decisions remain inside AMPB. ## Platform providers diff --git a/docs/fixture-manifests.md b/docs/fixture-manifests.md index 852cf66..eb6061f 100644 --- a/docs/fixture-manifests.md +++ b/docs/fixture-manifests.md @@ -1,9 +1,13 @@ # Fixture Manifests -> Status: draft | Updated 2026-07-07 | Applies to: AMPG and AMPB compatibility checks +> Status: draft | Updated 2026-07-11 | Applies to: AMPG and AMPB compatibility checks AMPG writes deterministic fixture manifests so AMPB can verify that generated site -variants route to the expected browser transport and profile. +variants route to the expected browser transport context. + +Current manifests use `ampg.fixture-manifest.v2`. The browser-facing `checks.context` +field is a logical transport context and does not imply a separate browser profile or +window. ## Output @@ -19,7 +23,7 @@ The manifest contains public route expectations only: - enabled protocol fixtures. - protocol renderer and relative output path. - route URL for AMPB checks. -- expected AMPB transport, profile, and transport-profile isolation. +- expected AMPB transport, logical context, and transport-context isolation. - declared interaction tier, identity adapter, payment adapter, realtime flag, and public exposure flag. - optional route-group metadata for configured public route policies. @@ -28,8 +32,9 @@ It must not contain private host inventory, hidden-service keys, tunnel keys, cr or deployment notes. The isolation check is a browser-facing result, not a daemon-management instruction. -AMPG declares which transport profile must consume the route; AMPB independently decides -whether to adopt or start the local transport needed to reach it. +AMPG declares which transport context must consume the route; AMPB independently decides +how to isolate that context and whether to adopt or start the local transport needed to +reach it. ## Commands diff --git a/docs/visual-guide.md b/docs/visual-guide.md index 9a3ae10..27ec71f 100644 --- a/docs/visual-guide.md +++ b/docs/visual-guide.md @@ -190,7 +190,7 @@ sequenceDiagram Site->>AMPG: build selected outputs AMPG->>Manifest: write route expectations AMPB->>Manifest: load fixtures - AMPB->>Transport: request fixture URL through expected profile + AMPB->>Transport: request fixture URL through expected context Transport-->>AMPB: return generated output AMPB-->>AMPG: report pass or failure ``` diff --git a/tests/test_fixture_manifest.py b/tests/test_fixture_manifest.py index 673e4d2..c6e74d6 100644 --- a/tests/test_fixture_manifest.py +++ b/tests/test_fixture_manifest.py @@ -59,7 +59,7 @@ cid = "bafyexample" manifest = fixture_manifest(config, config.sites[0]) written = write_fixture_manifests(config) - self.assertEqual("ampg.fixture-manifest.v1", manifest["schema"]) + self.assertEqual("ampg.fixture-manifest.v2", manifest["schema"]) self.assertEqual(["example"], [result.site_id for result in written]) self.assertEqual(5, written[0].fixture_count) @@ -75,8 +75,8 @@ cid = "bafyexample" self.assertEqual( { "transport": "ipfs", - "profile": "ipfs", - "isolation": "transport-profile", + "context": "ipfs", + "isolation": "transport-context", }, by_protocol["ipfs"]["checks"], ) diff --git a/tests/test_preview.py b/tests/test_preview.py index 92f0022..fcb8e10 100644 --- a/tests/test_preview.py +++ b/tests/test_preview.py @@ -36,10 +36,13 @@ class PreviewTest(unittest.TestCase): tor_root = by_protocol_path[("tor", "/")] self.assertEqual("http://127.0.0.1:19101/", tor_root["url"]) - self.assertEqual({"transport": "clearnet", "profile": "clearnet"}, tor_root["checks"]) + self.assertEqual( + {"transport": "clearnet", "context": "clearnet", "isolation": "transport-context"}, + tor_root["checks"], + ) self.assertEqual("http://preview.onion/", tor_root["published"]["url"]) self.assertEqual( - {"transport": "tor", "profile": "tor", "isolation": "transport-profile"}, + {"transport": "tor", "context": "tor", "isolation": "transport-context"}, tor_root["published"]["checks"], ) self.assertEqual("preview", tor_root["address_status"])