@lensmcp/protocol-types 1.26.9 → 1.26.11

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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The proof a change to an AI agent owes before it ships (foodguard-301 §4): what the model reads after the change
3
+ * decides what must be measured first. Two changes that looked safe — a fact stated once instead of several times, a
4
+ * call split into smaller ones — made FoodGuard's answers worse; each finding of the AI agent review names its class,
5
+ * the proof it owes, and its saving with the arithmetic behind it.
6
+ *
7
+ * The classes, from the safest: the model reads the same bytes; the same bytes, with code after the model changed; the
8
+ * same content in another place or order; less text, or a changed schema or instruction; a new mechanism. A change
9
+ * that could be in two is in the riskier one.
10
+ */
11
+ export declare const FINDING_RISK_CLASSES: readonly ["same-bytes", "after-the-model", "moved-content", "less-text-or-schema", "new-mechanism"];
12
+ export type FindingRiskClass = (typeof FINDING_RISK_CLASSES)[number];
13
+ /** Each class as a person reads it: its name, what the model reads after the change, an example, and the proof it owes. */
14
+ export declare const FINDING_RISK_CLASS: Record<FindingRiskClass, {
15
+ label: string;
16
+ reads: string;
17
+ example: string;
18
+ proof: string;
19
+ }>;
20
+ /** What a change saves: the amount with its unit and per what, the arithmetic it is computed from, and how it is known. */
21
+ export interface FindingSaving {
22
+ /** `$0.18 per analysis`, `12,000 input tokens a call`, `120 s off the stage`. */
23
+ amount: string;
24
+ /** The formula with the evidence's numbers: `135k × ($2.50 − $0.10) / 1M`. Empty when the review gave none. */
25
+ arithmetic: string;
26
+ /** `measured` only when the evidence held calls from before and after the change; else `estimate`. */
27
+ kind: 'estimate' | 'measured';
28
+ }
29
+ /** The class a review named, or none: an unknown or missing class is unclassified — the finding is kept. */
30
+ export declare function readRiskClass(raw: unknown): FindingRiskClass | undefined;
31
+ /**
32
+ * The finding's keys of the review's answer, one line each — asked of an analyzer that sets `proof` (the AI agent
33
+ * review's): its class, the proof it owes, its saving.
34
+ */
35
+ export declare const FINDING_PROOF_ASK: readonly string[];
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var a=(e,t)=>s(e,"name",{value:t,configurable:!0});var o=Object.defineProperty,r=a((e,t)=>o(e,"name",{value:t,configurable:!0}),"s");export const FINDING_RISK_CLASSES=["same-bytes","after-the-model","moved-content","less-text-or-schema","new-mechanism"],FINDING_RISK_CLASS={"same-bytes":{label:"Same bytes",reads:"the model reads the same bytes",example:"breakpoints, a prewarm, the order requests are sent",proof:"a byte-identity spec (the new request, joined, is the old one byte for byte) and a cost measurement"},"after-the-model":{label:"After the model",reads:"the model reads the same bytes; code after it changes",example:"dropping a finding that code adds to the answer",proof:"a free replay: the same recorded answers through the old and the new code, everything else byte-equal"},"moved-content":{label:"Moved content",reads:"the model reads the same content in another place or order",example:"cache levels, moving a section",proof:"a paired comparison: before and after side by side, in one session, more than one run a side"},"less-text-or-schema":{label:"Less text or a new schema",reads:"the model reads less text, or a changed schema or instruction",example:"shorter rows, field order, a fact stated once",proof:"the full accuracy comparison"},"new-mechanism":{label:"New mechanism",reads:"the model is asked in a new way",example:"grouping products in one call",proof:"a design first"}};const n={"same-bytes":"same-bytes","same-bytes-read":"same-bytes","byte-identical":"same-bytes","after-the-model":"after-the-model","after-model":"after-the-model","code-after-the-model":"after-the-model","code-after-model":"after-the-model","moved-content":"moved-content",moved:"moved-content","same-content-moved":"moved-content","less-text-or-schema":"less-text-or-schema","less-text":"less-text-or-schema","changed-schema":"less-text-or-schema","less-text-or-a-changed-schema":"less-text-or-schema","new-mechanism":"new-mechanism",new:"new-mechanism"};export function readRiskClass(e){if(typeof e!="string")return;const t=e.trim().toLowerCase().replace(/[\s_]+/g,"-");return n[t]}a(readRiskClass,"readRiskClass"),r(readRiskClass,"readRiskClass");export const FINDING_PROOF_ASK=[`"riskClass": one of ${FINDING_RISK_CLASSES.map(e=>`"${e}"`).join(" | ")} \u2014 what the model reads after the change (${FINDING_RISK_CLASSES.map(e=>`${e}: ${FINDING_RISK_CLASS[e].reads}`).join("; ")}); in doubt, the riskier`,`"proofOwed": "what must be shown before it ships \u2014 its class's proof (${FINDING_RISK_CLASSES.map(e=>`${e}: ${FINDING_RISK_CLASS[e].proof}`).join("; ")}), made concrete for this change: which spec, which calls, how many runs a side"`,`"saving": { "amount": "what it saves, with its unit and per what ('$0.18 per run', '12,000 input tokens a call', '120 s off the stage')", "arithmetic": "the formula with the evidence's numbers and the prices it used", "kind": "estimate" | "measured" (measured only when the evidence holds calls from before and after the change) } or null when it saves nothing countable`];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.26.9",
3
+ "version": "1.26.11",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",