feat(ql3): establish 3.0 incubation baseline

This commit is contained in:
whyour
2026-08-12 00:25:26 +08:00
parent 4bf92dcfeb
commit c699c32461
2817 changed files with 779642 additions and 653 deletions
+59
View File
@@ -0,0 +1,59 @@
import type { RunAttemptStatus, RunStatus } from './run';
export class RunStateMachineError extends Error {
constructor(message: string, public readonly code: string) {
super(message);
this.name = new.target.name;
}
}
export class RunVersionConflictError extends RunStateMachineError {
constructor(
public readonly runId: string,
public readonly expectedVersion: number,
public readonly actualVersion: number,
) {
super(
'Run version does not match the expected version',
'RUN_VERSION_CONFLICT',
);
}
}
export class InvalidRunTransitionError extends RunStateMachineError {
constructor(
public readonly runId: string,
public readonly from: RunStatus,
public readonly to: RunStatus,
) {
super(
`Run cannot transition from ${from} to ${to}`,
'INVALID_RUN_TRANSITION',
);
}
}
export class InvalidRunAttemptTransitionError extends RunStateMachineError {
constructor(
public readonly attemptId: string,
public readonly from: RunAttemptStatus,
public readonly to: RunAttemptStatus,
) {
super(
`RunAttempt cannot transition from ${from} to ${to}`,
'INVALID_RUN_ATTEMPT_TRANSITION',
);
}
}
export class InvalidTransitionTimestampError extends RunStateMachineError {
constructor(message: string) {
super(message, 'INVALID_TRANSITION_TIMESTAMP');
}
}
export class InvalidTransitionMetadataError extends RunStateMachineError {
constructor(message: string) {
super(message, 'INVALID_TRANSITION_METADATA');
}
}