fix(bootstrap): report FEATURE_OVERRIDES keys the build does not declare (09-09)
A misspelt kill-switch key was ignored without a trace, so the feature kept running. Boot now records feature.override.unknown once per such key, and release admission lists them as warnings in its record without refusing the artifact (a shared document may still name another build's features). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
69e40f106f
commit
b685b616e4
@@ -47,6 +47,7 @@ const diagnosticProducerFiles: Readonly<Record<string, string>> = {
|
||||
"ui.render.failed": "src/application/create-application.ts",
|
||||
"release.mismatch.detected": "src/application/create-application.ts",
|
||||
"telemetry.delivery.dropped": "src/bootstrap/runtime-adapters.ts",
|
||||
"feature.override.unknown": "src/bootstrap/runtime-adapters.ts",
|
||||
};
|
||||
|
||||
for (const key of DIAGNOSTIC_CONTEXT_ALLOWLIST) {
|
||||
|
||||
@@ -7,7 +7,9 @@ import {
|
||||
isDeploymentTarget,
|
||||
type AdmissionInput,
|
||||
} from "../src/contracts/deployment-admission.ts";
|
||||
import { unknownProductFeatureOverrides } from "../src/contracts/product-features.ts";
|
||||
import { parseRuntimeConfigArtifact } from "../src/contracts/release-artifacts.ts";
|
||||
import { COMPILED_PRODUCT_FEATURE_IDS } from "../src/features/installed-product-manifest.ts";
|
||||
|
||||
/**
|
||||
* §6.4 / FE-GATE-027. Refuses to admit an artifact to an environment it was not
|
||||
@@ -79,6 +81,18 @@ async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
const violations = findAdmissionViolations(declared, config);
|
||||
// 09-09. Inert by design (a shared document may name another build's
|
||||
// features), so this warns instead of refusing.
|
||||
const warnings = unknownProductFeatureOverrides(
|
||||
COMPILED_PRODUCT_FEATURE_IDS,
|
||||
"FEATURE_OVERRIDES" in config ? config.FEATURE_OVERRIDES : undefined,
|
||||
).map((featureId) => ({
|
||||
field: `FEATURE_OVERRIDES.${featureId}`,
|
||||
reason: `names no feature this build declares (${COMPILED_PRODUCT_FEATURE_IDS.join(", ") || "none"}); the override does nothing`,
|
||||
}));
|
||||
for (const warning of warnings) {
|
||||
process.stderr.write(`release admission warning: ${warning.field} ${warning.reason}\n`);
|
||||
}
|
||||
await mkdir("artifacts/release", { recursive: true });
|
||||
await writeFile(
|
||||
RECORD_PATH,
|
||||
@@ -93,6 +107,7 @@ async function main(): Promise<void> {
|
||||
releaseId: config.RELEASE_ID ?? null,
|
||||
status: violations.length === 0 ? "ADMITTED" : "REFUSED",
|
||||
violations,
|
||||
warnings,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
|
||||
@@ -688,6 +688,11 @@ export const deploymentAdmissionArtifactSchema = z
|
||||
violations: z.array(
|
||||
z.object({ field: nonEmptyString, reason: nonEmptyString }).strict(),
|
||||
),
|
||||
// 09-09. Findings that do not refuse the artifact, e.g. an override key
|
||||
// naming a feature this build does not declare.
|
||||
warnings: z.array(
|
||||
z.object({ field: nonEmptyString, reason: nonEmptyString }).strict(),
|
||||
),
|
||||
})
|
||||
.strict();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user