agent-afk 5.268.0 → 5.269.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/cli.mjs +381 -368
- package/dist/index.mjs +125 -125
- package/dist/telegram.mjs +143 -143
- package/dist/whatif/probe-signflip.d.ts +17 -0
- package/dist/whatif/report.predictions.d.ts +3 -0
- package/dist/whatif/report.signflip.d.ts +4 -0
- package/dist/whatif/run.failures.d.ts +22 -0
- package/dist/whatif/run.persist.d.ts +2 -1
- package/dist/whatif/run.persist.grades.d.ts +10 -0
- package/dist/whatif/run.report.d.ts +2 -0
- package/dist/whatif/run.verify.d.ts +2 -0
- package/dist/whatif/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const ZERO_TOLERANCE = 1e-9;
|
|
2
|
+
export interface ProbeSignFlipResult {
|
|
3
|
+
nPaired: number;
|
|
4
|
+
nUnpaired: number;
|
|
5
|
+
nNonzero: number;
|
|
6
|
+
meanDelta: number;
|
|
7
|
+
probeDiffs: number[];
|
|
8
|
+
p: number | null;
|
|
9
|
+
minAchievableP: number | null;
|
|
10
|
+
underpoweredForSig: boolean;
|
|
11
|
+
method: 'exact' | 'montecarlo';
|
|
12
|
+
}
|
|
13
|
+
export interface ArmSamples {
|
|
14
|
+
baseline: number[];
|
|
15
|
+
candidate: number[];
|
|
16
|
+
}
|
|
17
|
+
export declare function computeProbeSignFlip(pairedEpisodeData: Map<string, ArmSamples>, episodeOrder: string[]): ProbeSignFlipResult;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ArmImbalance } from './run.failures.js';
|
|
2
|
+
import type { VerifiedPrediction } from './types.js';
|
|
3
|
+
export declare function fmtP(p: number): string;
|
|
4
|
+
export declare function renderProbeSignFlipSection(verified: VerifiedPrediction[], armImbalance?: ArmImbalance): string[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { EpisodeTrace } from './types.js';
|
|
2
|
+
export interface FailedEpisodeRecord {
|
|
3
|
+
episodeId: string;
|
|
4
|
+
arm: 'baseline' | 'candidate';
|
|
5
|
+
sample: number;
|
|
6
|
+
errorClass: 'timeout' | 'error';
|
|
7
|
+
errorMessage: string;
|
|
8
|
+
probe?: string;
|
|
9
|
+
durationMs: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ArmImbalance {
|
|
12
|
+
baselineFailRate: number;
|
|
13
|
+
candidateFailRate: number;
|
|
14
|
+
rateDiff: number;
|
|
15
|
+
allInOneArm: boolean;
|
|
16
|
+
concentrationArm?: 'baseline' | 'candidate';
|
|
17
|
+
summary: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const IMBALANCE_RATE_THRESHOLD = 0.2;
|
|
20
|
+
export declare const IMBALANCE_MIN_FAILURES = 2;
|
|
21
|
+
export declare function buildFailedEpisodeRecords(traces: EpisodeTrace[], episodeTargets: Map<string, string>): FailedEpisodeRecord[];
|
|
22
|
+
export declare function detectArmImbalance(records: FailedEpisodeRecord[], baselineTotal: number, candidateTotal: number): ArmImbalance | undefined;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { EpisodeTrace, WhatifReport } from './types.js';
|
|
2
|
-
|
|
2
|
+
import type { JudgeResults } from './run.verify.scoring.js';
|
|
3
|
+
export declare function persistRun(runDir: string, report: WhatifReport, traces: EpisodeTrace[], judgeResults?: JudgeResults): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EpisodeTrace } from './types.js';
|
|
2
|
+
import type { JudgeResults } from './run.verify.scoring.js';
|
|
3
|
+
export interface GradeEntry {
|
|
4
|
+
episodeId: string;
|
|
5
|
+
env: 'baseline' | 'candidate';
|
|
6
|
+
sample: number;
|
|
7
|
+
predictionId: string;
|
|
8
|
+
pYes: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function persistGrades(runDir: string, judgeResults: JudgeResults, traces: EpisodeTrace[], predictionIds: string[]): Promise<void>;
|
|
@@ -2,6 +2,7 @@ import type { ChangeSpec, EpisodeTrace, Judge, Prediction, VerifyResult, WhatifR
|
|
|
2
2
|
import type { DroppedProbe } from './probe-grounding.js';
|
|
3
3
|
import type { CorpusExclusions } from './episodes.js';
|
|
4
4
|
import type { StructuralImpact } from './types.js';
|
|
5
|
+
import type { JudgeResults } from './run.verify.scoring.js';
|
|
5
6
|
export interface VerifiedReportArgs {
|
|
6
7
|
spec: ChangeSpec;
|
|
7
8
|
structural: StructuralImpact;
|
|
@@ -14,5 +15,6 @@ export interface VerifiedReportArgs {
|
|
|
14
15
|
runDir: string;
|
|
15
16
|
resolvedJudge: Judge;
|
|
16
17
|
autoKeepContextHooks: boolean;
|
|
18
|
+
judgeResults: JudgeResults;
|
|
17
19
|
}
|
|
18
20
|
export declare function buildAndPersistVerifiedReport(args: VerifiedReportArgs): Promise<WhatifReport>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type JudgeResults } from './run.verify.scoring.js';
|
|
1
2
|
import type { AgentRunner, CompleteFn, Episode, EpisodeTrace, Environment, Judge, Prediction, StructuralImpact, VerifyResult, WhatifProgress } from './types.js';
|
|
2
3
|
export interface VerifyRunInput {
|
|
3
4
|
episodes: Episode[];
|
|
@@ -26,5 +27,6 @@ export interface VerifyRunOutput {
|
|
|
26
27
|
verifyResult: VerifyResult;
|
|
27
28
|
allTraces: EpisodeTrace[];
|
|
28
29
|
analystCostUsd: number;
|
|
30
|
+
judgeResults: JudgeResults;
|
|
29
31
|
}
|
|
30
32
|
export declare function verifyRun(input: VerifyRunInput): Promise<VerifyRunOutput>;
|
package/dist/whatif/types.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ export interface VerifiedPrediction {
|
|
|
196
196
|
crossCheckAgreement?: number;
|
|
197
197
|
crossCheckTooFew?: boolean;
|
|
198
198
|
verdictReason?: 'judges disagree';
|
|
199
|
+
probeSignFlip?: import('./probe-signflip.js').ProbeSignFlipResult;
|
|
199
200
|
}
|
|
200
201
|
export interface DiscoveredDifference {
|
|
201
202
|
id: string;
|
|
@@ -222,6 +223,8 @@ export interface VerifyResult {
|
|
|
222
223
|
truncatedByBudget: boolean;
|
|
223
224
|
failedEpisodes: number;
|
|
224
225
|
judgeFailures?: number;
|
|
226
|
+
failedEpisodeRecords?: import('./run.failures.js').FailedEpisodeRecord[];
|
|
227
|
+
armImbalance?: import('./run.failures.js').ArmImbalance;
|
|
225
228
|
}
|
|
226
229
|
export interface WhatifReport {
|
|
227
230
|
spec: ChangeSpec;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-afk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.269.0",
|
|
4
4
|
"description": "Open-source coding-agent harness you can actually change — own the loop (prompts, gates, routing, skills, terminal states), use any model, run long tasks while you're away.",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|