refactor(evidence): remove session ledger quotas
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
ConfigurationError,
|
||||
EvidenceFileError,
|
||||
EvidenceIntegrityError,
|
||||
EvidenceLimitError,
|
||||
HopperRemoteError,
|
||||
HopperProcessError,
|
||||
HopperStartError,
|
||||
@@ -133,7 +132,6 @@ const STATIC_ERROR_CATEGORIES: Readonly<
|
||||
AnalysisCapabilityUnavailableError: "unsupported_provider",
|
||||
ProviderSelectionError: "unsupported_provider",
|
||||
EvidenceIntegrityError: "integrity_mismatch",
|
||||
EvidenceLimitError: "truncated",
|
||||
AnalysisCancelledError: "cancelled",
|
||||
HopperCancelledError: "cancelled",
|
||||
AnalysisTimeoutError: "timeout",
|
||||
@@ -158,8 +156,6 @@ export const analysisErrorUserMessage = (error: AnalysisError): string => {
|
||||
return artifactMessage(error.reason);
|
||||
if (error instanceof EvidenceIntegrityError)
|
||||
return "Evidence is invalid or has changed. Recreate or re-import it, then try again.";
|
||||
if (error instanceof EvidenceLimitError)
|
||||
return "Evidence is too large for this session. Reduce the evidence set and try again.";
|
||||
if (error instanceof EvidenceFileError)
|
||||
return evidenceFileMessage(error.reason);
|
||||
if (error instanceof WorkspaceStorageError)
|
||||
@@ -307,7 +303,6 @@ const KNOWN_ERROR_TAGS = {
|
||||
ArtifactOperationError: true,
|
||||
ProcessCaptureError: true,
|
||||
EvidenceIntegrityError: true,
|
||||
EvidenceLimitError: true,
|
||||
EvidenceFileError: true,
|
||||
WorkspaceStorageError: true,
|
||||
UnknownRegistryError: true,
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
BinaryTargetError,
|
||||
BrowserObservationError,
|
||||
EvidenceFileError,
|
||||
EvidenceLimitError,
|
||||
EvidenceReferenceError,
|
||||
HopperCancelledError,
|
||||
HopperProcessError,
|
||||
@@ -175,7 +174,6 @@ const STATIC_ERROR_CODES = {
|
||||
NoBinaryOpenError: "target_unavailable",
|
||||
BinaryTargetError: "target_unavailable",
|
||||
EvidenceIntegrityError: "evidence_integrity_mismatch",
|
||||
EvidenceLimitError: "truncated",
|
||||
ProviderAdapterError: "execution_failure",
|
||||
HopperRemoteError: "execution_failure",
|
||||
} as const satisfies Readonly<
|
||||
@@ -266,8 +264,6 @@ const artifactStateErrorDetails = (
|
||||
reason: error.reason,
|
||||
...(error.reason === "limit" ? { truncated: true } : {}),
|
||||
};
|
||||
if (error instanceof EvidenceLimitError)
|
||||
return { limit: error.limit, maximum: error.maximum, truncated: true };
|
||||
if (error instanceof WorkspaceStorageError)
|
||||
return { operation: error.operation, reason: error.reason };
|
||||
if (error instanceof UnknownRegistryError) return { reason: error.reason };
|
||||
|
||||
@@ -38,7 +38,6 @@ const ANALYSIS_ERROR_TAGS = [
|
||||
"ArtifactOperationError",
|
||||
"ProcessCaptureError",
|
||||
"EvidenceIntegrityError",
|
||||
"EvidenceLimitError",
|
||||
"EvidenceFileError",
|
||||
"WorkspaceStorageError",
|
||||
"UnknownRegistryError",
|
||||
@@ -319,18 +318,6 @@ export class EvidenceReferenceError extends EvidenceIntegrityError {
|
||||
}
|
||||
}
|
||||
|
||||
/** A bounded evidence ledger cannot accept more records or serialized bytes. */
|
||||
export class EvidenceLimitError extends AnalysisError {
|
||||
readonly _tag = "EvidenceLimitError";
|
||||
|
||||
constructor(
|
||||
readonly limit: "records" | "bytes",
|
||||
readonly maximum: number,
|
||||
) {
|
||||
super(`Evidence ledger ${limit} limit exceeded (${String(maximum)})`);
|
||||
}
|
||||
}
|
||||
|
||||
/** Evidence bundle filesystem access failed within the configured policy. */
|
||||
export class EvidenceFileError extends AnalysisError {
|
||||
readonly _tag = "EvidenceFileError";
|
||||
|
||||
Reference in New Issue
Block a user