From 67256e19328a5b53d262323e0d7a3d22453486ef Mon Sep 17 00:00:00 2001 From: philluiz2323 Date: Sun, 26 Jul 2026 06:30:57 -0700 Subject: [PATCH] fix(engine): stop classifying non-CI YAML paths as ci changes kindsFromPath tagged every .yml/.yaml file as ci via a bare-extension fallback, diluting the ci change-kind signal for configs like .loopover.yml. Classify ci only via CI_SEGMENTS path matches. Closes #8873 --- packages/loopover-engine/src/objective-anchor.ts | 2 +- .../loopover-engine/test/objective-anchor.test.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/loopover-engine/src/objective-anchor.ts b/packages/loopover-engine/src/objective-anchor.ts index ce59c55f03..b8dce0936e 100644 --- a/packages/loopover-engine/src/objective-anchor.ts +++ b/packages/loopover-engine/src/objective-anchor.ts @@ -228,7 +228,7 @@ function kindsFromPath(path: string): ObjectiveAnchorChangeKind[] { if (DOC_EXTENSIONS.has(extensionOf(path)) || segments.includes("docs") || filename.toLowerCase() === "readme.md") { kinds.push("docs"); } - if (segments.some((segment) => CI_SEGMENTS.has(segment)) || filename.endsWith(".yml") || filename.endsWith(".yaml")) { + if (segments.some((segment) => CI_SEGMENTS.has(segment))) { kinds.push("ci"); } if (CONFIG_FILENAMES.has(filename) || filename.endsWith(".jsonc") || filename.endsWith(".toml")) { diff --git a/packages/loopover-engine/test/objective-anchor.test.ts b/packages/loopover-engine/test/objective-anchor.test.ts index 5f0d84d57c..4e1bdbc0bf 100644 --- a/packages/loopover-engine/test/objective-anchor.test.ts +++ b/packages/loopover-engine/test/objective-anchor.test.ts @@ -383,3 +383,18 @@ test("renderObjectiveAnchorAuditMarkdown escapes markdown controls and collapses assert.ok(markdown.includes("- src/review/\\[unsafe\\].ts")); assert.ok(markdown.includes("- src/review/\\.ts")); }); + +test("extractObjectiveAnchorFeatures does not classify non-CI YAML as ci (#8873)", () => { + const features = extractObjectiveAnchorFeatures({ + paths: [".loopover.yml", "docs/mkdocs.yml", "config/app.yaml"], + }); + + assert.equal(features.changeKinds.includes("ci"), false); + assert.ok(features.changeKinds.includes("config")); + assert.ok(features.changeKinds.includes("docs")); + + const ciWorkflow = extractObjectiveAnchorFeatures({ + paths: [".github/workflows/ci.yml"], + }); + assert.ok(ciWorkflow.changeKinds.includes("ci")); +});