feat: make product features a declared selection with a runtime kill switch
Which features a build contains was not a decision anybody could express. The reference feature was spread directly into the route, API, schema, codec and adapter registries, so shipping without it meant editing five files by hand and hoping nothing still referred to it — and there was no way at all to take it out of service on a running deployment. The removability gate proved the editing worked; nothing made it a choice. There is now one manifest. `VITE_PRODUCT_FEATURES` narrows it at build time and `FEATURE_OVERRIDES` in the runtime document takes an installed feature out of service without a rebuild. Every registry composes from the manifest, and a test fails if a new one forgets to. Both inputs are subtractive, and the vocabulary is what enforces it rather than a check somewhere downstream: the override enum has no `ENABLED`, and a build-time selection naming something the source tree does not declare is refused instead of ignored. A configuration document that could name a feature into existence would be a configuration document choosing which code runs. Disabling is not just hiding. Withdrawing a route from navigation would leave a typed deep link that still mounts the feature, so the router refuses it too and answers with a surface that says the deployment switched it off. The platform overview now distinguishes the three states an operator actually needs: serving, switched off, and not in this build. What this is not: an env var does not shrink the bundle. A static import cannot be undone by a value, and making the import graph itself depend on a configuration string is the thing §3.5 exists to prevent — measured, `none` changes the output by 58 bytes. Physical removal remains FE-GATE-020's job, and the code comments say so rather than implying otherwise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0a97d235e4
commit
711d61e73f
@@ -226,6 +226,30 @@ function capabilityBadge(
|
||||
return { text: `활성 (${status.active})`, variant: "success" };
|
||||
}
|
||||
|
||||
/**
|
||||
* §3.5. The three states an operator has to be able to tell apart: shipped and
|
||||
* serving, shipped and switched off, and not in this build at all.
|
||||
*/
|
||||
const FEATURE_BADGE = Object.freeze({
|
||||
ACTIVE: Object.freeze({
|
||||
variant: "success" as const,
|
||||
text: "사용 중",
|
||||
description: "이 빌드에 설치되어 있고 런타임 설정이 끄지 않았습니다.",
|
||||
}),
|
||||
DISABLED_BY_CONFIG: Object.freeze({
|
||||
variant: "warning" as const,
|
||||
text: "설정으로 중지",
|
||||
description:
|
||||
"이 빌드에 포함되어 있으나 런타임 설정이 껐습니다. 재빌드 없이 다시 켤 수 있습니다.",
|
||||
}),
|
||||
NOT_INSTALLED: Object.freeze({
|
||||
variant: "neutral" as const,
|
||||
text: "미설치",
|
||||
description:
|
||||
"빌드 시 제품 매니페스트가 선택하지 않았습니다. 런타임 설정으로는 켤 수 없습니다.",
|
||||
}),
|
||||
});
|
||||
|
||||
function buildOperationRows(): readonly OperationRow[] {
|
||||
return Object.freeze(
|
||||
[...COMPOSED_CONTRACT_CONTRIBUTIONS.httpByOperationId.values()].map(
|
||||
@@ -273,6 +297,7 @@ export default function PlatformOverviewPage() {
|
||||
const routes = Object.values(ROUTE_REGISTRY);
|
||||
const operations = buildOperationRows();
|
||||
const capabilities = runtime.getCapabilitySnapshot();
|
||||
const features = runtime.getFeatureSnapshot();
|
||||
const activeCapabilityCount = capabilities.filter(
|
||||
(status) => status.active > 0,
|
||||
).length;
|
||||
@@ -479,6 +504,37 @@ export default function PlatformOverviewPage() {
|
||||
})}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section
|
||||
className="gallery-section"
|
||||
aria-labelledby="platform-features-title"
|
||||
>
|
||||
<header className="gallery-section__header">
|
||||
<h2 id="platform-features-title">제품 기능</h2>
|
||||
<p>
|
||||
제품 매니페스트가 이 빌드에 어떤 기능이 설치되었는지 정하고, 런타임
|
||||
설정은 설치된 기능을 끌 수만 있습니다. 두 입력 모두 감산만 하므로
|
||||
설정 문서가 없는 기능을 켜 낼 수는 없습니다. 그래서 「빌드에서 빠진
|
||||
기능」과 「운영자가 끈 기능」이 여기서 구분됩니다.
|
||||
</p>
|
||||
</header>
|
||||
<div className="component-grid component-grid--two">
|
||||
{features.map((status) => {
|
||||
const badge = FEATURE_BADGE[status.state];
|
||||
return (
|
||||
<Card
|
||||
key={status.featureId}
|
||||
title={status.featureId}
|
||||
footer={<Badge variant={badge.variant}>{badge.text}</Badge>}
|
||||
>
|
||||
<p data-product-feature={status.featureId}>
|
||||
{badge.description}
|
||||
</p>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user