mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
Recognize asserted personal credential delivery success
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
50cba8e277
commit
8992d4775c
2 files changed
+18
-3
No files matched your search
@@ -300,3 +300,19 @@ it("accepts a saved-value confirmation without a fabricated initial reply and re
|
||||
o.state.workerReceiptEvidence.events = [];
|
||||
expect(gradePersonalSecret(o).passed).toBe(false);
|
||||
});
|
||||
|
||||
it.each(["Your personal value worked.", "Your personal publishing key works.", "The personal token worked."])("accepts an asserted personal credential outcome: %s", reply => {
|
||||
expect(personalSecretConfirmation(reply)).toBe(true);
|
||||
});
|
||||
it.each(["The unrelated task worked.", "Riley's personal key worked.", "The other person's personal value worked.", "Your personal value did not work.", "If your personal key works, we can continue.", "Your personal value will work after saving.", "Your personal value is saved.", "I created a task for your personal value."])("does not invent a successful personal delivery from %s", reply => {
|
||||
if(reply === "Your personal value is saved.") {
|
||||
const o=valid();o.phaseReplies.at(-1)!.body=reply;o.state.authorizedChecks=0;
|
||||
expect(gradePersonalSecret(o).passed).toBe(false);
|
||||
} else expect(personalSecretConfirmation(reply)).toBe(false);
|
||||
});
|
||||
it("keeps successful worked wording dependent on actual worker delivery",()=>{
|
||||
const o=valid();o.phaseReplies.at(-1)!.body="Your personal value worked.";
|
||||
expect(gradePersonalSecret(o).passed).toBe(true);
|
||||
o.state.workerReceiptBound=false;
|
||||
expect(gradePersonalSecret(o).passed).toBe(false);
|
||||
});
|
||||
@@ -163,9 +163,8 @@ export function personalSecretConfirmation(reply: string) {
|
||||
.some(
|
||||
(clause) =>
|
||||
/personal|publishing/i.test(clause) &&
|
||||
/configured|available|saved|ready|set up|succeeded|success|checked|200/i.test(
|
||||
clause,
|
||||
) &&
|
||||
(/configured|available|saved|ready|set up|succeeded|success|checked|200/i.test(clause)
|
||||
|| /^\s*(?:your|the)\s+personal\s+(?:publishing\s+)?(?:value|key|token|credential)\s+(?:worked|works)\b/i.test(clause)) &&
|
||||
!/\b(?:not|cannot|can't|unavailable|missing|before|once|after|until|will|would|pending)\b/i.test(
|
||||
clause,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user