@nobulex/sdk 0.1.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/dist/adapters/express.d.ts +322 -0
- package/dist/adapters/express.d.ts.map +1 -0
- package/dist/adapters/express.js +356 -0
- package/dist/adapters/express.js.map +1 -0
- package/dist/adapters/index.d.ts +15 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +15 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/langchain.d.ts +183 -0
- package/dist/adapters/langchain.d.ts.map +1 -0
- package/dist/adapters/langchain.js +203 -0
- package/dist/adapters/langchain.js.map +1 -0
- package/dist/adapters/vercel-ai.d.ts +122 -0
- package/dist/adapters/vercel-ai.d.ts.map +1 -0
- package/dist/adapters/vercel-ai.js +128 -0
- package/dist/adapters/vercel-ai.js.map +1 -0
- package/dist/benchmarks.d.ts +164 -0
- package/dist/benchmarks.d.ts.map +1 -0
- package/dist/benchmarks.js +327 -0
- package/dist/benchmarks.js.map +1 -0
- package/dist/benchmarks.test.d.ts +2 -0
- package/dist/benchmarks.test.d.ts.map +1 -0
- package/dist/benchmarks.test.js +71 -0
- package/dist/benchmarks.test.js.map +1 -0
- package/dist/conformance.d.ts +160 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +1242 -0
- package/dist/conformance.js.map +1 -0
- package/dist/events.d.ts +176 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +208 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +384 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +695 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +986 -0
- package/dist/index.test.js.map +1 -0
- package/dist/middleware.d.ts +104 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +222 -0
- package/dist/middleware.js.map +1 -0
- package/dist/middleware.test.d.ts +5 -0
- package/dist/middleware.test.d.ts.map +1 -0
- package/dist/middleware.test.js +735 -0
- package/dist/middleware.test.js.map +1 -0
- package/dist/plugins/auth.d.ts +49 -0
- package/dist/plugins/auth.d.ts.map +1 -0
- package/dist/plugins/auth.js +82 -0
- package/dist/plugins/auth.js.map +1 -0
- package/dist/plugins/cache.d.ts +40 -0
- package/dist/plugins/cache.d.ts.map +1 -0
- package/dist/plugins/cache.js +191 -0
- package/dist/plugins/cache.js.map +1 -0
- package/dist/plugins/index.d.ts +16 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +12 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/metrics-plugin.d.ts +32 -0
- package/dist/plugins/metrics-plugin.d.ts.map +1 -0
- package/dist/plugins/metrics-plugin.js +61 -0
- package/dist/plugins/metrics-plugin.js.map +1 -0
- package/dist/plugins/plugins.test.d.ts +8 -0
- package/dist/plugins/plugins.test.d.ts.map +1 -0
- package/dist/plugins/plugins.test.js +640 -0
- package/dist/plugins/plugins.test.js.map +1 -0
- package/dist/plugins/retry-plugin.d.ts +55 -0
- package/dist/plugins/retry-plugin.d.ts.map +1 -0
- package/dist/plugins/retry-plugin.js +133 -0
- package/dist/plugins/retry-plugin.js.map +1 -0
- package/dist/telemetry.d.ts +183 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +241 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/types.d.ts +200 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stele adapter for Vercel AI SDK.
|
|
3
|
+
*
|
|
4
|
+
* Wraps AI SDK tool definitions with covenant enforcement.
|
|
5
|
+
* Before a tool's `execute()` is called, the action/resource pair is
|
|
6
|
+
* evaluated against the covenant's CCL constraints. If denied, a
|
|
7
|
+
* `SteleAccessDeniedError` is thrown (or the custom `onDenied` handler
|
|
8
|
+
* is invoked). If permitted, the original `execute()` runs normally.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { SteleClient, withStele, withSteleTools } from '@nobulex/sdk';
|
|
15
|
+
*
|
|
16
|
+
* const protectedTool = withStele(myTool, { client, covenant });
|
|
17
|
+
* const protectedTools = withSteleTools({ search, browse }, { client, covenant });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
// ─── Error ───────────────────────────────────────────────────────────────────
|
|
21
|
+
/**
|
|
22
|
+
* Error thrown when a tool call is denied by a Stele covenant.
|
|
23
|
+
*
|
|
24
|
+
* Carries the full `EvaluationResult` so callers can inspect the
|
|
25
|
+
* matched rule, severity, and reason for the denial.
|
|
26
|
+
*/
|
|
27
|
+
export class SteleAccessDeniedError extends Error {
|
|
28
|
+
/** The evaluation result that triggered the denial. */
|
|
29
|
+
evaluationResult;
|
|
30
|
+
constructor(message, result) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.name = 'SteleAccessDeniedError';
|
|
33
|
+
this.evaluationResult = result;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// ─── withStele ───────────────────────────────────────────────────────────────
|
|
37
|
+
/**
|
|
38
|
+
* Wrap a single Vercel AI SDK tool with Stele covenant enforcement.
|
|
39
|
+
*
|
|
40
|
+
* Returns a new tool object whose `execute()` evaluates the
|
|
41
|
+
* action/resource against the covenant before delegating to the
|
|
42
|
+
* original implementation.
|
|
43
|
+
*
|
|
44
|
+
* @param tool - The tool to wrap.
|
|
45
|
+
* @param options - Enforcement options including client and covenant.
|
|
46
|
+
* @returns A new tool with a guarded `execute()` method.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const protectedTool = withStele(myTool, { client, covenant });
|
|
51
|
+
* await protectedTool.execute('arg1'); // throws if denied
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export function withStele(tool, options) {
|
|
55
|
+
const { client, covenant, actionFromTool, resourceFromTool, onDenied } = options;
|
|
56
|
+
const originalExecute = tool.execute;
|
|
57
|
+
if (!originalExecute) {
|
|
58
|
+
return { ...tool };
|
|
59
|
+
}
|
|
60
|
+
const wrapped = { ...tool };
|
|
61
|
+
wrapped.execute = async (...args) => {
|
|
62
|
+
const action = actionFromTool
|
|
63
|
+
? actionFromTool(tool, args)
|
|
64
|
+
: (tool.name ?? 'execute');
|
|
65
|
+
const resource = resourceFromTool
|
|
66
|
+
? resourceFromTool(tool, args)
|
|
67
|
+
: ('/' + (tool.name ?? 'unknown'));
|
|
68
|
+
const result = await client.evaluateAction(covenant, action, resource);
|
|
69
|
+
if (!result.permitted) {
|
|
70
|
+
if (onDenied) {
|
|
71
|
+
return onDenied(tool, result);
|
|
72
|
+
}
|
|
73
|
+
throw new SteleAccessDeniedError(`Action '${action}' on resource '${resource}' denied by covenant`, result);
|
|
74
|
+
}
|
|
75
|
+
return originalExecute.apply(tool, args);
|
|
76
|
+
};
|
|
77
|
+
return wrapped;
|
|
78
|
+
}
|
|
79
|
+
export function withSteleTools(tools, options) {
|
|
80
|
+
if (Array.isArray(tools)) {
|
|
81
|
+
return tools.map((tool) => withStele(tool, options));
|
|
82
|
+
}
|
|
83
|
+
const wrapped = {};
|
|
84
|
+
for (const [key, tool] of Object.entries(tools)) {
|
|
85
|
+
wrapped[key] = withStele(tool, options);
|
|
86
|
+
}
|
|
87
|
+
return wrapped;
|
|
88
|
+
}
|
|
89
|
+
// ─── createToolGuard ─────────────────────────────────────────────────────────
|
|
90
|
+
/**
|
|
91
|
+
* Create a reusable guard function that enforces a covenant on any tool call.
|
|
92
|
+
*
|
|
93
|
+
* Unlike `withStele` which returns a new tool, `createToolGuard` returns a
|
|
94
|
+
* function you call manually, passing the tool and arguments each time.
|
|
95
|
+
*
|
|
96
|
+
* @param options - Enforcement options.
|
|
97
|
+
* @returns An async function `(tool, ...args) => Promise<unknown>` that
|
|
98
|
+
* evaluates the covenant and delegates to `tool.execute()`.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const guard = createToolGuard({ client, covenant });
|
|
103
|
+
* const result = await guard(myTool, 'arg1', 'arg2');
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export function createToolGuard(options) {
|
|
107
|
+
const { client, covenant, actionFromTool, resourceFromTool, onDenied } = options;
|
|
108
|
+
return async (tool, ...args) => {
|
|
109
|
+
const action = actionFromTool
|
|
110
|
+
? actionFromTool(tool, args)
|
|
111
|
+
: (tool.name ?? 'execute');
|
|
112
|
+
const resource = resourceFromTool
|
|
113
|
+
? resourceFromTool(tool, args)
|
|
114
|
+
: ('/' + (tool.name ?? 'unknown'));
|
|
115
|
+
const result = await client.evaluateAction(covenant, action, resource);
|
|
116
|
+
if (!result.permitted) {
|
|
117
|
+
if (onDenied) {
|
|
118
|
+
return onDenied(tool, result);
|
|
119
|
+
}
|
|
120
|
+
throw new SteleAccessDeniedError(`Action '${action}' on resource '${resource}' denied by covenant`, result);
|
|
121
|
+
}
|
|
122
|
+
if (!tool.execute) {
|
|
123
|
+
throw new Error(`Tool '${tool.name ?? 'unknown'}' has no execute method`);
|
|
124
|
+
}
|
|
125
|
+
return tool.execute(...args);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=vercel-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel-ai.js","sourceRoot":"","sources":["../../src/adapters/vercel-ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,uDAAuD;IAC9C,gBAAgB,CAAmB;IAE5C,YAAY,OAAe,EAAE,MAAwB;QACnD,KAAK,CAAC,OAAO,CAAC,C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,CAAC;QAErC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACtB,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAChC,CAAC;YACD,MAAM,IAAI,sBAAsB,CAC9B,WAAW,MAAM,kBAAkB,QAAQ,sBAAsB,EACjE,MAAM,CACP,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,IAAI,SAAS,yBAAyB,CAAC,CAAC;QAC5E,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nobulex/sdk -- Performance benchmark suite with SLA targets.
|
|
3
|
+
*
|
|
4
|
+
* Defines production-quality SLA targets for all critical protocol operations
|
|
5
|
+
* and provides a benchmark runner that validates them. This proves the protocol
|
|
6
|
+
* is fast enough for real-world use.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
/** Performance SLA target definition. */
|
|
11
|
+
export interface SLATarget {
|
|
12
|
+
/** p99 latency in the specified unit. */
|
|
13
|
+
readonly p99: number;
|
|
14
|
+
/** Unit of measurement (always 'ms'). */
|
|
15
|
+
readonly unit: 'ms';
|
|
16
|
+
/** Human-readable description of the operation. */
|
|
17
|
+
readonly description: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Production SLA targets for all critical Stele protocol operations.
|
|
21
|
+
*
|
|
22
|
+
* These targets are conservative and should be met by any modern machine.
|
|
23
|
+
* All latencies are p99 in milliseconds.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PERFORMANCE_SLAS: {
|
|
26
|
+
readonly 'crypto.generateKeyPair': {
|
|
27
|
+
readonly p99: 10;
|
|
28
|
+
readonly unit: "ms";
|
|
29
|
+
readonly description: "Ed25519 key generation";
|
|
30
|
+
};
|
|
31
|
+
readonly 'crypto.sign': {
|
|
32
|
+
readonly p99: 10;
|
|
33
|
+
readonly unit: "ms";
|
|
34
|
+
readonly description: "Ed25519 signing";
|
|
35
|
+
};
|
|
36
|
+
readonly 'crypto.verify': {
|
|
37
|
+
readonly p99: 10;
|
|
38
|
+
readonly unit: "ms";
|
|
39
|
+
readonly description: "Ed25519 verification";
|
|
40
|
+
};
|
|
41
|
+
readonly 'crypto.sha256': {
|
|
42
|
+
readonly p99: 2;
|
|
43
|
+
readonly unit: "ms";
|
|
44
|
+
readonly description: "SHA-256 hashing (1KB)";
|
|
45
|
+
};
|
|
46
|
+
readonly 'ccl.parse': {
|
|
47
|
+
readonly p99: 10;
|
|
48
|
+
readonly unit: "ms";
|
|
49
|
+
readonly description: "CCL parsing (10 rules)";
|
|
50
|
+
};
|
|
51
|
+
readonly 'ccl.evaluate': {
|
|
52
|
+
readonly p99: 2;
|
|
53
|
+
readonly unit: "ms";
|
|
54
|
+
readonly description: "CCL evaluation";
|
|
55
|
+
};
|
|
56
|
+
readonly 'covenant.build': {
|
|
57
|
+
readonly p99: 25;
|
|
58
|
+
readonly unit: "ms";
|
|
59
|
+
readonly description: "Build + sign covenant";
|
|
60
|
+
};
|
|
61
|
+
readonly 'covenant.verify': {
|
|
62
|
+
readonly p99: 15;
|
|
63
|
+
readonly unit: "ms";
|
|
64
|
+
readonly description: "Full 11-check verification";
|
|
65
|
+
};
|
|
66
|
+
readonly 'store.put': {
|
|
67
|
+
readonly p99: 2;
|
|
68
|
+
readonly unit: "ms";
|
|
69
|
+
readonly description: "MemoryStore put";
|
|
70
|
+
};
|
|
71
|
+
readonly 'store.get': {
|
|
72
|
+
readonly p99: 1;
|
|
73
|
+
readonly unit: "ms";
|
|
74
|
+
readonly description: "MemoryStore get";
|
|
75
|
+
};
|
|
76
|
+
readonly 'store.list_1000': {
|
|
77
|
+
readonly p99: 100;
|
|
78
|
+
readonly unit: "ms";
|
|
79
|
+
readonly description: "MemoryStore list with 1000 docs";
|
|
80
|
+
};
|
|
81
|
+
readonly 'sdk.evaluateAction': {
|
|
82
|
+
readonly p99: 15;
|
|
83
|
+
readonly unit: "ms";
|
|
84
|
+
readonly description: "Full SDK evaluate pipeline";
|
|
85
|
+
};
|
|
86
|
+
readonly 'negotiation.handshake': {
|
|
87
|
+
readonly p99: 100;
|
|
88
|
+
readonly unit: "ms";
|
|
89
|
+
readonly description: "Two-party covenant negotiation";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/** All SLA operation names. */
|
|
93
|
+
export type SLAOperationName = keyof typeof PERFORMANCE_SLAS;
|
|
94
|
+
/** Result from a single benchmark run. */
|
|
95
|
+
export interface BenchmarkResult {
|
|
96
|
+
/** Benchmark name (matches a key in PERFORMANCE_SLAS). */
|
|
97
|
+
name: string;
|
|
98
|
+
/** Number of timed iterations (excludes warmup). */
|
|
99
|
+
iterations: number;
|
|
100
|
+
/** 50th percentile latency in ms. */
|
|
101
|
+
p50: number;
|
|
102
|
+
/** 95th percentile latency in ms. */
|
|
103
|
+
p95: number;
|
|
104
|
+
/** 99th percentile latency in ms. */
|
|
105
|
+
p99: number;
|
|
106
|
+
/** Minimum observed latency in ms. */
|
|
107
|
+
min: number;
|
|
108
|
+
/** Maximum observed latency in ms. */
|
|
109
|
+
max: number;
|
|
110
|
+
/** Arithmetic mean latency in ms. */
|
|
111
|
+
mean: number;
|
|
112
|
+
/** The p99 SLA target in ms. */
|
|
113
|
+
slaTarget: number;
|
|
114
|
+
/** Whether the p99 latency met the SLA target. */
|
|
115
|
+
slaPassed: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** Result from running the full benchmark suite. */
|
|
118
|
+
export interface BenchmarkSuiteResult {
|
|
119
|
+
/** Per-benchmark results. */
|
|
120
|
+
results: BenchmarkResult[];
|
|
121
|
+
/** True if every SLA target was met. */
|
|
122
|
+
allPassed: boolean;
|
|
123
|
+
/** Total wall-clock duration of the suite in ms. */
|
|
124
|
+
totalDuration: number;
|
|
125
|
+
/** ISO 8601 timestamp of the run. */
|
|
126
|
+
timestamp: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Run a benchmark for a given function.
|
|
130
|
+
*
|
|
131
|
+
* 1. Runs warmup iterations (10% of total, minimum 5).
|
|
132
|
+
* 2. Runs the specified number of timed iterations (default 1000).
|
|
133
|
+
* 3. Records each duration using performance.now() or Date.now() fallback.
|
|
134
|
+
* 4. Computes percentiles (p50, p95, p99), min, max, and mean.
|
|
135
|
+
* 5. Checks against the SLA target if the benchmark name matches a known SLA.
|
|
136
|
+
*
|
|
137
|
+
* @param name - Benchmark name (used for SLA lookup).
|
|
138
|
+
* @param fn - The function to benchmark. May be sync or async.
|
|
139
|
+
* @param iterations - Number of timed iterations (default 1000).
|
|
140
|
+
* @returns Full benchmark result with statistics and SLA pass/fail.
|
|
141
|
+
*/
|
|
142
|
+
export declare function benchmark(name: string, fn: () => Promise<void> | void, iterations?: number): Promise<BenchmarkResult>;
|
|
143
|
+
/**
|
|
144
|
+
* Run the full benchmark suite against all defined SLA targets.
|
|
145
|
+
*
|
|
146
|
+
* Executes real protocol operations (key generation, signing, verification,
|
|
147
|
+
* CCL parsing/evaluation, covenant build/verify, store operations, and SDK
|
|
148
|
+
* evaluate pipeline) and checks each against its SLA target.
|
|
149
|
+
*
|
|
150
|
+
* @returns Full suite results including per-benchmark details and overall pass/fail.
|
|
151
|
+
*/
|
|
152
|
+
export declare function runBenchmarkSuite(): Promise<BenchmarkSuiteResult>;
|
|
153
|
+
/**
|
|
154
|
+
* Format benchmark results as a human-readable ASCII table.
|
|
155
|
+
*
|
|
156
|
+
* Shows each benchmark name, p50/p95/p99 latencies, SLA target,
|
|
157
|
+
* and PASS/FAIL status. Includes a summary footer with total
|
|
158
|
+
* duration and overall pass/fail.
|
|
159
|
+
*
|
|
160
|
+
* @param results - The benchmark suite results to format.
|
|
161
|
+
* @returns A multi-line string suitable for console output.
|
|
162
|
+
*/
|
|
163
|
+
export declare function formatBenchmarkResults(results: BenchmarkSuiteResult): string;
|
|
164
|
+
//# sourceMappingURL=benchmarks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmarks.d.ts","sourceRoot":"","sources":["../src/benchmarks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,yCAAyC;AACzC,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcnB,CAAC;AAEX,+BAA+B;AAC/B,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAI7D,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACnC,6BAA6B;IAC7B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB;AA4BD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAC9B,UAAU,GAAE,MAAa,GACxB,OAAO,CAAC,eAAe,CAAC,CA6C1B;AASD;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CA0KvE;AAID;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA4C5E"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nobulex/sdk -- Performance benchmark suite with SLA targets.
|
|
3
|
+
*
|
|
4
|
+
* Defines production-quality SLA targets for all critical protocol operations
|
|
5
|
+
* and provides a benchmark runner that validates them. This proves the protocol
|
|
6
|
+
* is fast enough for real-world use.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import { generateKeyPair, sign, verify, sha256 } from '@nobulex/crypto';
|
|
11
|
+
import { buildCovenant, verifyCovenant } from '@nobulex/core';
|
|
12
|
+
import { parse as cclParse, evaluate as cclEvaluate } from '@nobulex/ccl';
|
|
13
|
+
import { MemoryStore } from '@nobulex/store';
|
|
14
|
+
import { SteleClient } from './index.js';
|
|
15
|
+
import { initiate as negotiationInitiate, propose as negotiationPropose, agree as negotiationAgree, evaluate as negotiationEvaluate, } from '@nobulex/negotiation';
|
|
16
|
+
/**
|
|
17
|
+
* Production SLA targets for all critical Stele protocol operations.
|
|
18
|
+
*
|
|
19
|
+
* These targets are conservative and should be met by any modern machine.
|
|
20
|
+
* All latencies are p99 in milliseconds.
|
|
21
|
+
*/
|
|
22
|
+
export const PERFORMANCE_SLAS = {
|
|
23
|
+
'crypto.generateKeyPair': { p99: 10, unit: 'ms', description: 'Ed25519 key generation' },
|
|
24
|
+
'crypto.sign': { p99: 10, unit: 'ms', description: 'Ed25519 signing' },
|
|
25
|
+
'crypto.verify': { p99: 10, unit: 'ms', description: 'Ed25519 verification' },
|
|
26
|
+
'crypto.sha256': { p99: 2, unit: 'ms', description: 'SHA-256 hashing (1KB)' },
|
|
27
|
+
'ccl.parse': { p99: 10, unit: 'ms', description: 'CCL parsing (10 rules)' },
|
|
28
|
+
'ccl.evaluate': { p99: 2, unit: 'ms', description: 'CCL evaluation' },
|
|
29
|
+
'covenant.build': { p99: 25, unit: 'ms', description: 'Build + sign covenant' },
|
|
30
|
+
'covenant.verify': { p99: 15, unit: 'ms', description: 'Full 11-check verification' },
|
|
31
|
+
'store.put': { p99: 2, unit: 'ms', description: 'MemoryStore put' },
|
|
32
|
+
'store.get': { p99: 1, unit: 'ms', description: 'MemoryStore get' },
|
|
33
|
+
'store.list_1000': { p99: 100, unit: 'ms', description: 'MemoryStore list with 1000 docs' },
|
|
34
|
+
'sdk.evaluateAction': { p99: 15, unit: 'ms', description: 'Full SDK evaluate pipeline' },
|
|
35
|
+
'negotiation.handshake': { p99: 100, unit: 'ms', description: 'Two-party covenant negotiation' },
|
|
36
|
+
};
|
|
37
|
+
// ─── Timing utility ─────────────────────────────────────────────────────────
|
|
38
|
+
/** Get current time in ms with sub-ms precision when available. */
|
|
39
|
+
function now() {
|
|
40
|
+
try {
|
|
41
|
+
// performance.now() provides sub-ms precision
|
|
42
|
+
return performance.now();
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return Date.now();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// ─── Percentile computation ─────────────────────────────────────────────────
|
|
49
|
+
/**
|
|
50
|
+
* Compute the value at a given percentile from a sorted array.
|
|
51
|
+
* Uses nearest-rank method.
|
|
52
|
+
*/
|
|
53
|
+
function percentile(sorted, p) {
|
|
54
|
+
if (sorted.length === 0)
|
|
55
|
+
return 0;
|
|
56
|
+
const idx = Math.ceil((p / 100) * sorted.length) - 1;
|
|
57
|
+
return sorted[Math.max(0, idx)];
|
|
58
|
+
}
|
|
59
|
+
// ─── Core benchmark function ────────────────────────────────────────────────
|
|
60
|
+
/**
|
|
61
|
+
* Run a benchmark for a given function.
|
|
62
|
+
*
|
|
63
|
+
* 1. Runs warmup iterations (10% of total, minimum 5).
|
|
64
|
+
* 2. Runs the specified number of timed iterations (default 1000).
|
|
65
|
+
* 3. Records each duration using performance.now() or Date.now() fallback.
|
|
66
|
+
* 4. Computes percentiles (p50, p95, p99), min, max, and mean.
|
|
67
|
+
* 5. Checks against the SLA target if the benchmark name matches a known SLA.
|
|
68
|
+
*
|
|
69
|
+
* @param name - Benchmark name (used for SLA lookup).
|
|
70
|
+
* @param fn - The function to benchmark. May be sync or async.
|
|
71
|
+
* @param iterations - Number of timed iterations (default 1000).
|
|
72
|
+
* @returns Full benchmark result with statistics and SLA pass/fail.
|
|
73
|
+
*/
|
|
74
|
+
export async function benchmark(name, fn, iterations = 1000) {
|
|
75
|
+
// Warmup: 10% of iterations, minimum 5
|
|
76
|
+
const warmupCount = Math.max(5, Math.floor(iterations * 0.1));
|
|
77
|
+
for (let i = 0; i < warmupCount; i++) {
|
|
78
|
+
await fn();
|
|
79
|
+
}
|
|
80
|
+
// Timed iterations
|
|
81
|
+
const durations = new Array(iterations);
|
|
82
|
+
for (let i = 0; i < iterations; i++) {
|
|
83
|
+
const start = now();
|
|
84
|
+
await fn();
|
|
85
|
+
const end = now();
|
|
86
|
+
durations[i] = end - start;
|
|
87
|
+
}
|
|
88
|
+
// Sort for percentile computation
|
|
89
|
+
const sorted = durations.slice().sort((a, b) => a - b);
|
|
90
|
+
const p50 = percentile(sorted, 50);
|
|
91
|
+
const p95 = percentile(sorted, 95);
|
|
92
|
+
const p99 = percentile(sorted, 99);
|
|
93
|
+
const min = sorted[0];
|
|
94
|
+
const max = sorted[sorted.length - 1];
|
|
95
|
+
const mean = durations.reduce((sum, d) => sum + d, 0) / durations.length;
|
|
96
|
+
// Look up SLA target
|
|
97
|
+
const sla = PERFORMANCE_SLAS[name];
|
|
98
|
+
const slaTarget = sla ? sla.p99 : Infinity;
|
|
99
|
+
const slaPassed = p99 <= slaTarget;
|
|
100
|
+
return {
|
|
101
|
+
name,
|
|
102
|
+
iterations,
|
|
103
|
+
p50: round(p50),
|
|
104
|
+
p95: round(p95),
|
|
105
|
+
p99: round(p99),
|
|
106
|
+
min: round(min),
|
|
107
|
+
max: round(max),
|
|
108
|
+
mean: round(mean),
|
|
109
|
+
slaTarget,
|
|
110
|
+
slaPassed,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Round to 3 decimal places for readable output. */
|
|
114
|
+
function round(n) {
|
|
115
|
+
return Math.round(n * 1000) / 1000;
|
|
116
|
+
}
|
|
117
|
+
// ─── Benchmark suite ────────────────────────────────────────────────────────
|
|
118
|
+
/**
|
|
119
|
+
* Run the full benchmark suite against all defined SLA targets.
|
|
120
|
+
*
|
|
121
|
+
* Executes real protocol operations (key generation, signing, verification,
|
|
122
|
+
* CCL parsing/evaluation, covenant build/verify, store operations, and SDK
|
|
123
|
+
* evaluate pipeline) and checks each against its SLA target.
|
|
124
|
+
*
|
|
125
|
+
* @returns Full suite results including per-benchmark details and overall pass/fail.
|
|
126
|
+
*/
|
|
127
|
+
export async function runBenchmarkSuite() {
|
|
128
|
+
const suiteStart = now();
|
|
129
|
+
const results = [];
|
|
130
|
+
// ── Shared fixtures ──────────────────────────────────────────────────────
|
|
131
|
+
// Pre-generate keys for benchmarks that need them
|
|
132
|
+
const kp = await generateKeyPair();
|
|
133
|
+
const kp2 = await generateKeyPair();
|
|
134
|
+
const message = new TextEncoder().encode('benchmark payload for Stele protocol');
|
|
135
|
+
const signature = await sign(message, kp.privateKey);
|
|
136
|
+
const oneKBData = new Uint8Array(1024);
|
|
137
|
+
for (let i = 0; i < 1024; i++)
|
|
138
|
+
oneKBData[i] = i & 0xff;
|
|
139
|
+
const cclSource10Rules = [
|
|
140
|
+
"permit read on '/data/**'",
|
|
141
|
+
"permit write on '/data/public/**'",
|
|
142
|
+
"deny write on '/data/system/**'",
|
|
143
|
+
"deny delete on '/data/**'",
|
|
144
|
+
"permit read on '/api/**'",
|
|
145
|
+
"deny write on '/api/admin/**'",
|
|
146
|
+
"permit execute on '/scripts/**'",
|
|
147
|
+
"deny execute on '/scripts/dangerous/**'",
|
|
148
|
+
"permit read on '/config/**'",
|
|
149
|
+
"deny write on '/config/**'",
|
|
150
|
+
].join('\n');
|
|
151
|
+
const cclDoc = cclParse(cclSource10Rules);
|
|
152
|
+
const issuer = { id: 'bench-issuer', publicKey: kp.publicKeyHex, role: 'issuer' };
|
|
153
|
+
const beneficiary = { id: 'bench-beneficiary', publicKey: kp2.publicKeyHex, role: 'beneficiary' };
|
|
154
|
+
const constraints = "permit read on '/data/**'\ndeny write on '/system/**'";
|
|
155
|
+
// Build a covenant once for verify and evaluate benchmarks
|
|
156
|
+
const covenantDoc = await buildCovenant({
|
|
157
|
+
issuer,
|
|
158
|
+
beneficiary,
|
|
159
|
+
constraints,
|
|
160
|
+
privateKey: kp.privateKey,
|
|
161
|
+
});
|
|
162
|
+
// Pre-populate a store with 1000 documents for the list benchmark
|
|
163
|
+
const store = new MemoryStore();
|
|
164
|
+
const storeDocs = [];
|
|
165
|
+
for (let i = 0; i < 1000; i++) {
|
|
166
|
+
const doc = await buildCovenant({
|
|
167
|
+
issuer,
|
|
168
|
+
beneficiary,
|
|
169
|
+
constraints: `permit read on '/data/item${i}/**'`,
|
|
170
|
+
privateKey: kp.privateKey,
|
|
171
|
+
});
|
|
172
|
+
storeDocs.push(doc);
|
|
173
|
+
await store.put(doc);
|
|
174
|
+
}
|
|
175
|
+
// SDK client for evaluateAction benchmark
|
|
176
|
+
const client = new SteleClient({ keyPair: kp });
|
|
177
|
+
// ── Benchmarks ───────────────────────────────────────────────────────────
|
|
178
|
+
// Use fewer iterations for expensive operations to keep total time reasonable
|
|
179
|
+
const FAST_ITERS = 1000;
|
|
180
|
+
const MEDIUM_ITERS = 200;
|
|
181
|
+
const SLOW_ITERS = 50;
|
|
182
|
+
// crypto.generateKeyPair
|
|
183
|
+
results.push(await benchmark('crypto.generateKeyPair', async () => {
|
|
184
|
+
await generateKeyPair();
|
|
185
|
+
}, MEDIUM_ITERS));
|
|
186
|
+
// crypto.sign
|
|
187
|
+
results.push(await benchmark('crypto.sign', async () => {
|
|
188
|
+
await sign(message, kp.privateKey);
|
|
189
|
+
}, MEDIUM_ITERS));
|
|
190
|
+
// crypto.verify
|
|
191
|
+
results.push(await benchmark('crypto.verify', async () => {
|
|
192
|
+
await verify(message, signature, kp.publicKey);
|
|
193
|
+
}, MEDIUM_ITERS));
|
|
194
|
+
// crypto.sha256
|
|
195
|
+
results.push(await benchmark('crypto.sha256', () => {
|
|
196
|
+
sha256(oneKBData);
|
|
197
|
+
}, FAST_ITERS));
|
|
198
|
+
// ccl.parse
|
|
199
|
+
results.push(await benchmark('ccl.parse', () => {
|
|
200
|
+
cclParse(cclSource10Rules);
|
|
201
|
+
}, FAST_ITERS));
|
|
202
|
+
// ccl.evaluate
|
|
203
|
+
results.push(await benchmark('ccl.evaluate', () => {
|
|
204
|
+
cclEvaluate(cclDoc, 'read', '/data/users');
|
|
205
|
+
}, FAST_ITERS));
|
|
206
|
+
// covenant.build
|
|
207
|
+
results.push(await benchmark('covenant.build', async () => {
|
|
208
|
+
await buildCovenant({
|
|
209
|
+
issuer,
|
|
210
|
+
beneficiary,
|
|
211
|
+
constraints,
|
|
212
|
+
privateKey: kp.privateKey,
|
|
213
|
+
});
|
|
214
|
+
}, MEDIUM_ITERS));
|
|
215
|
+
// covenant.verify
|
|
216
|
+
results.push(await benchmark('covenant.verify', async () => {
|
|
217
|
+
await verifyCovenant(covenantDoc);
|
|
218
|
+
}, MEDIUM_ITERS));
|
|
219
|
+
// store.put
|
|
220
|
+
results.push(await benchmark('store.put', async () => {
|
|
221
|
+
await store.put(covenantDoc);
|
|
222
|
+
}, FAST_ITERS));
|
|
223
|
+
// store.get
|
|
224
|
+
results.push(await benchmark('store.get', async () => {
|
|
225
|
+
await store.get(covenantDoc.id);
|
|
226
|
+
}, FAST_ITERS));
|
|
227
|
+
// store.list_1000
|
|
228
|
+
results.push(await benchmark('store.list_1000', async () => {
|
|
229
|
+
await store.list();
|
|
230
|
+
}, SLOW_ITERS));
|
|
231
|
+
// sdk.evaluateAction
|
|
232
|
+
results.push(await benchmark('sdk.evaluateAction', async () => {
|
|
233
|
+
await client.evaluateAction(covenantDoc, 'read', '/data/users');
|
|
234
|
+
}, MEDIUM_ITERS));
|
|
235
|
+
// negotiation.handshake (full two-party initiate -> propose -> evaluate -> agree cycle)
|
|
236
|
+
results.push(await benchmark('negotiation.handshake', () => {
|
|
237
|
+
const policyA = {
|
|
238
|
+
requiredConstraints: ['deny:exfiltrate-data', 'require:audit-log'],
|
|
239
|
+
preferredConstraints: ['permit:read-public'],
|
|
240
|
+
dealbreakers: ['permit:delete-all'],
|
|
241
|
+
maxRounds: 10,
|
|
242
|
+
timeoutMs: 30000,
|
|
243
|
+
};
|
|
244
|
+
// Initiate session
|
|
245
|
+
let session = negotiationInitiate('alice', 'bob', policyA);
|
|
246
|
+
// Bob counter-proposes
|
|
247
|
+
const counterProposal = {
|
|
248
|
+
from: 'bob',
|
|
249
|
+
constraints: ['deny:exfiltrate-data', 'require:audit-log', 'permit:read-public', 'require:encryption'],
|
|
250
|
+
requirements: ['deny:exfiltrate-data', 'require:encryption'],
|
|
251
|
+
timestamp: Date.now(),
|
|
252
|
+
};
|
|
253
|
+
session = negotiationPropose(session, counterProposal);
|
|
254
|
+
// Alice evaluates Bob's proposal
|
|
255
|
+
negotiationEvaluate(counterProposal, policyA);
|
|
256
|
+
// Reach agreement
|
|
257
|
+
negotiationAgree(session);
|
|
258
|
+
}, MEDIUM_ITERS));
|
|
259
|
+
// ── Aggregate ────────────────────────────────────────────────────────────
|
|
260
|
+
const suiteEnd = now();
|
|
261
|
+
const allPassed = results.every((r) => r.slaPassed);
|
|
262
|
+
return {
|
|
263
|
+
results,
|
|
264
|
+
allPassed,
|
|
265
|
+
totalDuration: round(suiteEnd - suiteStart),
|
|
266
|
+
timestamp: new Date().toISOString(),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
// ─── Formatting ─────────────────────────────────────────────────────────────
|
|
270
|
+
/**
|
|
271
|
+
* Format benchmark results as a human-readable ASCII table.
|
|
272
|
+
*
|
|
273
|
+
* Shows each benchmark name, p50/p95/p99 latencies, SLA target,
|
|
274
|
+
* and PASS/FAIL status. Includes a summary footer with total
|
|
275
|
+
* duration and overall pass/fail.
|
|
276
|
+
*
|
|
277
|
+
* @param results - The benchmark suite results to format.
|
|
278
|
+
* @returns A multi-line string suitable for console output.
|
|
279
|
+
*/
|
|
280
|
+
export function formatBenchmarkResults(results) {
|
|
281
|
+
const lines = [];
|
|
282
|
+
// Header
|
|
283
|
+
const sep = '+' + '-'.repeat(32) + '+' + '-'.repeat(10) + '+' + '-'.repeat(10) + '+' + '-'.repeat(10) + '+' + '-'.repeat(10) + '+' + '-'.repeat(8) + '+';
|
|
284
|
+
lines.push('');
|
|
285
|
+
lines.push(' Stele Performance Benchmark Suite');
|
|
286
|
+
lines.push(' ' + results.timestamp);
|
|
287
|
+
lines.push('');
|
|
288
|
+
lines.push(sep);
|
|
289
|
+
lines.push('| ' + 'Operation'.padEnd(30) + ' | ' +
|
|
290
|
+
'p50'.padStart(8) + ' | ' +
|
|
291
|
+
'p95'.padStart(8) + ' | ' +
|
|
292
|
+
'p99'.padStart(8) + ' | ' +
|
|
293
|
+
'SLA'.padStart(8) + ' | ' +
|
|
294
|
+
'Status'.padEnd(6) + ' |');
|
|
295
|
+
lines.push(sep);
|
|
296
|
+
for (const r of results.results) {
|
|
297
|
+
const status = r.slaPassed ? 'PASS' : 'FAIL';
|
|
298
|
+
lines.push('| ' + r.name.padEnd(30) + ' | ' +
|
|
299
|
+
fmtMs(r.p50).padStart(8) + ' | ' +
|
|
300
|
+
fmtMs(r.p95).padStart(8) + ' | ' +
|
|
301
|
+
fmtMs(r.p99).padStart(8) + ' | ' +
|
|
302
|
+
fmtMs(r.slaTarget).padStart(8) + ' | ' +
|
|
303
|
+
status.padEnd(6) + ' |');
|
|
304
|
+
}
|
|
305
|
+
lines.push(sep);
|
|
306
|
+
// Summary
|
|
307
|
+
const passCount = results.results.filter((r) => r.slaPassed).length;
|
|
308
|
+
const totalCount = results.results.length;
|
|
309
|
+
const overallStatus = results.allPassed ? 'ALL PASSED' : 'SOME FAILED';
|
|
310
|
+
lines.push('');
|
|
311
|
+
lines.push(` ${passCount}/${totalCount} SLAs met | Total: ${fmtMs(results.totalDuration)} | ${overallStatus}`);
|
|
312
|
+
lines.push('');
|
|
313
|
+
return lines.join('\n');
|
|
314
|
+
}
|
|
315
|
+
/** Format a millisecond value with unit suffix. */
|
|
316
|
+
function fmtMs(ms) {
|
|
317
|
+
if (ms === Infinity)
|
|
318
|
+
return ' N/A';
|
|
319
|
+
if (ms < 1)
|
|
320
|
+
return ms.toFixed(3) + 'ms';
|
|
321
|
+
if (ms < 10)
|
|
322
|
+
return ms.toFixed(2) + 'ms';
|
|
323
|
+
if (ms < 100)
|
|
324
|
+
return ms.toFixed(1) + 'ms';
|
|
325
|
+
return ms.toFixed(0) + 'ms';
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=benchmarks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmarks.js","sourceRoot":"","sources":["../src/benchmarks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,e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