@sedum-dev/core 0.1.0-alpha.20 → 0.1.0-alpha.22
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/index.d.ts +28 -7
- package/dist/index.js +72 -39
- package/dist/run-result.schema.json +9 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export { j as Ai, k as AiValue, l as FlowStep, m as FormatCoverage, n as ModuleD
|
|
|
5
5
|
import { inspect } from 'node:util';
|
|
6
6
|
import 'playwright/test';
|
|
7
7
|
|
|
8
|
+
/** Whether a test's outcome decides the run; see `ResultTest.blocking`. */
|
|
9
|
+
declare function isBlocking(test: ResultTest): boolean;
|
|
10
|
+
/** A non-blocking test that failed or could not run. */
|
|
11
|
+
declare function nonBlockingFailure(test: ResultTest): boolean;
|
|
8
12
|
declare function resultTotals(tests: readonly ResultTest[], setupCalls?: readonly ResultCall[], selectedTestCount?: number): RunResult["totals"];
|
|
9
13
|
|
|
10
14
|
declare const ResultSourceSchema: z.ZodObject<{
|
|
@@ -687,6 +691,7 @@ declare const ResultTestSchema: z.ZodObject<{
|
|
|
687
691
|
verify: z.ZodString;
|
|
688
692
|
}, z.core.$strict>>;
|
|
689
693
|
tags: z.ZodArray<z.ZodString>;
|
|
694
|
+
blocking: z.ZodOptional<z.ZodLiteral<false>>;
|
|
690
695
|
state: z.ZodEnum<{
|
|
691
696
|
error: "error";
|
|
692
697
|
running: "running";
|
|
@@ -1000,6 +1005,7 @@ declare const ResultTotalsSchema: z.ZodObject<{
|
|
|
1000
1005
|
executedTests: z.ZodNumber;
|
|
1001
1006
|
passedTests: z.ZodNumber;
|
|
1002
1007
|
failedTests: z.ZodNumber;
|
|
1008
|
+
nonBlockingFailedTests: z.ZodOptional<z.ZodNumber>;
|
|
1003
1009
|
passedSteps: z.ZodNumber;
|
|
1004
1010
|
failedSteps: z.ZodNumber;
|
|
1005
1011
|
historicalAttempts: z.ZodNumber;
|
|
@@ -1079,6 +1085,7 @@ declare const RunResultSchema: z.ZodObject<{
|
|
|
1079
1085
|
executedTests: z.ZodNumber;
|
|
1080
1086
|
passedTests: z.ZodNumber;
|
|
1081
1087
|
failedTests: z.ZodNumber;
|
|
1088
|
+
nonBlockingFailedTests: z.ZodOptional<z.ZodNumber>;
|
|
1082
1089
|
passedSteps: z.ZodNumber;
|
|
1083
1090
|
failedSteps: z.ZodNumber;
|
|
1084
1091
|
historicalAttempts: z.ZodNumber;
|
|
@@ -1123,6 +1130,7 @@ declare const RunResultSchema: z.ZodObject<{
|
|
|
1123
1130
|
verify: z.ZodString;
|
|
1124
1131
|
}, z.core.$strict>>;
|
|
1125
1132
|
tags: z.ZodArray<z.ZodString>;
|
|
1133
|
+
blocking: z.ZodOptional<z.ZodLiteral<false>>;
|
|
1126
1134
|
state: z.ZodEnum<{
|
|
1127
1135
|
error: "error";
|
|
1128
1136
|
running: "running";
|
|
@@ -1504,6 +1512,7 @@ declare class RunRecorder {
|
|
|
1504
1512
|
private readonly started;
|
|
1505
1513
|
private value;
|
|
1506
1514
|
private readonly ordinals;
|
|
1515
|
+
private nonBlocking;
|
|
1507
1516
|
private lastTestId;
|
|
1508
1517
|
constructor(sink: ResultSink, runId?: string);
|
|
1509
1518
|
get runId(): string;
|
|
@@ -1517,8 +1526,12 @@ declare class RunRecorder {
|
|
|
1517
1526
|
start(): Promise<void>;
|
|
1518
1527
|
addSetupCalls(calls: readonly ResultCall[]): Promise<void>;
|
|
1519
1528
|
addDiscoveryProblems(problems: NonNullable<RunResult["discoveryProblems"]>): Promise<void>;
|
|
1520
|
-
/**
|
|
1521
|
-
|
|
1529
|
+
/**
|
|
1530
|
+
* Record the selection size and, for parallel or sharded runs, how it runs.
|
|
1531
|
+
* Tests named in `nonBlockingIds` are recorded with `blocking: false` when
|
|
1532
|
+
* they start.
|
|
1533
|
+
*/
|
|
1534
|
+
selectTests(count: number, execution?: ResultExecution, nonBlockingIds?: readonly string[]): Promise<void>;
|
|
1522
1535
|
/** The recording for a selection ordinal, if that test has started. */
|
|
1523
1536
|
testAt(ordinal: number): TestRecording | undefined;
|
|
1524
1537
|
/** The most recently started test, for sequential single-test callers. */
|
|
@@ -2048,6 +2061,8 @@ interface RelevanceProvider {
|
|
|
2048
2061
|
readonly calls: readonly ProviderCall[];
|
|
2049
2062
|
/** Max over complete diff chunks, not a calibrated whole-PR probability. */
|
|
2050
2063
|
readonly chunkCount?: number;
|
|
2064
|
+
/** Indexes of tests too large to score; the caller runs them. */
|
|
2065
|
+
readonly oversized?: readonly number[];
|
|
2051
2066
|
}>;
|
|
2052
2067
|
}
|
|
2053
2068
|
interface ResolverDecision {
|
|
@@ -2577,11 +2592,17 @@ declare function buildRelevanceBatches<Request>(diff: string, tests: readonly Re
|
|
|
2577
2592
|
pair: number;
|
|
2578
2593
|
batch: number;
|
|
2579
2594
|
questions: number;
|
|
2595
|
+
/** Pair bytes a test must leave for the diff, its metadata and markers. */
|
|
2596
|
+
minDiff: number;
|
|
2580
2597
|
}): {
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2598
|
+
batches: {
|
|
2599
|
+
request: Request;
|
|
2600
|
+
indexes: number[];
|
|
2601
|
+
chunkIndex: number;
|
|
2602
|
+
}[];
|
|
2603
|
+
/** Tests too large to score; callers run them rather than truncate them. */
|
|
2604
|
+
oversized: number[];
|
|
2605
|
+
};
|
|
2585
2606
|
|
|
2586
2607
|
interface VisionObservation {
|
|
2587
2608
|
readonly instruction: string;
|
|
@@ -4203,4 +4224,4 @@ interface ActionRequest {
|
|
|
4203
4224
|
readonly description: string;
|
|
4204
4225
|
}
|
|
4205
4226
|
|
|
4206
|
-
export { ACCEPTANCE_POLICY_VERSION, type ActionRequest, AiValues, type Aim, type AimResult, type AllowRule, AssertionEngineError, type AssertionEngineErrorCode, type AssertionOptions, type AttemptDependencies, type AttemptReport, BACKOFF_JITTER, type BrowserContextOptions, type BrowserContextSession, type BrowserDriver, BrowserDriverError, type BrowserDriverErrorCode, type BrowserInstallResult, type BrowserKind, type BrowserLaunchOptions, type BrowserPage, type BrowserSession, type BrowserSignal, type BrowserSignalSource, BugDetector, type BugDetectorOptions, CACHE_FORMAT, CANDIDATE_LIMIT, CLASSIFICATION_PROMPT_VERSION, type CacheEntry, type CacheLookup, type CacheMissReason, type CacheStore, type CachedClassification, type Candidate, type CandidatePage, type ChoiceWhy, ClassificationBatchError, type ClassificationCache, type ClassificationDiagnostic, type ClassificationDiagnosticCode, type ClassificationInput, type ClassificationMetrics, type ClassificationOptions, type ClassificationProvider, type ClassificationResult, type ClassifiedFlowDefinition, type ClassifiedFlowSentence, type ClassifiedFlowStep, type ClassifiedModuleStep, type ClassifiedStep, type ClassifyFlowOptions, type ClickOptions, type ClickResult, type ControlStateResult, DEFAULT_ALLOW, DEFAULT_BAND, DEFAULT_CONTRADICTION_CUTOFF, DEFAULT_MAX_SEVERAL, DEFAULT_MIN_P, DEFAULT_PROVIDER_CONCURRENCY, DEFAULT_SEMANTIC_THRESHOLDS, DEFAULT_TUNING, DIGEST_LIMIT, DataResolutionError, DeclaredDataValue, type Detection, type DetectionCheck, type DetectorCall, type DigestResult, type DiscoveryProblem, type DiscoveryProblemCode, type EmittedStep, type EmittedTest, type ExplorationAdvisor, type ExploreAction, type ExploreActionKind, type ExploreAdvice, type ExploreAdviceRequest, type ExploreDecision, type ExploreDecisionRequest, type ExploreFailure, type ExploreFinding, type ExploreMode, type ExploreOptions, type ExploreResult, type ExploreRunMeta, type ExploreRunResult, type ExploreSafety, type ExploreStepView, type ExploreTuning, FileClassificationCache, type FillResult, type FillTarget, type FindingTest, type FlowClassificationDiagnostic, type FlowClassificationResult, FlowDefinition, FlowDiagnostic, type FlowRunResult, type FlowRunnerDependencies, FlowScalar, FlowSource, FlowToken, FlowValidationResult, type FrameBox, type FreshPage, FullValidationCoverage, GOAL_NO_MATCH, GateAborted, GateWaitExceeded, type GoalAction, type GoalChoice, type GoalDecision, type GoalOptions, type GoalPlanner, type GoalResult, type GoalState, type GoalValueState, type HelperCall, type HistoryMove, INSPECTED_PAGE_LIMITS, type ImportBinding, type InputSource, type InspectedPage, type InvalidListEntry, type ItemVerdict, type Judge, type JudgeDecision, type JudgePageDigest, type LineRange, type ListedDiagnostic, type ListedTest, type LoadedScriptFile, LocatorCacheConflict, type LocatorCacheDiagnostic, type LocatorCacheLookup, type LocatorCacheSeed, type LocatorDiagnostic, type LocatorFailure, type LocatorOptionDiagnostic, type LocatorOptions, type LocatorResult, MATCHER_VERSION, MAX_COOLDOWN_MS, MAX_PROVIDER_CONCURRENCY, MIN_MODEL_MARGIN, MIN_MODEL_PROBABILITY, MODEL_CHOICES, type MatchResult, type MeasureResult, type ModelChoice, type ModelClassification, type ModelDecision, ModuleBinding, ModuleBindingResolutionError, ModuleStep, NAME_LIMIT, NOT_CHECKED_OFFLINE_CODE, NO_PAGE_FINDINGS, type NavigationOptions, type NavigationResult, NoopCacheStore, NoopClassificationCache, OPERATIONS, OPERATION_SET_VERSION, type Operation, type OracleEvent, type OracleOptions, PAGE_KINDS, PAGE_PROTOCOL, PEER_LIMIT, type PageBridge, type PageCheck, PageChecks, type PageChecksOptions, type PageFindings, type PageInspection, type PageInspector, PageScriptError, PageSignalCollector, type PageVersion, type ParseFlowOptions, ParsedFlowResult, ParsedModuleResult, PlaywrightBrowserDriver, type PlaywrightBrowserDriverOptions, type ProjectFileValidation, type ProjectFiles, type ProjectValidationCounts, type ProjectValidationOptions, type ProjectValidationResult, type ProviderCall, type ProviderCallOptions, ProviderError, type ProviderErrorCode, ProviderGate, type ProviderGateOptions, type ProviderRate, type ProviderTokenUsage, RATE_LIMIT_BUDGET_MS, type ReadTargetResult, type RejectionOwner, RejectionRouter, type RelevanceProvider, type RelevanceTest, type RepeatedMemberPolicy, type ReportPrivacy, type ResolveFlowModulesOptions, type ResolvedDataEntry, type ResolvedFlowResult, ResolvedModuleCall, ResolvedStepTarget, type Resolver, type ResolverCandidate, type ResolverCandidates, type ResolverDecision, type ResolverItem, type ResolverOption, type ResultAttempt, ResultAttemptSchema, type ResultCall, ResultCallSchema, type ResultDetection, ResultDetectionSchema, ResultErrorSchema, type ResultExecution, ResultExecutionSchema, type ResultFrame, ResultFrameSchema, ResultJudgementSchema, ResultLocatorSchema, ResultObservationSchema, type ResultPage, ResultPageSchema, type ResultProblem, ResultProblemSchema, type ResultSink, ResultSourceSchema, type ResultStep, ResultStepSchema, type ResultTest, ResultTestSchema, ResultTotalsSchema, ReusableBrowserDriver, RunRecorder, type RunResult, RunResultSchema, type RunningTest, RuntimeUrl, RuntimeValue, SCRIPT_TEST_SUFFIX, SEMANTIC_CHECKS, ScriptRegistration, type ScriptSentence, type ScriptSentenceScan, type ScriptTest, ScriptUsageError, SeededRandom, type SemanticCheck, type SemanticThresholds, type SentenceClassification, type SentencePresentation, SentenceStep, type SettleOptions, type SettleResult, type ShrinkResult, type SignalSettleOptions, type StateInspection, type StepCommand, StepExecutionError, type StepExecutionOptions, type StepExecutionResult, type StepFailureCode, type StepFailurePhase, type StepFrames, type StepInspection, type StepOperation, type StepOperationKind, type StepOutcome, type StepSource, type StepTokenization, type StrayReason, TEST_SUFFIXES, type TargetCheckDecision, type TargetCheckInput, type TargetCheckOptions, type TargetChecker, type TargetIdentity, TestBody, type TestListing, TestRecording, type TestStartInput, type TraceEntry, type UnattributedRejection, ValidationInput, type VerifyDecision, type VerifyFlag, type VerifyOptions, type VerifyPolicy, type VerifyResult, type VisionFailure, type VisionObservation, type VisionResolver, WAIT_UNTIL, type WriteRecord, allowed, attributeRejection, backoffDelay, buildExploreRunResult, buildRelevanceBatches, callExtent, canonicalSentence, captureVisionObservation, checkRegistrations, classificationKey, classifyParsedFlow, classifySentenceSteps, classifySteps, clearPageRefs, clickTarget, closeQuietly, codePoints, collectCandidates, compareDiagnostics, controlState, cooldownDelay, dedupeDiagnostics, describeAction, describeRejection, discoverFlowFiles, discoverProjectFiles, displayPath, emitTest, evaluateModelAnswer, evaluateVerifyScores, executeSentence, executeStep, explore, findBrowserExecutable, findIdentityCollisions, firstDiagnostic, goalChoiceAccepted, goalFailureArtifacts, goalOperations, inlineValues, installChromium, isClaimSentence, isFlowScalar, isPageInspector, isRunWideProviderError, isSafeRole, isScriptTestFile, isStaticHoldsClaim, isWeakPeer, keyedDigest, listTests, liveCandidates, loadFlowFile, loadListingEntries, loadScriptFile, looksDestructive, matchEntry, matchLiveEntry, measure, navigationWhy, nextConcurrency, normalizeSignal, opaqueMatches, pageDigest, pageKey, pageVersion, parseAllowRule, parseDataTemplate, parseFlow, parseModule, parseRetryAfter, patternOperation, preflightSentence, projectCandidates, projectDigest, quietPage, readTarget, recordGoalAction, redactOpaqueText, relevanceQuestion, replay, reportPage, resolveData, resolveEntryUrl, resolveFlowModules, resolveModuleBindings, resolveTarget, resolveTypeOperand, resultCall, resultTotals, runFlow, runGoal, runResultJsonSchema, runScriptTest, runtimeFailure, safeSource, safeText, safeUrl, sameVisualVersion, scanImportBindings, scanLocalImports, scanScriptSentences, scriptListingEntries, semanticDetections, shrink, signalDetection, stageEntry, stateDetections, targetVariants, textDetections, tokenize, tokenizeStep, uniqueDetections, unknownCostCall, validateFlows, validateOperand, validateProject, validateRunResult, validateTypeOperand, valueEntries, verify, visibleText, visualCandidates, walkSuiteFiles };
|
|
4227
|
+
export { ACCEPTANCE_POLICY_VERSION, type ActionRequest, AiValues, type Aim, type AimResult, type AllowRule, AssertionEngineError, type AssertionEngineErrorCode, type AssertionOptions, type AttemptDependencies, type AttemptReport, BACKOFF_JITTER, type BrowserContextOptions, type BrowserContextSession, type BrowserDriver, BrowserDriverError, type BrowserDriverErrorCode, type BrowserInstallResult, type BrowserKind, type BrowserLaunchOptions, type BrowserPage, type BrowserSession, type BrowserSignal, type BrowserSignalSource, BugDetector, type BugDetectorOptions, CACHE_FORMAT, CANDIDATE_LIMIT, CLASSIFICATION_PROMPT_VERSION, type CacheEntry, type CacheLookup, type CacheMissReason, type CacheStore, type CachedClassification, type Candidate, type CandidatePage, type ChoiceWhy, ClassificationBatchError, type ClassificationCache, type ClassificationDiagnostic, type ClassificationDiagnosticCode, type ClassificationInput, type ClassificationMetrics, type ClassificationOptions, type ClassificationProvider, type ClassificationResult, type ClassifiedFlowDefinition, type ClassifiedFlowSentence, type ClassifiedFlowStep, type ClassifiedModuleStep, type ClassifiedStep, type ClassifyFlowOptions, type ClickOptions, type ClickResult, type ControlStateResult, DEFAULT_ALLOW, DEFAULT_BAND, DEFAULT_CONTRADICTION_CUTOFF, DEFAULT_MAX_SEVERAL, DEFAULT_MIN_P, DEFAULT_PROVIDER_CONCURRENCY, DEFAULT_SEMANTIC_THRESHOLDS, DEFAULT_TUNING, DIGEST_LIMIT, DataResolutionError, DeclaredDataValue, type Detection, type DetectionCheck, type DetectorCall, type DigestResult, type DiscoveryProblem, type DiscoveryProblemCode, type EmittedStep, type EmittedTest, type ExplorationAdvisor, type ExploreAction, type ExploreActionKind, type ExploreAdvice, type ExploreAdviceRequest, type ExploreDecision, type ExploreDecisionRequest, type ExploreFailure, type ExploreFinding, type ExploreMode, type ExploreOptions, type ExploreResult, type ExploreRunMeta, type ExploreRunResult, type ExploreSafety, type ExploreStepView, type ExploreTuning, FileClassificationCache, type FillResult, type FillTarget, type FindingTest, type FlowClassificationDiagnostic, type FlowClassificationResult, FlowDefinition, FlowDiagnostic, type FlowRunResult, type FlowRunnerDependencies, FlowScalar, FlowSource, FlowToken, FlowValidationResult, type FrameBox, type FreshPage, FullValidationCoverage, GOAL_NO_MATCH, GateAborted, GateWaitExceeded, type GoalAction, type GoalChoice, type GoalDecision, type GoalOptions, type GoalPlanner, type GoalResult, type GoalState, type GoalValueState, type HelperCall, type HistoryMove, INSPECTED_PAGE_LIMITS, type ImportBinding, type InputSource, type InspectedPage, type InvalidListEntry, type ItemVerdict, type Judge, type JudgeDecision, type JudgePageDigest, type LineRange, type ListedDiagnostic, type ListedTest, type LoadedScriptFile, LocatorCacheConflict, type LocatorCacheDiagnostic, type LocatorCacheLookup, type LocatorCacheSeed, type LocatorDiagnostic, type LocatorFailure, type LocatorOptionDiagnostic, type LocatorOptions, type LocatorResult, MATCHER_VERSION, MAX_COOLDOWN_MS, MAX_PROVIDER_CONCURRENCY, MIN_MODEL_MARGIN, MIN_MODEL_PROBABILITY, MODEL_CHOICES, type MatchResult, type MeasureResult, type ModelChoice, type ModelClassification, type ModelDecision, ModuleBinding, ModuleBindingResolutionError, ModuleStep, NAME_LIMIT, NOT_CHECKED_OFFLINE_CODE, NO_PAGE_FINDINGS, type NavigationOptions, type NavigationResult, NoopCacheStore, NoopClassificationCache, OPERATIONS, OPERATION_SET_VERSION, type Operation, type OracleEvent, type OracleOptions, PAGE_KINDS, PAGE_PROTOCOL, PEER_LIMIT, type PageBridge, type PageCheck, PageChecks, type PageChecksOptions, type PageFindings, type PageInspection, type PageInspector, PageScriptError, PageSignalCollector, type PageVersion, type ParseFlowOptions, ParsedFlowResult, ParsedModuleResult, PlaywrightBrowserDriver, type PlaywrightBrowserDriverOptions, type ProjectFileValidation, type ProjectFiles, type ProjectValidationCounts, type ProjectValidationOptions, type ProjectValidationResult, type ProviderCall, type ProviderCallOptions, ProviderError, type ProviderErrorCode, ProviderGate, type ProviderGateOptions, type ProviderRate, type ProviderTokenUsage, RATE_LIMIT_BUDGET_MS, type ReadTargetResult, type RejectionOwner, RejectionRouter, type RelevanceProvider, type RelevanceTest, type RepeatedMemberPolicy, type ReportPrivacy, type ResolveFlowModulesOptions, type ResolvedDataEntry, type ResolvedFlowResult, ResolvedModuleCall, ResolvedStepTarget, type Resolver, type ResolverCandidate, type ResolverCandidates, type ResolverDecision, type ResolverItem, type ResolverOption, type ResultAttempt, ResultAttemptSchema, type ResultCall, ResultCallSchema, type ResultDetection, ResultDetectionSchema, ResultErrorSchema, type ResultExecution, ResultExecutionSchema, type ResultFrame, ResultFrameSchema, ResultJudgementSchema, ResultLocatorSchema, ResultObservationSchema, type ResultPage, ResultPageSchema, type ResultProblem, ResultProblemSchema, type ResultSink, ResultSourceSchema, type ResultStep, ResultStepSchema, type ResultTest, ResultTestSchema, ResultTotalsSchema, ReusableBrowserDriver, RunRecorder, type RunResult, RunResultSchema, type RunningTest, RuntimeUrl, RuntimeValue, SCRIPT_TEST_SUFFIX, SEMANTIC_CHECKS, ScriptRegistration, type ScriptSentence, type ScriptSentenceScan, type ScriptTest, ScriptUsageError, SeededRandom, type SemanticCheck, type SemanticThresholds, type SentenceClassification, type SentencePresentation, SentenceStep, type SettleOptions, type SettleResult, type ShrinkResult, type SignalSettleOptions, type StateInspection, type StepCommand, StepExecutionError, type StepExecutionOptions, type StepExecutionResult, type StepFailureCode, type StepFailurePhase, type StepFrames, type StepInspection, type StepOperation, type StepOperationKind, type StepOutcome, type StepSource, type StepTokenization, type StrayReason, TEST_SUFFIXES, type TargetCheckDecision, type TargetCheckInput, type TargetCheckOptions, type TargetChecker, type TargetIdentity, TestBody, type TestListing, TestRecording, type TestStartInput, type TraceEntry, type UnattributedRejection, ValidationInput, type VerifyDecision, type VerifyFlag, type VerifyOptions, type VerifyPolicy, type VerifyResult, type VisionFailure, type VisionObservation, type VisionResolver, WAIT_UNTIL, type WriteRecord, allowed, attributeRejection, backoffDelay, buildExploreRunResult, buildRelevanceBatches, callExtent, canonicalSentence, captureVisionObservation, checkRegistrations, classificationKey, classifyParsedFlow, classifySentenceSteps, classifySteps, clearPageRefs, clickTarget, closeQuietly, codePoints, collectCandidates, compareDiagnostics, controlState, cooldownDelay, dedupeDiagnostics, describeAction, describeRejection, discoverFlowFiles, discoverProjectFiles, displayPath, emitTest, evaluateModelAnswer, evaluateVerifyScores, executeSentence, executeStep, explore, findBrowserExecutable, findIdentityCollisions, firstDiagnostic, goalChoiceAccepted, goalFailureArtifacts, goalOperations, inlineValues, installChromium, isBlocking, isClaimSentence, isFlowScalar, isPageInspector, isRunWideProviderError, isSafeRole, isScriptTestFile, isStaticHoldsClaim, isWeakPeer, keyedDigest, listTests, liveCandidates, loadFlowFile, loadListingEntries, loadScriptFile, looksDestructive, matchEntry, matchLiveEntry, measure, navigationWhy, nextConcurrency, nonBlockingFailure, normalizeSignal, opaqueMatches, pageDigest, pageKey, pageVersion, parseAllowRule, parseDataTemplate, parseFlow, parseModule, parseRetryAfter, patternOperation, preflightSentence, projectCandidates, projectDigest, quietPage, readTarget, recordGoalAction, redactOpaqueText, relevanceQuestion, replay, reportPage, resolveData, resolveEntryUrl, resolveFlowModules, resolveModuleBindings, resolveTarget, resolveTypeOperand, resultCall, resultTotals, runFlow, runGoal, runResultJsonSchema, runScriptTest, runtimeFailure, safeSource, safeText, safeUrl, sameVisualVersion, scanImportBindings, scanLocalImports, scanScriptSentences, scriptListingEntries, semanticDetections, shrink, signalDetection, stageEntry, stateDetections, targetVariants, textDetections, tokenize, tokenizeStep, uniqueDetections, unknownCostCall, validateFlows, validateOperand, validateProject, validateRunResult, validateTypeOperand, valueEntries, verify, visibleText, visualCandidates, walkSuiteFiles };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,21 @@ import {
|
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
16
|
// src/run-result/validation.ts
|
|
17
|
+
function isBlocking(test2) {
|
|
18
|
+
return test2.blocking !== false;
|
|
19
|
+
}
|
|
20
|
+
function nonBlockingFailure(test2) {
|
|
21
|
+
return !isBlocking(test2) && (test2.verdict === "failed" || test2.state === "error");
|
|
22
|
+
}
|
|
23
|
+
function completedRunVerdict(tests) {
|
|
24
|
+
const blocking = tests.filter(isBlocking);
|
|
25
|
+
if (blocking.some((test2) => test2.verdict === "failed")) return "failed";
|
|
26
|
+
if (blocking.every((test2) => test2.verdict === "passed")) return "passed";
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function runFlags(tests) {
|
|
30
|
+
return [...new Set(tests.filter(isBlocking).flatMap((test2) => test2.flags))];
|
|
31
|
+
}
|
|
17
32
|
function resultTotals(tests, setupCalls = [], selectedTestCount = tests.length) {
|
|
18
33
|
const selected = tests.flatMap(
|
|
19
34
|
(test2) => test2.attempts.filter((attempt) => attempt.id === test2.selectedAttemptId)
|
|
@@ -33,7 +48,10 @@ function resultTotals(tests, setupCalls = [], selectedTestCount = tests.length)
|
|
|
33
48
|
selectedTests: selectedTestCount,
|
|
34
49
|
executedTests: tests.filter((test2) => test2.attempts.length > 0).length,
|
|
35
50
|
passedTests: tests.filter((test2) => test2.verdict === "passed").length,
|
|
36
|
-
failedTests: tests.filter(
|
|
51
|
+
failedTests: tests.filter(
|
|
52
|
+
(test2) => isBlocking(test2) && test2.verdict === "failed"
|
|
53
|
+
).length,
|
|
54
|
+
...tests.some((test2) => !isBlocking(test2)) ? { nonBlockingFailedTests: tests.filter(nonBlockingFailure).length } : {},
|
|
37
55
|
passedSteps: steps.filter((step) => step.verdict === "passed").length,
|
|
38
56
|
failedSteps: steps.filter((step) => step.verdict === "failed").length,
|
|
39
57
|
historicalAttempts: tests.reduce(
|
|
@@ -208,9 +226,7 @@ function validateTest(test2, ids) {
|
|
|
208
226
|
function expectedRunVerdict(result) {
|
|
209
227
|
if (result.error || result.state !== "completed" || result.tests.length === 0)
|
|
210
228
|
return null;
|
|
211
|
-
|
|
212
|
-
if (result.tests.every((test2) => test2.verdict === "passed")) return "passed";
|
|
213
|
-
return null;
|
|
229
|
+
return completedRunVerdict(result.tests);
|
|
214
230
|
}
|
|
215
231
|
function validateRunAggregates(result) {
|
|
216
232
|
const expectedTotals = resultTotals(
|
|
@@ -226,15 +242,14 @@ function validateRunAggregates(result) {
|
|
|
226
242
|
result.verdict !== expectedRunVerdict(result),
|
|
227
243
|
"Run verdict differs from tests"
|
|
228
244
|
);
|
|
229
|
-
const runFlags = [...new Set(result.tests.flatMap((test2) => test2.flags))];
|
|
230
245
|
rejectIf(
|
|
231
|
-
JSON.stringify(result.flags) !== JSON.stringify(runFlags),
|
|
246
|
+
JSON.stringify(result.flags) !== JSON.stringify(runFlags(result.tests)),
|
|
232
247
|
"Run flags differ from tests"
|
|
233
248
|
);
|
|
234
249
|
}
|
|
235
250
|
function validateRunCompletion(result) {
|
|
236
251
|
const hasIncompleteTest = result.tests.some(
|
|
237
|
-
(test2) => test2.state !== "completed"
|
|
252
|
+
(test2) => test2.state !== "completed" && (isBlocking(test2) || test2.state !== "error")
|
|
238
253
|
);
|
|
239
254
|
rejectIf(
|
|
240
255
|
result.state === "completed" && (result.error !== null || result.tests.length === 0 || hasIncompleteTest),
|
|
@@ -486,6 +501,12 @@ var ResultTestSchema = z.strictObject({
|
|
|
486
501
|
description: z.string().max(512),
|
|
487
502
|
goal: z.strictObject({ text: z.string(), verify: z.string() }).optional(),
|
|
488
503
|
tags: z.array(z.string().max(120)),
|
|
504
|
+
/**
|
|
505
|
+
* `false` when `--non-blocking-labels` matched a tag: the test runs and is
|
|
506
|
+
* reported, but its failure or error does not decide the run. Absent means
|
|
507
|
+
* blocking.
|
|
508
|
+
*/
|
|
509
|
+
blocking: z.literal(false).optional(),
|
|
489
510
|
state,
|
|
490
511
|
verdict: verdict.nullable(),
|
|
491
512
|
flags: z.array(flag),
|
|
@@ -496,7 +517,10 @@ var ResultTotalsSchema = z.strictObject({
|
|
|
496
517
|
selectedTests: count,
|
|
497
518
|
executedTests: count,
|
|
498
519
|
passedTests: count,
|
|
520
|
+
/** Failed blocking tests; non-blocking failures count separately. */
|
|
499
521
|
failedTests: count,
|
|
522
|
+
/** Non-blocking tests that failed or could not run; present when any test is non-blocking. */
|
|
523
|
+
nonBlockingFailedTests: count.optional(),
|
|
500
524
|
passedSteps: count,
|
|
501
525
|
failedSteps: count,
|
|
502
526
|
historicalAttempts: count,
|
|
@@ -634,6 +658,20 @@ function newAttempt(runId, ordinal2, lane2) {
|
|
|
634
658
|
primaryProblemId: null
|
|
635
659
|
};
|
|
636
660
|
}
|
|
661
|
+
function newTest(input, attempt, blocking) {
|
|
662
|
+
return {
|
|
663
|
+
id: input.id,
|
|
664
|
+
file: input.file,
|
|
665
|
+
description: input.description ?? "",
|
|
666
|
+
tags: [...input.tags ?? []],
|
|
667
|
+
...blocking ? {} : { blocking: false },
|
|
668
|
+
state: "running",
|
|
669
|
+
verdict: null,
|
|
670
|
+
flags: [],
|
|
671
|
+
selectedAttemptId: attempt.id,
|
|
672
|
+
attempts: [attempt]
|
|
673
|
+
};
|
|
674
|
+
}
|
|
637
675
|
var RunRecorder = class {
|
|
638
676
|
constructor(sink, runId = randomUUID()) {
|
|
639
677
|
this.sink = sink;
|
|
@@ -660,6 +698,7 @@ var RunRecorder = class {
|
|
|
660
698
|
started = performance.now();
|
|
661
699
|
value;
|
|
662
700
|
ordinals = /* @__PURE__ */ new Map();
|
|
701
|
+
nonBlocking = /* @__PURE__ */ new Set();
|
|
663
702
|
lastTestId = null;
|
|
664
703
|
get runId() {
|
|
665
704
|
return this.value.runId;
|
|
@@ -677,9 +716,7 @@ var RunRecorder = class {
|
|
|
677
716
|
this.value.setupCalls,
|
|
678
717
|
Math.max(this.value.selectedTestCount ?? 0, this.value.tests.length)
|
|
679
718
|
),
|
|
680
|
-
flags:
|
|
681
|
-
...new Set(this.value.tests.flatMap((test2) => test2.flags))
|
|
682
|
-
]
|
|
719
|
+
flags: runFlags(this.value.tests)
|
|
683
720
|
};
|
|
684
721
|
await this.sink(validateRunResult(this.value));
|
|
685
722
|
}
|
|
@@ -728,10 +765,15 @@ var RunRecorder = class {
|
|
|
728
765
|
};
|
|
729
766
|
await this.publish();
|
|
730
767
|
}
|
|
731
|
-
/**
|
|
732
|
-
|
|
768
|
+
/**
|
|
769
|
+
* Record the selection size and, for parallel or sharded runs, how it runs.
|
|
770
|
+
* Tests named in `nonBlockingIds` are recorded with `blocking: false` when
|
|
771
|
+
* they start.
|
|
772
|
+
*/
|
|
773
|
+
async selectTests(count2, execution, nonBlockingIds = []) {
|
|
733
774
|
if (!Number.isSafeInteger(count2) || count2 < this.value.tests.length)
|
|
734
775
|
throw new Error("Selected test count is invalid");
|
|
776
|
+
this.nonBlocking = new Set(nonBlockingIds);
|
|
735
777
|
this.value = {
|
|
736
778
|
...this.value,
|
|
737
779
|
selectedTestCount: count2,
|
|
@@ -760,18 +802,11 @@ var RunRecorder = class {
|
|
|
760
802
|
const ordinal2 = input.ordinal ?? Math.max(-1, ...this.ordinals.values()) + 1;
|
|
761
803
|
if ([...this.ordinals.values()].includes(ordinal2))
|
|
762
804
|
throw new Error("Test ordinal already started");
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
tags: [...input.tags ?? []],
|
|
769
|
-
state: "running",
|
|
770
|
-
verdict: null,
|
|
771
|
-
flags: [],
|
|
772
|
-
selectedAttemptId: attempt.id,
|
|
773
|
-
attempts: [attempt]
|
|
774
|
-
};
|
|
805
|
+
const test2 = newTest(
|
|
806
|
+
input,
|
|
807
|
+
newAttempt(this.value.runId, 1, input.lane),
|
|
808
|
+
!this.nonBlocking.has(input.id)
|
|
809
|
+
);
|
|
775
810
|
const position = this.value.tests.findIndex(
|
|
776
811
|
(entry) => (this.ordinals.get(entry.id) ?? 0) > ordinal2
|
|
777
812
|
);
|
|
@@ -982,15 +1017,13 @@ var RunRecorder = class {
|
|
|
982
1017
|
};
|
|
983
1018
|
}
|
|
984
1019
|
const tests = this.value.tests;
|
|
985
|
-
const verdict2 = error2 || tests.length === 0
|
|
1020
|
+
const verdict2 = error2 || tests.length === 0 ? null : completedRunVerdict(tests);
|
|
986
1021
|
this.value = {
|
|
987
1022
|
...this.value,
|
|
988
1023
|
state: error2 ? terminalState : "completed",
|
|
989
1024
|
error: error2,
|
|
990
1025
|
verdict: verdict2,
|
|
991
|
-
flags:
|
|
992
|
-
...new Set(tests.flatMap((test2) => test2.flags))
|
|
993
|
-
],
|
|
1026
|
+
flags: runFlags(tests),
|
|
994
1027
|
finishedAt: at
|
|
995
1028
|
};
|
|
996
1029
|
await this.publish();
|
|
@@ -3593,16 +3626,14 @@ function buildRelevanceBatches(diff, tests, makeRequest, limits) {
|
|
|
3593
3626
|
const questions = tests.map(relevanceQuestion);
|
|
3594
3627
|
const bytes = (request) => Buffer.byteLength(JSON.stringify(request));
|
|
3595
3628
|
const pair = (text, index) => makeRequest(text, { [`test${index}`]: questions[index] });
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
`Test ${JSON.stringify(test2.file)} exceeds the relevance context budget; input was not truncated. Run the full suite.`
|
|
3601
|
-
);
|
|
3602
|
-
if (!tests.length || !diff) return [];
|
|
3603
|
-
const fits = (text) => tests.every((_, index) => bytes(pair(text, index)) <= limits.pair);
|
|
3604
|
-
const diffs = fits(diff) ? [diff] : partition(diff, fits);
|
|
3629
|
+
const oversized = [];
|
|
3630
|
+
const scored = [];
|
|
3631
|
+
for (const index of tests.keys())
|
|
3632
|
+
(bytes(pair("", index)) > limits.pair - limits.minDiff ? oversized : scored).push(index);
|
|
3605
3633
|
const output = [];
|
|
3634
|
+
if (!scored.length || !diff) return { batches: output, oversized };
|
|
3635
|
+
const fits = (text) => scored.every((index) => bytes(pair(text, index)) <= limits.pair);
|
|
3636
|
+
const diffs = fits(diff) ? [diff] : partition(diff, fits);
|
|
3606
3637
|
const push = (text, indexes, chunkIndex) => {
|
|
3607
3638
|
output.push({
|
|
3608
3639
|
request: makeRequest(
|
|
@@ -3622,7 +3653,7 @@ function buildRelevanceBatches(diff, tests, makeRequest, limits) {
|
|
|
3622
3653
|
};
|
|
3623
3654
|
for (const [chunkIndex, text] of diffs.entries()) {
|
|
3624
3655
|
let indexes = [];
|
|
3625
|
-
for (const index of
|
|
3656
|
+
for (const index of scored) {
|
|
3626
3657
|
const candidate = [...indexes, index];
|
|
3627
3658
|
const request = makeRequest(
|
|
3628
3659
|
text,
|
|
@@ -3635,7 +3666,7 @@ function buildRelevanceBatches(diff, tests, makeRequest, limits) {
|
|
|
3635
3666
|
}
|
|
3636
3667
|
if (indexes.length) push(text, indexes, chunkIndex);
|
|
3637
3668
|
}
|
|
3638
|
-
return output;
|
|
3669
|
+
return { batches: output, oversized };
|
|
3639
3670
|
}
|
|
3640
3671
|
|
|
3641
3672
|
// src/vision.ts
|
|
@@ -17521,6 +17552,7 @@ export {
|
|
|
17521
17552
|
goalOperations,
|
|
17522
17553
|
inlineValues,
|
|
17523
17554
|
installChromium,
|
|
17555
|
+
isBlocking,
|
|
17524
17556
|
isClaimSentence,
|
|
17525
17557
|
isFlowScalar,
|
|
17526
17558
|
isFullyValidated,
|
|
@@ -17543,6 +17575,7 @@ export {
|
|
|
17543
17575
|
measure,
|
|
17544
17576
|
navigationWhy,
|
|
17545
17577
|
nextConcurrency,
|
|
17578
|
+
nonBlockingFailure,
|
|
17546
17579
|
normalizeSignal,
|
|
17547
17580
|
opaqueMatches,
|
|
17548
17581
|
pageDigest,
|
|
@@ -198,6 +198,11 @@
|
|
|
198
198
|
"minimum": 0,
|
|
199
199
|
"maximum": 9007199254740991
|
|
200
200
|
},
|
|
201
|
+
"nonBlockingFailedTests": {
|
|
202
|
+
"type": "integer",
|
|
203
|
+
"minimum": 0,
|
|
204
|
+
"maximum": 9007199254740991
|
|
205
|
+
},
|
|
201
206
|
"passedSteps": {
|
|
202
207
|
"type": "integer",
|
|
203
208
|
"minimum": 0,
|
|
@@ -442,6 +447,10 @@
|
|
|
442
447
|
"maxLength": 120
|
|
443
448
|
}
|
|
444
449
|
},
|
|
450
|
+
"blocking": {
|
|
451
|
+
"type": "boolean",
|
|
452
|
+
"const": false
|
|
453
|
+
},
|
|
445
454
|
"state": {
|
|
446
455
|
"type": "string",
|
|
447
456
|
"enum": [
|