jsfe 1.69.0 → 1.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -373,7 +373,7 @@ deterministic reader cannot read, jsfe asks what the reply does with the step's
373
373
  `answers`, `abort`, `new_request` or `irrelevant`. ONE aiCallback call whose 4th argument is `task: 'rank_reply'` with both
374
374
  executors' instructions (`llm`, `systemOne`); the host replies `{ "option": … }`, plus `"fallback": true` when the
375
375
  option is `answers` only because nothing cleared the cut (System One). `jsfe/host` exports
376
- `buildReplyRank`, `decodeReplyRankLlm` and `decodeReplyRankSystemOne` (the highest option at or above its cut: 0.5, or `choice:no` 0.65, `new_request` 0.6, `irrelevant` 0.7; a cleared choice outranks `answers` and `new_request`, and `irrelevant` from 0.8; else `answers`). `answers` continues the flow, after extracting the step's `responseParameters` with a stage-2 request
376
+ `buildReplyRank`, `decodeReplyRankLlm` and `decodeReplyRankSystemOne` (the highest option at or above its cut: 0.5, or `choice:no` 0.65, `new_request` 0.6, `irrelevant` 0.7; a cleared choice outranks `answers` and `new_request`, and `irrelevant` rated above it outranks the choice; else `answers`). `answers` continues the flow, after extracting the step's `responseParameters` with a stage-2 request
377
377
  when it declares them. A confident `answers` (no `fallback`) is never lost: when the declaration is one parameter marked
378
378
  `verbatim: true` (an open string whose words are the value, such as a reason) and extraction finds nothing or fails,
379
379
  the field is the reply as said. Unmarked fields (a product, a city) always need a real extraction. After a
@@ -385,7 +385,7 @@ in the chain declaring `user_description` / `user_description_es`, written with
385
385
  a reason question; cut 0.6, and the top score wins over a cleared choice): the caller expresses doubt that the current process is what they need.
386
386
  The reader says the description, how to cancel ("To cancel, press the asterisk key or say EXIT." / "To cancel, type EXIT."; Spanish
387
387
  SALIR) and the question again; no attempt is counted;
388
- `irrelevant` (a stray word, an unfinished sentence, speech to someone else; cut 0.7, and 0.8 to outrank a cleared choice) extracts nothing and asks again: no flow moves. `new_request` ends the flows and routes the input through intent detection. Only a new request is routed: after
388
+ `irrelevant` (a stray word, an unfinished sentence, speech to someone else; cut 0.7; rated above a cleared choice, it outranks it) extracts nothing and asks again: no flow moves. `new_request` ends the flows and routes the input through intent detection. Only a new request is routed: after
389
389
  `answers` a later ordinary DISPATCH in the same turn hands the host the turn without detection. A host that does not know the task answers the `llm`
390
390
  instructions with its text model.
391
391
 
@@ -44,11 +44,6 @@ export declare const REPLY_YES_THRESHOLD = 0.5;
44
44
  * from labelled prod replies (owner 2026-10-28), never guessed.
45
45
  */
46
46
  export declare const REPLY_CUTS: Partial<Record<ReplyOption, number>>;
47
- /**
48
- * `irrelevant` outranks a cleared choice only from here: a false pick can transfer the call. Measured 2026-11-01: "You." and
49
- * "And, Leslie." at a pay menu rated 0.86 and were taken as a request for a person; "Operator." 0.78 is that request.
50
- */
51
- export declare const REPLY_IRRELEVANT_OVER_CHOICE = 0.8;
52
47
  /**
53
48
  * The cut another declared choice must clear to be reported beside the pick (`also`): a reply may ask for two of a menu's
54
49
  * facts ("my due date and the amount"). Measured 2026-11-02 on 136 prod replies at the account menu: 0.6 kept those and
@@ -1 +1 @@
1
- {"version":3,"file":"reply-rank.d.ts","sourceRoot":"","sources":["../../src/host/reply-rank.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,aAAa,4DAA6D,CAAC;AACxF,kEAAkE;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,UAAU,MAAM,EAAE,CAAC;AACxF,wHAAwH;AACxH,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AACjD,0FAA0F;AAG1F,MAAM,WAAW,oBAAoB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;AACzF,MAAM,WAAW,WAAW;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CA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AC,CAAC,CAAA;CAAO,GAC/H;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CA6B7F;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAGhF"}
@@ -42,11 +42,6 @@ export const REPLY_CUTS = {
42
42
  // decides by score, also over a cleared choice); the live purpose test (prod CA6a93680b…) is its first measurement.
43
43
  concern: 0.6,
44
44
  };
45
- /**
46
- * `irrelevant` outranks a cleared choice only from here: a false pick can transfer the call. Measured 2026-11-01: "You." and
47
- * "And, Leslie." at a pay menu rated 0.86 and were taken as a request for a person; "Operator." 0.78 is that request.
48
- */
49
- export const REPLY_IRRELEVANT_OVER_CHOICE = 0.8;
50
45
  /**
51
46
  * The cut another declared choice must clear to be reported beside the pick (`also`): a reply may ask for two of a menu's
52
47
  * facts ("my due date and the amount"). Measured 2026-11-02 on 136 prod replies at the account menu: 0.6 kept those and
@@ -214,8 +209,10 @@ export function decodeReplyRankSystemOne(answers, request, { threshold = REPLY_Y
214
209
  const firstChoice = cleared.find(o => o.startsWith(CHOICE_PREFIX));
215
210
  const named = firstChoice === `${CHOICE_PREFIX}no` ? cleared.find(o => o.startsWith(CHOICE_PREFIX) && ![`${CHOICE_PREFIX}no`, `${CHOICE_PREFIX}yes`].includes(o) && !o.startsWith(`${CHOICE_PREFIX}__`)) : undefined;
216
211
  const choice = named ?? firstChoice;
217
- // `irrelevant` takes a choice's place only from its own higher cut (REPLY_IRRELEVANT_OVER_CHOICE).
218
- const yieldsToChoice = (named !== undefined && cleared[0] === `${CHOICE_PREFIX}no`) || cleared[0] === 'answers' || cleared[0] === 'new_request' || (cleared[0] === 'irrelevant' && scores.irrelevant < REPLY_IRRELEVANT_OVER_CHOICE);
212
+ // `irrelevant` rated above every cleared choice wins (owner 2026-11-15): it asks the question again and moves nothing,
213
+ // so it is the safer verdict when a false pick could transfer the call. A reply a question's reader takes (an agent
214
+ // request such as "Operator.") never reaches the ranker.
215
+ const yieldsToChoice = (named !== undefined && cleared[0] === `${CHOICE_PREFIX}no`) || cleared[0] === 'answers' || cleared[0] === 'new_request';
219
216
  // A clear ask outranks noise (owner 2026-11-02, prod "¿Quién habla?" irrelevant .85, new_request .72): with both cleared the reply is a request.
220
217
  const best = choice && yieldsToChoice ? choice : cleared[0] === 'irrelevant' && !choice && cleared.includes('new_request') ? 'new_request' : cleared[0];
221
218
  if (best) {
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:6ab9a0b5ef4f98e1d9d4b2047fc1c53942be49d8563e7396fbafae9b9063a9af";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:06dffe8268f3b1dbff40b7725a2f81ea18001ee6715a9667a79fc12cd3c9462e";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.69.0",
3
+ "version": "1.70.0",
4
4
  "description": "TypeScript workflow engine for conversational/automation apps: multi-flow orchestration, interrupt/resume, stack-based control, robust errors, and flexible tool/REST integration.",
5
5
  "license": "MIT",
6
6
  "author": "Ron Pinkas",