@tangle-network/traces 0.11.2 → 0.11.3

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/cli.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  buildPolicyEvidenceRecord,
8
8
  buildSessionIndexFromRows,
9
9
  cmdReplayVerify,
10
+ cmdReplayVerifyBatch,
10
11
  collectSessionSelection,
11
12
  commandAnalyzer,
12
13
  commandRedactor,
@@ -53,7 +54,7 @@ import {
53
54
  writePolicyEvidenceFile,
54
55
  writeSessionIndexFile,
55
56
  writeTraceEvidenceExportFile
56
- } from "./chunk-UY3M7XUF.js";
57
+ } from "./chunk-CK5F5TWO.js";
57
58
 
58
59
  // src/cli.ts
59
60
  import { readFileSync } from "fs";
@@ -1273,6 +1274,9 @@ Commands:
1273
1274
  replay-verify
1274
1275
  Replay a trajectory prefix in a sandbox, execute step k both recorded
1275
1276
  and corrected, and emit an executed-proof verdict (--help for flags)
1277
+ replay-verify-batch
1278
+ Measure replayability + fix-flip rates across gold-labeled corpora:
1279
+ arm A per replayable case, LLM-generated arm-B fixes (--help for flags)
1276
1280
  evidence Emit compact session-evidence JSONL for downstream policy miners
1277
1281
  stream Emit JSONL trace stream events for live visualizers or replay
1278
1282
  watch Online observer: tail active sessions, notify on loops + semantic findings
@@ -1357,6 +1361,10 @@ async function main() {
1357
1361
  await cmdReplayVerify(rawArgs.slice(1));
1358
1362
  return;
1359
1363
  }
1364
+ if (rawArgs[0] === "replay-verify-batch") {
1365
+ await cmdReplayVerifyBatch(rawArgs.slice(1));
1366
+ return;
1367
+ }
1360
1368
  const parsedArgs = parseArgs(rawArgs);
