chore: sync the frontend template from a0fbafb to 5434760
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>
This commit is contained in:
co-authored by
Claude Opus 5
parent
325a2a0843
commit
bdee07a93b
@@ -723,9 +723,13 @@ function findArchitectureViolations(
|
||||
continue;
|
||||
}
|
||||
for (const dependency of dependencies) {
|
||||
const sourceGroups = rule.from?.path
|
||||
? (new RegExp(rule.from.path, "u").exec(dependency.source)?.slice(1) ??
|
||||
[])
|
||||
: [];
|
||||
if (
|
||||
matchesPath(dependency.source, rule.from) &&
|
||||
matchesPath(dependency.target, rule.to)
|
||||
matchesPath(dependency.target, rule.to, sourceGroups)
|
||||
) {
|
||||
violations.push({
|
||||
rule: rule.name,
|
||||
@@ -746,16 +750,52 @@ function findArchitectureViolations(
|
||||
function matchesPath(
|
||||
modulePath: string,
|
||||
criterion: PathRule | undefined,
|
||||
sourceGroups: readonly string[] = [],
|
||||
): boolean {
|
||||
if (!criterion) return true;
|
||||
if (criterion.path && !new RegExp(criterion.path, "u").test(modulePath)) {
|
||||
if (
|
||||
criterion.path &&
|
||||
!new RegExp(expandSourceGroups(criterion.path, sourceGroups), "u").test(
|
||||
modulePath,
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return !(
|
||||
criterion.pathNot && new RegExp(criterion.pathNot, "u").test(modulePath)
|
||||
criterion.pathNot &&
|
||||
new RegExp(expandSourceGroups(criterion.pathNot, sourceGroups), "u").test(
|
||||
modulePath,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Substitutes `$1`..`$9` in a `to` pattern with the capture groups the `from`
|
||||
* pattern matched on the importing module.
|
||||
*
|
||||
* Without it, "an adapter may not import a *different* adapter" cannot be
|
||||
* written as one rule: the target pattern has to name the importer's own
|
||||
* directory to exempt it. The alternative is one rule per adapter group, which
|
||||
* silently stops covering a group the moment somebody adds one — exactly the
|
||||
* gap that let `diagnostics` import `telemetry` while the documented rule said
|
||||
* it could not.
|
||||
*/
|
||||
function expandSourceGroups(
|
||||
pattern: string,
|
||||
sourceGroups: readonly string[],
|
||||
): string {
|
||||
return pattern.replaceAll(/\$([1-9])/gu, (whole, index: string) => {
|
||||
const captured = sourceGroups[Number(index) - 1];
|
||||
// A `from` pattern that did not capture leaves the token literal rather
|
||||
// than quietly matching everything.
|
||||
return captured === undefined ? whole : escapeRegExp(captured);
|
||||
});
|
||||
}
|
||||
|
||||
function escapeRegExp(value: string): string {
|
||||
return value.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`);
|
||||
}
|
||||
|
||||
function validateArchitectureRules(rules: readonly ArchitectureRule[]): void {
|
||||
if (!rules.some((rule) => rule.to?.circular === true)) {
|
||||
throw new Error("Architecture configuration must contain a circular rule");
|
||||
|
||||
Reference in New Issue
Block a user