From c82bcbbe6b358a82d1d4efaad018df147db2c19d Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Sun, 9 Aug 2026 13:36:08 -0700 Subject: [PATCH] Reuse the shared lease fixture in the envelope tests The hand-written lease drifted the moment the record grew a field. Same reason the fixture exists for the write-admission tests. --- .../agent-session-mutation-envelope.test.ts | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/shared/agent-session-mutation-envelope.test.ts b/src/shared/agent-session-mutation-envelope.test.ts index 406cc3788d7..f488e14e31e 100644 --- a/src/shared/agent-session-mutation-envelope.test.ts +++ b/src/shared/agent-session-mutation-envelope.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import type { AgentSessionOperationDecision } from './agent-session-operation-ledger' -import type { AgentSessionLease } from './agent-session-record' +import { agentSessionLeaseFixture } from './agent-session-record.test-fixture' import { admitAgentSessionMutation, agentSessionFingerprintConflict, @@ -8,23 +8,11 @@ import { } from './agent-session-mutation-envelope' import type { AgentSessionMutationEnvelope } from './agent-session-wire' -const LEASE: AgentSessionLease = { +const LEASE = agentSessionLeaseFixture({ sessionId: 'session-1', runtimeKind: 'native', - provenHandleLinkId: 'link-1', - deathEvidence: null, - runtimeFence: 4, - ownerProcess: { hostId: 'host-1', pid: 42, processStartTimeMs: null, spawnToken: 'token-1' }, - reservedSpawnToken: null, - leaseDeadlineAt: 10_000, - lastRenewedAt: 9_000, - handoffOperationId: null, - journalCheckpoint: null, - claimKeyId: 'key-1', - claimStatus: 'live', - unreconciled: false, - handoffStage: null -} + runtimeFence: 4 +}) function envelope(overrides: Partial = {}) { return {