1361
1369
  if (parsedArgs.help) {
1362
1370
  if (parsedArgs.command === "import-codetracebench" || parsedArgs.command === "help" && parsedArgs.input === "import-codetracebench") usageImportCodeTraceBench();
package/dist/index.d.ts CHANGED
@@ -3318,6 +3318,434 @@ declare function parseReplayVerifyArgs(argv: readonly string[]): ReplayVerifyCli
3318
3318
  declare function replayVerifyUsage(): string;
3319
3319
  declare function cmdReplayVerify(argv: readonly string[]): Promise<void>;
3320
3320
 
3321
+ /**
3322
+ * Corpus enumeration for batch replay-verification.
3323
+ *
3324
+ * A CodeTraceBench corpus is a gold label file (array of trajectory entries
3325
+ * with `incorrect_stages[].incorrect_step_ids`) plus a prepared directory:
3326
+ * <prepared>/normalized/<traj_id>/steps.json CodeTracer-normalized steps
3327
+ * <prepared>/normalized/<traj_id>/task.md optional task statement
3328
+ * <prepared>/extracted/<traj_id>/swe_raw/** raw mini-SWE trajectory
3329
+ *
3330
+ * Only SWE-style trajectories are replayable: the raw trajectory must carry
3331
+ * `info.docker_config.base_image`. Every excluded case is returned with a
3332
+ * machine-readable reason — the batch report surfaces the full exclusion
3333
+ * table, never a silently shrunk denominator.
3334
+ */
3335
+
3336
+ interface CorpusSpec {
3337
+ readonly name: string;
3338
+ readonly labelsPath: string;
3339
+ readonly preparedDir: string;
3340
+ }
3341
+ /** Parses `name=<labelsPath>::<preparedDir>` (paths may contain `=`, not `::`). */
3342
+ declare function parseCorpusFlag(value: string): CorpusSpec;
3343
+ type ReplayExclusionReason = 'no-swe-raw-trajectory' | 'ambiguous-swe-raw-trajectory' | 'unreadable-raw-trajectory' | 'no-docker-image' | 'no-gold-incorrect-step' | 'gold-only-submit-step' | 'missing-steps-json' | 'gold-step-outside-steps' | 'cwd-underivable';
3344
+ /** mini-SWE's end-of-run submit convention: the agent echoes this sentinel
3345
+ * and dumps the diff. A gold label on this step marks a bad SUBMIT DECISION,
3346
+ * not a failed command — there is no executable failure to reproduce, so it
3347
+ * is never a counterfactual replay target (split3's gold labels concentrate
3348
+ * here, which is why a constant accuse-the-submit rule scores well there). */
3349
+ declare const SUBMIT_ACTION_SIGNATURE = "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT";
3350
+ declare function isSubmitAction(action: string): boolean;
3351
+ interface ExcludedCase {
3352
+ readonly corpus: string;
3353
+ readonly trajId: string;
3354
+ readonly reason: ReplayExclusionReason;
3355
+ readonly detail?: string;
3356
+ }
3357
+ type CwdSource = 'run-config' | 'docker-config' | 'pwd-observation';
3358
+ /** Everything needed to invoke replay-verify for one trajectory. */
3359
+ interface CaseResources {
3360
+ readonly corpus: string;
3361
+ readonly trajId: string;
3362
+ readonly stepsPath: string;
3363
+ readonly steps: readonly CodeTraceBenchStep[];
3364
+ readonly taskStatement: string | null;
3365
+ readonly image: string;
3366
+ readonly cwd: string;
3367
+ readonly cwdSource: CwdSource;
3368
+ /** Per-step timeout the recorded run used, when the raw config carries one. */
3369
+ readonly recordedStepTimeoutMs: number | null;
3370
+ }
3371
+ interface ReplayableCase extends CaseResources {
3372
+ /** 1-based gold incorrect step ids, ascending. */
3373
+ readonly goldIncorrectSteps: readonly number[];
3374
+ /** k — the first gold incorrect step that is a real mid-trajectory action;
3375
+ * submit-command golds are skipped (see SUBMIT_ACTION_SIGNATURE). */
3376
+ readonly k: number;
3377
+ /** Gold steps before k skipped because their action is the submit command. */
3378
+ readonly submitGoldsSkipped: number;
3379
+ /** Recorded returncode at k; null when the observation carries none. */
3380
+ readonly recordedReturncodeAtK: number | null;
3381
+ }
3382
+ interface LabelEntry {
3383
+ readonly traj_id: string;
3384
+ readonly incorrect_stages?: readonly {
3385
+ readonly incorrect_step_ids?: readonly number[];
3386
+ }[];
3387
+ }
3388
+ declare function readLabelEntries(labelsPath: string): LabelEntry[];
3389
+ declare function goldIncorrectSteps(entry: LabelEntry): number[];
3390
+ type ResourceResolution = {
3391
+ readonly resolved: true;
3392
+ readonly resources: CaseResources;
3393
+ } | {
3394
+ readonly resolved: false;
3395
+ readonly reason: ReplayExclusionReason;
3396
+ readonly detail?: string;
3397
+ };
3398
+ /**
3399
+ * Resolves the replay resources for one trajectory, independent of gold
3400
+ * labels — the analyst wire uses this with a finding-supplied step instead.
3401
+ */
3402
+ declare function resolveCaseResources(corpus: CorpusSpec, trajId: string): ResourceResolution;
3403
+ interface EnumerationResult {
3404
+ readonly replayable: ReplayableCase[];
3405
+ readonly excluded: ExcludedCase[];
3406
+ readonly labelEntryCount: number;
3407
+ }
3408
+ /**
3409
+ * Replayable = SWE-style raw trajectory with a docker image AND at least one
3410
+ * gold incorrect step that is a real mid-trajectory action. Gold steps whose
3411
+ * action is the submit command are skipped when choosing k (counted per case);
3412
+ * a case whose golds are ALL submit steps is excluded as gold-only-submit-step.
3413
+ * Exclusion reasons are reported in resolution order:
3414
+ * raw trajectory → docker image → gold labels → steps.json → k range → cwd.
3415
+ */
3416
+ declare function enumerateReplayableCases(corpora: readonly CorpusSpec[]): EnumerationResult;
3417
+
3418
+ /**
3419
+ * Counterfactual patch synthesis: one LLM call per case that turns a gold
3420
+ * incorrect step into a corrected shell command for replay-verify arm B.
3421
+ *
3422
+ * The caller is a typed outcome boundary ({ succeeded, value, error }) so a
3423
+ * provider failure is a per-case report row, never a thrown batch abort and
3424
+ * never a silent empty fix.
3425
+ */
3426
+
3427
+ interface ChatUsage {
3428
+ readonly promptTokens: number;
3429
+ readonly completionTokens: number;
3430
+ }
3431
+ type ChatOutcome = {
3432
+ readonly succeeded: true;
3433
+ readonly value: {
3434
+ content: string;
3435
+ usage: ChatUsage | null;
3436
+ };
3437
+ } | {
3438
+ readonly succeeded: false;
3439
+ readonly error: string;
3440
+ };
3441
+ interface ChatCompletionCaller {
3442
+ complete(system: string, user: string): Promise<ChatOutcome>;
3443
+ }
3444
+ interface ZaiChatCallerOptions {
3445
+ readonly baseUrl: string;
3446
+ readonly apiKey: string;
3447
+ readonly model: string;
3448
+ readonly maxTokens?: number;
3449
+ readonly timeoutMs?: number;
3450
+ readonly fetchImpl?: typeof fetch;
3451
+ }
3452
+ /** OpenAI-compatible /chat/completions caller (z.ai coding endpoint shape). */
3453
+ declare function zaiChatCaller(options: ZaiChatCallerOptions): ChatCompletionCaller;
3454
+ interface FixPromptInput {
3455
+ readonly taskStatement: string | null;
3456
+ readonly steps: readonly CodeTraceBenchStep[];
3457
+ /** 1-based step_id of the gold incorrect step. */
3458
+ readonly k: number;
3459
+ /** Steps of context on each side of k (default 3). */
3460
+ readonly contextRadius?: number;
3461
+ }
3462
+ declare function buildFixPrompt(input: FixPromptInput): {
3463
+ system: string;
3464
+ user: string;
3465
+ };
3466
+ /** Last fenced code block, else the whole trimmed content; null when empty. */
3467
+ declare function extractFixCommand(content: string): string | null;
3468
+ type FixGenerationOutcome = {
3469
+ readonly succeeded: true;
3470
+ readonly value: {
3471
+ command: string;
3472
+ usage: ChatUsage | null;
3473
+ };
3474
+ } | {
3475
+ readonly succeeded: false;
3476
+ readonly error: string;
3477
+ };
3478
+ declare function generateFixCommand(caller: ChatCompletionCaller, input: FixPromptInput): Promise<FixGenerationOutcome>;
3479
+
3480
+ /**
3481
+ * Batch replay-verification across gold-labeled CodeTraceBench corpora.
3482
+ *
3483
+ * For every replayable case (SWE-style raw trajectory with a docker image AND
3484
+ * at least one gold incorrect step) the batch:
3485
+ * 1. derives the uid-1000 replay image (the sandbox platform pins customer
3486
+ * commands to a non-root identity, so root-owned trees must be chowned),
3487
+ * 2. replays the prefix and runs arm A — the recorded gold step k, and
3488
+ * 3. optionally generates a corrected command with one LLM call and runs
3489
+ * arm B in its own fresh sandbox.
3490
+ *
3491
+ * Headline metrics:
3492
+ * replayability rate — fraction of replayable cases where the prefix
3493
+ * replays with ≤10% returncode divergence AND arm A reproduces the
3494
+ * recorded returncode at k;
3495
+ * fix-flip rate — fraction of arm-B-executed cases where the failure
3496
+ * vanished (exit 0, signature absent).
3497
+ *
3498
+ * Image pulls and sandbox execs run strictly serially: pulls contend on disk
3499
+ * and registry bandwidth, and serial cases keep wall-time attribution per
3500
+ * case honest. Pull failures are report rows, never silent skips.
3501
+ */
3502
+
3503
+ type ImagePreparation = {
3504
+ readonly succeeded: true;
3505
+ readonly value: {
3506
+ derivedImage: string;
3507
+ pulled: boolean;
3508
+ built: boolean;
3509
+ };
3510
+ } | {
3511
+ readonly succeeded: false;
3512
+ readonly error: string;
3513
+ };
3514
+ interface ImagePreparer {
3515
+ ensure(image: string, cwd: string): Promise<ImagePreparation>;
3516
+ }
3517
+ interface DockerImagePreparerOptions {
3518
+ readonly pullTimeoutMs?: number;
3519
+ readonly buildTimeoutMs?: number;
3520
+ }
3521
+ declare function derivedImageTag(image: string, cwd: string): string;
3522
+ /**
3523
+ * Pulls the base image when absent and builds `FROM <base>; RUN chown -R
3524
+ * 1000:1000 <cwd>` tagged by content hash, so repeated batches reuse both
3525
+ * the pull and the build. cwd `/` skips the chown (never chown -R /) and
3526
+ * replays on the base image directly.
3527
+ */
3528
+ declare function dockerImagePreparer(options?: DockerImagePreparerOptions): ImagePreparer;
3529
+ interface ReplayBatchOptions {
3530
+ readonly corpora: readonly CorpusSpec[];
3531
+ readonly out: string;
3532
+ readonly baseUrl?: string;
3533
+ readonly apiKey?: string;
3534
+ /** 'generate' runs one LLM call per arm-A-reproduced case, then arm B. */
3535
+ readonly fix: 'none' | 'generate';
3536
+ readonly fixCaller?: ChatCompletionCaller;
3537
+ readonly fixModelLabel?: string;
3538
+ /** Cap on LLM fix calls; eligible cases beyond it are seeded-sampled out. */
3539
+ readonly maxFixCases?: number;
3540
+ readonly seed?: number;
3541
+ /** Overrides the per-case recorded step timeout. */
3542
+ readonly stepTimeoutMs?: number;
3543
+ readonly prefixLimit?: number;
3544
+ /** Run only cases whose trajId contains this substring (smoke knob). */
3545
+ readonly caseFilter?: string;
3546
+ /** Run only the first N replayable cases (smoke knob). */
3547
+ readonly caseLimit?: number;
3548
+ readonly maxLifetimeSeconds?: number;
3549
+ readonly preparer?: ImagePreparer;
3550
+ /** Test seam: receives the derived image, returns the exec backend. */
3551
+ readonly backendFactory?: (derivedImage: string) => ReplayExecBackend;
3552
+ readonly onProgress?: (message: string) => void;
3553
+ }
3554
+ interface ReplayBatchFixResult {
3555
+ /** false when the case was eligible but seeded-sampled out of the cap. */
3556
+ readonly attempted: boolean;
3557
+ readonly sampledOut: boolean;
3558
+ readonly command: string | null;
3559
+ readonly llmError: string | null;
3560
+ readonly usage: ChatUsage | null;
3561
+ readonly armBExit: number | null;
3562
+ readonly armBPrefixExecuted: number | null;
3563
+ readonly armBPrefixDivergences: number | null;
3564
+ readonly failureVanished: boolean | null;
3565
+ readonly armBError: string | null;
3566
+ }
3567
+ interface ReplayBatchCaseRow {
3568
+ readonly corpus: string;
3569
+ readonly trajId: string;
3570
+ readonly image: string;
3571
+ readonly derivedImage: string | null;
3572
+ readonly cwd: string;
3573
+ readonly cwdSource: string;
3574
+ readonly k: number;
3575
+ readonly stepCount: number;
3576
+ readonly goldIncorrectSteps: readonly number[];
3577
+ /** Gold steps before k skipped because their action is the submit command. */
3578
+ readonly submitGoldsSkipped: number;
3579
+ readonly recordedReturncodeAtK: number | null;
3580
+ readonly signature: string | null;
3581
+ readonly status: 'ok' | 'image-unavailable' | 'replay-error';
3582
+ readonly error: string | null;
3583
+ readonly imagePulled: boolean;
3584
+ readonly imageBuilt: boolean;
3585
+ readonly prefixExecuted: number | null;
3586
+ readonly prefixDivergences: number | null;
3587
+ readonly prefixDivergencePct: number | null;
3588
+ readonly armAExit: number | null;
3589
+ readonly armAReturncodeMatch: boolean;
3590
+ readonly armASignatureMatch: boolean;
3591
+ /** Headline predicate: divergence ≤10% AND arm A reproduced the returncode. */
3592
+ readonly replayed: boolean;
3593
+ readonly fix: ReplayBatchFixResult | null;
3594
+ readonly wallMs: number;
3595
+ }
3596
+ interface ReplayBatchReport {
3597
+ readonly generatedAt: string;
3598
+ readonly corpora: readonly {
3599
+ name: string;
3600
+ labelsPath: string;
3601
+ preparedDir: string;
3602
+ }[];
3603
+ readonly totals: {
3604
+ readonly labelEntries: number;
3605
+ readonly replayable: number;
3606
+ readonly executed: number;
3607
+ readonly excludedByReason: Record<string, number>;
3608
+ /** Per-corpus submit-gold accounting: cases dropped because every gold is
3609
+ * the submit command, and golds skipped inside still-replayable cases. */
3610
+ readonly submitGoldsByCorpus: Record<string, {
3611
+ submitOnlyCases: number;
3612
+ goldsSkippedWithinReplayable: number;
3613
+ }>;
3614
+ };
3615
+ readonly headline: {
3616
+ readonly replayabilityRate: {
3617
+ numerator: number;
3618
+ denominator: number;
3619
+ value: number | null;
3620
+ };
3621
+ readonly signatureStrictRate: {
3622
+ numerator: number;
3623
+ denominator: number;
3624
+ value: number | null;
3625
+ };
3626
+ readonly fixFlipRate: {
3627
+ numerator: number;
3628
+ denominator: number;
3629
+ value: number | null;
3630
+ } | null;
3631
+ /** Fix-flip restricted to cases whose recorded returncode at k is nonzero —
3632
+ * real recorded failures, where "the failure vanished" is not vacuous. */
3633
+ readonly fixFlipRateNonzeroRc: {
3634
+ numerator: number;
3635
+ denominator: number;
3636
+ value: number | null;
3637
+ } | null;
3638
+ };
3639
+ readonly llm: {
3640
+ readonly model: string;
3641
+ readonly calls: number;
3642
+ readonly failures: number;
3643
+ readonly promptTokens: number;
3644
+ readonly completionTokens: number;
3645
+ } | null;
3646
+ readonly excluded: readonly {
3647
+ corpus: string;
3648
+ trajId: string;
3649
+ reason: string;
3650
+ detail?: string;
3651
+ }[];
3652
+ readonly pullFailures: readonly {
3653
+ corpus: string;
3654
+ trajId: string;
3655
+ image: string;
3656
+ error: string;
3657
+ }[];
3658
+ readonly cases: readonly ReplayBatchCaseRow[];
3659
+ }
3660
+ declare function seededSample<T>(items: readonly T[], size: number, seed: number): Set<T>;
3661
+ declare function runReplayBatch(options: ReplayBatchOptions): Promise<ReplayBatchReport>;
3662
+ declare function renderBatchReport(report: ReplayBatchReport): string;
3663
+ interface ReplayBatchCliArgs {
3664
+ readonly corpora: CorpusSpec[];
3665
+ readonly out: string;
3666
+ readonly fix: 'none' | 'generate';
3667
+ readonly fixModel: string;
3668
+ readonly fixBaseUrl: string;
3669
+ readonly fixApiKeyEnv: string;
3670
+ readonly maxFixCases: number;
3671
+ readonly seed: number;
3672
+ readonly stepTimeoutMs?: number;
3673
+ readonly prefixLimit?: number;
3674
+ readonly caseFilter?: string;
3675
+ readonly caseLimit?: number;
3676
+ readonly baseUrl: string;
3677
+ readonly apiKeyEnv: string;
3678
+ readonly maxLifetimeSeconds?: number;
3679
+ readonly enumerateOnly: boolean;
3680
+ }
3681
+ declare function parseReplayBatchArgs(argv: readonly string[]): ReplayBatchCliArgs | 'help';
3682
+ declare function replayBatchUsage(): string;
3683
+ declare function cmdReplayVerifyBatch(argv: readonly string[]): Promise<void>;
3684
+
3685
+ /**
3686
+ * Finding-to-replay wire: the entry point the analyst product calls to turn
3687
+ * a cited incorrect-steps finding into an executed replay-verify proof.
3688
+ *
3689
+ * A CodeTraceBench analyst finding names its trajectory and carries a subject
3690
+ * of the form `incorrect-steps-<first>-<last>-<escaped|unescaped>-consequence-<step>`.
3691
+ * The wire maps that to a replay-verify invocation: `--at` = the finding's
3692
+ * first incorrect step (which may differ from the gold label), the docker
3693
+ * image and cwd from the trajectory's raw config, and — optionally — an arm-B
3694
+ * corrected command from the counterfactual fix generator.
3695
+ */
3696
+
3697
+ interface IncorrectStepsSubject {
3698
+ readonly firstStep: number;
3699
+ readonly lastStep: number;
3700
+ readonly escapeStatus: 'escaped' | 'unescaped';
3701
+ readonly consequenceStep: number;
3702
+ }
3703
+ /** Null when the subject is not an incorrect-steps finding subject. */
3704
+ declare function parseIncorrectStepsSubject(subject: string): IncorrectStepsSubject | null;
3705
+ interface AnalystReplayFinding {
3706
+ readonly trajId: string;
3707
+ readonly subject: string;
3708
+ }
3709
+ interface ResolvedReplayInvocation {
3710
+ readonly resources: CaseResources;
3711
+ readonly subject: IncorrectStepsSubject;
3712
+ /** 1-based step_id replay-verify receives as --at: the finding's first incorrect step. */
3713
+ readonly at: number;
3714
+ }
3715
+ /**
3716
+ * Maps a finding onto replay resources, searching the given corpora for the
3717
+ * trajectory. Throws with the precise reason when the finding cannot be
3718
+ * replayed (malformed subject, unknown trajectory, non-SWE case, step out of
3719
+ * range) — the analyst product surfaces that reason instead of a proof.
3720
+ */
3721
+ declare function resolveFindingInvocation(finding: AnalystReplayFinding, corpora: readonly CorpusSpec[]): ResolvedReplayInvocation;
3722
+ interface ReplayFindingOptions {
3723
+ readonly corpora: readonly CorpusSpec[];
3724
+ readonly out: string;
3725
+ /** Generates the arm-B corrected command; omit to run arm A only. */
3726
+ readonly fixCaller?: ChatCompletionCaller;
3727
+ /** Pre-supplied arm-B command; mutually exclusive with fixCaller. */
3728
+ readonly fixCommand?: string;
3729
+ readonly stepTimeoutMs?: number;
3730
+ readonly prefixLimit?: number;
3731
+ readonly backend?: ReplayExecBackend;
3732
+ readonly apiKey?: string;
3733
+ readonly baseUrl?: string;
3734
+ readonly onProgress?: (message: string) => void;
3735
+ }
3736
+ interface ReplayFindingResult {
3737
+ readonly invocation: ResolvedReplayInvocation;
3738
+ readonly fixCommand: string | null;
3739
+ readonly verdict: ReplayVerdict;
3740
+ }
3741
+ /**
3742
+ * The shape the analyst product calls: finding in, executed proof out.
3743
+ * Note the caller supplies the image via resources; when no injected backend
3744
+ * is given the image must already be replay-ready (uid-1000 derived) — batch
3745
+ * preparation lives in replay-batch's ImagePreparer.
3746
+ */
3747
+ declare function replayVerifyFinding(finding: AnalystReplayFinding, options: ReplayFindingOptions): Promise<ReplayFindingResult>;
3748
+
3321
3749
  /**
3322
3750
  * Local upload-dedup state.
3323
3751
  *
@@ -3420,4 +3848,4 @@ interface ExecuteOptions {
3420
3848
  /** Send the final, new outbound items (or write their dry-run OTLP). */
3421
3849
  declare function executeUpload(plan: UploadPlan, opts?: ExecuteOptions): Promise<UploadResult>;
3422
3850
 
3423
- export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalyzeOptions, type AnalyzeResult, type ArmExecutionResult, BLOBS_DIR, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CODING_REDACTION_RULES, CONTENT_CAP, COORDINATION_LOG_FILE, CORRECTIVE_REACTIONS, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, ClaudeAdapter, type CodeTraceBenchFileRef, type CodeTraceBenchImportOptions, type CodeTraceBenchImportReceipt, type CodeTraceBenchImportResult, type CodeTraceBenchImportedTrace, type CodeTraceBenchStep, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, type ConformanceRenderOptions, type CoordinationLog, type CoordinationQuestion, type CoordinationSteer, CopilotAdapter, type CorruptionMode, DEFAULT_HARNESS, EMPTY_SPAN_RUN_SNAPSHOT, EXPORT_RULE, EmptySessionError, type ExecuteOptions, type ExportRule, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FactoryAdapter, type FileRunContextReaderOptions, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, INGEST_SOURCE_CLI, type IngestedTrajectory, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type LoopConvergence, type LoopConvergenceReport, type LoopIteration, type LoopTrend, type LoopTrendBasis, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpIngestIssue, type OtlpIngestIssueKind, type OtlpInput, type OtlpInputFile, type OtlpRowConversion, type OtlpSpan, type OtlpSpanKind, type OtlpSpanLink, type OtlpStatusCode, type ParentTaskResolution, type ParseOptions, PartialUploadError, PiAdapter, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, type PrefixDivergence, type PrefixReplayResult, QwenAdapter, REACTIONS, RESULT_FILE, RULE, type Reaction, type ReactionReport, type ReactionSessionReport, type Redactor, type ReplayArmVerdict, type ReplayExecBackend, type ReplayExecResult, type ReplayExecSession, type ReplayVerdict, type ReplayVerifyCliArgs, type ReplayVerifyOptions, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type ResolvedOtlpInput, type RunContextJournal, type RunContextNode, type RunContextResult, type RunContextSnapshot, type RunResult, type RunWatchSnapshot, type RunWatchTarget, type RuntimeTrace, SPAWN_JOURNAL_FILE, STATUS_MARK, SandboxCounterfactualRunner, type SandboxCounterfactualRunnerOptions, type SandboxReplayBackendOptions, type ScanOptions, type ScannedSession, type SessionBatch, type SessionCorruptionReceipt, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionRef, type SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SkippedAnalysis, type SkippedInputFile, type SpanInput, type SpanNodeStatus, type SpanRedaction, type SpanRunNode, type SpanRunSnapshot, type SpanStructure, type SpendRoll, type SteeringChainReport, type SteeringEdge, TRACES_REDACTION_RULES, type TraceAgenticRoute, type TraceAgenticRouteReason, type TraceAgenticRouteReasonCode, type TraceContextIndex, type TraceContextRoot, type TraceEvidenceExportOptions, type TraceEvidenceExportResult, type TraceEvidenceFormatOption, type TraceEvidenceInputFormat, type TraceEvidenceRow, type TraceExecutionOptions, type TraceFindingPacket, type TraceImprovementArtifacts, type TraceImprovementOptions, type TraceImprovementResult, type TraceIndexedFile, type TraceInspectionArea, type TraceInspectionFinding, type TraceInspectionReport, type TraceInspectionSeverity, type TraceInvestigationOptions, type TraceInvestigationResult, type TraceLiveAction, type TraceLiveActionKind, type TraceLiveAnalysisContext, type TraceLiveAnalyst, type TraceLiveBatch, type TraceLiveEvidence, type TraceLiveFinding, type TraceLiveLoop, type TraceLiveSeverity, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type UnavailableCapabilities, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, type WatchRunTargetOptions, ZERO_ROLL, addSpend, alreadyUploaded, analyzeAdoption, analyzeLiveBatch, analyzeLoopConvergence, analyzeReactions, analyzeSpans, analyzeSteeringChain, applyRedactor, buildPolicyEvidenceRecord, buildSessionIndex, buildSessionIndexFromRows, buildSpanRunTree, buildTraceFindingPacket, capText, chatTrajectoryToSpans, classifyLiveActions, classifyReaction, claudeActor, cmdReplayVerify, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, conformanceOfSpans, connectors, countSkillRunsJsonl, cwdMatchesSelection, defaultTraceLiveAnalysts, deriveFailureSignature, describeSessionRelationship, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, fileRunContextSupervisorRunReader, findSpanSourceFiles, forEachTreeNode, haloAnalyzer, hodoscopeAnalyzer, importCodeTraceBench, incompleteInputsNote, indexSessionIdsByTrace, inferRole, inferSpanKind, ingestCodeTraceBenchSteps, inspectSessionIndex, int, isChatTrajectory, isChatTrajectoryMessage, isFileRunContextDir, knownHarnesses, listAdapters, loadState, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeRolls, mergeTracesConfig, ms, normalizeRemote, otlpRowToSpan, outboundHash, parseIsoToEpochMs, parseObservationOutput, parseRecordedReturncode, parseReplayVerifyArgs, parseSession, parseSince, planTraceAgenticRoute, planUpload, readCoordinationLog, readFileRunContext, readJsonFile, readJsonl, readOtlpInput, readRunContextJournal, readRunContextSnapshot, readRunWatchSnapshot, readSessionIndexFile, readSpanRunSnapshot, recordSessionCorruption, redactSpans, renderConformance, renderInspectionReport, renderRunContextSnapshot, renderRunWatchSnapshot, renderSpanRunSnapshot, renderValidation, replayVerify, replayVerifyUsage, resolveAdapter, resolveOtlpInputFiles, resolveRepoAttrs, resolveRunContextDir, resolveRunWatchTarget, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTotals, runTraceImprovement, runTraceInvestigation, runTraceStoreInvestigation, sandboxReplayBackend, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, skippedAnalyses, span, spanRunTotals, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, summarizeSpanStructure, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, tokens, totalAgenticFailureMessage, traceAgenticKinds, traceStreamEventsFromSpans, unavailableCapabilities, uploadKey, usd, userPromptSpan, validateOtlpSpans, validationExitCode, watchRunTarget, watchSessions, wrap, wrapActionForExec, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts, zeroPricedCost };
3851
+ export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalystReplayFinding, type AnalyzeOptions, type AnalyzeResult, type ArmExecutionResult, BLOBS_DIR, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CODING_REDACTION_RULES, CONTENT_CAP, COORDINATION_LOG_FILE, CORRECTIVE_REACTIONS, type CaseResources, type ChatCompletionCaller, type ChatOutcome, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, type ChatUsage, ClaudeAdapter, type CodeTraceBenchFileRef, type CodeTraceBenchImportOptions, type CodeTraceBenchImportReceipt, type CodeTraceBenchImportResult, type CodeTraceBenchImportedTrace, type CodeTraceBenchStep, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, type ConformanceRenderOptions, type CoordinationLog, type CoordinationQuestion, type CoordinationSteer, CopilotAdapter, type CorpusSpec, type CorruptionMode, type CwdSource, DEFAULT_HARNESS, type DockerImagePreparerOptions, EMPTY_SPAN_RUN_SNAPSHOT, EXPORT_RULE, EmptySessionError, type EnumerationResult, type ExcludedCase, type ExecuteOptions, type ExportRule, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FactoryAdapter, type FileRunContextReaderOptions, type FixGenerationOutcome, type FixPromptInput, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, INGEST_SOURCE_CLI, type ImagePreparation, type ImagePreparer, type IncorrectStepsSubject, type IngestedTrajectory, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type LoopConvergence, type LoopConvergenceReport, type LoopIteration, type LoopTrend, type LoopTrendBasis, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpIngestIssue, type OtlpIngestIssueKind, type OtlpInput, type OtlpInputFile, type OtlpRowConversion, type OtlpSpan, type OtlpSpanKind, type OtlpSpanLink, type OtlpStatusCode, type ParentTaskResolution, type ParseOptions, PartialUploadError, PiAdapter, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, type PrefixDivergence, type PrefixReplayResult, QwenAdapter, REACTIONS, RESULT_FILE, RULE, type Reaction, type ReactionReport, type ReactionSessionReport, type Redactor, type ReplayArmVerdict, type ReplayBatchCaseRow, type ReplayBatchCliArgs, type ReplayBatchFixResult, type ReplayBatchOptions, type ReplayBatchReport, type ReplayExclusionReason, type ReplayExecBackend, type ReplayExecResult, type ReplayExecSession, type ReplayFindingOptions, type ReplayFindingResult, type ReplayVerdict, type ReplayVerifyCliArgs, type ReplayVerifyOptions, type ReplayableCase, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type ResolvedOtlpInput, type ResolvedReplayInvocation, type ResourceResolution, type RunContextJournal, type RunContextNode, type RunContextResult, type RunContextSnapshot, type RunResult, type RunWatchSnapshot, type RunWatchTarget, type RuntimeTrace, SPAWN_JOURNAL_FILE, STATUS_MARK, SUBMIT_ACTION_SIGNATURE, SandboxCounterfactualRunner, type SandboxCounterfactualRunnerOptions, type SandboxReplayBackendOptions, type ScanOptions, type ScannedSession, type SessionBatch, type SessionCorruptionReceipt, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionRef, type SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SkippedAnalysis, type SkippedInputFile, type SpanInput, type SpanNodeStatus, type SpanRedaction, type SpanRunNode, type SpanRunSnapshot, type SpanStructure, type SpendRoll, type SteeringChainReport, type SteeringEdge, TRACES_REDACTION_RULES, type TraceAgenticRoute, type TraceAgenticRouteReason, type TraceAgenticRouteReasonCode, type TraceContextIndex, type TraceContextRoot, type TraceEvidenceExportOptions, type TraceEvidenceExportResult, type TraceEvidenceFormatOption, type TraceEvidenceInputFormat, type TraceEvidenceRow, type TraceExecutionOptions, type TraceFindingPacket, type TraceImprovementArtifacts, type TraceImprovementOptions, type TraceImprovementResult, type TraceIndexedFile, type TraceInspectionArea, type TraceInspectionFinding, type TraceInspectionReport, type TraceInspectionSeverity, type TraceInvestigationOptions, type TraceInvestigationResult, type TraceLiveAction, type TraceLiveActionKind, type TraceLiveAnalysisContext, type TraceLiveAnalyst, type TraceLiveBatch, type TraceLiveEvidence, type TraceLiveFinding, type TraceLiveLoop, type TraceLiveSeverity, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type UnavailableCapabilities, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, type WatchRunTargetOptions, ZERO_ROLL, type ZaiChatCallerOptions, addSpend, alreadyUploaded, analyzeAdoption, analyzeLiveBatch, analyzeLoopConvergence, analyzeReactions, analyzeSpans, analyzeSteeringChain, applyRedactor, buildFixPrompt, buildPolicyEvidenceRecord, buildSessionIndex, buildSessionIndexFromRows, buildSpanRunTree, buildTraceFindingPacket, capText, chatTrajectoryToSpans, classifyLiveActions, classifyReaction, claudeActor, cmdReplayVerify, cmdReplayVerifyBatch, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, conformanceOfSpans, connectors, countSkillRunsJsonl, cwdMatchesSelection, defaultTraceLiveAnalysts, deriveFailureSignature, derivedImageTag, describeSessionRelationship, dockerImagePreparer, enumerateReplayableCases, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, extractFixCommand, fileRunContextSupervisorRunReader, findSpanSourceFiles, forEachTreeNode, generateFixCommand, goldIncorrectSteps, haloAnalyzer, hodoscopeAnalyzer, importCodeTraceBench, incompleteInputsNote, indexSessionIdsByTrace, inferRole, inferSpanKind, ingestCodeTraceBenchSteps, inspectSessionIndex, int, isChatTrajectory, isChatTrajectoryMessage, isFileRunContextDir, isSubmitAction, knownHarnesses, listAdapters, loadState, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeRolls, mergeTracesConfig, ms, normalizeRemote, otlpRowToSpan, outboundHash, parseCorpusFlag, parseIncorrectStepsSubject, parseIsoToEpochMs, parseObservationOutput, parseRecordedReturncode, parseReplayBatchArgs, parseReplayVerifyArgs, parseSession, parseSince, planTraceAgenticRoute, planUpload, readCoordinationLog, readFileRunContext, readJsonFile, readJsonl, readLabelEntries, readOtlpInput, readRunContextJournal, readRunContextSnapshot, readRunWatchSnapshot, readSessionIndexFile, readSpanRunSnapshot, recordSessionCorruption, redactSpans, renderBatchReport, renderConformance, renderInspectionReport, renderRunContextSnapshot, renderRunWatchSnapshot, renderSpanRunSnapshot, renderValidation, replayBatchUsage, replayVerify, replayVerifyFinding, replayVerifyUsage, resolveAdapter, resolveCaseResources, resolveFindingInvocation, resolveOtlpInputFiles, resolveRepoAttrs, resolveRunContextDir, resolveRunWatchTarget, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runReplayBatch, runTotals, runTraceImprovement, runTraceInvestigation, runTraceStoreInvestigation, sandboxReplayBackend, saveReport, saveState, scanSessions, seededSample, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, skippedAnalyses, span, spanRunTotals, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, summarizeSpanStructure, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, tokens, totalAgenticFailureMessage, traceAgenticKinds, traceStreamEventsFromSpans, unavailableCapabilities, uploadKey, usd, userPromptSpan, validateOtlpSpans, validationExitCode, watchRunTarget, watchSessions, wrap, wrapActionForExec, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts, zaiChatCaller, zeroPricedCost };