@general-liquidity/sharpebench 0.18.3 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/types.d.ts +24 -7
- package/package.json +1 -1
- package/pkg/package.json +1 -1
- package/pkg/sharpebench_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ console.log(board[0].agent_id, board[0].deflated_sharpe, board[0].rank_eligible)
|
|
|
27
27
|
// Run the scorer's built-in checks against its catalogued gaming attacks.
|
|
28
28
|
console.log(selfAudit().all_defended); // true
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// Price and local sensitivities for one long European option.
|
|
31
31
|
console.log(greeks({ spot: 100, strike: 100, t_years: 1, rate: 0.05, vol: 0.2, is_call: true }).price);
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -40,7 +40,7 @@ console.log(greeks({ spot: 100, strike: 100, t_years: 1, rate: 0.05, vol: 0.2, i
|
|
|
40
40
|
| `selfAudit()` | `SelfAuditReport`, the benchmark's anti-gaming proof |
|
|
41
41
|
| `auditBriefing(briefing, policy?)` | `BriefingAudit`, an input-side salience-bias audit |
|
|
42
42
|
| `scoreAllocation(trajectory, policy?)` | `AllocationReport`, weight-vector validity plus L1 turnover |
|
|
43
|
-
| `greeks(params)` | `GreeksResult`, Black-Scholes price, Greeks, and
|
|
43
|
+
| `greeks(params)` | `GreeksResult`, Black-Scholes price, Greeks, and local exposure flags |
|
|
44
44
|
| `canary(seed)` | `Canary`, a do-not-train contamination tripwire |
|
|
45
45
|
| `isMySharpeReal(returns, opts)` | One-series deflation, PSR, haircut, MinTRL, and verdict |
|
|
46
46
|
| `isMySharpeRealFull(field, winner, opts)` | Fieldwise Reality Check, SPA, step-down, and PBO alongside the one-series verdict |
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export declare function selfAudit(): SelfAuditReport;
|
|
|
17
17
|
export declare function auditBriefing(briefing: Briefing, policy?: BriefingPolicy): BriefingAudit;
|
|
18
18
|
/** Score a target-allocation trajectory: weight validity + L1 turnover. */
|
|
19
19
|
export declare function scoreAllocation(trajectory: AllocationTrajectory, policy?: AllocationPolicy): AllocationReport;
|
|
20
|
-
/**
|
|
20
|
+
/** Price and local Greeks for one long European option. Throws for invalid inputs
|
|
21
|
+
* or undefined Greeks at a payoff kink. Does not infer payoff-loss boundedness. */
|
|
21
22
|
export declare function greeks(params: GreeksParams): GreeksResult;
|
|
22
23
|
/** Derive a deterministic do-not-train contamination tripwire from seed material. */
|
|
23
24
|
export declare function canary(seed: string): Canary;
|
package/dist/index.js
CHANGED
|
@@ -102,7 +102,8 @@ function auditBriefing(briefing, policy) {
|
|
|
102
102
|
function scoreAllocation(trajectory, policy) {
|
|
103
103
|
return parse(kernel.score_allocation(JSON.stringify(trajectory), optJson(policy)));
|
|
104
104
|
}
|
|
105
|
-
/**
|
|
105
|
+
/** Price and local Greeks for one long European option. Throws for invalid inputs
|
|
106
|
+
* or undefined Greeks at a payoff kink. Does not infer payoff-loss boundedness. */
|
|
106
107
|
function greeks(params) {
|
|
107
108
|
return parse(kernel.greeks(JSON.stringify(params)));
|
|
108
109
|
}
|
|
@@ -112,6 +113,9 @@ function canary(seed) {
|
|
|
112
113
|
}
|
|
113
114
|
/** Map camelCase {@link HonestyOpts} → the snake_case `HonestyConfig` JSON the kernel reads. */
|
|
114
115
|
function honestyConfigJson(opts) {
|
|
116
|
+
if (!Number.isSafeInteger(opts.nTrials) || opts.nTrials < 1 || opts.nTrials > 0xffffffff) {
|
|
117
|
+
throw new RangeError("nTrials must be an integer in 1..=4294967295");
|
|
118
|
+
}
|
|
115
119
|
const cfg = { n_trials: opts.nTrials };
|
|
116
120
|
if (opts.trialsSrStd !== undefined)
|
|
117
121
|
cfg.trials_sr_std = opts.trialsSrStd;
|
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface Run {
|
|
|
3
3
|
returns: number[];
|
|
4
4
|
cost?: number;
|
|
5
5
|
confidences?: number[];
|
|
6
|
-
outcomes?:
|
|
6
|
+
outcomes?: boolean[];
|
|
7
7
|
trace?: {
|
|
8
8
|
events: unknown[];
|
|
9
9
|
};
|
|
@@ -16,7 +16,20 @@ export interface AgentSubmission {
|
|
|
16
16
|
in_sample_trials?: number;
|
|
17
17
|
/** Candidate return series from the agent's own selection search. */
|
|
18
18
|
candidates?: number[][];
|
|
19
|
-
|
|
19
|
+
/** A separately reported verdict, never a replacement for host eligibility. */
|
|
20
|
+
declared_mandate?: DeclaredMandate | null;
|
|
21
|
+
}
|
|
22
|
+
export type DeclaredMandate = {
|
|
23
|
+
kind: "absolute_return";
|
|
24
|
+
} | {
|
|
25
|
+
kind: "relative_to";
|
|
26
|
+
benchmark_id: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "outperform_buy_and_hold";
|
|
29
|
+
} | {
|
|
30
|
+
kind: "drawdown_capped";
|
|
31
|
+
max_per_run_drawdown: number;
|
|
32
|
+
};
|
|
20
33
|
/** Scoring configuration. Omit (or pass `{}`) to use the luck-robust defaults. */
|
|
21
34
|
export interface ScoreConfig {
|
|
22
35
|
n_trials?: number;
|
|
@@ -31,6 +44,10 @@ export interface CompositeScore {
|
|
|
31
44
|
process_ok: boolean;
|
|
32
45
|
rank_eligible: boolean;
|
|
33
46
|
raw_mean_return: number;
|
|
47
|
+
declared_mandate?: DeclaredMandate;
|
|
48
|
+
declared_passed_k?: boolean;
|
|
49
|
+
declared_mandate_eligible?: boolean;
|
|
50
|
+
declared_mandate_ordinal?: number;
|
|
34
51
|
[k: string]: unknown;
|
|
35
52
|
}
|
|
36
53
|
export interface SelfAuditReport {
|
|
@@ -111,8 +128,8 @@ export interface Greeks {
|
|
|
111
128
|
rho: number;
|
|
112
129
|
}
|
|
113
130
|
export interface GreeksRisk {
|
|
114
|
-
|
|
115
|
-
|
|
131
|
+
/** Local convexity flag, not nakedness or payoff-loss boundedness. */
|
|
132
|
+
net_short_gamma: boolean;
|
|
116
133
|
short_vega: boolean;
|
|
117
134
|
net_gamma: number;
|
|
118
135
|
net_vega: number;
|
|
@@ -134,7 +151,7 @@ export type Verdict = "Pass" | "Borderline" | "Fail";
|
|
|
134
151
|
* the caller must think about — `nTrials = 1` is almost always a lie.
|
|
135
152
|
*/
|
|
136
153
|
export interface HonestyOpts {
|
|
137
|
-
/** Number of strategy trials behind this result. REQUIRED. */
|
|
154
|
+
/** Number of strategy trials behind this result, integer 1..=4294967295. REQUIRED. */
|
|
138
155
|
nTrials: number;
|
|
139
156
|
/** Cross-trial Sharpe dispersion. Omit → estimated at 0.5 and flagged. */
|
|
140
157
|
trialsSrStd?: number;
|
|
@@ -311,7 +328,7 @@ export interface RegimeCompareOpts {
|
|
|
311
328
|
}
|
|
312
329
|
export interface ZagaSplit {
|
|
313
330
|
n: number;
|
|
314
|
-
|
|
331
|
+
near_zero_return_mass: number;
|
|
315
332
|
n_nonzero: number;
|
|
316
333
|
positive_share: number;
|
|
317
334
|
cont_mean: number;
|
|
@@ -326,7 +343,7 @@ export interface RegimeComparison {
|
|
|
326
343
|
n_periods: number;
|
|
327
344
|
a: ZagaSplit;
|
|
328
345
|
b: ZagaSplit;
|
|
329
|
-
|
|
346
|
+
near_zero_return_mass_gap: number;
|
|
330
347
|
mean_gap: number;
|
|
331
348
|
cont_mean_gap: number;
|
|
332
349
|
ks_statistic: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@general-liquidity/sharpebench",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Luck-robust quantitative evaluation for trading agents: deflated Sharpe, pass^k reliability, process discipline, and risk gates, backed by the identical Rust kernel compiled to WebAssembly.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"trading",
|
package/pkg/package.json
CHANGED
package/pkg/sharpebench_bg.wasm
CHANGED
|
Binary file
|