fix(pi-workflow): ignore config files in UI path detection
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user