Skip to content

Commit 9381e67

Browse files
committed
Remove disabmiguation clause check
1 parent 44ea1a0 commit 9381e67

2 files changed

Lines changed: 0 additions & 65 deletions

File tree

scripts/src/frontmatter/__tests__/frontmatter.test.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {
1919
extractTriggerPhrases,
2020
hasDoNotUseForClause,
2121
hasPreferOverClause,
22-
isDisambiguationClauseRemoved,
23-
buildDisambiguationRemovalIssues,
2422
validateTriggerOverlapDisambiguation,
2523
validateSkillFile,
2624
} from "../cli.js";
@@ -583,39 +581,6 @@ describe("Frontmatter Spec Validator", () => {
583581

584582
expect(issues).toEqual([]);
585583
});
586-
587-
it("detects disambiguation clause removal", () => {
588-
expect(
589-
isDisambiguationClauseRemoved(
590-
"PREFER OVER azure-prepare when copilot sdk markers exist.",
591-
"WHEN: deploy to Azure, copilot sdk",
592-
),
593-
).toBe(true);
594-
595-
expect(
596-
isDisambiguationClauseRemoved(
597-
"DO NOT USE FOR: generic web apps",
598-
"DO NOT USE FOR: generic web apps",
599-
),
600-
).toBe(false);
601-
});
602-
603-
it("emits error issue when disambiguation clause is removed", () => {
604-
const issues = buildDisambiguationRemovalIssues(
605-
"DO NOT USE FOR: generic web apps",
606-
"WHEN: deploy to Azure",
607-
);
608-
expect(issues).toHaveLength(1);
609-
expect(issues[0].check).toBe("disambiguation-removal");
610-
expect(issues[0].severity).toBe("error");
611-
expect(issues[0].message).toContain("DO NOT USE FOR");
612-
expect(issues[0].message).toContain("Re-add");
613-
});
614-
615-
it("emits no warning issue when previous description is unavailable", () => {
616-
const issues = buildDisambiguationRemovalIssues(null, "WHEN: deploy to Azure");
617-
expect(issues).toEqual([]);
618-
});
619584
});
620585

621586
// ── validateSkillFile (integration) ──────────────────────────────────────

scripts/src/frontmatter/cli.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -542,19 +542,6 @@ export function validateTriggerOverlapDisambiguation(
542542
return issues;
543543
}
544544

545-
function validateDisambiguationRemoval(skill: SkillRoutingContext, mergeBaseRef: string | null): ValidationIssue[] {
546-
if (mergeBaseRef === null) return [];
547-
548-
const previousDescription = getDescriptionFromGitRef(skill.file, mergeBaseRef);
549-
return buildDisambiguationRemovalIssues(previousDescription, skill.description);
550-
}
551-
552-
export function isDisambiguationClauseRemoved(previousDescription: string | null, currentDescription: string | null): boolean {
553-
const previousHasDisambiguation = hasDoNotUseForClause(previousDescription) || hasAnyPreferOverClause(previousDescription);
554-
const currentHasDisambiguation = hasDoNotUseForClause(currentDescription) || hasAnyPreferOverClause(currentDescription);
555-
return previousHasDisambiguation && !currentHasDisambiguation;
556-
}
557-
558545
function getRemovedDisambiguationClauses(previousDescription: string | null, currentDescription: string | null): string[] {
559546
const removed: string[] = [];
560547
if (hasDoNotUseForClause(previousDescription) && !hasDoNotUseForClause(currentDescription)) {
@@ -566,22 +553,6 @@ function getRemovedDisambiguationClauses(previousDescription: string | null, cur
566553
return removed;
567554
}
568555

569-
export function buildDisambiguationRemovalIssues(
570-
previousDescription: string | null,
571-
currentDescription: string | null,
572-
): ValidationIssue[] {
573-
if (previousDescription === null) return [];
574-
if (!isDisambiguationClauseRemoved(previousDescription, currentDescription)) return [];
575-
const removedClauses = getRemovedDisambiguationClauses(previousDescription, currentDescription);
576-
const clauseLabel = removedClauses.length === 1 ? removedClauses[0] : removedClauses.join(" and ");
577-
const clauseWord = removedClauses.length === 1 ? "clause" : "clauses";
578-
return [{
579-
check: "disambiguation-removal",
580-
severity: "error",
581-
message: `Removed disambiguation ${clauseWord}: ${clauseLabel}. Re-add a DO NOT USE FOR or PREFER OVER clause if trigger overlap still exists.`,
582-
}];
583-
}
584-
585556
// ── Validate a single SKILL.md ──────────────────────────────────────────────
586557

587558
export function validateSkillFile(filePath: string): ValidationResult {
@@ -797,7 +768,6 @@ function main(): void {
797768
const routingContext = routingContextByName.get(result.skill);
798769
if (routingContext) {
799770
result.issues.push(...validateTriggerOverlapDisambiguation(routingContext, routingContexts));
800-
result.issues.push(...validateDisambiguationRemoval(routingContext, mergeBaseRef));
801771
}
802772
results.push(result);
803773
}

0 commit comments

Comments
 (0)