Move web provider fallback into catalog
This commit is contained in:
parent
5839ae2acb
commit
9a07d1f5e8
7 changed files with 218 additions and 73 deletions
|
|
@ -280,6 +280,12 @@ Exit criteria:
|
|||
|
||||
Recently cut:
|
||||
|
||||
- The web reference no longer hardcodes the local provider list in
|
||||
`web/surface.js`. It loads `web/local-provider-catalog.json`, then opens
|
||||
advertisement-backed entries for Aetheria, Repixelizer, and Sai through the
|
||||
same `loadProviderAdvertisement` path used by the provider picker. Fixture-only
|
||||
surfaces remain explicit local catalog entries until they gain provider
|
||||
advertisements or move into their owner packs.
|
||||
- Provider advertisements can now name sidecar plugin requirements per surface
|
||||
with `surfaces[].requiresPlugins[]`. The parity harness validates those
|
||||
requirements against known plugin manifests, exports them in the conformance
|
||||
|
|
|
|||
|
|
@ -47,15 +47,20 @@ provider picker:
|
|||
|
||||
- `Repixelizer`: loads `web/fixtures/repixelizer.provider-advertisement.json`
|
||||
and `web/fixtures/repixelizer.eve-surface.json`.
|
||||
- `Aetheria`: loads `web/fixtures/aetheria.provider-advertisement.json`
|
||||
and `web/fixtures/aetheria-world-surface.json`.
|
||||
- `Sai VN Surface`: loads `web/fixtures/sai-vn.provider-advertisement.json`
|
||||
and `web/fixtures/sai-vn-surface.json`.
|
||||
- `Fensalir Direct2D`: loads `web/fixtures/fensalir-client-surface.json`, a
|
||||
recorded surface describing the Direct2D client lowering path.
|
||||
- `Sai VN Surface`: loads `web/fixtures/sai-vn-surface.json`.
|
||||
- `Huginn .cc`: compiles `web/fixtures/huginn-cc-surface.eve`.
|
||||
- `Reactive DSL`: compiles `web/fixtures/reactive-composition.eve`.
|
||||
- `CultUI Inspector`: compiles `web/fixtures/cultui-slider-inspector.eve`
|
||||
and proves partition/field-row/slider-anatomy lowering in the web reference.
|
||||
|
||||
The remaining temporary part is the local fixture provider list itself. The
|
||||
The local fallback provider list now lives in `web/local-provider-catalog.json`
|
||||
instead of renderer code. That catalog is fixture discovery data for the browser
|
||||
oracle; live discovery still belongs to CultMesh/Odin advertisements. The
|
||||
runtime app target is the same picker fed by live
|
||||
`gamecult.eve.provider_advertisement.v1` documents through CultMesh/Odin; the
|
||||
browser reference no longer opens live providers by dialing Mimir's deck broker
|
||||
|
|
|
|||
|
|
@ -133,6 +133,8 @@ First cuts:
|
|||
|
||||
- Replace hardcoded tabs with a provider picker.
|
||||
- Represent existing fixtures as provider advertisements.
|
||||
- Load fallback provider entries from `web/local-provider-catalog.json` so
|
||||
local discovery data stays out of renderer code.
|
||||
- Add Repixelizer fixture loading from `docs/fixtures/repixelizer.eve-surface.json`.
|
||||
- Map the full Repixelizer style token set to CSS variables.
|
||||
- Add screenshot capture for the Repixelizer first viewport and main app
|
||||
|
|
|
|||
|
|
@ -464,6 +464,15 @@
|
|||
"requiredFixtures": ["embedded-surface"],
|
||||
"pluginFixtures": ["sai-vn"],
|
||||
"supportedFeatures": ["embeddedDocuments", "providerAdvertisements", "stateBindings", "styleTokens", "authorityWitnesses"],
|
||||
"localProviderCatalog": {
|
||||
"path": "web/local-provider-catalog.json",
|
||||
"requiredProviders": ["aetheria", "repixelizer", "gamecult.home.vn"],
|
||||
"requiredAdvertisements": [
|
||||
"web/fixtures/aetheria.provider-advertisement.json",
|
||||
"web/fixtures/repixelizer.provider-advertisement.json",
|
||||
"web/fixtures/sai-vn.provider-advertisement.json"
|
||||
]
|
||||
},
|
||||
"supportedPlugins": [
|
||||
{
|
||||
"pluginId": "sai.vn",
|
||||
|
|
@ -481,7 +490,11 @@
|
|||
"expectedSourceSymbols": [
|
||||
{
|
||||
"path": "web/surface.js",
|
||||
"contains": ["loadProviderAdvertisement", "aetheria.provider-advertisement.json", "publishCommandIntent", "browser.reference"]
|
||||
"contains": ["loadLocalProviderCatalog", "loadProviderAdvertisement", "publishCommandIntent", "browser.reference"]
|
||||
},
|
||||
{
|
||||
"path": "web/local-provider-catalog.json",
|
||||
"contains": ["aetheria.provider-advertisement.json", "repixelizer.provider-advertisement.json", "sai-vn.provider-advertisement.json"]
|
||||
},
|
||||
{
|
||||
"path": "packages/eve-browser-lowering/src/index.ts",
|
||||
|
|
|
|||
|
|
@ -303,6 +303,7 @@ async function evaluateRuntime(runtime, fixtureResults) {
|
|||
}
|
||||
const commandTransportSmokeErrors = await validateRuntimeCommandTransportSmoke(runtime);
|
||||
const capabilityManifestErrors = await validateRuntimeCapabilityManifest(runtime);
|
||||
const localProviderCatalogErrors = await validateRuntimeLocalProviderCatalog(runtime);
|
||||
const missingIncubationFields = requiredIncubationFields(runtime).filter(field => !runtime[field]);
|
||||
const pluginCapabilityGaps = collectPluginCapabilityGaps(runtime, fixtureResults);
|
||||
const unsupportedPluginNotes = collectUnsupportedPluginNotes(runtime, fixtureResults);
|
||||
|
|
@ -313,6 +314,7 @@ async function evaluateRuntime(runtime, fixtureResults) {
|
|||
if (runtime.kind === "active" && missingRequiredFeatures.length) status = "missing-required-feature";
|
||||
if (runtime.kind === "active" && commandTransportSmokeErrors.length) status = "missing-command-transport-smoke";
|
||||
if (runtime.kind === "active" && capabilityManifestErrors.length) status = "invalid-runtime-capability";
|
||||
if (runtime.kind === "active" && localProviderCatalogErrors.length) status = "invalid-local-provider-catalog";
|
||||
if (runtime.kind === "active" && missingIncubationFields.length) status = "missing-incubation-metadata";
|
||||
if (runtime.kind === "active" && pluginCapabilityGaps.length && status === "active") status = "active-with-capability-gaps";
|
||||
if (runtime.kind === "pending" && runtime.adapterSpike === "external" && !missingExternalPaths.length && !missingExternalSourceSymbols.length) {
|
||||
|
|
@ -347,6 +349,8 @@ async function evaluateRuntime(runtime, fixtureResults) {
|
|||
commandTransportSmokeErrors,
|
||||
capabilityManifest: runtime.capabilityManifest || null,
|
||||
capabilityManifestErrors,
|
||||
localProviderCatalog: runtime.localProviderCatalog || null,
|
||||
localProviderCatalogErrors,
|
||||
lifecycle: runtime.lifecycle || null,
|
||||
ownerRepo: runtime.ownerRepo || "",
|
||||
repoRole: runtime.repoRole || "",
|
||||
|
|
@ -361,6 +365,56 @@ async function evaluateRuntime(runtime, fixtureResults) {
|
|||
};
|
||||
}
|
||||
|
||||
async function validateRuntimeLocalProviderCatalog(runtime) {
|
||||
const catalogConfig = runtime.localProviderCatalog;
|
||||
if (!catalogConfig) return [];
|
||||
|
||||
const errors = [];
|
||||
const catalogPath = catalogConfig.path || "";
|
||||
const absolutePath = path.join(repoRoot, catalogPath);
|
||||
if (!existsSync(absolutePath)) return [`${catalogPath}:missing`];
|
||||
|
||||
let catalog;
|
||||
try {
|
||||
catalog = JSON.parse(await readFile(absolutePath, "utf8"));
|
||||
} catch (error) {
|
||||
return [`${catalogPath}:invalid-json:${error instanceof Error ? error.message : String(error)}`];
|
||||
}
|
||||
|
||||
const providers = Array.isArray(catalog.providers) ? catalog.providers : [];
|
||||
const providerIds = new Set(providers.map(provider => provider.providerId).filter(Boolean));
|
||||
for (const providerId of catalogConfig.requiredProviders || []) {
|
||||
if (!providerIds.has(providerId)) errors.push(`${catalogPath}:provider:${providerId}:missing`);
|
||||
}
|
||||
|
||||
const catalogDirectory = path.posix.dirname(normalizePath(catalogPath));
|
||||
const advertisedPaths = new Set(providers
|
||||
.map(provider => resolveCatalogPath(catalogDirectory, provider.advertisement || ""))
|
||||
.filter(Boolean));
|
||||
for (const advertisementPath of catalogConfig.requiredAdvertisements || []) {
|
||||
const normalized = normalizePath(advertisementPath);
|
||||
if (!advertisedPaths.has(normalized)) {
|
||||
errors.push(`${catalogPath}:advertisement:${advertisementPath}:unreferenced`);
|
||||
}
|
||||
if (!existsSync(path.join(repoRoot, advertisementPath))) {
|
||||
errors.push(`${advertisementPath}:missing`);
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
function normalizePath(candidate) {
|
||||
return candidate.replaceAll("\\", "/").replace(/^\.\//, "");
|
||||
}
|
||||
|
||||
function resolveCatalogPath(catalogDirectory, candidate) {
|
||||
const normalized = normalizePath(candidate);
|
||||
if (!normalized) return "";
|
||||
if (/^(https?:|\/)/i.test(normalized)) return normalized;
|
||||
return path.posix.normalize(path.posix.join(catalogDirectory, normalized));
|
||||
}
|
||||
|
||||
async function evaluatePlugin(plugin, fixtureResults) {
|
||||
const expectedPaths = plugin.expectedPaths || [];
|
||||
const missingPaths = expectedPaths.filter(candidate => !existsSync(path.join(repoRoot, candidate)));
|
||||
|
|
@ -1243,13 +1297,14 @@ function buildConformanceExport(report) {
|
|||
capabilityManifestPath: runtime.capabilityManifest?.manifestPath || "",
|
||||
commandTransportSchema: runtime.commandTransportSmoke?.schema || "",
|
||||
captureStatus: runtime.capture?.status || "",
|
||||
lifecycle: runtime.lifecycle,
|
||||
missingEvidence: [
|
||||
lifecycle: runtime.lifecycle,
|
||||
missingEvidence: [
|
||||
...runtime.missingPaths,
|
||||
...runtime.missingRequiredFixtures.map(id => `fixture:${id}`),
|
||||
...runtime.missingRequiredFeatures.map(id => `feature:${id}`),
|
||||
...runtime.commandTransportSmokeErrors.map(id => `command-smoke:${id}`),
|
||||
...runtime.capabilityManifestErrors.map(id => `runtime-capability:${id}`),
|
||||
...runtime.localProviderCatalogErrors.map(id => `local-provider-catalog:${id}`),
|
||||
],
|
||||
}))
|
||||
: [];
|
||||
|
|
@ -1464,6 +1519,7 @@ function renderMarkdown(report) {
|
|||
...runtime.missingRequiredFeatures.map(id => `feature:${id}`),
|
||||
...runtime.commandTransportSmokeErrors.map(id => `command-smoke:${id}`),
|
||||
...runtime.capabilityManifestErrors.map(id => `runtime-capability:${id}`),
|
||||
...runtime.localProviderCatalogErrors.map(id => `local-provider-catalog:${id}`),
|
||||
...runtime.missingIncubationFields.map(id => `metadata:${id}`),
|
||||
].join(", ");
|
||||
lines.push(`| ${runtime.title} | ${runtime.status} | ${runtime.ownerRepo} | ${summarizeLifecycle(runtime.lifecycle)} | ${runtime.capture?.status || "unknown"} | ${runtime.commandTransportSmoke?.schema || ""} | ${runtime.requiredFixtures.join(", ")} | ${runtime.pluginFixtures.join(", ")} | ${runtime.supportedFeatures.join(", ")} | ${runtime.pluginCapabilityGaps.join(", ")} | ${runtime.unsupportedPluginNotes.join(", ")} | ${missing} |`);
|
||||
|
|
|
|||
124
web/local-provider-catalog.json
Normal file
124
web/local-provider-catalog.json
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
{
|
||||
"schema": "gamecult.eve.local_provider_catalog.v1",
|
||||
"purpose": "Browser reference fallback catalog for local provider advertisements and fixture surfaces. This is not live discovery truth.",
|
||||
"providers": [
|
||||
{
|
||||
"providerId": "aetheria",
|
||||
"title": "Aetheria",
|
||||
"kind": "game.runtime",
|
||||
"advertisement": "./fixtures/aetheria.provider-advertisement.json",
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-json",
|
||||
"surfaceId": "aetheria.daemon.game",
|
||||
"url": "./fixtures/aetheria-world-surface.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "repixelizer",
|
||||
"title": "Repixelizer",
|
||||
"kind": "service.product",
|
||||
"advertisement": "./fixtures/repixelizer.provider-advertisement.json",
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-json",
|
||||
"surfaceId": "repixelizer.operator.surface",
|
||||
"url": "./fixtures/repixelizer.eve-surface.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "gamecult.home.vn",
|
||||
"aliases": ["sai.visual_novel", "sai-vn"],
|
||||
"title": "Sai VN Surface",
|
||||
"kind": "content.runtime",
|
||||
"advertisement": "./fixtures/sai-vn.provider-advertisement.json",
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-json",
|
||||
"surfaceId": "sai.visual_novel.surface",
|
||||
"url": "./fixtures/sai-vn-surface.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "fensalir.direct2d",
|
||||
"title": "Fensalir Direct2D",
|
||||
"kind": "surface.renderer",
|
||||
"freshness": { "state": "fixture" },
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-json",
|
||||
"surfaceId": "fensalir.direct2d.fixture",
|
||||
"url": "./fixtures/fensalir-client-surface.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "cultcache.huginn.inspector",
|
||||
"title": "Huginn .cc",
|
||||
"kind": "inspection.huginn",
|
||||
"freshness": { "state": "fixture" },
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-eve-dsl",
|
||||
"surfaceId": "cultcache.huginn.inspector",
|
||||
"url": "./fixtures/huginn-cc-surface.eve"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "eve.reactive.dsl",
|
||||
"title": "Reactive DSL",
|
||||
"kind": "surface.fixture",
|
||||
"freshness": { "state": "fixture" },
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-eve-dsl",
|
||||
"surfaceId": "eve.reactive.dsl",
|
||||
"url": "./fixtures/reactive-composition.eve"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "gamecult.eve.authority-witness",
|
||||
"title": "Authority Witness",
|
||||
"kind": "surface.fixture",
|
||||
"freshness": { "state": "fixture" },
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-json",
|
||||
"surfaceId": "gamecult.eve.authority-witness",
|
||||
"url": "./fixtures/authority-staleness-witness.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "eve.cultui.inspector",
|
||||
"title": "CultUI Inspector",
|
||||
"kind": "surface.fixture",
|
||||
"freshness": { "state": "fixture" },
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-eve-dsl",
|
||||
"surfaceId": "eve.cultui.inspector",
|
||||
"url": "./fixtures/cultui-slider-inspector.eve"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"providerId": "gamecult.eve.embedded-demo",
|
||||
"title": "Embedded Surface Slot",
|
||||
"kind": "surface.fixture",
|
||||
"freshness": { "state": "fixture" },
|
||||
"surfaces": [
|
||||
{
|
||||
"transport": "local-json",
|
||||
"surfaceId": "gamecult.eve.embedded-demo",
|
||||
"url": "./fixtures/cultui-embedded-surface.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -17,73 +17,6 @@ let currentProvider;
|
|||
let liveHermodr = false;
|
||||
let openProviderGeneration = 0;
|
||||
|
||||
const localProviders = [
|
||||
{
|
||||
providerId: "aetheria",
|
||||
title: "Aetheria",
|
||||
kind: "game.runtime",
|
||||
advertisement: "./fixtures/aetheria.provider-advertisement.json",
|
||||
surfaces: [{ transport: "local-json", surfaceId: "aetheria.daemon.game", url: "./fixtures/aetheria-world-surface.json" }],
|
||||
},
|
||||
{
|
||||
providerId: "repixelizer",
|
||||
title: "Repixelizer",
|
||||
kind: "service.product",
|
||||
advertisement: "./fixtures/repixelizer.provider-advertisement.json",
|
||||
surfaces: [{ transport: "local-json", surfaceId: "repixelizer.operator.surface", url: "./fixtures/repixelizer.eve-surface.json" }],
|
||||
},
|
||||
{
|
||||
providerId: "fensalir.direct2d",
|
||||
title: "Fensalir Direct2D",
|
||||
kind: "surface.renderer",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-json", surfaceId: "fensalir.direct2d.fixture", url: "./fixtures/fensalir-client-surface.json" }],
|
||||
},
|
||||
{
|
||||
providerId: "sai.visual_novel",
|
||||
aliases: ["gamecult.home.vn", "sai-vn"],
|
||||
title: "Sai VN Surface",
|
||||
kind: "content.runtime",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-json", surfaceId: "sai.visual_novel.surface", url: "./fixtures/sai-vn-surface.json" }],
|
||||
},
|
||||
{
|
||||
providerId: "cultcache.huginn.inspector",
|
||||
title: "Huginn .cc",
|
||||
kind: "inspection.huginn",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-eve-dsl", surfaceId: "cultcache.huginn.inspector", url: "./fixtures/huginn-cc-surface.eve" }],
|
||||
},
|
||||
{
|
||||
providerId: "eve.reactive.dsl",
|
||||
title: "Reactive DSL",
|
||||
kind: "surface.fixture",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-eve-dsl", surfaceId: "eve.reactive.dsl", url: "./fixtures/reactive-composition.eve" }],
|
||||
},
|
||||
{
|
||||
providerId: "gamecult.eve.authority-witness",
|
||||
title: "Authority Witness",
|
||||
kind: "surface.fixture",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-json", surfaceId: "gamecult.eve.authority-witness", url: "./fixtures/authority-staleness-witness.json" }],
|
||||
},
|
||||
{
|
||||
providerId: "eve.cultui.inspector",
|
||||
title: "CultUI Inspector",
|
||||
kind: "surface.fixture",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-eve-dsl", surfaceId: "eve.cultui.inspector", url: "./fixtures/cultui-slider-inspector.eve" }],
|
||||
},
|
||||
{
|
||||
providerId: "gamecult.eve.embedded-demo",
|
||||
title: "Embedded Surface Slot",
|
||||
kind: "surface.fixture",
|
||||
freshness: { state: "fixture" },
|
||||
surfaces: [{ transport: "local-json", surfaceId: "gamecult.eve.embedded-demo", url: "./fixtures/cultui-embedded-surface.json" }],
|
||||
},
|
||||
];
|
||||
|
||||
providerSelect.addEventListener("change", () => {
|
||||
const provider = providers.find(candidate => candidate.providerId === providerSelect.value);
|
||||
if (provider) void openProvider(provider);
|
||||
|
|
@ -96,7 +29,7 @@ async function bootProviders() {
|
|||
if (providers.length) {
|
||||
liveHermodr = true;
|
||||
} else {
|
||||
providers = await Promise.all(localProviders.map(loadProviderAdvertisement));
|
||||
providers = await Promise.all((await loadLocalProviderCatalog()).map(loadProviderAdvertisement));
|
||||
}
|
||||
providerSelect.replaceChildren(...providers.map(provider => {
|
||||
const option = document.createElement("option");
|
||||
|
|
@ -115,6 +48,12 @@ async function bootProviders() {
|
|||
await openProvider(firstProduct);
|
||||
}
|
||||
|
||||
async function loadLocalProviderCatalog() {
|
||||
const response = await fetch("./local-provider-catalog.json", { cache: "no-store" });
|
||||
const catalog = await response.json();
|
||||
return catalog.providers || [];
|
||||
}
|
||||
|
||||
async function loadHermodrProviders() {
|
||||
try {
|
||||
const response = await fetch("/hermodr/verse/catalog", { cache: "no-store" });
|
||||
|
|
|
|||
Loading…
Reference in a new issue