Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/signals/focus-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ export function deriveContributionLanes(manifest: FocusManifest): ContributionLa

const prEntryGuidance: string[] = [];
if (safeWanted.length > 0) {
prEntryGuidance.push(`Focus changes on maintainer-wanted areas: ${manifest.wantedPaths.slice(0, 5).join(", ")}.`);
prEntryGuidance.push(`Focus changes on maintainer-wanted areas: ${safeWanted.slice(0, 5).join(", ")}.`);
}
if (manifest.preferredLabels.length > 0) {
const safeLabels = manifest.preferredLabels.filter(isFocusManifestPublicSafe);
Expand Down
13 changes: 13 additions & 0 deletions test/unit/policy-sanitizer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,19 @@ describe("contribution lane output — public-safe via deriveContributionLanes",
expect(JSON.stringify(lanes)).not.toMatch(FORBIDDEN_POLICY_PATTERN);
});

it("still surfaces safe wanted paths in PR guidance when the manifest mixes in a public-unsafe path", () => {
// A single public-unsafe wantedPaths entry must not drop the whole "Focus changes on maintainer-wanted
// areas" line via the all-or-nothing public-safety filter: the interpolation is built from the filtered
// safe paths, so the safe path still surfaces and the unsafe one never appears.
const manifest = parseFocusManifest({ wantedPaths: ["src/", "reward-farming/"] });
const lanes = deriveContributionLanes(manifest);
const focusLine = lanes.prEntryGuidance.find((entry) => entry.startsWith("Focus changes on maintainer-wanted areas:"));
expect(focusLine).toBeDefined();
expect(focusLine).toContain("src/");
expect(focusLine).not.toContain("reward-farming/");
expect(JSON.stringify(lanes)).not.toMatch(FORBIDDEN_POLICY_PATTERN);
});

it("emits a warning when contribution scope is unclear", () => {
const manifest = parseFocusManifest({ wantedPaths: [], preferredLabels: [], issueDiscoveryPolicy: "encouraged" });
const lanes = deriveContributionLanes(manifest);
Expand Down