// Type-level smoke test: exercises all exported APIs to catch declaration errors. // This file is checked by `npm run typecheck` but never executed at runtime. import { db, jobs, runs, messages, approvals, agents, dispatchQueue, gateway, paths, promptContext, retrieval, shellResults, idempotency, taskTracker, teamAdapter, shellRuntime, runtimeLease, dispatcherRuntime, runState, runCompletion, governance, deliveryOutbox, deliveryAttachments, approvalState, SCHEDULER_SCHEMAS, v02Runtime, handoffArtifacts, runtimeEvents, providerSessions, credentialRuntime, capabilityNegotiation, delegationRuntime, proofRuntime, evidenceRuntime, identityRuntime, type JobSpec, type JobRecord, type RunRecord, type MessageRecord, type ApprovalRecord, type AgentRecord, type DispatchRecord, type ShellResult, type PartialShellResult, type SendMessageOpts, type CreateRunOpts, type FinishRunOpts, type NormalizeShellOpts, type InboxOpts, type TeamMessagesOpts, type DbPathParams, type ArtifactsDirParams, type AgentTurnOpts, type AgentTurnWithTimeoutOpts, type AgentTurnResult, type DeliveryResult, type SqliteRunResult, type SchedulerDatabase, type TaskGroupOpts, type TaskGroupResult, type TaskGroupStatus, type TeamTaskGateOpts, type ResolvedIdentity, type TrustEvaluation, type AuthorizationProofResult, type AuthorizationResult, type EvidenceResult, type CredentialHandoffSummary, type HandoffArtifactRecord, type RuntimeEventRecord, type ProviderSessionRecord, type CredentialPresentationRecord, type CredentialMaterialization, type ArtifactEvidenceVerification, } from './index.js'; // ---- db ---- void db.getResolvedDbPath(); const schemaDb: SchedulerDatabase = db.applyBundledSchema('type smoke schema apply'); void schemaDb; void db.setDbPath(':memory:'); void db.closeDb(); const checkpoint = db.checkpointWal(); if (checkpoint) { void checkpoint.busy; void checkpoint.checkpointed; void checkpoint.log; } // ---- jobs: CRUD ---- const jobSpec: JobSpec = { name: 'Type smoke', schedule_cron: '0 0 31 2 *', payload_message: 'echo ok', run_timeout_ms: 300000, session_target: 'shell', payload_kind: 'shellCommand', }; const created: JobRecord = jobs.createJob(jobSpec); const fetched: JobRecord | undefined = jobs.getJob('id'); const listed: JobRecord[] = jobs.listJobs({ enabledOnly: true }); const listedWithArtifacts: JobRecord[] = jobs.listJobs({ enabledOnly: true, includeHandoffArtifacts: true, }); void listedWithArtifacts[0]?.handoff_artifact_payload; const updated: JobRecord | null = jobs.updateJob('id', { enabled: 0 }); jobs.deleteJob('id'); // ---- jobs: watchdog fields ---- const watchdogSpec: JobSpec = { name: 'Watchdog smoke', schedule_cron: '*/5 * * * *', payload_message: 'echo check', run_timeout_ms: 300000, session_target: 'shell', payload_kind: 'shellCommand', job_type: 'watchdog', watchdog_target_label: 'my-task', watchdog_check_cmd: 'curl -sf http://localhost/health', watchdog_timeout_min: 60, watchdog_alert_channel: 'telegram', watchdog_alert_target: '12345', watchdog_self_destruct: 1, watchdog_started_at: '2026-01-01 00:00:00', }; void watchdogSpec; // ---- jobs: additional fields ---- const fullSpec: JobSpec = { name: 'Full smoke', payload_message: 'echo full', run_timeout_ms: 300000, payload_scope: 'global', payload_model: 'gpt-5-mini', payload_model_fallback: 'openclaw:main', payload_thinking: 'extended', auth_profile_fallback: 'openai:work', delivery_guarantee: 'at-least-once', job_class: 'standard', preferred_session_key: 'my-key', delivery_opt_out_reason: 'background job, no delivery needed', }; void fullSpec; // ---- jobs: scheduling ---- const nextRun: string | null = jobs.nextRunFromCron('0 0 * * *'); const due: JobRecord[] = jobs.getDueJobs(); const runNow = jobs.runJobNow('id'); if (runNow) { void runNow.dispatch_id; void runNow.dispatch_kind; void runNow.name; } // ---- jobs: validation ---- jobs.validateJobSpec(jobSpec, null, 'create'); jobs.validateJobPayload('shell', 'shellCommand'); // ---- jobs: chaining ---- const children: JobRecord[] = jobs.getTriggeredChildren('parent', 'ok'); const allChildren: JobRecord[] = jobs.getChildJobs('parent'); const condMatch: boolean = jobs.evalTriggerCondition('contains:ALERT', 'ALERT: disk full'); const fired = jobs.fireTriggeredChildren('parent', 'ok', 'output'); if (fired.length) { void fired[0].dispatch_id; void fired[0].scheduled_for; } jobs.detectCycle('child', 'parent'); const depth: number = jobs.getChainDepth('id'); // ---- jobs: queue management ---- const enqueued = jobs.enqueueJob('id'); void enqueued.queued; void enqueued.queued_count; void enqueued.limited; const dequeued: boolean = jobs.dequeueJob('id'); const backlog: number = jobs.getDispatchBacklogCount('id'); const canEnqueue: boolean = jobs.canEnqueueDispatch('id', 25); // ---- jobs: retry ---- const shouldRetry: boolean = jobs.shouldRetry(created, 'run-id'); const retryResult = jobs.scheduleRetry(created, 'run-id'); void retryResult.retryCount; void retryResult.delaySec; void retryResult.retryOf; void retryResult.dispatch; if (retryResult.skipped) { void retryResult.skipped; } // ---- jobs: overlap detection ---- const hasRunning: boolean = jobs.hasRunningRun('id'); const poolRunning: boolean = jobs.hasRunningRunForPool('pool'); // ---- jobs: lifecycle ---- const cancelled: string[] = jobs.cancelJob('id', { cascade: true }); const pruned: number = jobs.pruneExpiredJobs(); // ---- runs ---- const run: RunRecord = runs.createRun('job-1', { status: 'running', retry_count: 0 }); void run.started_at; void run.finished_at; void run.duration_ms; void run.session_key; void run.last_heartbeat; void run.dispatched_at; void run.run_timeout_ms; void run.context_summary; void run.replay_of; void run.idempotency_key; const gotRun: RunRecord | undefined = runs.getRun('id'); const jobRuns: RunRecord[] = runs.getRunsForJob('job-1'); const finished: RunRecord | null = runs.finishRun('id', 'ok', { summary: 'done', shell_exit_code: 0 }); runs.updateHeartbeat('id'); runs.updateRunSession('id', 'key', 'session'); const stale = runs.getStaleRuns(90); if (stale.length) { void stale[0].job_name; void stale[0].job_timeout_ms; } const timedOut = runs.getTimedOutRuns(); if (timedOut.length) { void timedOut[0].job_name; } const running = runs.getRunningRuns(); if (running.length) { void running[0].job_name; void running[0].job_timeout_ms; } const poolRuns = runs.getRunningRunsByPool('pool'); if (poolRuns.length) { void poolRuns[0].job_name; } runs.pruneRuns(100); runs.updateContextSummary('id', { key: 'value' }); // ---- messages ---- const msg: MessageRecord = messages.sendMessage({ from_agent: 'main', to_agent: 'ops', body: 'hello', team_id: 'team-1', member_id: 'm-1', task_id: 't-1', kind: 'text', priority: 1, ack_required: 1, }); void msg.team_id; void msg.member_id; void msg.task_id; void msg.reply_to; void msg.subject; void msg.priority; void msg.channel; void msg.delivered_at; void msg.read_at; void msg.ack_required; void msg.ack_at; void msg.delivery_attempts; void msg.last_error; void msg.team_mapped_at; void msg.expires_at; void msg.created_at; void msg.job_id; void msg.run_id; void msg.owner; const gotMsg: MessageRecord | undefined = messages.getMessage('id'); const inbox: MessageRecord[] = messages.getInbox('main', { limit: 10, includeRead: true, teamId: 't' }); const outbox: MessageRecord[] = messages.getOutbox('main', 10); const thread: MessageRecord[] = messages.getThread('id'); const teamMsgs: MessageRecord[] = messages.getTeamMessages('team-1', { limit: 10, memberId: 'm-1' }); messages.markDelivered('id'); messages.markRead('id'); const markAllResult: SqliteRunResult = messages.markAllRead('main'); void markAllResult.changes; const unread: number = messages.getUnreadCount('main'); const acked: MessageRecord = messages.ackMessage('id', 'operator', 'acknowledged'); const expireResult: SqliteRunResult = messages.expireMessages(); void expireResult.changes; const pruneResult: SqliteRunResult = messages.pruneMessages(30, 3, 3); void pruneResult.changes; const attempt: MessageRecord | null = messages.recordMessageAttempt('id', { ok: true, actor: 'system' }); const receipts: Array> = messages.listMessageReceipts('id', 50); // ---- approvals ---- const approval: ApprovalRecord = approvals.createApproval('job-1', 'run-1', 'dq-1'); void approval.dispatch_queue_id; void approval.requested_at; void approval.resolved_at; void approval.resolved_by; void approval.notes; const gotApproval: ApprovalRecord | undefined = approvals.getApproval('id'); const pending: ApprovalRecord | undefined = approvals.getPendingApproval('job-1'); const allPending = approvals.listPendingApprovals(); if (allPending.length) { void allPending[0].job_name; } const resolved: ApprovalRecord | null = approvals.resolveApproval('id', 'approved', 'operator', 'lgtm'); const pendingCount: number = approvals.countPendingApprovalsForJob('job-1'); const timedOutApprovals = approvals.getTimedOutApprovals(); if (timedOutApprovals.length) { void timedOutApprovals[0].job_name; void timedOutApprovals[0].approval_timeout_s; void timedOutApprovals[0].approval_auto; } const pruneApprovalsResult: SqliteRunResult = approvals.pruneApprovals(30); void pruneApprovalsResult.changes; // ---- agents ---- const agent: AgentRecord = agents.upsertAgent('main', { name: 'Main', status: 'idle', capabilities: ['*'] }); void agent.last_seen_at; void agent.created_at; const gotAgent: AgentRecord | undefined = agents.getAgent('main'); const allAgents: AgentRecord[] = agents.listAgents(); agents.setAgentStatus('main', 'busy', 'session-key'); agents.touchAgent('main'); // ---- dispatchQueue ---- const dispatch: DispatchRecord = dispatchQueue.enqueueDispatch('job-1', { kind: 'manual' }); void dispatch.dispatch_kind; void dispatch.scheduled_for; void dispatch.source_run_id; void dispatch.claimed_at; void dispatch.processed_at; const gotDispatch: DispatchRecord | null = dispatchQueue.getDispatch('id'); const dueDispatches = dispatchQueue.getDueDispatches(10); if (dueDispatches.length) { void dueDispatches[0].job_name; } const claimed: DispatchRecord | null = dispatchQueue.claimDispatch('id'); const released: DispatchRecord | null = dispatchQueue.releaseDispatch('id', '2026-01-01 00:00:00'); const statusUpdated: DispatchRecord | null = dispatchQueue.setDispatchStatus('id', 'done'); const jobDispatches: DispatchRecord[] = dispatchQueue.listDispatchesForJob('job-1', 20); // ---- gateway ---- void gateway.TELEGRAM_MAX_MESSAGE_LENGTH; const parts: string[] = gateway.splitMessageForChannel('telegram', 'hello'); const alias = gateway.resolveDeliveryAlias('@owner_dm'); if (alias) { void alias.channel; void alias.target; } const healthy: Promise = gateway.checkGatewayHealth(); const waited: Promise = gateway.waitForGateway(5000, 1000); // Async gateway functions (type-check only, not called) async function _gatewaySmoke() { const turnResult: AgentTurnResult = await gateway.runAgentTurn({ message: 'hi', }); void turnResult.ok; void turnResult.content; void turnResult.usage; void turnResult.sessionKey; const activityResult: AgentTurnResult = await gateway.runAgentTurnWithActivityTimeout({ message: 'hi', idleTimeoutMs: 60000, absoluteTimeoutMs: 300000, }); void activityResult.content; const sysEvent: Record = await gateway.sendSystemEvent('test'); void sysEvent; const toolResult: Record = await gateway.invokeGatewayTool('sessions_list', {}); void toolResult; const sessions: Record = await gateway.listSessions({ activeMinutes: 10 }); void sessions; const subSessions: Array> = await gateway.getAllSubAgentSessions(10); void subSessions; const delivery: DeliveryResult = await gateway.deliverMessage('telegram', '123', 'hello'); void delivery.ok; void delivery.parts; void delivery.lastResponse; } void _gatewaySmoke; // A consumer prepares the selection before passing only the model to a turn. async function _gatewayPreparationSmoke() { const selection = gateway.normalizeAgentSelection({ modelRef: 'vendor/model', authProfile: 'vendor:work', }, 'main'); const identity: string = selection.identity; const selectedModel: string | undefined = selection.model; const selectedProfile: string | undefined = selection.authProfile; void identity; void selectedModel; void selectedProfile; const prepared = await gateway.prepareAgentSelection('scheduler:fixture', { modelRef: 'vendor/model', authProfile: 'vendor:work', }, 'main', { signal: new AbortController().signal, timeout: 5000, openclawCommand: '/fixture/bin/openclaw', gatewayToken: 'fixture-token', env: { HOME: '/fixture/home' }, execFile(_command, _args, options, callback) { const encoding: 'utf8' = options.encoding; void encoding; callback(null, '{}'); }, }); if (prepared.applied) { const model: string = prepared.model; const authProfile: string = prepared.authProfile; void model; void authProfile; } else { const model: string | undefined = prepared.model; void model; // @ts-expect-error A no-op does not claim to have applied a profile. void prepared.authProfile; } await gateway.runAgentTurn({ message: 'hi', model: prepared.model }); await gateway.runAgentTurnWithActivityTimeout({ message: 'hi', model: prepared.model }); await gateway.runIsolatedAgentTurn({ message: 'hi', model: prepared.model }); await gateway.prepareAgentSelection('scheduler:fixture'); const inheritedProfile: string = await gateway.resolveMainSessionAuthProfile('main', { timeout: 5000, signal: null }); void inheritedProfile; // @ts-expect-error The read boundary accepts an agent owner, not arbitrary query options. await gateway.resolveMainSessionAuthProfile({ activeMinutes: 120 }); gateway.normalizeAgentSelection({ modelRef: null, authProfile: null }); const failure = new gateway.GatewayPreparationError('outcome unknown', { code: 'GATEWAY_PREPARATION_UNKNOWN', uncertain: true, cause: new Error('timeout'), }); const caught: unknown = failure; if (caught instanceof gateway.GatewayPreparationError) { const code: string = caught.code; const uncertain: boolean = caught.uncertain; const cause: unknown = caught.cause; void code; void uncertain; void cause; } // @ts-expect-error Profile selection belongs to preparation, not the low-level runner. await gateway.runAgentTurn({ message: 'hi', authProfile: 'vendor:work' }); // @ts-expect-error The activity-timeout runner also rejects direct profile selection. await gateway.runAgentTurnWithActivityTimeout({ message: 'hi', authProfile: 'vendor:work' }); // @ts-expect-error The isolated alias has the same profile-free turn contract. await gateway.runIsolatedAgentTurn({ message: 'hi', authProfile: 'vendor:work' }); // @ts-expect-error Override values must be strings or null, never booleans. gateway.normalizeAgentSelection({ authProfile: true }); // @ts-expect-error Uncertainty is a boolean, not a status string. new gateway.GatewayPreparationError('failed', { uncertain: 'unknown' }); } void _gatewayPreparationSmoke; // ---- paths ---- const home: string = paths.resolveSchedulerHome(); const dbPath: string = paths.resolveSchedulerDbPath({ explicitPath: ':memory:' }); const parent: string = paths.ensureSchedulerDbParent('/tmp/test.db'); const backupDir: string = paths.resolveBackupStagingDir(); const artifactsDir: string = paths.resolveArtifactsDir({ dbPath: ':memory:' }); const ensuredDir: string = paths.ensureArtifactsDir('/tmp/artifacts'); // ---- promptContext ---- const triggerCtx = promptContext.buildTriggeredRunContext(run, { getRunById: (id) => runs.getRun(id), getJobById: (id) => jobs.getJob(id), }); void triggerCtx.text; void triggerCtx.meta; // ---- retrieval ---- const recent = retrieval.getRecentRunSummaries('job-1', 5); if (recent.length) { void recent[0].started_at; void recent[0].context_summary; } const searched = retrieval.searchRunSummaries('job-1', 'error', 5); if (searched.length) { void searched[0]._score; } const ctx: string = retrieval.buildRetrievalContext(created); // ---- shellResults ---- void shellResults.DEFAULT_STORE_LIMIT; void shellResults.DEFAULT_EXCERPT_LIMIT; void shellResults.DEFAULT_SUMMARY_LIMIT; void shellResults.DEFAULT_OFFLOAD_THRESHOLD; const storedArtifact: string | null = shellResults.storeRunArtifact('verification', 'run-id', 'output'); void storedArtifact; const normalized: ShellResult = shellResults.normalizeShellResult( { stdout: 'ok', stderr: '', error: null }, { runId: 'r-1', storeLimit: 1024 }, ); void normalized.stdoutTruncated; void normalized.stderrTruncated; void normalized.contextSummary; const extracted: PartialShellResult | null = shellResults.extractShellResultFromRun(run); if (extracted) { void extracted.exitCode; void extracted.signal; void extracted.timedOut; void extracted.stdout; void extracted.stderr; void extracted.errorMessage; void extracted.stdoutPath; void extracted.stdoutBytes; } // ---- SCHEDULER_SCHEMAS ---- void SCHEDULER_SCHEMAS.jobs.type; void SCHEDULER_SCHEMAS.jobs.required; void SCHEDULER_SCHEMAS.jobs.fields; void SCHEDULER_SCHEMAS.runs.statuses; void SCHEDULER_SCHEMAS.runs.key_fields; void SCHEDULER_SCHEMAS.approvals.statuses; void SCHEDULER_SCHEMAS.dispatches.kinds; void SCHEDULER_SCHEMAS.dispatches.statuses; void SCHEDULER_SCHEMAS.messages.kinds; void SCHEDULER_SCHEMAS.messages.statuses; // ---- idempotency ---- const idemKey: string = idempotency.generateIdempotencyKey('job-1', '2026-01-01'); const chainKey: string = idempotency.generateChainIdempotencyKey('run-1', 'child-1'); const runNowKey: string = idempotency.generateRunNowIdempotencyKey('job-1'); const idemCheck: Record | null = idempotency.checkIdempotencyKey(idemKey); const idemEntry: Record | null = idempotency.getIdempotencyEntry(idemKey); const idemClaimed: boolean = idempotency.claimIdempotencyKey(idemKey, 'job-1', 'run-1', '2026-12-31'); idempotency.releaseIdempotencyKey(idemKey); idempotency.updateIdempotencyResultHash(idemKey, 'content'); const idemList: Array> = idempotency.listIdempotencyForJob('job-1', 10); const idemForce: number = idempotency.forcePruneIdempotency(); // ---- taskTracker ---- const tgOpts: TaskGroupOpts = { name: 'smoke', expectedAgents: ['a', 'b'] }; const tgResult: TaskGroupResult = taskTracker.createTaskGroup(tgOpts); void tgResult.id; void tgResult.agents; const tgGet: Record | undefined = taskTracker.getTaskGroup('id'); const tgActive: Array> = taskTracker.listActiveTaskGroups(); taskTracker.agentStarted('t-1', 'agent-a', 'key'); taskTracker.registerAgentSession('t-1', 'agent-a', 'key'); taskTracker.touchAgentHeartbeat('t-1', 'agent-a'); taskTracker.agentCompleted('t-1', 'agent-a', 'done'); taskTracker.agentFailed('t-1', 'agent-a', 'error'); const deadAgents = taskTracker.checkDeadAgents(); if (deadAgents.length) { void deadAgents[0].tracker_id; void deadAgents[0].agent_label; } const tgCompletion: Record | null = taskTracker.checkGroupCompletion('t-1'); const tgStatus: TaskGroupStatus | null = taskTracker.getTaskGroupStatus('t-1'); if (tgStatus) { void tgStatus.elapsed; void tgStatus.agents; void tgStatus.remaining_timeout; } // ---- teamAdapter ---- const mapped: number = teamAdapter.mapTeamMessages(10); const teamTasks: Array> = teamAdapter.listTeamTasks('team-1', 10); const teamEvents: Array> = teamAdapter.listTeamMailboxEvents('team-1', { limit: 10, taskId: 'task-1' }); const gateOpts: TeamTaskGateOpts = { teamId: 'team-1', taskId: 'task-1', expectedMembers: ['a', 'b'] }; const gate = teamAdapter.createTeamTaskGate(gateOpts); void gate.team_id; void gate.task_id; void gate.gate_status; void gate.tracker_id; const gatesResult = teamAdapter.checkTeamTaskGates(10); void gatesResult.passed; void gatesResult.failed; void gatesResult.pending; const ackResult: Record | null = teamAdapter.ackTeamMessage('msg-1', 'operator', 'ok'); // ---- v0.2 Identity fields on JobSpec ---- const v02Spec: JobSpec = { name: 'v02 smoke', payload_message: 'echo v02', run_timeout_ms: 300000, identity_principal: 'agent:ops-runner', identity_run_as: 'service:deployer', identity_subject_kind: 'agent', identity_trust_level: 'supervised', identity_delegation_mode: 'on-behalf-of', identity: '{"subject_kind":"agent","principal":"agent:ops-runner"}', authorization_proof_ref: 'proof-ref-1', authorization_proof: '{"method":"signed-jwt","token":"..."}', authorization_ref: 'authz-ref-1', authorization: '{"decision":"permit"}', evidence_ref: 'ev-ref-1', evidence: '{"collect":["logs","metrics"]}', contract_required_trust_level: 'supervised', contract_trust_enforcement: 'advisory', contract_sandbox: '{"isolation":"container"}', contract_allowed_paths: '["/tmp"]', contract_network: '{"egress":"deny"}', contract_max_cost_usd: 1.50, contract_audit: '{"level":"full"}', child_credential_policy: 'downscope', }; void v02Spec; // ---- v0.2 Outcome fields on RunRecord ---- const v02Run: Partial = { identity_resolved: '{"subject_kind":"agent"}', trust_evaluation: '{"decision":"permit"}', authorization_decision: '{"decision":"permit"}', authorization_proof_verification: '{"verified":true}', evidence_record: '{"evidence_ref":"ev-1"}', credential_handoff_summary: '{"mode":"inject"}', }; void v02Run; // ---- v0.2 Outcome fields on FinishRunOpts ---- const v02Finish: FinishRunOpts = { summary: 'done', identity_resolved: { subject_kind: 'agent' }, trust_evaluation: '{"decision":"permit"}', authorization_decision: { decision: 'permit' }, authorization_proof_verification: null, evidence_record: '{"evidence_ref":"ev-1"}', credential_handoff_summary: { mode: 'inject', bindings_count: 2, cleanup_required: false }, }; void v02Finish; // ---- v0.2 Runtime module ---- void v02Runtime.TRUST_LEVELS; const identityP: Promise = v02Runtime.resolveIdentity({ identity_principal: 'test' }); const identity: ResolvedIdentity | null = null as unknown as Awaited; if (identity) { void identity.provider; void identity.session; void identity.source; void identity.subject_kind; void identity.principal; void identity.trust_level; void identity.delegation_mode; void identity.raw; void identity.transient; void identity.error; } const trust: TrustEvaluation = v02Runtime.evaluateTrust({}, identity); void trust.effective_level; void trust.required_level; void trust.decision; void trust.reason; const proofResultP: Promise = v02Runtime.verifyAuthorizationProof({}); const proofResult: AuthorizationProofResult | null = null as unknown as Awaited; if (proofResult) { void proofResult.verified; void proofResult.method; void proofResult.ref; void proofResult.source; void proofResult.provider; } const authResultP: Promise = v02Runtime.evaluateAuthorization({}, identity, trust); const authResult: AuthorizationResult | null = null as unknown as Awaited; if (authResult) { void authResult.decision; void authResult.reason; void authResult.ref; void authResult.source; void authResult.provider; } const evidenceResult: EvidenceResult | null = v02Runtime.generateEvidence({}, null, null); if (evidenceResult) { void evidenceResult.evidence_ref; void evidenceResult.created_at; void evidenceResult.hash; void evidenceResult.payload_summary; } const handoff: CredentialHandoffSummary | null = v02Runtime.summarizeCredentialHandoff({}); if (handoff) { void handoff.mode; void handoff.bindings_count; void handoff.cleanup_required; } // ---- Handoff v4 public runtime surface ---- const v4Spec: JobSpec = { name: 'v4 smoke', payload_message: 'echo v4', run_timeout_ms: 300000, handoff_version: 4, handoff_artifact_digest: 'sha256:0000000000000000000000000000000000000000000000000000000000000000', handoff_artifact_payload: { schema: handoffArtifacts.HANDOFF_V4_SCHEMA }, effective_task_hash: 'sha256:1111111111111111111111111111111111111111111111111111111111111111', }; void v4Spec; void handoffArtifacts.HANDOFF_V4_VERSION; void handoffArtifacts.HANDOFF_V4_SCHEMA_MIN; void handoffArtifacts.HANDOFF_V4_EXECUTION_BINDING_VERSION; void handoffArtifacts.HANDOFF_V4_SCHEDULER_JOB_BINDING_VERSION; void handoffArtifacts.HANDOFF_V4_RUNTIME_CONTRACT.artifact_schema; const canonicalV4: string = handoffArtifacts.canonicalStringify({ z: 1, a: 2 }); const digestV4: string = handoffArtifacts.artifactDigest({ payload: 'v4' }); const validationV4 = handoffArtifacts.validateHandoffArtifact({ schema: handoffArtifacts.HANDOFF_V4_SCHEMA }); void validationV4.ok; void validationV4.payload; void validationV4.digest; void validationV4.errors; const artifactV4: HandoffArtifactRecord | null = handoffArtifacts.getHandoffArtifact(digestV4); if (artifactV4) { void artifactV4.execution_binding_version; void artifactV4.payload_bytes; } const runtimeEventV4: RuntimeEventRecord | null = runtimeEvents.getRuntimeEvent(1); if (runtimeEventV4) { void runtimeEventV4.event_type; void runtimeEventV4.payload_sha256; } const runtimeEventListV4: RuntimeEventRecord[] = runtimeEvents.listRuntimeEvents({ runId: 'run-v4', limit: 10 }); const providerSessionV4: ProviderSessionRecord | null = providerSessions.getProviderSession('session-v4'); if (providerSessionV4) { void providerSessionV4.status; void providerSessionV4.rotation_counter; } const providerSessionListV4: ProviderSessionRecord[] = providerSessions.listProviderSessions({ status: 'active' }); const credentialRowsV4: CredentialPresentationRecord[] = credentialRuntime.listCredentialPresentations({ runId: 'run-v4' }); const materializationV4: CredentialMaterialization = { env: {}, gatewayEnv: {}, stdin: null, presentationIds: [], tempPaths: [], runtimeRoot: '/tmp', }; const capabilityV4 = capabilityNegotiation.negotiateCredentialCapabilities(materializationV4, { artifactDigest: digestV4, runtimeInstanceId: 'runtime-v4', sessionTarget: 'shell', }); const delegationV4 = delegationRuntime.validateArtifactBoundDelegation(created, artifactV4 || {}, dispatch, { runId: 'run-v4' }); const replayV4 = proofRuntime.claimProofReplay(db.getDb(), { method: 'jwt', proofId: 'proof-v4', artifactDigest: digestV4, runId: 'run-v4', expiresAt: '2099-01-01T00:00:00Z', }); const proofV4 = proofRuntime.verifyArtifactBoundProof(created, artifactV4 || {}, run); const evidenceV4: Promise = evidenceRuntime.verifyPersistedArtifactBoundEvidence('run-v4'); const identityV4 = identityRuntime.resolveArtifactBoundIdentity(created, artifactV4 || {}, run); void canonicalV4; void runtimeEventListV4; void providerSessionListV4; void credentialRowsV4; void capabilityV4; void delegationV4; void replayV4; void proofV4; void evidenceV4; void identityV4; // Suppress unused variable warnings void created; void fetched; void listed; void updated; void nextRun; void due; void children; void allChildren; void condMatch; void depth; void dequeued; void backlog; void canEnqueue; void shouldRetry; void hasRunning; void poolRunning; void cancelled; void pruned; void gotRun; void jobRuns; void finished; void gotMsg; void inbox; void outbox; void thread; void teamMsgs; void unread; void acked; void attempt; void receipts; void gotApproval; void pending; void resolved; void pendingCount; void gotAgent; void allAgents; void gotDispatch; void claimed; void released; void statusUpdated; void jobDispatches; void healthy; void waited; void home; void dbPath; void parent; void backupDir; void artifactsDir; void ensuredDir; void ctx; void normalized; void parts; void idemKey; void chainKey; void runNowKey; void idemCheck; void idemEntry; void idemClaimed; void idemList; void idemForce; void tgOpts; void tgGet; void tgActive; void tgCompletion; void mapped; void teamTasks; void teamEvents; void gateOpts; void ackResult;