import { describe, expect, it } from "vitest"; import { ROUTE_REGISTRY, ROUTE_RUNTIME_CONTRACT, } from "../../src/features/installed-feature-contracts.ts"; import { ROUTE_RUNTIME } from "../../src/features/installed-feature-runtimes.tsx"; import { PLATFORM_ROUTE_REGISTRY } from "../../src/contracts/routes.ts"; import { TECH_LOG_ROUTE_REGISTRY } from "../../src/features/tech-log/contracts/tech-log-route-contract.ts"; import { parseRouteInput } from "../../src/presentation/routes/route-codecs.ts"; describe("typed installed route catalog", () => { it("keeps contract and executable runtime contributions complete", () => { expect(Object.keys(ROUTE_RUNTIME_CONTRACT).sort()).toEqual( Object.keys(ROUTE_REGISTRY).sort(), ); // Upstream the global runtime table holds only the platform's routes: // installed features load theirs through their bounded context. TechLog // is composed directly (src/features/tech-log/NOT_INSTALLED), so its // runtimes sit beside the platform's. expect(Object.keys(ROUTE_RUNTIME).sort()).toEqual( [ ...Object.keys(PLATFORM_ROUTE_REGISTRY), ...Object.keys(TECH_LOG_ROUTE_REGISTRY), ].sort(), ); }); it("accepts the platform not-found splat owner", () => { expect( parseRouteInput( "NOT_FOUND", { "*": "missing/path" }, new URLSearchParams(), ), ).toMatchObject({ success: true }); }); });