@sponsio/sdk 0.1.0-alpha.3 → 0.2.0-alpha.10
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/bin/sponsio.cjs +11 -0
- package/contracts/benchmark/agentdojo.yaml +551 -0
- package/contracts/benchmark/odcv_bench.yaml +393 -0
- package/contracts/benchmark/redcode_exec.yaml +488 -0
- package/contracts/benchmark/swebench.yaml +176 -0
- package/contracts/benchmark/tau2_bench.yaml +984 -0
- package/contracts/capability/credentials.yaml +8 -8
- package/contracts/capability/database.yaml +6 -6
- package/contracts/capability/destructive.yaml +213 -0
- package/contracts/capability/factual-claims.yaml +79 -0
- package/contracts/capability/filesystem-strict.yaml +4 -4
- package/contracts/capability/filesystem.yaml +9 -9
- package/contracts/capability/host-config-integrity.yaml +318 -0
- package/contracts/capability/self-modify.yaml +260 -9
- package/contracts/capability/shell.yaml +43 -41
- package/contracts/capability/subagent.yaml +5 -5
- package/contracts/incident/claude-code-secret-bypass.yaml +57 -26
- package/contracts/incident/cursor-railway-wipe.yaml +63 -7
- package/contracts/incident/mcp-composition.yaml +12 -12
- package/contracts/incident/openclaw.yaml +47 -92
- package/contracts/incident/subagent-escape.yaml +4 -4
- package/contracts/premium/.gitkeep +5 -6
- package/dist/cli/check.d.ts +2 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/check.js +283 -0
- package/dist/cli/check.js.map +1 -0
- package/dist/cli/cli.d.ts +25 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +491 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/config.d.ts +88 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +243 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/demo.d.ts +12 -0
- package/dist/cli/demo.d.ts.map +1 -0
- package/dist/cli/demo.js +350 -0
- package/dist/cli/demo.js.map +1 -0
- package/dist/cli/doctor.d.ts +11 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +201 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/eval.d.ts +2 -0
- package/dist/cli/eval.d.ts.map +1 -0
- package/dist/cli/eval.js +361 -0
- package/dist/cli/eval.js.map +1 -0
- package/dist/cli/explain.d.ts +2 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +266 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/export-sessions.d.ts +2 -0
- package/dist/cli/export-sessions.d.ts.map +1 -0
- package/dist/cli/export-sessions.js +182 -0
- package/dist/cli/export-sessions.js.map +1 -0
- package/dist/cli/export.d.ts +2 -0
- package/dist/cli/export.d.ts.map +1 -0
- package/dist/cli/export.js +222 -0
- package/dist/cli/export.js.map +1 -0
- package/dist/cli/extractors/common.d.ts +27 -0
- package/dist/cli/extractors/common.d.ts.map +1 -0
- package/dist/cli/extractors/common.js +107 -0
- package/dist/cli/extractors/common.js.map +1 -0
- package/dist/cli/extractors/generic.d.ts +37 -0
- package/dist/cli/extractors/generic.d.ts.map +1 -0
- package/dist/cli/extractors/generic.js +185 -0
- package/dist/cli/extractors/generic.js.map +1 -0
- package/dist/cli/extractors/langchain.d.ts +18 -0
- package/dist/cli/extractors/langchain.d.ts.map +1 -0
- package/dist/cli/extractors/langchain.js +86 -0
- package/dist/cli/extractors/langchain.js.map +1 -0
- package/dist/cli/extractors/vercel.d.ts +17 -0
- package/dist/cli/extractors/vercel.d.ts.map +1 -0
- package/dist/cli/extractors/vercel.js +46 -0
- package/dist/cli/extractors/vercel.js.map +1 -0
- package/dist/cli/index.d.ts +38 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +146 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +177 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mode.d.ts +2 -0
- package/dist/cli/mode.d.ts.map +1 -0
- package/dist/cli/mode.js +71 -0
- package/dist/cli/mode.js.map +1 -0
- package/dist/cli/onboard.d.ts +88 -0
- package/dist/cli/onboard.d.ts.map +1 -0
- package/dist/cli/onboard.js +758 -0
- package/dist/cli/onboard.js.map +1 -0
- package/dist/cli/otlp.d.ts +27 -0
- package/dist/cli/otlp.d.ts.map +1 -0
- package/dist/cli/otlp.js +79 -0
- package/dist/cli/otlp.js.map +1 -0
- package/dist/cli/package.json +1 -0
- package/dist/cli/packs.d.ts +16 -0
- package/dist/cli/packs.d.ts.map +1 -0
- package/dist/cli/packs.js +190 -0
- package/dist/cli/packs.js.map +1 -0
- package/dist/cli/patterns.d.ts +16 -0
- package/dist/cli/patterns.d.ts.map +1 -0
- package/dist/cli/patterns.js +136 -0
- package/dist/cli/patterns.js.map +1 -0
- package/dist/cli/prompt.d.ts +2 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +54 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/replay.d.ts +2 -0
- package/dist/cli/replay.d.ts.map +1 -0
- package/dist/cli/replay.js +196 -0
- package/dist/cli/replay.js.map +1 -0
- package/dist/cli/report.d.ts +57 -0
- package/dist/cli/report.d.ts.map +1 -0
- package/dist/cli/report.js +298 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/scan.d.ts +2 -0
- package/dist/cli/scan.d.ts.map +1 -0
- package/dist/cli/scan.js +172 -0
- package/dist/cli/scan.js.map +1 -0
- package/dist/cli/skill.d.ts +15 -0
- package/dist/cli/skill.d.ts.map +1 -0
- package/dist/cli/skill.js +131 -0
- package/dist/cli/skill.js.map +1 -0
- package/dist/cli/tokens.d.ts +31 -0
- package/dist/cli/tokens.d.ts.map +1 -0
- package/dist/cli/tokens.js +73 -0
- package/dist/cli/tokens.js.map +1 -0
- package/dist/cli/types.d.ts +46 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +3 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/validate.d.ts +19 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +205 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/cli/zod.d.ts +36 -0
- package/dist/cli/zod.d.ts.map +1 -0
- package/dist/cli/zod.js +226 -0
- package/dist/cli/zod.js.map +1 -0
- package/dist/cloud/client.d.ts +76 -0
- package/dist/cloud/client.d.ts.map +1 -0
- package/dist/cloud/client.js +204 -0
- package/dist/cloud/client.js.map +1 -0
- package/dist/cloud/evidence.d.ts +108 -0
- package/dist/cloud/evidence.d.ts.map +1 -0
- package/dist/cloud/evidence.js +184 -0
- package/dist/cloud/evidence.js.map +1 -0
- package/dist/cloud/privacy.d.ts +67 -0
- package/dist/cloud/privacy.d.ts.map +1 -0
- package/dist/cloud/privacy.js +170 -0
- package/dist/cloud/privacy.js.map +1 -0
- package/dist/cloud/view-model.d.ts +49 -0
- package/dist/cloud/view-model.d.ts.map +1 -0
- package/dist/cloud/view-model.js +172 -0
- package/dist/cloud/view-model.js.map +1 -0
- package/dist/contract.d.ts +13 -13
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +21 -21
- package/dist/contract.js.map +1 -1
- package/dist/core/config-loader.d.ts +1 -1
- package/dist/core/config-loader.d.ts.map +1 -1
- package/dist/core/config-loader.js +116 -26
- package/dist/core/config-loader.js.map +1 -1
- package/dist/core/evaluator.d.ts +11 -1
- package/dist/core/evaluator.d.ts.map +1 -1
- package/dist/core/evaluator.js +275 -13
- package/dist/core/evaluator.js.map +1 -1
- package/dist/core/formula.d.ts +76 -17
- package/dist/core/formula.d.ts.map +1 -1
- package/dist/core/formula.js +95 -1
- package/dist/core/formula.js.map +1 -1
- package/dist/core/grounding.d.ts +86 -3
- package/dist/core/grounding.d.ts.map +1 -1
- package/dist/core/grounding.js +485 -143
- package/dist/core/grounding.js.map +1 -1
- package/dist/core/nl-parser.d.ts +2 -2
- package/dist/core/nl-parser.d.ts.map +1 -1
- package/dist/core/nl-parser.js +690 -42
- package/dist/core/nl-parser.js.map +1 -1
- package/dist/core/pack-loader.d.ts.map +1 -1
- package/dist/core/pack-loader.js +14 -2
- package/dist/core/pack-loader.js.map +1 -1
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +30 -1
- package/dist/core/parser.js.map +1 -1
- package/dist/core/pattern-factory.d.ts +4 -4
- package/dist/core/pattern-factory.d.ts.map +1 -1
- package/dist/core/pattern-factory.js +59 -4
- package/dist/core/pattern-factory.js.map +1 -1
- package/dist/core/patterns.d.ts +196 -5
- package/dist/core/patterns.d.ts.map +1 -1
- package/dist/core/patterns.js +400 -13
- package/dist/core/patterns.js.map +1 -1
- package/dist/core/session-log.d.ts.map +1 -1
- package/dist/core/session-log.js +20 -1
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/spans.d.ts +1 -1
- package/dist/core/spans.d.ts.map +1 -1
- package/dist/core/spans.js.map +1 -1
- package/dist/core/sto.d.ts +30 -66
- package/dist/core/sto.d.ts.map +1 -1
- package/dist/core/sto.js +39 -100
- package/dist/core/sto.js.map +1 -1
- package/dist/core/tool-names.d.ts +59 -0
- package/dist/core/tool-names.d.ts.map +1 -0
- package/dist/core/tool-names.js +128 -0
- package/dist/core/tool-names.js.map +1 -0
- package/dist/index.d.ts +227 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +539 -152
- package/dist/index.js.map +1 -1
- package/dist/integrations/claude-agent.d.ts +5 -0
- package/dist/integrations/claude-agent.d.ts.map +1 -1
- package/dist/integrations/claude-agent.js +42 -13
- package/dist/integrations/claude-agent.js.map +1 -1
- package/dist/integrations/google-adk.d.ts +5 -3
- package/dist/integrations/google-adk.d.ts.map +1 -1
- package/dist/integrations/google-adk.js +9 -5
- package/dist/integrations/google-adk.js.map +1 -1
- package/dist/integrations/langchain.d.ts +7 -0
- package/dist/integrations/langchain.d.ts.map +1 -1
- package/dist/integrations/langchain.js +21 -3
- package/dist/integrations/langchain.js.map +1 -1
- package/dist/integrations/openai-agents.d.ts +22 -10
- package/dist/integrations/openai-agents.d.ts.map +1 -1
- package/dist/integrations/openai-agents.js +57 -16
- package/dist/integrations/openai-agents.js.map +1 -1
- package/dist/integrations/openai.d.ts +11 -0
- package/dist/integrations/openai.d.ts.map +1 -1
- package/dist/integrations/openai.js +130 -48
- package/dist/integrations/openai.js.map +1 -1
- package/dist/integrations/vercel-ai.d.ts +20 -9
- package/dist/integrations/vercel-ai.d.ts.map +1 -1
- package/dist/integrations/vercel-ai.js +131 -32
- package/dist/integrations/vercel-ai.js.map +1 -1
- package/dist/render/tokens.d.ts.map +1 -1
- package/dist/render/tokens.js +1 -0
- package/dist/render/tokens.js.map +1 -1
- package/package.json +41 -9
- package/prompts/onboard.md +259 -0
- package/prompts/scan.md +123 -0
- package/skills/SKILL.md +432 -0
- package/contracts/core/llm_safety.yaml +0 -130
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What may leave this machine.
|
|
3
|
+
*
|
|
4
|
+
* Port of ``sponsio/bridge/privacy.py``. Enforcement already happened
|
|
5
|
+
* here — the det checks are pure and local — so nothing in this file can
|
|
6
|
+
* change a verdict. It only narrows what the console is shown, which is
|
|
7
|
+
* what makes it cheap: the run's shape is all the cloud needs to render
|
|
8
|
+
* a dashboard, count a finding, or meter usage.
|
|
9
|
+
*/
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
11
|
+
export const LEVELS = ["full", "shape", "hashed", "metadata", "tool_calls"];
|
|
12
|
+
const DEFAULT = "full";
|
|
13
|
+
const STRICTEST = "tool_calls";
|
|
14
|
+
function isLevel(v) {
|
|
15
|
+
return LEVELS.includes(v);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The level in force. The environment beats the argument, deliberately:
|
|
19
|
+
* the person who decides what may leave a machine is the operator of
|
|
20
|
+
* that machine, not the author of the agent running on it.
|
|
21
|
+
*/
|
|
22
|
+
export function resolve(explicit) {
|
|
23
|
+
const env = (process.env.SPONSIO_PRIVACY ?? "").trim().toLowerCase();
|
|
24
|
+
if (isLevel(env))
|
|
25
|
+
return env;
|
|
26
|
+
if (env) {
|
|
27
|
+
// An unrecognised value is far more likely to be a typo in a
|
|
28
|
+
// deployment that meant to tighten than a request to loosen, so it
|
|
29
|
+
// fails closed, to the strictest level there is.
|
|
30
|
+
return STRICTEST;
|
|
31
|
+
}
|
|
32
|
+
if (explicit && isLevel(explicit))
|
|
33
|
+
return explicit;
|
|
34
|
+
return DEFAULT;
|
|
35
|
+
}
|
|
36
|
+
function typeOf(value) {
|
|
37
|
+
if (value === null || value === undefined)
|
|
38
|
+
return "<null>";
|
|
39
|
+
if (typeof value === "boolean")
|
|
40
|
+
return "<bool>";
|
|
41
|
+
if (typeof value === "number") {
|
|
42
|
+
// The one place the two runtimes cannot agree. JavaScript has a
|
|
43
|
+
// single number type, so a value Python reports as ``<float>``
|
|
44
|
+
// because it was written 250.0 arrives here indistinguishable from
|
|
45
|
+
// 250 and is reported ``<int>``. Reporting every number as a float
|
|
46
|
+
// to match would misdescribe every integer, which is worse: a shape
|
|
47
|
+
// is read to answer "what did the agent pass", and the answer for
|
|
48
|
+
// this runtime is that it passed a number JavaScript calls integral.
|
|
49
|
+
return Number.isInteger(value) ? "<int>" : "<float>";
|
|
50
|
+
}
|
|
51
|
+
if (typeof value === "string")
|
|
52
|
+
return `<str:${value.length}>`;
|
|
53
|
+
if (Array.isArray(value))
|
|
54
|
+
return `<list:${value.length}>`;
|
|
55
|
+
if (typeof value === "object") {
|
|
56
|
+
const parts = Object.entries(value).map(([k, v]) => `${k}: ${typeOf(v)}`);
|
|
57
|
+
return `{${parts.join(", ")}}`;
|
|
58
|
+
}
|
|
59
|
+
return `<${typeof value}>`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The structure of an argument set, with every value replaced.
|
|
63
|
+
*
|
|
64
|
+
* Lengths survive for strings and lists because "the model passed a
|
|
65
|
+
* 40 000-character path" is a debugging fact and not content, and it is
|
|
66
|
+
* the one an oversize-argument rule fires on.
|
|
67
|
+
*/
|
|
68
|
+
export function shape(args) {
|
|
69
|
+
if (args === null || args === undefined)
|
|
70
|
+
return "";
|
|
71
|
+
if (typeof args === "object" && !Array.isArray(args)) {
|
|
72
|
+
const parts = Object.entries(args).map(([k, v]) => `"${k}": ${typeOf(v)}`);
|
|
73
|
+
return `{${parts.join(", ")}}`;
|
|
74
|
+
}
|
|
75
|
+
return typeOf(args);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* ``json.dumps`` as Python writes it, which is what the other runtime
|
|
79
|
+
* hashes and displays.
|
|
80
|
+
*
|
|
81
|
+
* ``JSON.stringify`` omits the spaces Python puts after ``,`` and
|
|
82
|
+
* ``:``. That is invisible in a console and decisive in a digest: the
|
|
83
|
+
* same arguments hashed to different values on the two sides, so
|
|
84
|
+
* duplicate and loop detection disagreed about whether two calls were
|
|
85
|
+
* the same call. ``sortKeys`` additionally makes two calls that differ
|
|
86
|
+
* only in key order agree, which is what the digest is for.
|
|
87
|
+
*/
|
|
88
|
+
export function pyJson(value, sortKeys = false) {
|
|
89
|
+
const seen = new WeakSet();
|
|
90
|
+
const walk = (v) => {
|
|
91
|
+
if (v === null || v === undefined)
|
|
92
|
+
return "null";
|
|
93
|
+
if (typeof v === "string")
|
|
94
|
+
return JSON.stringify(v);
|
|
95
|
+
if (typeof v === "number" || typeof v === "boolean")
|
|
96
|
+
return JSON.stringify(v);
|
|
97
|
+
if (typeof v !== "object")
|
|
98
|
+
return JSON.stringify(String(v));
|
|
99
|
+
if (seen.has(v))
|
|
100
|
+
return JSON.stringify("[circular]");
|
|
101
|
+
seen.add(v);
|
|
102
|
+
if (Array.isArray(v))
|
|
103
|
+
return "[" + v.map(walk).join(", ") + "]";
|
|
104
|
+
const o = v;
|
|
105
|
+
const keys = sortKeys ? Object.keys(o).sort() : Object.keys(o);
|
|
106
|
+
return "{" + keys.map((k) => `${JSON.stringify(k)}: ${walk(o[k])}`).join(", ") + "}";
|
|
107
|
+
};
|
|
108
|
+
try {
|
|
109
|
+
return walk(value);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return String(value);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A stable short hash of an argument set. An equality token, not a
|
|
117
|
+
* signature, which is why twelve hex characters is enough: it is what
|
|
118
|
+
* lets duplicate and loop detection keep working with no content.
|
|
119
|
+
*/
|
|
120
|
+
export function digest(args) {
|
|
121
|
+
if (args === null || args === undefined)
|
|
122
|
+
return "";
|
|
123
|
+
return ("sha256:" +
|
|
124
|
+
createHash("sha256").update(pyJson(args, true)).digest("hex").slice(0, 12));
|
|
125
|
+
}
|
|
126
|
+
/** What ``argsPreview`` carries at this level. */
|
|
127
|
+
export function preview(args, level, fullPreview) {
|
|
128
|
+
if (level === "full")
|
|
129
|
+
return fullPreview;
|
|
130
|
+
if (level === "shape")
|
|
131
|
+
return shape(args);
|
|
132
|
+
if (level === "hashed")
|
|
133
|
+
return digest(args);
|
|
134
|
+
return "";
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* What a model turn may quote of itself. A response is the most
|
|
138
|
+
* content-bearing field in the payload, so it goes one level earlier
|
|
139
|
+
* than arguments do.
|
|
140
|
+
*/
|
|
141
|
+
export function say(text, level) {
|
|
142
|
+
return level === "metadata" || level === "tool_calls" ? "" : text;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Whether a step of this type is recorded at all.
|
|
146
|
+
*
|
|
147
|
+
* Only ``tool_calls`` drops whole steps. Every other level keeps the
|
|
148
|
+
* shape of the run and empties fields; this one keeps the action lane
|
|
149
|
+
* alone, because that is what the customer asked for by name.
|
|
150
|
+
*/
|
|
151
|
+
export function keepsStep(stepType, level) {
|
|
152
|
+
return level === "tool_calls" ? stepType === "tool_call" : true;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* A stamp for the run, so a reader knows what they are not seeing.
|
|
156
|
+
*
|
|
157
|
+
* A dashboard showing empty arguments has to be able to say whether the
|
|
158
|
+
* agent passed none or the deployment declined to send them.
|
|
159
|
+
*/
|
|
160
|
+
export function describe(level) {
|
|
161
|
+
return {
|
|
162
|
+
level,
|
|
163
|
+
sendsArguments: level === "full",
|
|
164
|
+
sendsArgumentShapes: level === "full" || level === "shape",
|
|
165
|
+
sendsOutputText: level === "full" || level === "shape" || level === "hashed",
|
|
166
|
+
sendsClaimValues: level === "full" || level === "shape" || level === "hashed",
|
|
167
|
+
sendsOutputLane: level !== "tool_calls",
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=privacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy.js","sourceRoot":"","sources":["../../src/cloud/privacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAU,CAAC;AAGrF,MAAM,OAAO,GAAiB,MAAM,CAAC;AACrC,MAAM,SAAS,GAAiB,YAAY,CAAC;AAE7C,SAAS,OAAO,CAAC,CAAS;IACxB,OAAQ,MAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,QAAiB;IACvC,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrE,IAAI,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAC7B,IAAI,GAAG,EAAE,CAAC;QACR,6DAA6D;QAC7D,mEAAmE;QACnE,iDAAiD;QACjD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,QAAQ,IAAI,OAAO,CAAC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AAO,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAmB;IACnD,OAAO,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,KAAmB;IAC7D,OAAO,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAmB;IAC1C,OAAO;QACL,KAAK;QACL,cAAc,EAAE,KAAK,KAAK,MAAM;QAChC,mBAAmB,EAAE,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO;QAC1D,eAAe,EAAE,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ;QAC5E,gBAAgB,EAAE,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ;QAC7E,eAAe,EAAE,KAAK,KAAK,YAAY;KACxC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One finished run, in the shape the cloud stores.
|
|
3
|
+
*
|
|
4
|
+
* Port of the projection in ``sponsio/bridge/session.py``. Field names
|
|
5
|
+
* are Python's, not new ones: the server, the console and the findings
|
|
6
|
+
* pipeline all read this object, and a TypeScript run that spelled
|
|
7
|
+
* ``argsPreview`` differently would upload successfully and then appear
|
|
8
|
+
* as a run with no arguments and no rules.
|
|
9
|
+
*/
|
|
10
|
+
import type { DetFormula } from "../core/patterns.js";
|
|
11
|
+
import type { AgentTurnSpan } from "../core/spans.js";
|
|
12
|
+
import type { DetViolation } from "../index.js";
|
|
13
|
+
import * as privacy from "./privacy.js";
|
|
14
|
+
/** Parity with ``bridge.spans.slug``. */
|
|
15
|
+
export declare function slug(text: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* One line, truncated. Truncation happens before the value leaves the
|
|
18
|
+
* machine, so an argument that should never have been sent cannot be
|
|
19
|
+
* reconstructed from what was.
|
|
20
|
+
*/
|
|
21
|
+
export declare function argsPreview(args: unknown, limit?: number): string;
|
|
22
|
+
/** A run id with enough entropy that two runs cannot silently become one. */
|
|
23
|
+
export declare function newSessionId(): string;
|
|
24
|
+
export interface RunSpan {
|
|
25
|
+
span: AgentTurnSpan;
|
|
26
|
+
/** The violations the check produced, in the order it produced them. */
|
|
27
|
+
violations: DetViolation[];
|
|
28
|
+
/** What kind of step this was; only ``tool_call`` survives `tool_calls`. */
|
|
29
|
+
type?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ViewModelInput {
|
|
32
|
+
agentId: string;
|
|
33
|
+
mode: string;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
startedAt: number;
|
|
36
|
+
contracts: DetFormula[];
|
|
37
|
+
spans: RunSpan[];
|
|
38
|
+
privacyLevel: privacy.PrivacyLevel;
|
|
39
|
+
/** Which book this run enforced, when it came from the cloud. */
|
|
40
|
+
rulebookStamp?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build the run object.
|
|
44
|
+
*
|
|
45
|
+
* The privacy level is applied here rather than at the transport, so
|
|
46
|
+
* there is one place that decides what leaves and no path around it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildViewModel(input: ViewModelInput): Record<string, unknown>;
|
|
49
|
+
//# sourceMappingURL=view-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-model.d.ts","sourceRoot":"","sources":["../../src/cloud/view-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAKxC,yCAAyC;AACzC,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,SAAM,GAAG,MAAM,CAO9D;AA4BD,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,wEAAwE;IACxE,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC;IACnC,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuG7E"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One finished run, in the shape the cloud stores.
|
|
3
|
+
*
|
|
4
|
+
* Port of the projection in ``sponsio/bridge/session.py``. Field names
|
|
5
|
+
* are Python's, not new ones: the server, the console and the findings
|
|
6
|
+
* pipeline all read this object, and a TypeScript run that spelled
|
|
7
|
+
* ``argsPreview`` differently would upload successfully and then appear
|
|
8
|
+
* as a run with no arguments and no rules.
|
|
9
|
+
*/
|
|
10
|
+
import { randomBytes } from "node:crypto";
|
|
11
|
+
import * as privacy from "./privacy.js";
|
|
12
|
+
import { pyJson } from "./privacy.js";
|
|
13
|
+
const SLUG = /[^a-z0-9]+/g;
|
|
14
|
+
/** Parity with ``bridge.spans.slug``. */
|
|
15
|
+
export function slug(text) {
|
|
16
|
+
return String(text).trim().toLowerCase().replace(SLUG, "-").replace(/^-|-$/g, "") || "rule";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One line, truncated. Truncation happens before the value leaves the
|
|
20
|
+
* machine, so an argument that should never have been sent cannot be
|
|
21
|
+
* reconstructed from what was.
|
|
22
|
+
*/
|
|
23
|
+
export function argsPreview(args, limit = 160) {
|
|
24
|
+
if (args === null || args === undefined)
|
|
25
|
+
return "";
|
|
26
|
+
// Python's json.dumps spacing, so the same call renders identically in
|
|
27
|
+
// the console whichever runtime recorded it.
|
|
28
|
+
let text = pyJson(args);
|
|
29
|
+
text = text.split(/\s+/).join(" ");
|
|
30
|
+
return text.length <= limit ? text : text.slice(0, limit - 1) + "…";
|
|
31
|
+
}
|
|
32
|
+
/** Statuses the console has a colour for. */
|
|
33
|
+
const KNOWN_ACTIONS = new Set([
|
|
34
|
+
"blocked", "escalated", "redirected", "retrying", "warned", "observed",
|
|
35
|
+
]);
|
|
36
|
+
function stepStatus(span, violations) {
|
|
37
|
+
if (!violations.length)
|
|
38
|
+
return "ok";
|
|
39
|
+
const acted = violations.find((v) => v.action && KNOWN_ACTIONS.has(v.action));
|
|
40
|
+
if (acted?.action)
|
|
41
|
+
return acted.action;
|
|
42
|
+
return span.blocked ? "blocked" : "observed";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Hex from the system CSPRNG, as Python's ``secrets.token_hex`` does.
|
|
46
|
+
*
|
|
47
|
+
* ``Math.random()`` is not one, and this is the one place where that
|
|
48
|
+
* matters: the server keys a run by its id and upserts, so two runs
|
|
49
|
+
* sharing an id silently become one and the older is overwritten with no
|
|
50
|
+
* error. A booting fleet seeds ``Math.random`` from a clock they share.
|
|
51
|
+
*/
|
|
52
|
+
function hex(chars) {
|
|
53
|
+
return randomBytes(Math.ceil(chars / 2))
|
|
54
|
+
.toString("hex")
|
|
55
|
+
.slice(0, chars);
|
|
56
|
+
}
|
|
57
|
+
/** A run id with enough entropy that two runs cannot silently become one. */
|
|
58
|
+
export function newSessionId() {
|
|
59
|
+
return "run-" + hex(16);
|
|
60
|
+
}
|
|
61
|
+
function firstContractName(span) {
|
|
62
|
+
for (const child of span.children ?? []) {
|
|
63
|
+
const named = child;
|
|
64
|
+
if (named.contractName)
|
|
65
|
+
return named.contractName;
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Build the run object.
|
|
71
|
+
*
|
|
72
|
+
* The privacy level is applied here rather than at the transport, so
|
|
73
|
+
* there is one place that decides what leaves and no path around it.
|
|
74
|
+
*/
|
|
75
|
+
export function buildViewModel(input) {
|
|
76
|
+
const { privacyLevel: level } = input;
|
|
77
|
+
const byLabel = new Map(input.contracts.map((c) => [c.desc, c]));
|
|
78
|
+
const violationCounts = new Map();
|
|
79
|
+
const traceId = hex(32);
|
|
80
|
+
const steps = [];
|
|
81
|
+
input.spans.forEach((entry, idx) => {
|
|
82
|
+
const type = entry.type ?? "tool_call";
|
|
83
|
+
if (!privacy.keepsStep(type, level))
|
|
84
|
+
return;
|
|
85
|
+
const rawArgs = entry.span.attributes.args;
|
|
86
|
+
const violations = entry.violations.map((v) => {
|
|
87
|
+
const contract = byLabel.get(v.desc);
|
|
88
|
+
const label = v.desc;
|
|
89
|
+
violationCounts.set(label, (violationCounts.get(label) ?? 0) + 1);
|
|
90
|
+
return {
|
|
91
|
+
contractId: slug(label),
|
|
92
|
+
contractLabel: label,
|
|
93
|
+
category: "Prohibited",
|
|
94
|
+
kind: "guarantee",
|
|
95
|
+
severity: "HIGH",
|
|
96
|
+
pipeline: "det",
|
|
97
|
+
enforcement: {
|
|
98
|
+
strategy: v.action === "escalated" ? "EscalateToHuman" : "DetBlock",
|
|
99
|
+
action: v.action ?? "observed",
|
|
100
|
+
},
|
|
101
|
+
evidence: `Runtime det violation: ${label}`,
|
|
102
|
+
reason: label,
|
|
103
|
+
// The rule's identity, which is what the cloud groups findings
|
|
104
|
+
// by. Without it a violation carries only its English sentence
|
|
105
|
+
// and a reworded rule loses its own history.
|
|
106
|
+
pattern: contract?.patternName ?? v.ruleId ?? "",
|
|
107
|
+
args: contract?.args ?? [],
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
steps.push({
|
|
111
|
+
id: `s${idx}`,
|
|
112
|
+
serviceName: entry.span.agentId || input.agentId,
|
|
113
|
+
traceId,
|
|
114
|
+
spanId: "0".repeat(16),
|
|
115
|
+
type,
|
|
116
|
+
tool: entry.span.action,
|
|
117
|
+
argsPreview: privacy.preview(rawArgs, level, argsPreview(rawArgs)),
|
|
118
|
+
durationMs: Number((entry.span.durationMs() ?? 0).toFixed(2)),
|
|
119
|
+
status: stepStatus(entry.span, entry.violations),
|
|
120
|
+
verdict: {
|
|
121
|
+
blocked: entry.span.blocked,
|
|
122
|
+
contractsChecked: entry.span.totalContractsChecked,
|
|
123
|
+
violations,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
const contracts = input.contracts.map((c) => ({
|
|
128
|
+
id: slug(c.desc),
|
|
129
|
+
label: c.desc,
|
|
130
|
+
status: (violationCounts.get(c.desc) ?? 0) > 0 ? "watching" : "armed",
|
|
131
|
+
pipeline: "det",
|
|
132
|
+
violationCount: violationCounts.get(c.desc) ?? 0,
|
|
133
|
+
pattern: c.patternName,
|
|
134
|
+
args: c.args ?? [],
|
|
135
|
+
source: "policy",
|
|
136
|
+
boundAgents: [],
|
|
137
|
+
}));
|
|
138
|
+
const total = steps.length;
|
|
139
|
+
const failed = steps.filter((s) => s.status !== "ok").length;
|
|
140
|
+
const blocked = steps.filter((s) => s.status === "blocked").length;
|
|
141
|
+
const vm = {
|
|
142
|
+
session: {
|
|
143
|
+
id: input.sessionId,
|
|
144
|
+
agentId: input.agentId,
|
|
145
|
+
mode: input.mode,
|
|
146
|
+
startedAt: input.startedAt,
|
|
147
|
+
},
|
|
148
|
+
agents: [{ id: input.agentId, label: input.agentId }],
|
|
149
|
+
edges: [],
|
|
150
|
+
steps,
|
|
151
|
+
contracts,
|
|
152
|
+
summary: {
|
|
153
|
+
passRate: total ? (total - failed) / total : 1,
|
|
154
|
+
totalSteps: total,
|
|
155
|
+
detBlocks: blocked,
|
|
156
|
+
stoRetries: 0,
|
|
157
|
+
escalations: steps.filter((s) => s.status === "escalated").length,
|
|
158
|
+
contractsArmed: contracts.filter((c) => c.violationCount === 0).length,
|
|
159
|
+
contractsTotal: contracts.length,
|
|
160
|
+
stopped: blocked,
|
|
161
|
+
},
|
|
162
|
+
// So a reader can tell "the agent passed no arguments" from "this
|
|
163
|
+
// deployment does not send them".
|
|
164
|
+
privacy: privacy.describe(level),
|
|
165
|
+
};
|
|
166
|
+
if (input.rulebookStamp) {
|
|
167
|
+
vm.rulebook = input.rulebookStamp;
|
|
168
|
+
vm.rulebookRef = input.rulebookStamp;
|
|
169
|
+
}
|
|
170
|
+
return vm;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=view-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-model.js","sourceRoot":"","sources":["../../src/cloud/view-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,IAAI,GAAG,aAAa,CAAC;AAE3B,yCAAyC;AACzC,MAAM,UAAU,IAAI,CAAC,IAAY;IAC/B,O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C,aAAa,EAAE,CAAC;QACxB,EAAE,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC;QAClC,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/contract.d.ts
CHANGED
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
* contracts: [
|
|
12
12
|
* contract("refund policy gate")
|
|
13
13
|
* .assume("called `issue_refund`")
|
|
14
|
-
* .
|
|
14
|
+
* .guarantees("must call `check_policy` before `issue_refund`"),
|
|
15
15
|
* contract("rate cap")
|
|
16
|
-
* .
|
|
16
|
+
* .guarantees("tool `issue_refund` at most 3 times"),
|
|
17
17
|
* ],
|
|
18
18
|
* });
|
|
19
19
|
*
|
|
20
|
-
* Repeated ``.assume`` / ``.
|
|
20
|
+
* Repeated ``.assume`` / ``.guarantees`` calls AND-combine (matching
|
|
21
21
|
* the Python builder). If ``.assume`` is omitted the contract is
|
|
22
|
-
* unconditional and the
|
|
23
|
-
* ``.assume`` is present the formula is ``A ->
|
|
22
|
+
* unconditional and the guarantee formula is used as-is. If
|
|
23
|
+
* ``.assume`` is present the formula is ``A -> G``.
|
|
24
24
|
*
|
|
25
25
|
* The builder satisfies ``DetFormula`` structurally, so it can be
|
|
26
26
|
* passed directly to ``Sponsio({ contracts: [...] })`` — no ``build()``
|
|
@@ -33,23 +33,23 @@ export declare class ContractBuilder implements DetFormula {
|
|
|
33
33
|
readonly patternName: string;
|
|
34
34
|
readonly liveness: boolean;
|
|
35
35
|
private _assumption;
|
|
36
|
-
private
|
|
36
|
+
private _guarantee;
|
|
37
37
|
constructor(desc?: string);
|
|
38
38
|
/** Add an assumption clause (A side). Repeated calls AND-combine. */
|
|
39
39
|
assume(clause: string | DetFormula): ContractBuilder;
|
|
40
|
-
/** Add
|
|
41
|
-
|
|
40
|
+
/** Add a guarantee clause (G side). Repeated calls AND-combine. */
|
|
41
|
+
guarantees(clause: string | DetFormula): ContractBuilder;
|
|
42
42
|
/**
|
|
43
43
|
* The compiled LTL formula. Accessed at `Sponsio` construction time.
|
|
44
44
|
*
|
|
45
|
-
* - If both A and
|
|
46
|
-
* the evaluator runs from ``pos=0``; a bare ``Implies(A,
|
|
45
|
+
* - If both A and G are set: ``G(A -> G_)``. We wrap in ``G`` because
|
|
46
|
+
* the evaluator runs from ``pos=0``; a bare ``Implies(A, G_)`` would
|
|
47
47
|
* short-circuit whenever ``A`` was false at step 0 regardless of
|
|
48
48
|
* later events. ``G`` lifts the implication to every step so the
|
|
49
|
-
*
|
|
50
|
-
* - If only
|
|
49
|
+
* guarantee fires whenever the assumption holds.
|
|
50
|
+
* - If only G: ``G_`` (unconditional; the pattern factories already
|
|
51
51
|
* emit safety properties wrapped in ``G`` where needed).
|
|
52
|
-
* - If neither: throws — every contract needs
|
|
52
|
+
* - If neither: throws — every contract needs a guarantee.
|
|
53
53
|
*/
|
|
54
54
|
get formula(): Formula;
|
|
55
55
|
private _clone;
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,eAAgB,YAAW,UAAU;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAc;IAC1C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAS;IAEnC,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,eAAgB,YAAW,UAAU;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAc;IAC1C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAS;IAEnC,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,UAAU,CAAiB;gBAEvB,IAAI,CAAC,EAAE,MAAM;IAMzB,qEAAqE;IACrE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe;IAOpD,mEAAmE;IACnE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe;IAOxD;;;;;;;;;;;OAWG;IACH,IAAI,OAAO,IAAI,OAAO,CASrB;IAED,OAAO,CAAC,MAAM;CAMf;AAeD,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAEvD"}
|
package/dist/contract.js
CHANGED
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
* contracts: [
|
|
12
12
|
* contract("refund policy gate")
|
|
13
13
|
* .assume("called `issue_refund`")
|
|
14
|
-
* .
|
|
14
|
+
* .guarantees("must call `check_policy` before `issue_refund`"),
|
|
15
15
|
* contract("rate cap")
|
|
16
|
-
* .
|
|
16
|
+
* .guarantees("tool `issue_refund` at most 3 times"),
|
|
17
17
|
* ],
|
|
18
18
|
* });
|
|
19
19
|
*
|
|
20
|
-
* Repeated ``.assume`` / ``.
|
|
20
|
+
* Repeated ``.assume`` / ``.guarantees`` calls AND-combine (matching
|
|
21
21
|
* the Python builder). If ``.assume`` is omitted the contract is
|
|
22
|
-
* unconditional and the
|
|
23
|
-
* ``.assume`` is present the formula is ``A ->
|
|
22
|
+
* unconditional and the guarantee formula is used as-is. If
|
|
23
|
+
* ``.assume`` is present the formula is ``A -> G``.
|
|
24
24
|
*
|
|
25
25
|
* The builder satisfies ``DetFormula`` structurally, so it can be
|
|
26
26
|
* passed directly to ``Sponsio({ contracts: [...] })`` — no ``build()``
|
|
@@ -33,11 +33,11 @@ export class ContractBuilder {
|
|
|
33
33
|
patternName = "contract";
|
|
34
34
|
liveness = false;
|
|
35
35
|
_assumption;
|
|
36
|
-
|
|
36
|
+
_guarantee;
|
|
37
37
|
constructor(desc) {
|
|
38
38
|
this.desc = desc ?? "contract";
|
|
39
39
|
this._assumption = null;
|
|
40
|
-
this.
|
|
40
|
+
this._guarantee = null;
|
|
41
41
|
}
|
|
42
42
|
/** Add an assumption clause (A side). Repeated calls AND-combine. */
|
|
43
43
|
assume(clause) {
|
|
@@ -46,37 +46,37 @@ export class ContractBuilder {
|
|
|
46
46
|
next._assumption = next._assumption ? new And(next._assumption, f) : f;
|
|
47
47
|
return next;
|
|
48
48
|
}
|
|
49
|
-
/** Add
|
|
50
|
-
|
|
49
|
+
/** Add a guarantee clause (G side). Repeated calls AND-combine. */
|
|
50
|
+
guarantees(clause) {
|
|
51
51
|
const next = this._clone();
|
|
52
|
-
const f = toFormula(clause, "
|
|
53
|
-
next.
|
|
52
|
+
const f = toFormula(clause, "guarantees");
|
|
53
|
+
next._guarantee = next._guarantee ? new And(next._guarantee, f) : f;
|
|
54
54
|
return next;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* The compiled LTL formula. Accessed at `Sponsio` construction time.
|
|
58
58
|
*
|
|
59
|
-
* - If both A and
|
|
60
|
-
* the evaluator runs from ``pos=0``; a bare ``Implies(A,
|
|
59
|
+
* - If both A and G are set: ``G(A -> G_)``. We wrap in ``G`` because
|
|
60
|
+
* the evaluator runs from ``pos=0``; a bare ``Implies(A, G_)`` would
|
|
61
61
|
* short-circuit whenever ``A`` was false at step 0 regardless of
|
|
62
62
|
* later events. ``G`` lifts the implication to every step so the
|
|
63
|
-
*
|
|
64
|
-
* - If only
|
|
63
|
+
* guarantee fires whenever the assumption holds.
|
|
64
|
+
* - If only G: ``G_`` (unconditional; the pattern factories already
|
|
65
65
|
* emit safety properties wrapped in ``G`` where needed).
|
|
66
|
-
* - If neither: throws — every contract needs
|
|
66
|
+
* - If neither: throws — every contract needs a guarantee.
|
|
67
67
|
*/
|
|
68
68
|
get formula() {
|
|
69
|
-
if (!this.
|
|
70
|
-
throw new Error(`contract(${JSON.stringify(this.desc)}): .
|
|
69
|
+
if (!this._guarantee) {
|
|
70
|
+
throw new Error(`contract(${JSON.stringify(this.desc)}): .guarantees(...) is required`);
|
|
71
71
|
}
|
|
72
72
|
return this._assumption
|
|
73
|
-
? new G(new Implies(this._assumption, this.
|
|
74
|
-
: this.
|
|
73
|
+
? new G(new Implies(this._assumption, this._guarantee))
|
|
74
|
+
: this._guarantee;
|
|
75
75
|
}
|
|
76
76
|
_clone() {
|
|
77
77
|
const next = new ContractBuilder(this.desc);
|
|
78
78
|
next._assumption = this._assumption;
|
|
79
|
-
next.
|
|
79
|
+
next._guarantee = this._guarantee;
|
|
80
80
|
return next;
|
|
81
81
|
}
|
|
82
82
|
}
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAgB,MAAM,mBAAmB,CAAC;AAGlE,MAAM,OAAO,eAAe;IACjB,IAAI,CAAS;IACb,WAAW,GAAW,UAAU,CAAC;IACjC,QAAQ,GAAY,KAAK,CAAC;IAE3B,WAAW,CAAiB;IAC5B,
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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AAU,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,YAAY,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,iCAAiC,CACvE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,WAAW;YACrB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACvD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IACtB,CAAC;IAEO,MAAM;QACZ,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,SAAS,CAAC,MAA2B,EAAE,KAAa;IAC3D,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,cAAc,KAAK,KAAK,MAAM,+BAA+B,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,IAAa;IACpC,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -31,7 +31,7 @@ export interface LoadedConfig {
|
|
|
31
31
|
/**
|
|
32
32
|
* Det contracts the TS SDK can consume. NL strings get run through
|
|
33
33
|
* ``parseNl`` in the ctor; pre-built ``DetFormula`` entries (from
|
|
34
|
-
* structured patterns, raw LTL, or A/
|
|
34
|
+
* structured patterns, raw LTL, or A/G composition) are pushed
|
|
35
35
|
* straight onto the contract list — no NL parsing required.
|
|
36
36
|
*/
|
|
37
37
|
contracts: (string | DetFormula)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/core/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/core/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA+BhD,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,SAAS,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IACnC,iEAAiE;IACjE,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,yEAAyE;IACzE,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,cAAc,GAAG,kBAAkB,CAAC;IAC3E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,WAAW,GACX,WAAW,GACX,mBAAmB,GACnB,oBAAoB,GACpB,eAAe,GACf,kBAAkB,GAClB,gBAAgB,CAAC;AAErB;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,E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