Commit db23a3c
authored
* feat(workflow): authorize keyword triggering instead of forcing it
Reframes keyword/effort triggering from 'force a workflow' to 'arm the tool and
let the model decide', addressing #88 (over-triggering), #89 (triggered runs
going idle instead of staying interactive), and cutting the always-on prompt
(part of #65).
- buildForcedWorkflowPrompt -> buildArmedWorkflowPrompt: the trigger now injects
an authorize directive ('typing the word is explicit opt-in; if it's a request
call workflow, if it's a question just answer -- the opt-in does not force a
workflow') instead of 'You MUST / the ONLY acceptable action / Do NOT answer'.
A lexical false-positive is no longer amplified into a forced wrong action.
- #89 falls out of de-forcing: the idle was a downstream effect of the model
being told to emit nothing but one bare background workflow call (which ends
the turn). Handled in a normal turn, Pi stays interactive and the model can
fold results inline. No change to the tool's background machinery.
- Always-on prompt shrunk ~91% (6500 -> ~600 bytes): the ~20 'For workflow,'
how-to lines moved off the always-on promptGuidelines into
workflowHowToGuidelines(), injected into the message only on an armed turn; the
always-on guideline is now a single gate line. Cuts self-priming and the
always-on token cost, and stops churning the prompt-prefix cache.
- byEffort path de-forced too, with an explicit conversational-turn escape.
- Kept: keywordTriggerEnabled default ON (under authorize semantics the worst
case is just an armed-turn directive), the #79 boundary regex, rainbow
highlight, Backspace-to-disarm. README updated (force -> arm).
914 tests; always-on prompt budget ratcheted 6500 -> 650.
* refactor(workflow): root-and-branch authorize fix (P1-P5)
- Move the how-to mechanics from the per-armed-turn message into the
workflow tool's static description, so the model has the manual on every
arming path AND on off-keyword natural-language opt-ins, cacheably, not as
per-turn priming (P2). Always-on promptGuidelines stays the single gate line.
- buildArmedWorkflowPrompt now leads with the decision boundary, states the
truthful opt-in reason per path (keyword vs standing-effort), and carries the
#89 background/deliver-back reassurance so an ending turn reads as expected,
not a stall (P1, P3).
- /workflows run uses a distinct forcing directive (no question-escape) while
avoiding the old MUST/ONLY language (P5).
- Gate line gains task-shape positives, balancing the strong negative (P4).
- Tests: trigger regression corpus (negatives/positives), gate-line R3, how-to
now in tool description, armed-directive content, /workflows run forcing;
honest prompt-budget ratchets (always-on ~766B, tool def grows to ~8.8KB as a
MOVE, armed message drops ~6.8KB -> ~0.9KB; how-to trimming is #65, separate).
* docs: note the off-keyword natural-language path needs the workflow tool default-active
The how-to now lives in the tool description, so a bare natural-language opt-in
('fan this out') sees the mechanics only if the host keeps the workflow tool in
its default active set. The arming paths add it on arm; document the dependency.
1 parent 63f4e50 commit db23a3c
11 files changed
Lines changed: 482 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
169 | 172 | | |
170 | 173 | | |
171 | | - | |
| 174 | + | |
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
388 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
391 | 450 | | |
392 | 451 | | |
393 | 452 | | |
394 | 453 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
400 | 478 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
407 | 485 | | |
408 | 486 | | |
409 | 487 | | |
| |||
603 | 681 | | |
604 | 682 | | |
605 | 683 | | |
606 | | - | |
| 684 | + | |
607 | 685 | | |
608 | | - | |
609 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
610 | 700 | | |
611 | 701 | | |
612 | 702 | | |
| |||
0 commit comments