bitfab 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-J342BFLH.js → chunk-25HVPGSF.js} +39 -4
- package/dist/chunk-25HVPGSF.js.map +1 -0
- package/dist/{chunk-B363XZTL.js → chunk-2U4Y5FHT.js} +150 -3
- package/dist/chunk-2U4Y5FHT.js.map +1 -0
- package/dist/{chunk-6NUSTEQ6.js → chunk-2UDEQITO.js} +32 -8
- package/dist/chunk-2UDEQITO.js.map +1 -0
- package/dist/{chunk-MS3GWCJB.js → chunk-P2SYAT44.js} +6 -3
- package/dist/{chunk-MS3GWCJB.js.map → chunk-P2SYAT44.js.map} +1 -1
- package/dist/{chunk-ROZEHSGO.js → chunk-YGDXDDTX.js} +6 -3
- package/dist/chunk-YGDXDDTX.js.map +1 -0
- package/dist/{http-BD3WK3FL.js → http-CWPHM5T3.js} +2 -2
- package/dist/{http-2UZ6CM3K.js → http-JBQTF36K.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-KQCLQRJT.js → replay-LBALXLOM.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-6NUSTEQ6.js.map +0 -1
- package/dist/chunk-B363XZTL.js.map +0 -1
- package/dist/chunk-J342BFLH.js.map +0 -1
- package/dist/chunk-ROZEHSGO.js.map +0 -1
- /package/dist/{http-2UZ6CM3K.js.map → http-CWPHM5T3.js.map} +0 -0
- /package/dist/{http-BD3WK3FL.js.map → http-JBQTF36K.js.map} +0 -0
- /package/dist/{replay-KQCLQRJT.js.map → replay-LBALXLOM.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
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
getCurrentTrace,
|
|
37
37
|
reseedFromRegistry,
|
|
38
38
|
seedFromRegistry
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-2UDEQITO.js";
|
|
40
40
|
import "./chunk-YWXQM6J3.js";
|
|
41
41
|
import {
|
|
42
42
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
ReplayError,
|
|
46
46
|
reportReplayProgress,
|
|
47
47
|
serializeReplayResult
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-2U4Y5FHT.js";
|
|
49
49
|
import {
|
|
50
50
|
BitfabError,
|
|
51
51
|
DEFAULT_SERVICE_URL,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
MixedTracingError,
|
|
54
54
|
__version__,
|
|
55
55
|
flushTraces
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-YGDXDDTX.js";
|
|
57
57
|
import "./chunk-MT36GJMW.js";
|
|
58
58
|
export {
|
|
59
59
|
AssertionCategoriesClient,
|
package/dist/node.cjs
CHANGED
|
@@ -97,7 +97,7 @@ var __version__, __packageName__;
|
|
|
97
97
|
var init_version_generated = __esm({
|
|
98
98
|
"src/version.generated.ts"() {
|
|
99
99
|
"use strict";
|
|
100
|
-
__version__ = "0.64.
|
|
100
|
+
__version__ = "0.64.8";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -2911,7 +2911,7 @@ var init_http = __esm({
|
|
|
2911
2911
|
* Start a replay session by fetching historical traces.
|
|
2912
2912
|
* Blocking call - creates an experiment and returns lightweight item references.
|
|
2913
2913
|
*/
|
|
2914
|
-
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun) {
|
|
2914
|
+
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun, invocation) {
|
|
2915
2915
|
const payload = { traceFunctionKey };
|
|
2916
2916
|
if (experimentalSelectiveReplay !== void 0) {
|
|
2917
2917
|
payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
|
|
@@ -2972,6 +2972,9 @@ var init_http = __esm({
|
|
|
2972
2972
|
if (dryRun) {
|
|
2973
2973
|
payload.dryRun = true;
|
|
2974
2974
|
}
|
|
2975
|
+
if (invocation !== void 0) {
|
|
2976
|
+
payload.invocation = invocation;
|
|
2977
|
+
}
|
|
2975
2978
|
const git = await resolvedGitState();
|
|
2976
2979
|
if (git && !isEmptyGitState(git)) {
|
|
2977
2980
|
payload.git = git;
|
|
@@ -3767,6 +3770,113 @@ var init_replayInterrupt = __esm({
|
|
|
3767
3770
|
}
|
|
3768
3771
|
});
|
|
3769
3772
|
|
|
3773
|
+
// src/replayInvocation.ts
|
|
3774
|
+
function replayEnvironment() {
|
|
3775
|
+
if (readEnv(REPLAY_EXECUTION_TARGET_ENV) === HOSTED_EXECUTION_TARGET) {
|
|
3776
|
+
return "cloud_replay";
|
|
3777
|
+
}
|
|
3778
|
+
if (CI_TRUE_VALUES.has((readEnv(CI_ENV) ?? "").toLowerCase())) {
|
|
3779
|
+
return "ci";
|
|
3780
|
+
}
|
|
3781
|
+
if (CI_PRESENCE_ENV_VARS.some((name) => (readEnv(name) ?? "") !== "")) {
|
|
3782
|
+
return "ci";
|
|
3783
|
+
}
|
|
3784
|
+
return "local";
|
|
3785
|
+
}
|
|
3786
|
+
function flagScalar(value) {
|
|
3787
|
+
if (typeof value === "string") {
|
|
3788
|
+
return value.slice(0, MAX_FLAG_STRING_LENGTH);
|
|
3789
|
+
}
|
|
3790
|
+
if (typeof value === "number") {
|
|
3791
|
+
return Number.isFinite(value) ? value : void 0;
|
|
3792
|
+
}
|
|
3793
|
+
if (typeof value === "boolean" || value === null) {
|
|
3794
|
+
return value;
|
|
3795
|
+
}
|
|
3796
|
+
return void 0;
|
|
3797
|
+
}
|
|
3798
|
+
function flagValue(value) {
|
|
3799
|
+
if (Array.isArray(value)) {
|
|
3800
|
+
const items = value.slice(0, MAX_FLAG_LIST_LENGTH).map(flagScalar);
|
|
3801
|
+
return items.every((item) => item !== void 0) ? items : true;
|
|
3802
|
+
}
|
|
3803
|
+
const scalar = flagScalar(value);
|
|
3804
|
+
return scalar === void 0 ? true : scalar;
|
|
3805
|
+
}
|
|
3806
|
+
function optionFlagName(option) {
|
|
3807
|
+
return OPTION_FLAG_NAMES[option] ?? option.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
3808
|
+
}
|
|
3809
|
+
function metadataKeys(value) {
|
|
3810
|
+
const keys = Array.isArray(value) ? value.map((pair) => String(pair).split("=")[0]) : typeof value === "object" && value !== null ? Object.keys(value) : void 0;
|
|
3811
|
+
return keys === void 0 ? true : [...new Set(keys)].sort();
|
|
3812
|
+
}
|
|
3813
|
+
function invocationFlags(entries) {
|
|
3814
|
+
const flags = {};
|
|
3815
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3816
|
+
for (const [name, value] of entries) {
|
|
3817
|
+
if (seen.size >= MAX_FLAGS) {
|
|
3818
|
+
break;
|
|
3819
|
+
}
|
|
3820
|
+
if (value === void 0 || seen.has(name) || name.length === 0 || name.length > MAX_FLAG_NAME_LENGTH || SECRET_FLAG_NAME.test(name)) {
|
|
3821
|
+
continue;
|
|
3822
|
+
}
|
|
3823
|
+
flags[name] = flagValue(
|
|
3824
|
+
name === METADATA_FLAG ? metadataKeys(value) : value
|
|
3825
|
+
);
|
|
3826
|
+
seen.add(name);
|
|
3827
|
+
}
|
|
3828
|
+
return flags;
|
|
3829
|
+
}
|
|
3830
|
+
function buildReplayInvocation(entries = []) {
|
|
3831
|
+
return {
|
|
3832
|
+
flags: invocationFlags(entries),
|
|
3833
|
+
sdk: { language: "typescript", version: __version__ },
|
|
3834
|
+
environment: replayEnvironment()
|
|
3835
|
+
};
|
|
3836
|
+
}
|
|
3837
|
+
function safeReplayInvocation(build) {
|
|
3838
|
+
try {
|
|
3839
|
+
return build();
|
|
3840
|
+
} catch {
|
|
3841
|
+
return void 0;
|
|
3842
|
+
}
|
|
3843
|
+
}
|
|
3844
|
+
function cliFlags(options) {
|
|
3845
|
+
return options?.[CLI_FLAGS];
|
|
3846
|
+
}
|
|
3847
|
+
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;
|
|
3848
|
+
var init_replayInvocation = __esm({
|
|
3849
|
+
"src/replayInvocation.ts"() {
|
|
3850
|
+
"use strict";
|
|
3851
|
+
init_constants();
|
|
3852
|
+
init_readEnv();
|
|
3853
|
+
REPLAY_EXECUTION_TARGET_ENV = "BITFAB_REPLAY_EXECUTION_TARGET";
|
|
3854
|
+
HOSTED_EXECUTION_TARGET = "hosted";
|
|
3855
|
+
CI_ENV = "CI";
|
|
3856
|
+
CI_TRUE_VALUES = /* @__PURE__ */ new Set(["true", "1"]);
|
|
3857
|
+
CI_PRESENCE_ENV_VARS = [
|
|
3858
|
+
"GITHUB_ACTIONS",
|
|
3859
|
+
"GITLAB_CI",
|
|
3860
|
+
"CIRCLECI",
|
|
3861
|
+
"BUILDKITE",
|
|
3862
|
+
"JENKINS_URL",
|
|
3863
|
+
"TF_BUILD"
|
|
3864
|
+
];
|
|
3865
|
+
MAX_FLAGS = 100;
|
|
3866
|
+
MAX_FLAG_NAME_LENGTH = 100;
|
|
3867
|
+
MAX_FLAG_STRING_LENGTH = 1e3;
|
|
3868
|
+
MAX_FLAG_LIST_LENGTH = 100;
|
|
3869
|
+
SECRET_FLAG_NAME = /key|token|secret|password/i;
|
|
3870
|
+
CLI_FLAGS = /* @__PURE__ */ Symbol("bitfab.replayCliFlags");
|
|
3871
|
+
METADATA_FLAG = "metadata";
|
|
3872
|
+
OPTION_FLAG_NAMES = {
|
|
3873
|
+
maxConcurrency: "concurrency",
|
|
3874
|
+
datasetId: "dataset-ids",
|
|
3875
|
+
datasetIds: "dataset-ids"
|
|
3876
|
+
};
|
|
3877
|
+
}
|
|
3878
|
+
});
|
|
3879
|
+
|
|
3770
3880
|
// src/selectiveReplay.ts
|
|
3771
3881
|
function replayNodeKey(node) {
|
|
3772
3882
|
return JSON.stringify([node.traceFunctionKey, node.spanName]);
|
|
@@ -4196,6 +4306,16 @@ function resolveDbBranchSettings(dbBranch) {
|
|
|
4196
4306
|
};
|
|
4197
4307
|
return Object.keys(settings).length === 0 ? void 0 : settings;
|
|
4198
4308
|
}
|
|
4309
|
+
function explicitReplayOptions(options) {
|
|
4310
|
+
var _a;
|
|
4311
|
+
const explicit = {};
|
|
4312
|
+
for (const name of REPLAY_OPTION_NAMES) {
|
|
4313
|
+
if (options?.[name] !== void 0) {
|
|
4314
|
+
explicit[_a = optionFlagName(name)] ?? (explicit[_a] = options[name]);
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
return explicit;
|
|
4318
|
+
}
|
|
4199
4319
|
function reportReplayProgress(progress) {
|
|
4200
4320
|
const stderr = typeof process !== "undefined" ? process.stderr : void 0;
|
|
4201
4321
|
if (!stderr) {
|
|
@@ -4707,7 +4827,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4707
4827
|
options?.experimentalSelectiveReplay,
|
|
4708
4828
|
options?.notes,
|
|
4709
4829
|
options?.metadata,
|
|
4710
|
-
options?.dryRun === true
|
|
4830
|
+
options?.dryRun === true,
|
|
4831
|
+
safeReplayInvocation(
|
|
4832
|
+
() => buildReplayInvocation(
|
|
4833
|
+
Object.entries(cliFlags(options) ?? explicitReplayOptions(options))
|
|
4834
|
+
)
|
|
4835
|
+
)
|
|
4711
4836
|
);
|
|
4712
4837
|
if (started.items.length === 0) {
|
|
4713
4838
|
try {
|
|
@@ -5099,7 +5224,7 @@ async function writeReplayResultFile(result) {
|
|
|
5099
5224
|
}
|
|
5100
5225
|
}
|
|
5101
5226
|
}
|
|
5102
|
-
var REPLAY_PERSISTENCE_TIMEOUT_MS, MAX_REPLAY_ATTEMPTS, RESUME_CONFLICTING_OPTIONS, CARRIED_OVER_ERROR, BITFAB_PROGRESS_PREFIX, ReplayError, DbBranchReplayError, JUDGE_ASSERTIONS_DEPRECATION_WARNING;
|
|
5227
|
+
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;
|
|
5103
5228
|
var init_replay = __esm({
|
|
5104
5229
|
"src/replay.ts"() {
|
|
5105
5230
|
"use strict";
|
|
@@ -5112,6 +5237,7 @@ var init_replay = __esm({
|
|
|
5112
5237
|
init_replayContext();
|
|
5113
5238
|
init_replayHeartbeat();
|
|
5114
5239
|
init_replayInterrupt();
|
|
5240
|
+
init_replayInvocation();
|
|
5115
5241
|
init_selectiveReplayRuntime();
|
|
5116
5242
|
init_serialize();
|
|
5117
5243
|
init_warnOnce();
|
|
@@ -5129,6 +5255,37 @@ var init_replay = __esm({
|
|
|
5129
5255
|
"experimentalSelectiveReplay"
|
|
5130
5256
|
];
|
|
5131
5257
|
CARRIED_OVER_ERROR = "This item errored in an earlier run of this experiment, before it was resumed.";
|
|
5258
|
+
REPLAY_OPTION_NAMES = [
|
|
5259
|
+
"experimentalSelectiveReplay",
|
|
5260
|
+
"limit",
|
|
5261
|
+
"attempts",
|
|
5262
|
+
"traceIds",
|
|
5263
|
+
"name",
|
|
5264
|
+
"notes",
|
|
5265
|
+
"metadata",
|
|
5266
|
+
"maxConcurrency",
|
|
5267
|
+
"codeChangeDescription",
|
|
5268
|
+
"codeChangeFiles",
|
|
5269
|
+
"mock",
|
|
5270
|
+
"mockOverride",
|
|
5271
|
+
"dbBranch",
|
|
5272
|
+
"experimentGroupId",
|
|
5273
|
+
"datasetId",
|
|
5274
|
+
"datasetIds",
|
|
5275
|
+
"graderIds",
|
|
5276
|
+
"onlyWithAssertions",
|
|
5277
|
+
"skipAssertionJudging",
|
|
5278
|
+
"judgeAssertions",
|
|
5279
|
+
"adaptInputs",
|
|
5280
|
+
"dryRun",
|
|
5281
|
+
"onItemFinish",
|
|
5282
|
+
"onProgress",
|
|
5283
|
+
"onItemStart",
|
|
5284
|
+
"onExperimentStart",
|
|
5285
|
+
"onInterrupt",
|
|
5286
|
+
"resume",
|
|
5287
|
+
"force"
|
|
5288
|
+
];
|
|
5132
5289
|
BITFAB_PROGRESS_PREFIX = "@@bitfab:progress ";
|
|
5133
5290
|
ReplayError = class extends BitfabError {
|
|
5134
5291
|
constructor(message, items, experimentId, experimentUrl, cause) {
|
|
@@ -6912,9 +7069,34 @@ var GradersClient = class {
|
|
|
6912
7069
|
init_http();
|
|
6913
7070
|
|
|
6914
7071
|
// src/labels.ts
|
|
7072
|
+
init_errors();
|
|
6915
7073
|
init_http();
|
|
6916
7074
|
var LABELS_PATH = "/api/sdk/traces/labels";
|
|
6917
7075
|
var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
|
|
7076
|
+
function assertEveryVerdictNamesAnAssertion(updates) {
|
|
7077
|
+
const unscoped = updates.filter(
|
|
7078
|
+
(update) => !("archive" in update && update.archive === true) && (typeof update.assertionId !== "string" || update.assertionId === "")
|
|
7079
|
+
);
|
|
7080
|
+
if (unscoped.length > 0) {
|
|
7081
|
+
const targets = unscoped.map(
|
|
7082
|
+
(update) => update.traceId ?? update.originalTraceId
|
|
7083
|
+
);
|
|
7084
|
+
throw new BitfabError(
|
|
7085
|
+
`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.`
|
|
7086
|
+
);
|
|
7087
|
+
}
|
|
7088
|
+
}
|
|
7089
|
+
function assertEveryHumanVerdictNamesAnAssertion(updates) {
|
|
7090
|
+
const unscoped = updates.filter(
|
|
7091
|
+
(update) => typeof update.assertionId !== "string" || update.assertionId === ""
|
|
7092
|
+
);
|
|
7093
|
+
if (unscoped.length > 0) {
|
|
7094
|
+
const targets = unscoped.map((update) => update.traceId);
|
|
7095
|
+
throw new BitfabError(
|
|
7096
|
+
`Human verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.saveHuman and saveHumanAll.`
|
|
7097
|
+
);
|
|
7098
|
+
}
|
|
7099
|
+
}
|
|
6918
7100
|
function labelEvidencePath(traceId, assertionId) {
|
|
6919
7101
|
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
|
|
6920
7102
|
}
|
|
@@ -6927,6 +7109,7 @@ var LabelsClient = class {
|
|
|
6927
7109
|
return outcome;
|
|
6928
7110
|
}
|
|
6929
7111
|
async saveAll(updates, experimentId) {
|
|
7112
|
+
assertEveryVerdictNamesAnAssertion(updates);
|
|
6930
7113
|
const response = await this.httpClient.request(
|
|
6931
7114
|
LABELS_PATH,
|
|
6932
7115
|
{
|
|
@@ -6936,11 +7119,9 @@ var LabelsClient = class {
|
|
|
6936
7119
|
);
|
|
6937
7120
|
return response.labels;
|
|
6938
7121
|
}
|
|
6939
|
-
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
6940
7122
|
async skip(target, experimentId) {
|
|
6941
7123
|
return this.save({ ...target, skip: true }, experimentId);
|
|
6942
7124
|
}
|
|
6943
|
-
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
6944
7125
|
async archive(target, experimentId) {
|
|
6945
7126
|
return this.save({ ...target, archive: true }, experimentId);
|
|
6946
7127
|
}
|
|
@@ -6949,6 +7130,7 @@ var LabelsClient = class {
|
|
|
6949
7130
|
return outcome;
|
|
6950
7131
|
}
|
|
6951
7132
|
async saveHumanAll(updates) {
|
|
7133
|
+
assertEveryHumanVerdictNamesAnAssertion(updates);
|
|
6952
7134
|
const response = await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates });
|
|
6953
7135
|
return response.labels;
|
|
6954
7136
|
}
|
|
@@ -11986,6 +12168,7 @@ init_replay();
|
|
|
11986
12168
|
init_errors();
|
|
11987
12169
|
init_replay();
|
|
11988
12170
|
init_replayInterrupt();
|
|
12171
|
+
init_replayInvocation();
|
|
11989
12172
|
init_warnOnce();
|
|
11990
12173
|
function defineReplayRegistry(registry) {
|
|
11991
12174
|
validateReplayRegistry(registry);
|