Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/loopover-engine/src/objective-anchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ 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")) {
// "ci" is classified ONLY by a real CI path segment (CI_SEGMENTS), matching the path-segment discipline every
// other kind here uses. The old bare `.yml`/`.yaml` extension fallback tagged any YAML file anywhere (root
// `.loopover.yml`, `docs/mkdocs.yml`) as "ci", diluting the signal scoreObjectiveAnchor relies on (#8873).
if (segments.some((segment) => CI_SEGMENTS.has(segment))) {
kinds.push("ci");
}
if (CONFIG_FILENAMES.has(filename) || filename.endsWith(".jsonc") || filename.endsWith(".toml")) {
Expand Down
12 changes: 12 additions & 0 deletions test/unit/engine-objective-anchor-config-classification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ describe("loopover-engine objective-anchor config-filename classification", () =
});

expect(features.changeKinds).toContain("config");
// #8873: a config YAML at the repo root must NOT be tagged "ci" purely by its extension.
expect(features.changeKinds).not.toContain("ci");
expect(features.paths).toEqual([".loopover.yml"]);
});

it("does NOT tag a non-CI YAML file (docs/mkdocs.yml) as a 'ci' change kind (#8873)", () => {
const features = extractObjectiveAnchorFeatures({ paths: ["docs/mkdocs.yml"], labels: [], titles: [], notes: [] });
expect(features.changeKinds).not.toContain("ci");
});

it("still tags a YAML under a real CI path segment (.github/workflows/ci.yml) as 'ci' (#8873)", () => {
const features = extractObjectiveAnchorFeatures({ paths: [".github/workflows/ci.yml"], labels: [], titles: [], notes: [] });
expect(features.changeKinds).toContain("ci");
});
});