jev-recipes 0.8.0 → 0.8.2

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.
Files changed (34) hide show
  1. package/README.md +5 -3
  2. package/dist/catalog/evidence.d.ts +21 -0
  3. package/dist/catalog/evidence.js +1 -0
  4. package/dist/catalog/generated/details/paragraph-boundary.json +42 -0
  5. package/dist/catalog/generated/details/text-block-role.json +77 -0
  6. package/dist/catalog/generated/loaders.js +2 -0
  7. package/dist/catalog/generated/metadata.js +1207 -0
  8. package/dist/catalog/generated/names.d.ts +1 -1
  9. package/dist/catalog/generated/names.js +2 -0
  10. package/dist/catalog/index.d.ts +3 -0
  11. package/dist/catalog/schema.d.ts +2 -0
  12. package/dist/cli/schema.d.ts +6 -0
  13. package/dist/evaluation/archive.d.ts +8 -8
  14. package/dist/evaluation/decisions.js +1 -1
  15. package/dist/evaluation/schema.d.ts +6 -6
  16. package/dist/recipes/action-effects/index.js +5 -5
  17. package/dist/recipes/causal-attribution/schema.d.ts +3 -3
  18. package/dist/recipes/completion-gate/index.js +2 -2
  19. package/dist/recipes/context-prune/index.js +3 -3
  20. package/dist/recipes/motivation-source/schema.d.ts +3 -3
  21. package/dist/recipes/paragraph-boundary/demo.json +19 -0
  22. package/dist/recipes/paragraph-boundary/index.d.ts +5 -0
  23. package/dist/recipes/paragraph-boundary/index.js +15 -0
  24. package/dist/recipes/paragraph-boundary/schema.d.ts +39 -0
  25. package/dist/recipes/paragraph-boundary/schema.js +17 -0
  26. package/dist/recipes/response-refusal/schema.d.ts +3 -3
  27. package/dist/recipes/text-block-role/demo.json +29 -0
  28. package/dist/recipes/text-block-role/index.d.ts +5 -0
  29. package/dist/recipes/text-block-role/index.js +21 -0
  30. package/dist/recipes/text-block-role/schema.d.ts +56 -0
  31. package/dist/recipes/text-block-role/schema.js +26 -0
  32. package/dist/src/index.d.ts +4 -0
  33. package/dist/src/index.js +2 -0
  34. package/package.json +9 -1
