Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
/** Keep enough of evicted receipts to answer committed; derive the remaining receipt from its manifest. */
import { isRecord } from './orcad-migration-manifest-fields'
export const MAX_ORCAD_MIGRATION_EVICTED_RECEIPTS = 4_096
export type OrcadMigrationEvictedReceipt = {
migrationId: string
manifestSha256: string
importedAt: string
}
export function normalizeOrcadMigrationEvictedReceipts(
value: unknown
): OrcadMigrationEvictedReceipt[] {
if (!Array.isArray(value)) {
return []
}
return value
.filter(
(entry): entry is OrcadMigrationEvictedReceipt =>
isRecord(entry) &&
typeof entry.migrationId === 'string' &&
entry.migrationId.length > 0 &&
typeof entry.manifestSha256 === 'string' &&
/^[a-f0-9]{64}$/.test(entry.manifestSha256) &&
typeof entry.importedAt === 'string' &&
Number.isFinite(Date.parse(entry.importedAt))
)
.map(({ migrationId, manifestSha256, importedAt }) => ({
migrationId,
manifestSha256,
importedAt
}))
.slice(-MAX_ORCAD_MIGRATION_EVICTED_RECEIPTS)
}