Merge branch 'main' into feature/techlog-ui-migration
Integrates the frontend template sync (a0fbafb → 5434760) into the TechLog UI migration. Merged in this direction so every conflict is resolved and proved in the worktree; main is only fast-forwarded afterwards and never holds a state that was not verified here. 15 conflicts. The rule throughout: keep the template's mechanism, keep the product's content, and never invent a third state neither branch would accept. The template's product manifest and its runtime feature kill switch are adopted. The route registry is deliberately not composed from contract.routes: the reference feature still declares screens this product deleted, and reducing over them would register paths with no component behind them. ROUTE_FEATURE_OWNER is narrowed to registered routes for the same reason. The first resolution did compose from contract.routes and was rejected by product-features.test.ts. Three files pinned counts and a digest describing the gate contract. Neither side's numbers describe the merged config/ci/gates.json, so they were recomputed from it rather than chosen: 27 gates, 82 commands, 94 command references, 107 evidence references, 128 artifacts, shape sha256 5063586d. README.md and docs/accessibility/manual-checklist.md now enumerate this product's 27 routes, which the template's own verify:documentation requires. product-feature-switch.test.tsx was rewritten around the invariant that still applies here — no registered route without a component — rather than deleted with the screens it used to exercise. docs/operations/template-merge-2026-08-17.md records every decision, the gate results, and the three follow-ups this merge deliberately did not decide. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
import type { RouteRuntimeDefinition } from "../contracts/route-runtime-contract.ts";
|
||||
import type { RouteDefinition } from "../contracts/routes.ts";
|
||||
import {
|
||||
PLATFORM_ROUTE_RUNTIME_CONTRACT,
|
||||
type RouteRuntimeDefinition,
|
||||
} from "../contracts/route-runtime-contract.ts";
|
||||
import {
|
||||
PLATFORM_ROUTE_REGISTRY,
|
||||
type RouteDefinition,
|
||||
} from "../contracts/routes.ts";
|
||||
import {
|
||||
composeSchemaRegistry,
|
||||
PLATFORM_SCHEMA_REGISTRY,
|
||||
} from "../contracts/schema-registry.ts";
|
||||
import { REFERENCE_FEATURE_CONTRACT } from "./reference-feature/contracts/reference-feature-contract.ts";
|
||||
import {
|
||||
INSTALLED_PRODUCT_FEATURES,
|
||||
} from "./installed-product-manifest.ts";
|
||||
import {
|
||||
composeApiOperations,
|
||||
validateApiRuntimeBindings,
|
||||
@@ -18,14 +26,36 @@ import {
|
||||
TECH_LOG_ROUTE_SCHEMA_REGISTRY,
|
||||
} from "./tech-log/contracts/tech-log-route-contract.ts";
|
||||
|
||||
export const INSTALLED_FEATURE_CONTRACTS = Object.freeze([
|
||||
REFERENCE_FEATURE_CONTRACT,
|
||||
]);
|
||||
/**
|
||||
* §3.5. Composed from the product manifest rather than from a literal list, so
|
||||
* a feature the build did not select contributes no routes, no operations, no
|
||||
* schemas and no messages — and is therefore not reachable from any registry.
|
||||
*/
|
||||
export const INSTALLED_FEATURE_CONTRACTS = INSTALLED_PRODUCT_FEATURES;
|
||||
|
||||
/**
|
||||
* Template merge. Two intents meet here and both are kept.
|
||||
*
|
||||
* The template's manifest is retained above, so narrowing the selection still
|
||||
* withdraws a feature's operations, schemas, mappers and invalidation edges.
|
||||
*
|
||||
* The route registry is *not* composed from `contract.routes`, though. The
|
||||
* reference feature still declares `REFERENCE_RESOURCE_*` routes, but this
|
||||
* product deleted their screens during the UI migration, so reducing over those
|
||||
* routes would register paths with no component behind them — a deep link that
|
||||
* resolves to nothing. The registry therefore lists the platform routes (empty
|
||||
* on this branch) and TechLog's, which are the routes that actually exist.
|
||||
*
|
||||
* Re-adding the reference screens, or dropping the reference feature's route
|
||||
* declarations, is a product decision; a merge only has to avoid inventing a
|
||||
* third state where a route is registered and unmountable.
|
||||
*/
|
||||
export const ROUTE_REGISTRY = Object.freeze({
|
||||
...PLATFORM_ROUTE_REGISTRY,
|
||||
...TECH_LOG_ROUTE_REGISTRY,
|
||||
}) satisfies Readonly<Record<string, RouteDefinition>>;
|
||||
export const ROUTE_RUNTIME_CONTRACT = Object.freeze({
|
||||
...PLATFORM_ROUTE_RUNTIME_CONTRACT,
|
||||
...TECH_LOG_ROUTE_RUNTIME_CONTRACT,
|
||||
}) satisfies Readonly<Record<string, RouteRuntimeDefinition>>;
|
||||
export const API_OPERATIONS = composeApiOperations(
|
||||
@@ -73,6 +103,28 @@ export const API_RUNTIME_BINDINGS_VALID = validateApiRuntimeBindings(
|
||||
MAPPER_REGISTRY,
|
||||
);
|
||||
|
||||
/**
|
||||
* §3.5. Which feature owns each route.
|
||||
*
|
||||
* A route contributed by a feature disappears with it at build time, and has to
|
||||
* be withdrawn from navigation and from the router when the runtime document
|
||||
* disables that feature. Platform routes have no owner and are always present.
|
||||
*/
|
||||
export const ROUTE_FEATURE_OWNER: Readonly<Record<string, string>> =
|
||||
Object.freeze(
|
||||
Object.fromEntries(
|
||||
INSTALLED_FEATURE_CONTRACTS.flatMap((contract) =>
|
||||
Object.keys(contract.routes)
|
||||
// Template merge. Ownership describes routes this product actually
|
||||
// registered. The reference feature still declares screens this
|
||||
// product removed; attributing an unregistered route to a feature
|
||||
// would claim the kill switch governs something no router can mount.
|
||||
.filter((routeId) => routeId in ROUTE_REGISTRY)
|
||||
.map((routeId) => [routeId, contract.featureId] as const),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
export const NAVIGATION_ROUTES = Object.freeze(
|
||||
Object.values(ROUTE_REGISTRY)
|
||||
.filter(isNavigableRoute)
|
||||
|
||||
Reference in New Issue
Block a user