@@ -1 +1 @@
1
- export declare const recipeNames: readonly ["action-compare", "action-effects", "action-reversibility", "action-scope", "age-appropriateness", "alert-actionability", "answer-consistency", "answer-coverage", "answer-disclosures", "answer-grade", "answer-invalidation", "answer-relevance", "answerability", "appeal-grounds-kind", "appointment-request-kind", "argument-fit", "attempted-step", "attribution-match", "audience-fit", "breaking-change-signal", "budget-fit", "budget-narrative-fit", "bug-report-completeness", "buying-intent", "cache-match", "callback-responsibility", "cancellation-check", "care-urgency-wording", "category-fit", "causal-attribution", "causal-language-strength", "certainty-match", "change-meaning", "change-risk", "change-window-fit", "checkers-move", "choose-action", "citation-match", "citation-needed", "claim-facets", "claim-stance", "clarify", "clause-conflict", "clause-kind", "clickbait-level", "commit-message-fit", "commitment-strength", "comparable-fit", "completion-gate", "confirmation-match", "consent-request", "consent-scope-fit", "constraint-strength", "contact-opt-out", "content-facets", "content-freshness-signal", "context-prune", "context-role", "continuation-compare", "correction-target", "corrective-action-fit", "daw-request-kind", "deadline-risk", "defect-report-facets", "delegation-fit", "diff-hazards", "disclosure-facets", "dispute-kind", "document-role", "draft-compare", "dynamic-change", "eligibility-facets", "emotion-kind", "entity-match", "error-acknowledgment", "escalation-wording", "evaluation-mention", "evidence-conflict", "evidence-independence", "evidence-novelty", "evidence-strength", "exercise-select", "expense-category", "explanation-level", "extraction-fidelity", "fact-stability", "failure-kind", "fair-housing-wording", "feedback-actionability", "feedback-kind", "field-select", "financial-advice-signal", "finger-actions", "followup-link", "followup-timing", "forecast-confidence-wording", "format-fit", "freshness-needed", "frustration-signal", "funder-fit", "game-action", "game-phase", "goal-drift", "grounding-level", "guest-request-facets", "handoff", "handoff-completeness", "headline-fit", "incident-match", "incident-severity-wording", "injection-signal", "instruction-clarity", "instruction-conflict", "instruction-fit", "instruction-priority", "instruction-readability", "instrument-issue-kind", "instrument-report-facets", "intake-question-fit", "intent-change", "invoice-facets", "issue-impact", "issue-recurrence", "itinerary-feasibility", "job-post-facets", "length-fit", "listener-request-kind", "listing-compare", "listing-fact-consistency", "log-line-kind", "loss-cause-kind", "lyric-mood-fit", "maintenance-hazard-wording", "medication-mention", "memory-relation", "memory-scope", "memory-subject", "memory-value", "message-facets", "methods-facets", "model-route", "modulation-moment", "mood-match", "mood-request", "motivation-source", "move-explanation-fit", "narrative-consistency", "next-chord", "next-duration", "next-note", "notice-facets", "novelty-claim-level", "objection-kind", "objective-fit", "offer-terms-facets", "outcome-framing", "passage-compare", "passage-difficulty", "passage-duplicate", "passage-mood", "passage-standalone", "performance-feedback-facets", "persuasion-technique", "phrase-complete", "pii-presence", "plan-completeness", "policy-compliance", "policy-severity", "politeness-level", "postmortem-facets", "preference-kind", "priority-compare", "privacy-notice-facets", "product-match", "progress-stall", "promise-check", "proposal-facets", "qualification-evidence", "query-equivalence", "query-specificity", "question-assumption", "question-leading", "question-relevance", "reconciliation-match", "reference-resolve", "repeated-attempt", "repetition-level", "reply-template-match", "report-facets", "requirement-testability", "rerank", "resolution-check", "response-needed", "response-refusal", "result-outcome", "result-plausibility", "result-usefulness", "retrieval-needed", "retry-worthwhile", "review-comment-kind", "review-facets", "review-recommendation-kind", "review-response-fit", "rollback-signal", "root-cause-depth", "route", "route-many", "rule-compliance", "runbook-fit", "safety-incident-kind", "satisfaction-signal", "search-intent-kind", "sentiment-shift", "settlement-offer-facets", "shipment-issue-kind", "slot-fit", "sound-match", "source-applicability", "spam-signal", "stage-evidence", "step-complete", "step-progress", "style-kind", "summary-coverage", "symptom-facets", "take-turn", "task-complexity", "task-dependency", "task-duplicate", "task-overlap", "tempo-change", "tension-level", "ticket-match", "tone-check", "tool-call-gate", "tool-compare", "tool-fit", "topic-shift", "trip-purpose-kind", "troubleshooting-fit", "turn-intent", "uncertainty-expression", "urgency-signal", "verify", "wake-gate", "workaround-fit"];
1
+ export declare const recipeNames: readonly ["action-compare", "action-effects", "action-reversibility", "action-scope", "age-appropriateness", "alert-actionability", "answer-consistency", "answer-coverage", "answer-disclosures", "answer-grade", "answer-invalidation", "answer-relevance", "answerability", "appeal-grounds-kind", "appointment-request-kind", "argument-fit", "attempted-step", "attribution-match", "audience-fit", "breaking-change-signal", "budget-fit", "budget-narrative-fit", "bug-report-completeness", "buying-intent", "cache-match", "callback-responsibility", "cancellation-check", "care-urgency-wording", "category-fit", "causal-attribution", "causal-language-strength", "certainty-match", "change-meaning", "change-risk", "change-window-fit", "checkers-move", "choose-action", "citation-match", "citation-needed", "claim-facets", "claim-stance", "clarify", "clause-conflict", "clause-kind", "clickbait-level", "commit-message-fit", "commitment-strength", "comparable-fit", "completion-gate", "confirmation-match", "consent-request", "consent-scope-fit", "constraint-strength", "contact-opt-out", "content-facets", "content-freshness-signal", "context-prune", "context-role", "continuation-compare", "correction-target", "corrective-action-fit", "daw-request-kind", "deadline-risk", "defect-report-facets", "delegation-fit", "diff-hazards", "disclosure-facets", "dispute-kind", "document-role", "draft-compare", "dynamic-change", "eligibility-facets", "emotion-kind", "entity-match", "error-acknowledgment", "escalation-wording", "evaluation-mention", "evidence-conflict", "evidence-independence", "evidence-novelty", "evidence-strength", "exercise-select", "expense-category", "explanation-level", "extraction-fidelity", "fact-stability", "failure-kind", "fair-housing-wording", "feedback-actionability", "feedback-kind", "field-select", "financial-advice-signal", "finger-actions", "followup-link", "followup-timing", "forecast-confidence-wording", "format-fit", "freshness-needed", "frustration-signal", "funder-fit", "game-action", "game-phase", "goal-drift", "grounding-level", "guest-request-facets", "handoff", "handoff-completeness", "headline-fit", "incident-match", "incident-severity-wording", "injection-signal", "instruction-clarity", "instruction-conflict", "instruction-fit", "instruction-priority", "instruction-readability", "instrument-issue-kind", "instrument-report-facets", "intake-question-fit", "intent-change", "invoice-facets", "issue-impact", "issue-recurrence", "itinerary-feasibility", "job-post-facets", "length-fit", "listener-request-kind", "listing-compare", "listing-fact-consistency", "log-line-kind", "loss-cause-kind", "lyric-mood-fit", "maintenance-hazard-wording", "medication-mention", "memory-relation", "memory-scope", "memory-subject", "memory-value", "message-facets", "methods-facets", "model-route", "modulation-moment", "mood-match", "mood-request", "motivation-source", "move-explanation-fit", "narrative-consistency", "next-chord", "next-duration", "next-note", "notice-facets", "novelty-claim-level", "objection-kind", "objective-fit", "offer-terms-facets", "outcome-framing", "paragraph-boundary", "passage-compare", "passage-difficulty", "passage-duplicate", "passage-mood", "passage-standalone", "performance-feedback-facets", "persuasion-technique", "phrase-complete", "pii-presence", "plan-completeness", "policy-compliance", "policy-severity", "politeness-level", "postmortem-facets", "preference-kind", "priority-compare", "privacy-notice-facets", "product-match", "progress-stall", "promise-check", "proposal-facets", "qualification-evidence", "query-equivalence", "query-specificity", "question-assumption", "question-leading", "question-relevance", "reconciliation-match", "reference-resolve", "repeated-attempt", "repetition-level", "reply-template-match", "report-facets", "requirement-testability", "rerank", "resolution-check", "response-needed", "response-refusal", "result-outcome", "result-plausibility", "result-usefulness", "retrieval-needed", "retry-worthwhile", "review-comment-kind", "review-facets", "review-recommendation-kind", "review-response-fit", "rollback-signal", "root-cause-depth", "route", "route-many", "rule-compliance", "runbook-fit", "safety-incident-kind", "satisfaction-signal", "search-intent-kind", "sentiment-shift", "settlement-offer-facets", "shipment-issue-kind", "slot-fit", "sound-match", "source-applicability", "spam-signal", "stage-evidence", "step-complete", "step-progress", "style-kind", "summary-coverage", "symptom-facets", "take-turn", "task-complexity", "task-dependency", "task-duplicate", "task-overlap", "tempo-change", "tension-level", "text-block-role", "ticket-match", "tone-check", "tool-call-gate", "tool-compare", "tool-fit", "topic-shift", "trip-purpose-kind", "troubleshooting-fit", "turn-intent", "uncertainty-expression", "urgency-signal", "verify", "wake-gate", "workaround-fit"];
@@ -156,6 +156,7 @@ export const recipeNames = [
156
156
  'objective-fit',
157
157
  'offer-terms-facets',
158
158
  'outcome-framing',
159
+ 'paragraph-boundary',
159
160
  'passage-compare',
160
161
  'passage-difficulty',
161
162
  'passage-duplicate',
@@ -232,6 +233,7 @@ export const recipeNames = [
232
233
  'task-overlap',
233
234
  'tempo-change',
234
235
  'tension-level',
236
+ 'text-block-role',
235
237
  'ticket-match',
236
238
  'tone-check',
237
239
  'tool-call-gate',
@@ -1,7 +1,9 @@
1
1
  import type { RecipeMetadata } from '../src/schema.js';
2
2
  import type { RecipeFilters, RecipeName } from './schema.js';
3
+ import type { RecipeEvidence } from './evidence.js';
3
4
  export type CatalogRecipe = RecipeMetadata & {
4
5
  id: RecipeName;
6
+ evidence?: RecipeEvidence;
5
7
  };
6
8
  export type RecipeDescription = CatalogRecipe & {
7
9
  inputSchema: Record<string, unknown>;
@@ -13,3 +15,4 @@ export { recipeFiltersSchema, recipeNameSchema } from './schema.js';
13
15
  export { recipeCategorySchema, recipeMetadataSchema } from '../src/schema.js';
14
16
  export type { RecipeFilters, RecipeName } from './schema.js';
15
17
  export type { RecipeCategory, RecipeMetadata } from '../src/schema.js';
18
+ export type { RecipeEvidence } from './evidence.js';
@@ -156,6 +156,7 @@ export declare const recipeNameSchema: z.ZodEnum<{
156
156
  "objective-fit": "objective-fit";
157
157
  "offer-terms-facets": "offer-terms-facets";
158
158
  "outcome-framing": "outcome-framing";
159
+ "paragraph-boundary": "paragraph-boundary";
159
160
  "passage-compare": "passage-compare";
160
161
  "passage-difficulty": "passage-difficulty";
161
162
  "passage-duplicate": "passage-duplicate";
@@ -232,6 +233,7 @@ export declare const recipeNameSchema: z.ZodEnum<{
232
233
  "task-overlap": "task-overlap";
233
234
  "tempo-change": "tempo-change";
234
235
  "tension-level": "tension-level";
236
+ "text-block-role": "text-block-role";
235
237
  "ticket-match": "ticket-match";
236
238
  "tone-check": "tone-check";
237
239
  "tool-call-gate": "tool-call-gate";
@@ -159,6 +159,7 @@ export declare const commandArgumentsSchema: z.ZodUnion<readonly [z.ZodTuple<[z.
159
159
  "objective-fit": "objective-fit";
160
160
  "offer-terms-facets": "offer-terms-facets";
161
161
  "outcome-framing": "outcome-framing";
162
+ "paragraph-boundary": "paragraph-boundary";
162
163
  "passage-compare": "passage-compare";
163
164
  "passage-difficulty": "passage-difficulty";
164
165
  "passage-duplicate": "passage-duplicate";
@@ -235,6 +236,7 @@ export declare const commandArgumentsSchema: z.ZodUnion<readonly [z.ZodTuple<[z.
235
236
  "task-overlap": "task-overlap";
236
237
  "tempo-change": "tempo-change";
237
238
  "tension-level": "tension-level";
239
+ "text-block-role": "text-block-role";
238
240
  "ticket-match": "ticket-match";
239
241
  "tone-check": "tone-check";
240
242
  "tool-call-gate": "tool-call-gate";
@@ -409,6 +411,7 @@ export declare const commandArgumentsSchema: z.ZodUnion<readonly [z.ZodTuple<[z.
409
411
  "objective-fit": "objective-fit";
410
412
  "offer-terms-facets": "offer-terms-facets";
411
413
  "outcome-framing": "outcome-framing";
414
+ "paragraph-boundary": "paragraph-boundary";
412
415
  "passage-compare": "passage-compare";
413
416
  "passage-difficulty": "passage-difficulty";
414
417
  "passage-duplicate": "passage-duplicate";
@@ -485,6 +488,7 @@ export declare const commandArgumentsSchema: z.ZodUnion<readonly [z.ZodTuple<[z.
485
488
  "task-overlap": "task-overlap";
486
489
  "tempo-change": "tempo-change";
487
490
  "tension-level": "tension-level";
491
+ "text-block-role": "text-block-role";
488
492
  "ticket-match": "ticket-match";
489
493
  "tone-check": "tone-check";
490
494
  "tool-call-gate": "tool-call-gate";
@@ -656,6 +660,7 @@ export declare const commandArgumentsSchema: z.ZodUnion<readonly [z.ZodTuple<[z.
656
660
  "objective-fit": "objective-fit";
657
661
  "offer-terms-facets": "offer-terms-facets";
658
662
  "outcome-framing": "outcome-framing";
663
+ "paragraph-boundary": "paragraph-boundary";
659
664
  "passage-compare": "passage-compare";
660
665
  "passage-difficulty": "passage-difficulty";
661
666
  "passage-duplicate": "passage-duplicate";
@@ -732,6 +737,7 @@ export declare const commandArgumentsSchema: z.ZodUnion<readonly [z.ZodTuple<[z.
732
737
  "task-overlap": "task-overlap";
733
738
  "tempo-change": "tempo-change";
734
739
  "tension-level": "tension-level";
740
+ "text-block-role": "text-block-role";
735
741
  "ticket-match": "ticket-match";
736
742
  "tone-check": "tone-check";
737
743
  "tool-call-gate": "tool-call-gate";
@@ -8,8 +8,8 @@ declare const archiveSchema: z.ZodObject<{
8
8
  runId: z.ZodString;
9
9
  createdAt: z.ZodISODateTime;
10
10
  mode: z.ZodEnum<{
11
- live: "live";
12
11
  fixture: "fixture";
12
+ live: "live";
13
13
  replay: "replay";
14
14
  }>;
15
15
  packageVersion: z.ZodString;
@@ -19,8 +19,8 @@ declare const archiveSchema: z.ZodObject<{
19
19
  inputFingerprint: z.ZodString;
20
20
  answerKeyFingerprint: z.ZodString;
21
21
  split: z.ZodEnum<{
22
- development: "development";
23
22
  "held-out": "held-out";
23
+ development: "development";
24
24
  }>;
25
25
  requestedModel: z.ZodString;
26
26
  policy: z.ZodObject<{
@@ -48,15 +48,15 @@ declare const archiveSchema: z.ZodObject<{
48
48
  rationale: z.ZodString;
49
49
  family: z.ZodOptional<z.ZodString>;
50
50
  split: z.ZodDefault<z.ZodEnum<{
51
- development: "development";
52
51
  "held-out": "held-out";
52
+ development: "development";
53
53
  }>>;
54
54
  provenance: z.ZodDefault<z.ZodObject<{
55
55
  method: z.ZodEnum<{
56
- "author-synthetic": "author-synthetic";
57
- "human-reviewed": "human-reviewed";
58
56
  "public-dataset": "public-dataset";
57
+ "human-reviewed": "human-reviewed";
59
58
  unspecified: "unspecified";
59
+ "author-synthetic": "author-synthetic";
60
60
  }>;
61
61
  source: z.ZodString;
62
62
  }, z.core.$strip>>;
@@ -107,7 +107,7 @@ export declare function freezePolicy(run: EvaluationRun): EvaluationPolicy;
107
107
  export declare function compare(baseline: EvaluationRun, candidate: EvaluationRun): {
108
108
  recipe: string;
109
109
  cases: number;
110
- split: "development" | "held-out";
110
+ split: "held-out" | "development";
111
111
  baseline: {
112
112
  runId: string;
113
113
  packageVersion: string;
@@ -124,7 +124,7 @@ export declare function compare(baseline: EvaluationRun, candidate: EvaluationRu
124
124
  split: "development";
125
125
  } | undefined;
126
126
  };
127
- mode: "live" | "fixture" | "replay";
127
+ mode: "fixture" | "live" | "replay";
128
128
  report: {
129
129
  contestedAccuracy: number | null;
130
130
  adversarialAccuracy: number | null;
@@ -309,7 +309,7 @@ export declare function compare(baseline: EvaluationRun, candidate: EvaluationRu
309
309
  split: "development";
310
310
  } | undefined;
311
311
  };
312
- mode: "live" | "fixture" | "replay";
312
+ mode: "fixture" | "live" | "replay";
313
313
  report: {
314
314
  contestedAccuracy: number | null;
315
315
  adversarialAccuracy: number | null;
@@ -13,7 +13,7 @@ export function comparableDecision(value) {
13
13
  return value.map(comparableDecision);
14
14
  if (isRecord(value))
15
15
  return Object.fromEntries(Object.entries(value)
16
- .filter(([name, field]) => !metadataFields.has(name) && typeof field !== 'number')
16
+ .filter(([name]) => !metadataFields.has(name))
17
17
  .map(([name, field]) => [name, comparableDecision(field)]));
18
18
  return value;
19
19
  }
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  export declare const provenanceSchema: z.ZodObject<{
3
3
  method: z.ZodEnum<{
4
- "author-synthetic": "author-synthetic";
5
- "human-reviewed": "human-reviewed";
6
4
  "public-dataset": "public-dataset";
5
+ "human-reviewed": "human-reviewed";
7
6
  unspecified: "unspecified";
7
+ "author-synthetic": "author-synthetic";
8
8
  }>;
9
9
  source: z.ZodString;
10
10
  }, z.core.$strip>;
@@ -15,15 +15,15 @@ export declare const evaluationCaseSchema: z.ZodObject<{
15
15
  rationale: z.ZodString;
16
16
  family: z.ZodOptional<z.ZodString>;
17
17
  split: z.ZodDefault<z.ZodEnum<{
18
- development: "development";
19
18
  "held-out": "held-out";
19
+ development: "development";
20
20
  }>>;
21
21
  provenance: z.ZodDefault<z.ZodObject<{
22
22
  method: z.ZodEnum<{
23
- "author-synthetic": "author-synthetic";
24
- "human-reviewed": "human-reviewed";
25
23
  "public-dataset": "public-dataset";
24
+ "human-reviewed": "human-reviewed";
26
25
  unspecified: "unspecified";
26
+ "author-synthetic": "author-synthetic";
27
27
  }>;
28
28
  source: z.ZodString;
29
29
  }, z.core.$strip>>;
@@ -54,8 +54,8 @@ export declare const evaluationOptionsSchema: z.ZodObject<{
54
54
  maxRequests: z.ZodDefault<z.ZodNumber>;
55
55
  model: z.ZodOptional<z.ZodString>;
56
56
  split: z.ZodDefault<z.ZodEnum<{
57
- development: "development";
58
57
  "held-out": "held-out";
58
+ development: "development";
59
59
  }>>;
60
60
  policy: z.ZodDefault<z.ZodObject<{
61
61
  minConfidence: z.ZodOptional<z.ZodNumber>;
@@ -4,35 +4,35 @@ export async function actionEffects(input, options = {}) {
4
4
  const { minConfidence = 0.8, ...state } = actionEffectsInputSchema.parse(input);
5
5
  const evaluation = await evaluateLabels(state, {
6
6
  writesData: {
7
- instruction: 'Does action create or modify stored data, such as records, files, settings, or state, without merely deleting it?',
7
+ instruction: 'Does executing action itself create or modify stored data, such as records, files, settings, or state, without merely deleting it? If action only explains, quotes, simulates, or proposes another operation without executing it, do not attribute that other operation’s effects to action.',
8
8
  criteria: {
9
9
  true: 'The action creates, updates, or overwrites stored records, files, fields, or configuration.',
10
10
  false: 'The action only reads, computes, sends, deletes, or does nothing to stored data.',
11
11
  },
12
12
  },
13
13
  sendsMessage: {
14
- instruction: 'Does action send a message or notification to a person or channel, such as an email, chat message, SMS, push notification, or post?',
14
+ instruction: 'Does executing action itself send a message or notification to a person or channel, such as an email, chat message, SMS, push notification, or post? Ignore effects of operations that action only describes or proposes without executing.',
15
15
  criteria: {
16
16
  true: 'The action transmits a message or notification that a person or channel will receive.',
17
17
  false: 'The action sends nothing that a person or channel would receive as a message.',
18
18
  },
19
19
  },
20
20
  spendsMoney: {
21
- instruction: 'Does action spend, transfer, refund, or otherwise move money or paid credits?',
21
+ instruction: 'Does executing action itself spend, transfer, refund, or otherwise move money or paid credits? Ignore effects of operations that action only describes or proposes without executing.',
22
22
  criteria: {
23
23
  true: 'The action makes a purchase, payment, transfer, refund, or charge, or consumes paid credits the description names.',
24
24
  false: 'The action moves no money and consumes no paid credits that the description names.',
25
25
  },
26
26
  },
27
27
  deletesData: {
28
- instruction: 'Does action delete, remove, drop, or purge stored data, records, files, or resources?',
28
+ instruction: 'Does executing action itself delete, remove, drop, or purge stored data, records, files, or resources? Ignore effects of operations that action only describes or proposes without executing.',
29
29
  criteria: {
30
30
  true: 'The action removes stored data, records, files, or resources so they no longer exist in their current location.',
31
31
  false: 'The action removes nothing; archiving or marking as inactive without removal does not count.',
32
32
  },
33
33
  },
34
34
  callsExternal: {
35
- instruction: "Does action call a service outside the system running the agent, such as a third-party API, a web request, or another vendor's platform?",
35
+ instruction: "Does executing action itself call a service outside the system running the agent, such as a third-party API, a web request, or another vendor's platform? Ignore external calls that action only describes without making them.",
36
36
  criteria: {
37
37
  true: "The action contacts a third-party API, external web endpoint, or another organization's service.",
38
38
  false: "The action stays within the system's own data and code with no outbound call to an external service.",
@@ -2,9 +2,9 @@ import { z } from 'zod';
2
2
  export declare const causalAttributionVerdictSchema: z.ZodEnum<{
3
3
  none: "none";
4
4
  unclear: "unclear";
5
+ mixed: "mixed";
5
6
  personal: "personal";
6
7
  situational: "situational";
7
- mixed: "mixed";
8
8
  }>;
9
9
  export declare const causalAttributionInputSchema: z.ZodObject<{
10
10
  behavior: z.ZodString;
@@ -25,17 +25,17 @@ export declare const causalAttributionResultSchema: z.ZodObject<{
25
25
  verdict: z.ZodEnum<{
26
26
  none: "none";
27
27
  unclear: "unclear";
28
+ mixed: "mixed";
28
29
  personal: "personal";
29
30
  situational: "situational";
30
- mixed: "mixed";
31
31
  }>;
32
32
  confidence: z.ZodNumber;
33
33
  probabilities: z.ZodRecord<z.ZodEnum<{
34
34
  none: "none";
35
35
  unclear: "unclear";
36
+ mixed: "mixed";
36
37
  personal: "personal";
37
38
  situational: "situational";
38
- mixed: "mixed";
39
39
  }>, z.ZodNumber>;
40
40
  }, z.core.$strip>;
41
41
  export type CausalAttributionInput = z.infer<typeof causalAttributionInputSchema>;
@@ -3,11 +3,11 @@ import { resolveLabels } from '../../src/labels.js';
3
3
  import { completionGateInputSchema, completionGateResultSchema } from './schema.js';
4
4
  export async function completionGate(input, options = {}) {
5
5
  const { minConfidence = 0.8, ...state } = completionGateInputSchema.parse(input);
6
- const decision = await evaluateChoiceWithLabels(state, 'An agent was given task and has stopped with report as its final message. Is the task actually done? Use evidence, when supplied, as the record of what happened, such as test output, diffs, or the transcript; the report alone is a claim, not proof. Count the task complete only when every part of it is shown done. Count it incomplete when any part is missing, deferred, skipped, or failed, including parts the report quietly drops. Count it unverified when the report claims completion but nothing supplied demonstrates it. Choose unclear only when task or report cannot be understood well enough to judge, such as a task with no identifiable requirement or a report with no readable content; a report that addresses different work than the task, or that points to material not supplied, is unverified, not unclear.', {
6
+ const decision = await evaluateChoiceWithLabels(state, 'Judge whether task is complete using report and supplied evidence. First determine what task requires: choose unclear if an unresolved reference, missing specification, or conflicting requirement prevents identifying the required deliverable. Do not invent that requirement or mark an unknown requirement as failed. For a clear task, choose incomplete if supplied material shows a required part was skipped, deferred, narrowed, or failed. Choose unverified if completion is claimed but no supplied evidence demonstrates it. Choose complete only when supplied evidence demonstrates every identifiable requirement. Missing proof for a clear requirement is unverified; missing information needed to identify the requirement is unclear.', {
7
7
  complete: 'Every part of the task is shown to be done.',
8
8
  incomplete: 'Some part of the task is missing, deferred, narrowed, or failed, whether or not the report admits it.',
9
9
  unverified: 'The report claims the task is done, but the supplied material does not demonstrate it.',
10
- unclear: 'The task or the report cannot be understood well enough to judge; not merely that proof is missing.',
10
+ unclear: 'A missing specification, unresolved reference, or conflict prevents identifying what would satisfy the task; not merely missing proof for a clear requirement.',
11
11
  }, {
12
12
  claimsWithoutEvidence: {
13
13
  instruction: 'Does report assert results, such as passing tests, a working feature, or a verified fix, that evidence does not show, or that nothing supplied shows when evidence is absent?',
@@ -9,9 +9,9 @@ export async function contextPrune(input, options = {}) {
9
9
  state: parseDecisionState(state),
10
10
  questions: Object.fromEntries(state.items.map((_, index) => [
11
11
  `item_${index}`,
12
- noul(asDecisionInstruction(`Will items[${index}].text still be needed to finish objective? Count it needed when it holds facts, results, decisions, errors, or user instructions the remaining work depends on, or when it is the only record of something that must not be redone. Do not count it needed merely because it was useful earlier, is long, or is recent; use recent, when supplied, for what has already been handled. Judge only this item.`), {
13
- true: 'The remaining work depends on this item.',
14
- false: 'The remaining work can proceed without this item.',
12
+ noul(asDecisionInstruction(`Will items[${index}].text still be needed to finish objective? Count it needed when it holds facts, results, decisions, errors, or user instructions the remaining work depends on, or when it is the only record of something that must not be redone. Do not count it needed merely because it was useful earlier, is long, or is recent; use recent, when supplied, for what has already been handled. Keep active user constraints even if they were stated early. Drop an obsolete value only when the supplied state explicitly replaces it and the old value has no remaining purpose. Completing one step does not make its result irrelevant when a later step depends on it. Judge only this item.`), {
13
+ true: 'This item is an active requirement, relevant fact or result, unresolved error, or unique record the unfinished objective still needs.',
14
+ false: 'This item is unrelated, explicitly superseded, or records completed work whose details are not needed again.',
15
15
  }),
16
16
  ])),
17
17
  }, options);
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  export declare const motivationSourceVerdictSchema: z.ZodEnum<{
3
3
  unclear: "unclear";
4
+ mixed: "mixed";
4
5
  intrinsic: "intrinsic";
5
6
  extrinsic: "extrinsic";
6
- mixed: "mixed";
7
7
  not_stated: "not_stated";
8
8
  }>;
9
9
  export declare const motivationSourceInputSchema: z.ZodObject<{
@@ -24,17 +24,17 @@ export declare const motivationSourceResultSchema: z.ZodObject<{
24
24
  }>;
25
25
  verdict: z.ZodEnum<{
26
26
  unclear: "unclear";
27
+ mixed: "mixed";
27
28
  intrinsic: "intrinsic";
28
29
  extrinsic: "extrinsic";
29
- mixed: "mixed";
30
30
  not_stated: "not_stated";
31
31
  }>;
32
32
  confidence: z.ZodNumber;
33
33
  probabilities: z.ZodRecord<z.ZodEnum<{
34
34
  unclear: "unclear";
35
+ mixed: "mixed";
35
36
  intrinsic: "intrinsic";
36
37
  extrinsic: "extrinsic";
37
- mixed: "mixed";
38
38
  not_stated: "not_stated";
39
39
  }>, z.ZodNumber>;
40
40
  }, z.core.$strip>;
@@ -0,0 +1,19 @@
1
+ {
2
+ "input": {
3
+ "left": "To finish installing the package, run",
4
+ "right": "the command shown in the next example.",
5
+ "minConfidence": 0.8
6
+ },
7
+ "response": {
8
+ "model": "demo-fixture",
9
+ "answers": {
10
+ "decision": {
11
+ "type": "choice",
12
+ "choice": "continue",
13
+ "confidence": 0.96,
14
+ "probabilities": { "continue": 0.96, "separate": 0.02, "unclear": 0.02 }
15
+ }
16
+ },
17
+ "usage": { "input_tokens": 0, "output_tokens": 0 }
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ import type { RecipeOptions } from '../../src/schema.js';
2
+ import type { ParagraphBoundaryInput, ParagraphBoundaryResult } from './schema.js';
3
+ export declare function paragraphBoundary(input: ParagraphBoundaryInput, options?: RecipeOptions): Promise<ParagraphBoundaryResult>;
4
+ export { paragraphBoundaryInputSchema, paragraphBoundaryResultSchema, paragraphBoundaryVerdictSchema, } from './schema.js';
5
+ export type { ParagraphBoundaryInput, ParagraphBoundaryResult, ParagraphBoundaryVerdict, } from './schema.js';
@@ -0,0 +1,15 @@
1
+ import { evaluateChoice } from '../../src/decisions.js';
2
+ import { paragraphBoundaryInputSchema, paragraphBoundaryResultSchema } from './schema.js';
3
+ export async function paragraphBoundary(input, options = {}) {
4
+ const { minConfidence = 0.8, ...state } = paragraphBoundaryInputSchema.parse(input);
5
+ const decision = await evaluateChoice(state, 'Do left and right continue the same prose paragraph, or should the boundary between them remain? The fragments are already in reading order. Choose continue for a hard line wrap within one paragraph. Choose separate for a heading, list item, table, code, poetry line, or a distinct paragraph, even when the subject stays the same. Similar vocabulary alone is not evidence of continuation. Use neighbors and context only to resolve this boundary. Choose unclear when both interpretations remain plausible.', {
6
+ continue: 'The right fragment continues the same prose paragraph interrupted by a line wrap.',
7
+ separate: 'The fragments belong to separate paragraphs or structural blocks and the boundary must remain.',
8
+ unclear: 'The supplied text does not establish whether this is a line wrap or a real boundary.',
9
+ }, options);
10
+ return paragraphBoundaryResultSchema.parse({
11
+ ...decision,
12
+ status: decision.confidence < minConfidence || decision.verdict === 'unclear' ? 'review' : 'ready',
13
+ });
14
+ }
15
+ export { paragraphBoundaryInputSchema, paragraphBoundaryResultSchema, paragraphBoundaryVerdictSchema, } from './schema.js';
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export declare const paragraphBoundaryVerdictSchema: z.ZodEnum<{
3
+ unclear: "unclear";
4
+ continue: "continue";
5
+ separate: "separate";
6
+ }>;
7
+ export declare const paragraphBoundaryInputSchema: z.ZodObject<{
8
+ left: z.ZodString;
9
+ right: z.ZodString;
10
+ before: z.ZodOptional<z.ZodString>;
11
+ after: z.ZodOptional<z.ZodString>;
12
+ context: z.ZodOptional<z.ZodString>;
13
+ minConfidence: z.ZodOptional<z.ZodNumber>;
14
+ }, z.core.$strip>;
15
+ export declare const paragraphBoundaryResultSchema: z.ZodObject<{
16
+ model: z.ZodString;
17
+ usage: z.ZodObject<{
18
+ input_tokens: z.ZodNumber;
19
+ output_tokens: z.ZodNumber;
20
+ }, z.core.$strip>;
21
+ status: z.ZodEnum<{
22
+ ready: "ready";
23
+ review: "review";
24
+ }>;
25
+ verdict: z.ZodEnum<{
26
+ unclear: "unclear";
27
+ continue: "continue";
28
+ separate: "separate";
29
+ }>;
30
+ confidence: z.ZodNumber;
31
+ probabilities: z.ZodRecord<z.ZodEnum<{
32
+ unclear: "unclear";
33
+ continue: "continue";
34
+ separate: "separate";
35
+ }>, z.ZodNumber>;
36
+ }, z.core.$strip>;
37
+ export type ParagraphBoundaryVerdict = z.infer<typeof paragraphBoundaryVerdictSchema>;
38
+ export type ParagraphBoundaryInput = z.infer<typeof paragraphBoundaryInputSchema>;
39
+ export type ParagraphBoundaryResult = z.infer<typeof paragraphBoundaryResultSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { decisionStatusSchema, nonEmptyText, probability, resultMetadataSchema, } from '../../src/schema.js';
3
+ export const paragraphBoundaryVerdictSchema = z.enum(['continue', 'separate', 'unclear']);
4
+ export const paragraphBoundaryInputSchema = z.object({
5
+ left: nonEmptyText,
6
+ right: nonEmptyText,
7
+ before: nonEmptyText.optional(),
8
+ after: nonEmptyText.optional(),
9
+ context: nonEmptyText.optional(),
10
+ minConfidence: probability.optional(),
11
+ });
12
+ export const paragraphBoundaryResultSchema = resultMetadataSchema.extend({
13
+ status: decisionStatusSchema,
14
+ verdict: paragraphBoundaryVerdictSchema,
15
+ confidence: probability,
16
+ probabilities: z.record(paragraphBoundaryVerdictSchema, probability),
17
+ });
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  export declare const responseRefusalVerdictSchema: z.ZodEnum<{
3
3
  unclear: "unclear";
4
- attempted: "attempted";
5
4
  mixed: "mixed";
5
+ attempted: "attempted";
6
6
  not_addressed: "not_addressed";
7
7
  refused: "refused";
8
8
  unable: "unable";
@@ -25,8 +25,8 @@ export declare const responseRefusalResultSchema: z.ZodObject<{
25
25
  }>;
26
26
  verdict: z.ZodEnum<{
27
27
  unclear: "unclear";
28
- attempted: "attempted";
29
28
  mixed: "mixed";
29
+ attempted: "attempted";
30
30
  not_addressed: "not_addressed";
31
31
  refused: "refused";
32
32
  unable: "unable";
@@ -34,8 +34,8 @@ export declare const responseRefusalResultSchema: z.ZodObject<{
34
34
  confidence: z.ZodNumber;
35
35
  probabilities: z.ZodRecord<z.ZodEnum<{
36
36
  unclear: "unclear";
37
- attempted: "attempted";
38
37
  mixed: "mixed";
38
+ attempted: "attempted";
39
39
  not_addressed: "not_addressed";
40
40
  refused: "refused";
41
41
  unable: "unable";
@@ -0,0 +1,29 @@
1
+ {
2
+ "input": {
3
+ "text": "Installation",
4
+ "after": "Run npm install to add the package.",
5
+ "minConfidence": 0.8
6
+ },
7
+ "response": {
8
+ "model": "demo-fixture",
9
+ "answers": {
10
+ "decision": {
11
+ "type": "choice",
12
+ "choice": "heading",
13
+ "confidence": 0.94,
14
+ "probabilities": {
15
+ "heading": 0.94,
16
+ "body": 0.04,
17
+ "list_item": 0,
18
+ "code": 0,
19
+ "table": 0,
20
+ "caption": 0,
21
+ "formula": 0,
22
+ "other": 0,
23
+ "unclear": 0.02
24
+ }
25
+ }
26
+ },
27
+ "usage": { "input_tokens": 0, "output_tokens": 0 }
28
+ }
29
+ }
@@ -0,0 +1,5 @@
1
+ import type { RecipeOptions } from '../../src/schema.js';
2
+ import type { TextBlockRoleInput, TextBlockRoleResult } from './schema.js';
3
+ export declare function textBlockRole(input: TextBlockRoleInput, options?: RecipeOptions): Promise<TextBlockRoleResult>;
4
+ export { textBlockRoleInputSchema, textBlockRoleResultSchema, textBlockRoleVerdictSchema, } from './schema.js';
5
+ export type { TextBlockRoleInput, TextBlockRoleResult, TextBlockRoleVerdict } from './schema.js';
@@ -0,0 +1,21 @@
1
+ import { evaluateChoice } from '../../src/decisions.js';
2
+ import { textBlockRoleInputSchema, textBlockRoleResultSchema } from './schema.js';
3
+ export async function textBlockRole(input, options = {}) {
4
+ const { minConfidence = 0.8, ...state } = textBlockRoleInputSchema.parse(input);
5
+ const decision = await evaluateChoice(state, 'What structural role does text play in its source document? Use before, after, and context only to interpret this block. Choose the role of text itself, not the subject it discusses. Code discussed in prose is body; a description of a table is not a table. A short sentence is not necessarily a heading. Choose unclear when the supplied text cannot distinguish plausible roles. Never infer missing text.', {
6
+ heading: 'A title or section label introducing the content that follows.',
7
+ body: 'Ordinary prose forming a paragraph, including signature prose and explanations.',
8
+ list_item: 'One item in an enumeration or a bulleted list.',
9
+ code: 'Source code, a shell command, or a program fragment.',
10
+ table: 'Text arranged into rows and columns representing tabular relationships.',
11
+ caption: 'A label or description specifically attached to a figure or table.',
12
+ formula: 'A mathematical expression or equation, rather than prose mentioning mathematics.',
13
+ other: 'A clear structural role outside these categories, such as page furniture.',
14
+ unclear: 'Several roles remain plausible or the text is insufficient.',
15
+ }, options);
16
+ return textBlockRoleResultSchema.parse({
17
+ ...decision,
18
+ status: decision.confidence < minConfidence || decision.verdict === 'unclear' ? 'review' : 'ready',
19
+ });
20
+ }
21
+ export { textBlockRoleInputSchema, textBlockRoleResultSchema, textBlockRoleVerdictSchema, } from './schema.js';