Version browser context fixture contract

This commit is contained in:
jwinterm
2026-07-11 10:20:54 -04:00
parent 84d72cb2ed
commit 1651514c8e
8 changed files with 27 additions and 18 deletions
+1 -1
View File
@@ -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")
+3 -3
View File
@@ -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),
}
+2 -1
View File
@@ -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
+2 -2
View File
@@ -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
+10 -5
View File
@@ -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
+1 -1
View File
@@ -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
```
+3 -3
View File
@@ -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"],
)
+5 -2
View File
@@ -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"])