fix(pi-workflow): ignore config files in UI path detection

This commit is contained in:
jb
2026-08-26 22:25:43 -04:00
parent 51eace1fa8
commit 343703611c
2 changed files with 36 additions and 1 deletions
+19 -1
View File
@@ -41,6 +41,18 @@ const NON_TRIVIAL_PATH_PARTS = [
"/settings/",
];
const UI_SOURCE_SUFFIXES = [
".astro",
".css",
".html",
".jsx",
".less",
".scss",
".svelte",
".tsx",
".vue",
];
export interface UiImpactPolicyInput {
plannerImpact: UiImpact;
plannerEvidence: string[];
@@ -64,7 +76,13 @@ function objectiveEvidence(facts: WorkflowFacts) {
}
for (const candidatePath of facts.candidatePaths) {
const normalized = `/${candidatePath.toLowerCase().replaceAll("\\", "/")}`;
if (NON_TRIVIAL_PATH_PARTS.some((part) => normalized.includes(part))) {
const isUiSource = UI_SOURCE_SUFFIXES.some((suffix) =>
normalized.endsWith(suffix),
);
if (
isUiSource &&
NON_TRIVIAL_PATH_PARTS.some((part) => normalized.includes(part))
) {
evidence.push(`Affected path has non-trivial UI responsibility: ${candidatePath}`);
}
}