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>
69 lines
2.2 KiB
TypeScript
69 lines
2.2 KiB
TypeScript
import {
|
|
activeProductFeatureIds,
|
|
resolveProductFeatures,
|
|
type ProductFeatureState,
|
|
} from "../../src/contracts/product-features.ts";
|
|
import type { ProductFeaturesPort } from "../../src/application/ports/product-features-port.ts";
|
|
import {
|
|
COMPILED_PRODUCT_FEATURE_IDS,
|
|
INSTALLED_PRODUCT_FEATURE_IDS,
|
|
} from "../../src/features/installed-product-manifest.ts";
|
|
import type {
|
|
RuntimeCapabilityId,
|
|
RuntimeCapabilityStatus,
|
|
} from "../../src/contracts/runtime-capabilities.ts";
|
|
import type { RuntimeCapabilitiesPort } from "../../src/application/ports/runtime-capabilities-port.ts";
|
|
|
|
const CAPABILITY_IDS = Object.freeze([
|
|
"REALTIME",
|
|
"WEB_WORKER",
|
|
"SERVICE_WORKER",
|
|
"OFFLINE_COMMANDS",
|
|
] as const);
|
|
|
|
/**
|
|
* A capability port whose snapshot is fixed by the test rather than by the
|
|
* repository's installed selection, so a suite asserting presentation behaviour
|
|
* does not change meaning when a capability is later installed.
|
|
*/
|
|
export function createRuntimeCapabilitiesStub(
|
|
overrides: Readonly<Partial<Record<RuntimeCapabilityId, Partial<RuntimeCapabilityStatus>>>> = {},
|
|
): RuntimeCapabilitiesPort {
|
|
const snapshot = Object.freeze(
|
|
CAPABILITY_IDS.map((capabilityId) =>
|
|
Object.freeze({
|
|
capabilityId,
|
|
selected: 0,
|
|
active: 0,
|
|
override: "DEFAULT" as const,
|
|
...overrides[capabilityId],
|
|
}),
|
|
),
|
|
);
|
|
return Object.freeze({ getSnapshot: () => snapshot });
|
|
}
|
|
|
|
/**
|
|
* A product-feature port that reports the real manifest with nothing disabled.
|
|
* Tests that care about the switch build their own; the rest only need the
|
|
* boundary to be complete.
|
|
*/
|
|
export function createProductFeaturesStub(
|
|
overrides: Readonly<Record<string, ProductFeatureState>> = {},
|
|
): ProductFeaturesPort {
|
|
const snapshot = resolveProductFeatures(
|
|
COMPILED_PRODUCT_FEATURE_IDS,
|
|
INSTALLED_PRODUCT_FEATURE_IDS,
|
|
Object.fromEntries(
|
|
Object.entries(overrides)
|
|
.filter(([, state]) => state === "DISABLED_BY_CONFIG")
|
|
.map(([featureId]) => [featureId, "DISABLED" as const]),
|
|
),
|
|
);
|
|
const active = new Set(activeProductFeatureIds(snapshot));
|
|
return Object.freeze({
|
|
getSnapshot: () => snapshot,
|
|
isActive: (featureId: string) => active.has(featureId),
|
|
});
|
|
}
|