@bitfab/sdk 0.64.6 → 0.64.8
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/cloudReplay.py +3 -0
- package/dist/{chunk-RZDYDKTP.js → chunk-2AZMZWVJ.js} +6 -3
- package/dist/chunk-2AZMZWVJ.js.map +1 -0
- package/dist/{chunk-NPLI52PV.js → chunk-2FBHAXXP.js} +150 -3
- package/dist/chunk-2FBHAXXP.js.map +1 -0
- package/dist/{chunk-WJP4S2NP.js → chunk-C6COKMY5.js} +32 -8
- package/dist/chunk-C6COKMY5.js.map +1 -0
- package/dist/{chunk-LACTIQDT.js → chunk-D6UWKMAP.js} +39 -4
- package/dist/chunk-D6UWKMAP.js.map +1 -0
- package/dist/{chunk-6P4TTCPH.js → chunk-HEBW2JUM.js} +6 -3
- package/dist/{chunk-6P4TTCPH.js.map → chunk-HEBW2JUM.js.map} +1 -1
- package/dist/{http-HJX3DLQS.js → http-2GCHYMMN.js} +2 -2
- package/dist/{http-WUHILGJY.js → http-FYDY3CVR.js} +2 -2
- package/dist/index.cjs +189 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -12
- package/dist/index.d.ts +26 -12
- package/dist/index.js +3 -3
- package/dist/node.cjs +189 -6
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-OIY35N3F.js → replay-GUP3ZNRQ.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-LACTIQDT.js.map +0 -1
- package/dist/chunk-NPLI52PV.js.map +0 -1
- package/dist/chunk-RZDYDKTP.js.map +0 -1
- package/dist/chunk-WJP4S2NP.js.map +0 -1
- /package/dist/{http-HJX3DLQS.js.map → http-2GCHYMMN.js.map} +0 -0
- /package/dist/{http-WUHILGJY.js.map → http-FYDY3CVR.js.map} +0 -0
- /package/dist/{replay-OIY35N3F.js.map → replay-GUP3ZNRQ.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -452,6 +452,18 @@ interface ReplayContext {
|
|
|
452
452
|
dbSnapshotAccessed?: boolean;
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
type FlagScalar = string | number | boolean | null;
|
|
456
|
+
type FlagValue = FlagScalar | FlagScalar[];
|
|
457
|
+
type ReplayEnvironment = "local" | "ci" | "cloud_replay";
|
|
458
|
+
interface ReplayInvocation {
|
|
459
|
+
flags: Record<string, FlagValue>;
|
|
460
|
+
sdk: {
|
|
461
|
+
language: "typescript";
|
|
462
|
+
version: string;
|
|
463
|
+
};
|
|
464
|
+
environment: ReplayEnvironment;
|
|
465
|
+
}
|
|
466
|
+
|
|
455
467
|
interface SimulationPlanNode {
|
|
456
468
|
traceFunctionKey: string;
|
|
457
469
|
name: string;
|
|
@@ -697,7 +709,7 @@ declare class HttpClient {
|
|
|
697
709
|
* Start a replay session by fetching historical traces.
|
|
698
710
|
* Blocking call - creates an experiment and returns lightweight item references.
|
|
699
711
|
*/
|
|
700
|
-
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, skipAssertionJudging?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>, dryRun?: boolean): Promise<StartReplayResponse>;
|
|
712
|
+
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, skipAssertionJudging?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>, dryRun?: boolean, invocation?: ReplayInvocation): Promise<StartReplayResponse>;
|
|
701
713
|
resumeReplay(experimentId: string, traceFunctionKey: string, codeChangeFiles?: CodeChangeFile[] | null, force?: boolean): Promise<ResumeReplayResponse>;
|
|
702
714
|
/**
|
|
703
715
|
* Fetch an external span by ID.
|
|
@@ -1660,7 +1672,7 @@ type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
|
|
|
1660
1672
|
type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
|
|
1661
1673
|
type LabelStatus = "labeled" | "skipped" | "unlabeled";
|
|
1662
1674
|
type LabelSource = "human" | "agent";
|
|
1663
|
-
type
|
|
1675
|
+
type LabelAddress = {
|
|
1664
1676
|
traceId: string;
|
|
1665
1677
|
originalTraceId?: never;
|
|
1666
1678
|
attempt?: never;
|
|
@@ -1668,7 +1680,11 @@ type LabelTarget = ({
|
|
|
1668
1680
|
originalTraceId: string;
|
|
1669
1681
|
attempt?: number;
|
|
1670
1682
|
traceId?: never;
|
|
1671
|
-
}
|
|
1683
|
+
};
|
|
1684
|
+
type LabelTarget = LabelAddress & {
|
|
1685
|
+
assertionId: string;
|
|
1686
|
+
};
|
|
1687
|
+
type ArchiveLabelTarget = LabelAddress & {
|
|
1672
1688
|
assertionId?: string;
|
|
1673
1689
|
};
|
|
1674
1690
|
type LabelVerdict = {
|
|
@@ -1679,10 +1695,10 @@ type LabelVerdict = {
|
|
|
1679
1695
|
} | {
|
|
1680
1696
|
skip: true;
|
|
1681
1697
|
annotation?: string;
|
|
1682
|
-
} | {
|
|
1683
|
-
archive: true;
|
|
1684
1698
|
};
|
|
1685
|
-
type LabelUpdate = LabelTarget & LabelVerdict
|
|
1699
|
+
type LabelUpdate = (LabelTarget & LabelVerdict) | (ArchiveLabelTarget & {
|
|
1700
|
+
archive: true;
|
|
1701
|
+
});
|
|
1686
1702
|
type LabelOutcome = {
|
|
1687
1703
|
key: string;
|
|
1688
1704
|
traceId: string;
|
|
@@ -1690,7 +1706,7 @@ type LabelOutcome = {
|
|
|
1690
1706
|
};
|
|
1691
1707
|
type HumanLabelUpdate = {
|
|
1692
1708
|
traceId: string;
|
|
1693
|
-
assertionId
|
|
1709
|
+
assertionId: string;
|
|
1694
1710
|
label: boolean;
|
|
1695
1711
|
annotation: string;
|
|
1696
1712
|
confidence?: LabelConfidence;
|
|
@@ -1729,12 +1745,10 @@ declare class LabelsClient {
|
|
|
1729
1745
|
constructor(httpClient: HttpClient);
|
|
1730
1746
|
save(update: LabelUpdate, experimentId?: string): Promise<LabelOutcome>;
|
|
1731
1747
|
saveAll(updates: LabelUpdate[], experimentId?: string): Promise<LabelOutcome[]>;
|
|
1732
|
-
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1733
1748
|
skip(target: LabelTarget & {
|
|
1734
1749
|
annotation?: string;
|
|
1735
1750
|
}, experimentId?: string): Promise<LabelOutcome>;
|
|
1736
|
-
|
|
1737
|
-
archive(target: LabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1751
|
+
archive(target: ArchiveLabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1738
1752
|
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1739
1753
|
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1740
1754
|
get(traceId: string): Promise<TraceLabels | null>;
|
|
@@ -3980,7 +3994,7 @@ interface CommitRef {
|
|
|
3980
3994
|
/**
|
|
3981
3995
|
* SDK version from package.json (injected at build time)
|
|
3982
3996
|
*/
|
|
3983
|
-
declare const __version__ = "0.64.
|
|
3997
|
+
declare const __version__ = "0.64.8";
|
|
3984
3998
|
|
|
3985
3999
|
/**
|
|
3986
4000
|
* Constants for the Bitfab SDK.
|
|
@@ -4119,4 +4133,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
4119
4133
|
run?: boolean;
|
|
4120
4134
|
}): Promise<SeedResult>;
|
|
4121
4135
|
|
|
4122
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
|
4136
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -452,6 +452,18 @@ interface ReplayContext {
|
|
|
452
452
|
dbSnapshotAccessed?: boolean;
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
type FlagScalar = string | number | boolean | null;
|
|
456
|
+
type FlagValue = FlagScalar | FlagScalar[];
|
|
457
|
+
type ReplayEnvironment = "local" | "ci" | "cloud_replay";
|
|
458
|
+
interface ReplayInvocation {
|
|
459
|
+
flags: Record<string, FlagValue>;
|
|
460
|
+
sdk: {
|
|
461
|
+
language: "typescript";
|
|
462
|
+
version: string;
|
|
463
|
+
};
|
|
464
|
+
environment: ReplayEnvironment;
|
|
465
|
+
}
|
|
466
|
+
|
|
455
467
|
interface SimulationPlanNode {
|
|
456
468
|
traceFunctionKey: string;
|
|
457
469
|
name: string;
|
|
@@ -697,7 +709,7 @@ declare class HttpClient {
|
|
|
697
709
|
* Start a replay session by fetching historical traces.
|
|
698
710
|
* Blocking call - creates an experiment and returns lightweight item references.
|
|
699
711
|
*/
|
|
700
|
-
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, skipAssertionJudging?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>, dryRun?: boolean): Promise<StartReplayResponse>;
|
|
712
|
+
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, skipAssertionJudging?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>, dryRun?: boolean, invocation?: ReplayInvocation): Promise<StartReplayResponse>;
|
|
701
713
|
resumeReplay(experimentId: string, traceFunctionKey: string, codeChangeFiles?: CodeChangeFile[] | null, force?: boolean): Promise<ResumeReplayResponse>;
|
|
702
714
|
/**
|
|
703
715
|
* Fetch an external span by ID.
|
|
@@ -1660,7 +1672,7 @@ type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
|
|
|
1660
1672
|
type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
|
|
1661
1673
|
type LabelStatus = "labeled" | "skipped" | "unlabeled";
|
|
1662
1674
|
type LabelSource = "human" | "agent";
|
|
1663
|
-
type
|
|
1675
|
+
type LabelAddress = {
|
|
1664
1676
|
traceId: string;
|
|
1665
1677
|
originalTraceId?: never;
|
|
1666
1678
|
attempt?: never;
|
|
@@ -1668,7 +1680,11 @@ type LabelTarget = ({
|
|
|
1668
1680
|
originalTraceId: string;
|
|
1669
1681
|
attempt?: number;
|
|
1670
1682
|
traceId?: never;
|
|
1671
|
-
}
|
|
1683
|
+
};
|
|
1684
|
+
type LabelTarget = LabelAddress & {
|
|
1685
|
+
assertionId: string;
|
|
1686
|
+
};
|
|
1687
|
+
type ArchiveLabelTarget = LabelAddress & {
|
|
1672
1688
|
assertionId?: string;
|
|
1673
1689
|
};
|
|
1674
1690
|
type LabelVerdict = {
|
|
@@ -1679,10 +1695,10 @@ type LabelVerdict = {
|
|
|
1679
1695
|
} | {
|
|
1680
1696
|
skip: true;
|
|
1681
1697
|
annotation?: string;
|
|
1682
|
-
} | {
|
|
1683
|
-
archive: true;
|
|
1684
1698
|
};
|
|
1685
|
-
type LabelUpdate = LabelTarget & LabelVerdict
|
|
1699
|
+
type LabelUpdate = (LabelTarget & LabelVerdict) | (ArchiveLabelTarget & {
|
|
1700
|
+
archive: true;
|
|
1701
|
+
});
|
|
1686
1702
|
type LabelOutcome = {
|
|
1687
1703
|
key: string;
|
|
1688
1704
|
traceId: string;
|
|
@@ -1690,7 +1706,7 @@ type LabelOutcome = {
|
|
|
1690
1706
|
};
|
|
1691
1707
|
type HumanLabelUpdate = {
|
|
1692
1708
|
traceId: string;
|
|
1693
|
-
assertionId
|
|
1709
|
+
assertionId: string;
|
|
1694
1710
|
label: boolean;
|
|
1695
1711
|
annotation: string;
|
|
1696
1712
|
confidence?: LabelConfidence;
|
|
@@ -1729,12 +1745,10 @@ declare class LabelsClient {
|
|
|
1729
1745
|
constructor(httpClient: HttpClient);
|
|
1730
1746
|
save(update: LabelUpdate, experimentId?: string): Promise<LabelOutcome>;
|
|
1731
1747
|
saveAll(updates: LabelUpdate[], experimentId?: string): Promise<LabelOutcome[]>;
|
|
1732
|
-
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1733
1748
|
skip(target: LabelTarget & {
|
|
1734
1749
|
annotation?: string;
|
|
1735
1750
|
}, experimentId?: string): Promise<LabelOutcome>;
|
|
1736
|
-
|
|
1737
|
-
archive(target: LabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1751
|
+
archive(target: ArchiveLabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1738
1752
|
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1739
1753
|
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1740
1754
|
get(traceId: string): Promise<TraceLabels | null>;
|
|
@@ -3980,7 +3994,7 @@ interface CommitRef {
|
|
|
3980
3994
|
/**
|
|
3981
3995
|
* SDK version from package.json (injected at build time)
|
|
3982
3996
|
*/
|
|
3983
|
-
declare const __version__ = "0.64.
|
|
3997
|
+
declare const __version__ = "0.64.8";
|
|
3984
3998
|
|
|
3985
3999
|
/**
|
|
3986
4000
|
* Constants for the Bitfab SDK.
|
|
@@ -4119,4 +4133,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
4119
4133
|
run?: boolean;
|
|
4120
4134
|
}): Promise<SeedResult>;
|
|
4121
4135
|
|
|
4122
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
|
4136
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getCurrentTrace,
|
|
28
28
|
reseedFromRegistry,
|
|
29
29
|
seedFromRegistry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-C6COKMY5.js";
|
|
31
31
|
import "./chunk-YWXQM6J3.js";
|
|
32
32
|
import {
|
|
33
33
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
ReplayError,
|
|
37
37
|
reportReplayProgress,
|
|
38
38
|
serializeReplayResult
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-2FBHAXXP.js";
|
|
40
40
|
import {
|
|
41
41
|
BitfabError,
|
|
42
42
|
DEFAULT_SERVICE_URL,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
MixedTracingError,
|
|
45
45
|
__version__,
|
|
46
46
|
flushTraces
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-2AZMZWVJ.js";
|
|
48
48
|
import "./chunk-MT36GJMW.js";
|
|
49
49
|
export {
|
|
50
50
|
AssertionCategoriesClient,
|
package/dist/node.cjs
CHANGED
|
@@ -88,7 +88,7 @@ var __version__, __packageName__;
|
|
|
88
88
|
var init_version_generated = __esm({
|
|
89
89
|
"src/version.generated.ts"() {
|
|
90
90
|
"use strict";
|
|
91
|
-
__version__ = "0.64.
|
|
91
|
+
__version__ = "0.64.8";
|
|
92
92
|
__packageName__ = "@bitfab/sdk";
|
|
93
93
|
}
|
|
94
94
|
});
|
|
@@ -2902,7 +2902,7 @@ var init_http = __esm({
|
|
|
2902
2902
|
* Start a replay session by fetching historical traces.
|
|
2903
2903
|
* Blocking call - creates an experiment and returns lightweight item references.
|
|
2904
2904
|
*/
|
|
2905
|
-
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun) {
|
|
2905
|
+
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun, invocation) {
|
|
2906
2906
|
const payload = { traceFunctionKey };
|
|
2907
2907
|
if (experimentalSelectiveReplay !== void 0) {
|
|
2908
2908
|
payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
|
|
@@ -2963,6 +2963,9 @@ var init_http = __esm({
|
|
|
2963
2963
|
if (dryRun) {
|
|
2964
2964
|
payload.dryRun = true;
|
|
2965
2965
|
}
|
|
2966
|
+
if (invocation !== void 0) {
|
|
2967
|
+
payload.invocation = invocation;
|
|
2968
|
+
}
|
|
2966
2969
|
const git = await resolvedGitState();
|
|
2967
2970
|
if (git && !isEmptyGitState(git)) {
|
|
2968
2971
|
payload.git = git;
|
|
@@ -3758,6 +3761,113 @@ var init_replayInterrupt = __esm({
|
|
|
3758
3761
|
}
|
|
3759
3762
|
});
|
|
3760
3763
|
|
|
3764
|
+
// src/replayInvocation.ts
|
|
3765
|
+
function replayEnvironment() {
|
|
3766
|
+
if (readEnv(REPLAY_EXECUTION_TARGET_ENV) === HOSTED_EXECUTION_TARGET) {
|
|
3767
|
+
return "cloud_replay";
|
|
3768
|
+
}
|
|
3769
|
+
if (CI_TRUE_VALUES.has((readEnv(CI_ENV) ?? "").toLowerCase())) {
|
|
3770
|
+
return "ci";
|
|
3771
|
+
}
|
|
3772
|
+
if (CI_PRESENCE_ENV_VARS.some((name) => (readEnv(name) ?? "") !== "")) {
|
|
3773
|
+
return "ci";
|
|
3774
|
+
}
|
|
3775
|
+
return "local";
|
|
3776
|
+
}
|
|
3777
|
+
function flagScalar(value) {
|
|
3778
|
+
if (typeof value === "string") {
|
|
3779
|
+
return value.slice(0, MAX_FLAG_STRING_LENGTH);
|
|
3780
|
+
}
|
|
3781
|
+
if (typeof value === "number") {
|
|
3782
|
+
return Number.isFinite(value) ? value : void 0;
|
|
3783
|
+
}
|
|
3784
|
+
if (typeof value === "boolean" || value === null) {
|
|
3785
|
+
return value;
|
|
3786
|
+
}
|
|
3787
|
+
return void 0;
|
|
3788
|
+
}
|
|
3789
|
+
function flagValue(value) {
|
|
3790
|
+
if (Array.isArray(value)) {
|
|
3791
|
+
const items = value.slice(0, MAX_FLAG_LIST_LENGTH).map(flagScalar);
|
|
3792
|
+
return items.every((item) => item !== void 0) ? items : true;
|
|
3793
|
+
}
|
|
3794
|
+
const scalar = flagScalar(value);
|
|
3795
|
+
return scalar === void 0 ? true : scalar;
|
|
3796
|
+
}
|
|
3797
|
+
function optionFlagName(option) {
|
|
3798
|
+
return OPTION_FLAG_NAMES[option] ?? option.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
3799
|
+
}
|
|
3800
|
+
function metadataKeys(value) {
|
|
3801
|
+
const keys = Array.isArray(value) ? value.map((pair) => String(pair).split("=")[0]) : typeof value === "object" && value !== null ? Object.keys(value) : void 0;
|
|
3802
|
+
return keys === void 0 ? true : [...new Set(keys)].sort();
|
|
3803
|
+
}
|
|
3804
|
+
function invocationFlags(entries) {
|
|
3805
|
+
const flags = {};
|
|
3806
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3807
|
+
for (const [name, value] of entries) {
|
|
3808
|
+
if (seen.size >= MAX_FLAGS) {
|
|
3809
|
+
break;
|
|
3810
|
+
}
|
|
3811
|
+
if (value === void 0 || seen.has(name) || name.length === 0 || name.length > MAX_FLAG_NAME_LENGTH || SECRET_FLAG_NAME.test(name)) {
|
|
3812
|
+
continue;
|
|
3813
|
+
}
|
|
3814
|
+
flags[name] = flagValue(
|
|
3815
|
+
name === METADATA_FLAG ? metadataKeys(value) : value
|
|
3816
|
+
);
|
|
3817
|
+
seen.add(name);
|
|
3818
|
+
}
|
|
3819
|
+
return flags;
|
|
3820
|
+
}
|
|
3821
|
+
function buildReplayInvocation(entries = []) {
|
|
3822
|
+
return {
|
|
3823
|
+
flags: invocationFlags(entries),
|
|
3824
|
+
sdk: { language: "typescript", version: __version__ },
|
|
3825
|
+
environment: replayEnvironment()
|
|
3826
|
+
};
|
|
3827
|
+
}
|
|
3828
|
+
function safeReplayInvocation(build) {
|
|
3829
|
+
try {
|
|
3830
|
+
return build();
|
|
3831
|
+
} catch {
|
|
3832
|
+
return void 0;
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
function cliFlags(options) {
|
|
3836
|
+
return options?.[CLI_FLAGS];
|
|
3837
|
+
}
|
|
3838
|
+
var REPLAY_EXECUTION_TARGET_ENV, HOSTED_EXECUTION_TARGET, CI_ENV, CI_TRUE_VALUES, CI_PRESENCE_ENV_VARS, MAX_FLAGS, MAX_FLAG_NAME_LENGTH, MAX_FLAG_STRING_LENGTH, MAX_FLAG_LIST_LENGTH, SECRET_FLAG_NAME, CLI_FLAGS, METADATA_FLAG, OPTION_FLAG_NAMES;
|
|
3839
|
+
var init_replayInvocation = __esm({
|
|
3840
|
+
"src/replayInvocation.ts"() {
|
|
3841
|
+
"use strict";
|
|
3842
|
+
init_constants();
|
|
3843
|
+
init_readEnv();
|
|
3844
|
+
REPLAY_EXECUTION_TARGET_ENV = "BITFAB_REPLAY_EXECUTION_TARGET";
|
|
3845
|
+
HOSTED_EXECUTION_TARGET = "hosted";
|
|
3846
|
+
CI_ENV = "CI";
|
|
3847
|
+
CI_TRUE_VALUES = /* @__PURE__ */ new Set(["true", "1"]);
|
|
3848
|
+
CI_PRESENCE_ENV_VARS = [
|
|
3849
|
+
"GITHUB_ACTIONS",
|
|
3850
|
+
"GITLAB_CI",
|
|
3851
|
+
"CIRCLECI",
|
|
3852
|
+
"BUILDKITE",
|
|
3853
|
+
"JENKINS_URL",
|
|
3854
|
+
"TF_BUILD"
|
|
3855
|
+
];
|
|
3856
|
+
MAX_FLAGS = 100;
|
|
3857
|
+
MAX_FLAG_NAME_LENGTH = 100;
|
|
3858
|
+
MAX_FLAG_STRING_LENGTH = 1e3;
|
|
3859
|
+
MAX_FLAG_LIST_LENGTH = 100;
|
|
3860
|
+
SECRET_FLAG_NAME = /key|token|secret|password/i;
|
|
3861
|
+
CLI_FLAGS = /* @__PURE__ */ Symbol("bitfab.replayCliFlags");
|
|
3862
|
+
METADATA_FLAG = "metadata";
|
|
3863
|
+
OPTION_FLAG_NAMES = {
|
|
3864
|
+
maxConcurrency: "concurrency",
|
|
3865
|
+
datasetId: "dataset-ids",
|
|
3866
|
+
datasetIds: "dataset-ids"
|
|
3867
|
+
};
|
|
3868
|
+
}
|
|
3869
|
+
});
|
|
3870
|
+
|
|
3761
3871
|
// src/selectiveReplay.ts
|
|
3762
3872
|
function replayNodeKey(node) {
|
|
3763
3873
|
return JSON.stringify([node.traceFunctionKey, node.spanName]);
|
|
@@ -4187,6 +4297,16 @@ function resolveDbBranchSettings(dbBranch) {
|
|
|
4187
4297
|
};
|
|
4188
4298
|
return Object.keys(settings).length === 0 ? void 0 : settings;
|
|
4189
4299
|
}
|
|
4300
|
+
function explicitReplayOptions(options) {
|
|
4301
|
+
var _a;
|
|
4302
|
+
const explicit = {};
|
|
4303
|
+
for (const name of REPLAY_OPTION_NAMES) {
|
|
4304
|
+
if (options?.[name] !== void 0) {
|
|
4305
|
+
explicit[_a = optionFlagName(name)] ?? (explicit[_a] = options[name]);
|
|
4306
|
+
}
|
|
4307
|
+
}
|
|
4308
|
+
return explicit;
|
|
4309
|
+
}
|
|
4190
4310
|
function reportReplayProgress(progress) {
|
|
4191
4311
|
const stderr = typeof process !== "undefined" ? process.stderr : void 0;
|
|
4192
4312
|
if (!stderr) {
|
|
@@ -4698,7 +4818,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4698
4818
|
options?.experimentalSelectiveReplay,
|
|
4699
4819
|
options?.notes,
|
|
4700
4820
|
options?.metadata,
|
|
4701
|
-
options?.dryRun === true
|
|
4821
|
+
options?.dryRun === true,
|
|
4822
|
+
safeReplayInvocation(
|
|
4823
|
+
() => buildReplayInvocation(
|
|
4824
|
+
Object.entries(cliFlags(options) ?? explicitReplayOptions(options))
|
|
4825
|
+
)
|
|
4826
|
+
)
|
|
4702
4827
|
);
|
|
4703
4828
|
if (started.items.length === 0) {
|
|
4704
4829
|
try {
|
|
@@ -5090,7 +5215,7 @@ async function writeReplayResultFile(result) {
|
|
|
5090
5215
|
}
|
|
5091
5216
|
}
|
|
5092
5217
|
}
|
|
5093
|
-
var REPLAY_PERSISTENCE_TIMEOUT_MS, MAX_REPLAY_ATTEMPTS, RESUME_CONFLICTING_OPTIONS, CARRIED_OVER_ERROR, BITFAB_PROGRESS_PREFIX, ReplayError, DbBranchReplayError, JUDGE_ASSERTIONS_DEPRECATION_WARNING;
|
|
5218
|
+
var REPLAY_PERSISTENCE_TIMEOUT_MS, MAX_REPLAY_ATTEMPTS, RESUME_CONFLICTING_OPTIONS, CARRIED_OVER_ERROR, REPLAY_OPTION_NAMES, BITFAB_PROGRESS_PREFIX, ReplayError, DbBranchReplayError, JUDGE_ASSERTIONS_DEPRECATION_WARNING;
|
|
5094
5219
|
var init_replay = __esm({
|
|
5095
5220
|
"src/replay.ts"() {
|
|
5096
5221
|
"use strict";
|
|
@@ -5103,6 +5228,7 @@ var init_replay = __esm({
|
|
|
5103
5228
|
init_replayContext();
|
|
5104
5229
|
init_replayHeartbeat();
|
|
5105
5230
|
init_replayInterrupt();
|
|
5231
|
+
init_replayInvocation();
|
|
5106
5232
|
init_selectiveReplayRuntime();
|
|
5107
5233
|
init_serialize();
|
|
5108
5234
|
init_warnOnce();
|
|
@@ -5120,6 +5246,37 @@ var init_replay = __esm({
|
|
|
5120
5246
|
"experimentalSelectiveReplay"
|
|
5121
5247
|
];
|
|
5122
5248
|
CARRIED_OVER_ERROR = "This item errored in an earlier run of this experiment, before it was resumed.";
|
|
5249
|
+
REPLAY_OPTION_NAMES = [
|
|
5250
|
+
"experimentalSelectiveReplay",
|
|
5251
|
+
"limit",
|
|
5252
|
+
"attempts",
|
|
5253
|
+
"traceIds",
|
|
5254
|
+
"name",
|
|
5255
|
+
"notes",
|
|
5256
|
+
"metadata",
|
|
5257
|
+
"maxConcurrency",
|
|
5258
|
+
"codeChangeDescription",
|
|
5259
|
+
"codeChangeFiles",
|
|
5260
|
+
"mock",
|
|
5261
|
+
"mockOverride",
|
|
5262
|
+
"dbBranch",
|
|
5263
|
+
"experimentGroupId",
|
|
5264
|
+
"datasetId",
|
|
5265
|
+
"datasetIds",
|
|
5266
|
+
"graderIds",
|
|
5267
|
+
"onlyWithAssertions",
|
|
5268
|
+
"skipAssertionJudging",
|
|
5269
|
+
"judgeAssertions",
|
|
5270
|
+
"adaptInputs",
|
|
5271
|
+
"dryRun",
|
|
5272
|
+
"onItemFinish",
|
|
5273
|
+
"onProgress",
|
|
5274
|
+
"onItemStart",
|
|
5275
|
+
"onExperimentStart",
|
|
5276
|
+
"onInterrupt",
|
|
5277
|
+
"resume",
|
|
5278
|
+
"force"
|
|
5279
|
+
];
|
|
5123
5280
|
BITFAB_PROGRESS_PREFIX = "@@bitfab:progress ";
|
|
5124
5281
|
ReplayError = class extends BitfabError {
|
|
5125
5282
|
constructor(message, items, experimentId, experimentUrl, cause) {
|
|
@@ -6903,9 +7060,34 @@ var GradersClient = class {
|
|
|
6903
7060
|
init_http();
|
|
6904
7061
|
|
|
6905
7062
|
// src/labels.ts
|
|
7063
|
+
init_errors();
|
|
6906
7064
|
init_http();
|
|
6907
7065
|
var LABELS_PATH = "/api/sdk/traces/labels";
|
|
6908
7066
|
var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
|
|
7067
|
+
function assertEveryVerdictNamesAnAssertion(updates) {
|
|
7068
|
+
const unscoped = updates.filter(
|
|
7069
|
+
(update) => !("archive" in update && update.archive === true) && (typeof update.assertionId !== "string" || update.assertionId === "")
|
|
7070
|
+
);
|
|
7071
|
+
if (unscoped.length > 0) {
|
|
7072
|
+
const targets = unscoped.map(
|
|
7073
|
+
(update) => update.traceId ?? update.originalTraceId
|
|
7074
|
+
);
|
|
7075
|
+
throw new BitfabError(
|
|
7076
|
+
`Agent verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.save, saveAll, and skip. Only archive may omit it, to clear an old whole-trace verdict.`
|
|
7077
|
+
);
|
|
7078
|
+
}
|
|
7079
|
+
}
|
|
7080
|
+
function assertEveryHumanVerdictNamesAnAssertion(updates) {
|
|
7081
|
+
const unscoped = updates.filter(
|
|
7082
|
+
(update) => typeof update.assertionId !== "string" || update.assertionId === ""
|
|
7083
|
+
);
|
|
7084
|
+
if (unscoped.length > 0) {
|
|
7085
|
+
const targets = unscoped.map((update) => update.traceId);
|
|
7086
|
+
throw new BitfabError(
|
|
7087
|
+
`Human verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.saveHuman and saveHumanAll.`
|
|
7088
|
+
);
|
|
7089
|
+
}
|
|
7090
|
+
}
|
|
6909
7091
|
function labelEvidencePath(traceId, assertionId) {
|
|
6910
7092
|
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
|
|
6911
7093
|
}
|
|
@@ -6918,6 +7100,7 @@ var LabelsClient = class {
|
|
|
6918
7100
|
return outcome;
|
|
6919
7101
|
}
|
|
6920
7102
|
async saveAll(updates, experimentId) {
|
|
7103
|
+
assertEveryVerdictNamesAnAssertion(updates);
|
|
6921
7104
|
const response = await this.httpClient.request(
|
|
6922
7105
|
LABELS_PATH,
|
|
6923
7106
|
{
|
|
@@ -6927,11 +7110,9 @@ var LabelsClient = class {
|
|
|
6927
7110
|
);
|
|
6928
7111
|
return response.labels;
|
|
6929
7112
|
}
|
|
6930
|
-
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
6931
7113
|
async skip(target, experimentId) {
|
|
6932
7114
|
return this.save({ ...target, skip: true }, experimentId);
|
|
6933
7115
|
}
|
|
6934
|
-
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
6935
7116
|
async archive(target, experimentId) {
|
|
6936
7117
|
return this.save({ ...target, archive: true }, experimentId);
|
|
6937
7118
|
}
|
|
@@ -6940,6 +7121,7 @@ var LabelsClient = class {
|
|
|
6940
7121
|
return outcome;
|
|
6941
7122
|
}
|
|
6942
7123
|
async saveHumanAll(updates) {
|
|
7124
|
+
assertEveryHumanVerdictNamesAnAssertion(updates);
|
|
6943
7125
|
const response = await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates });
|
|
6944
7126
|
return response.labels;
|
|
6945
7127
|
}
|
|
@@ -11977,6 +12159,7 @@ init_replay();
|
|
|
11977
12159
|
init_errors();
|
|
11978
12160
|
init_replay();
|
|
11979
12161
|
init_replayInterrupt();
|
|
12162
|
+
init_replayInvocation();
|
|
11980
12163
|
init_warnOnce();
|
|
11981
12164
|
function defineReplayRegistry(registry) {
|
|
11982
12165
|
validateReplayRegistry(registry);
|