Carries eight template commits: the provider sandbox actually running, release
admission to a named environment, the product feature manifest with its runtime
kill switch, architecture and documentation rules that match what is enforced,
the removability fixtures, and the browser, visual and performance evidence.
Product identity is unchanged. `package.json` keeps `tech-log-frontend` and the
catalog keeps the Tech Log naming; the home page was not in the delta. The
visual baselines are this product's own — the template's were excluded from the
transplant and these were regenerated here, where the only difference is the
platform overview's new product-feature section.
What this repository gains operationally: `config/runtime/{local,development,
staging,production}.json` with `FE-GATE-027` refusing an artifact whose runtime
document does not match the environment it is being admitted to, and
`FEATURE_OVERRIDES` for taking an installed feature out of service without a
rebuild.
Verified here: eight gates green, build green, visual 5/5, and 1,858 of 1,859
tests in the suites that do not need a sandbox — the one failure passes in
isolation and is a jsdom lazy-chunk timeout under parallel load. The provider
suites cannot run on this machine at all: `kernel.apparmor_restrict_unprivileged
_userns=1` makes `bwrap --unshare-net` fail, reproducible without any code from
either repository.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
64 lines
2.5 KiB
TypeScript
64 lines
2.5 KiB
TypeScript
import {
|
|
selectCompiledProductFeatures,
|
|
type SelectableProductFeature,
|
|
} from "../contracts/product-features.ts";
|
|
import { REFERENCE_FEATURE_CONTRACT } from "./reference-feature/contracts/reference-feature-contract.ts";
|
|
|
|
/**
|
|
* §3.5. The product manifest: the single declaration of which features this
|
|
* build contains.
|
|
*
|
|
* Before this file the reference feature was spread directly into the route,
|
|
* API, schema and message registries, so the only way to ship without it was to
|
|
* edit five registries by hand and hope nothing still referred to it. The
|
|
* removability gate proved that editing worked; nothing made it a decision you
|
|
* could express.
|
|
*
|
|
* Adding an entry here is what installs a feature. `VITE_PRODUCT_FEATURES` may
|
|
* then narrow the list at build time — a comma-separated subset, `none` for an
|
|
* empty selection, absent meaning "all of them". A narrowed-out feature reaches
|
|
* no registry, so it is not routed, not navigable and not callable.
|
|
*
|
|
* It is not deleted. The import above is static, and a value cannot undo a
|
|
* static import; making the import itself conditional on configuration is the
|
|
* thing §3.5 exists to prevent. FE-GATE-020 is what proves the feature can be
|
|
* physically removed, by removing it and rebuilding the whole project.
|
|
*/
|
|
|
|
const COMPILED_PRODUCT_FEATURES = Object.freeze([
|
|
REFERENCE_FEATURE_CONTRACT,
|
|
] as const);
|
|
|
|
/**
|
|
* Every feature this source tree declares, selected or not. The platform
|
|
* overview reports on this set so an operator can tell a feature that was built
|
|
* out from one that never existed.
|
|
*/
|
|
export const COMPILED_PRODUCT_FEATURE_IDS: readonly string[] = Object.freeze(
|
|
COMPILED_PRODUCT_FEATURES.map((feature) => feature.featureId),
|
|
);
|
|
|
|
/**
|
|
* `import.meta.env` exists in a Vite build and not under Node, and this module
|
|
* is read by release scripts as well as by the app. A missing environment means
|
|
* "nothing was narrowed", which is the same answer a plain developer build
|
|
* gives.
|
|
*/
|
|
function declaredFeatureSelection(): string | undefined {
|
|
const environment = (
|
|
import.meta as unknown as {
|
|
env?: Readonly<Record<string, string | undefined>>;
|
|
}
|
|
).env;
|
|
return environment?.["VITE_PRODUCT_FEATURES"];
|
|
}
|
|
|
|
export const INSTALLED_PRODUCT_FEATURES = selectCompiledProductFeatures(
|
|
COMPILED_PRODUCT_FEATURES as readonly SelectableProductFeature[],
|
|
declaredFeatureSelection(),
|
|
) as readonly (typeof COMPILED_PRODUCT_FEATURES)[number][];
|
|
|
|
export const INSTALLED_PRODUCT_FEATURE_IDS: readonly string[] = Object.freeze(
|
|
INSTALLED_PRODUCT_FEATURES.map((feature) => feature.featureId),
|
|
);
|