mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
test(evals): bind global assignment negation to its verb
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
39203fd131
commit
04da1afa34
2 files changed
+14
-1
No files matched your search
@@ -159,3 +159,16 @@ it("rejects global policy changes even without any final agent assignment", () =
|
||||
const activity = [...o.activity, { id: "policy", action: "company.skill_policy_reset", entityId: "company", agentId: "ceo" }];
|
||||
expect(gradeIntegratorSkills({ ...o, activity }).passed).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
it("rejects a correlative not-only claim of global enablement", () => {
|
||||
const o = valid("skills.author-skill");
|
||||
o.reply = "Not only created it but enabled it for all agents.";
|
||||
expect(gradeIntegratorSkills(o).passed).toBe(false);
|
||||
});
|
||||
it("preserves a negation that directly governs the assignment verb", () => {
|
||||
for (const denial of ["I have not enabled it for all agents.", "Did not enable it for all agents."]) {
|
||||
const o = authoredSelfUse(); o.reply += " " + denial;
|
||||
expect(gradeIntegratorSkills(o).passed).toBe(true);
|
||||
}
|
||||
});
|
||||
@@ -104,7 +104,7 @@ function authorSkillAssignmentScoped(o: SkillsObservation, skill: CompanySkillDe
|
||||
}
|
||||
function claimsGlobalSkillAssignment(reply: string): boolean {
|
||||
const claims = /\b(?:enabled|assigned|activated|attached)\s+(?:it|the skill|this skill)?\s*(?:(?:for|to)\s+)?(?:all|every|everyone)\b/gi;
|
||||
return [...reply.matchAll(claims)].some(match => !/\b(?:not|never|didn't|haven't|hasn't)\b[^,;.!?]{0,35}$/i.test(reply.slice(0, match.index)));
|
||||
return [...reply.matchAll(claims)].some(match => !/\b(?:not|never|didn't|haven't|hasn't)\s+(?:(?:been|ever|yet|automatically)\s+){0,2}$/i.test(reply.slice(0, match.index)));
|
||||
}
|
||||
export function gradeIntegratorSkills(value: unknown) {
|
||||
const c = checks(); const o = skillsObservation(value);
|
||||
|
||||
Reference in new issue
Block a user