Loading files
88c0e5c43This file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/openharness-1322671404.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
88c0e5c43This file is pinned to the selected release. Download the original to open it in your design tool.
import { describe, expect, it } from 'vitest'
import {
mergeTerminalRuntimes,
processIdentityKey,
sameProcessIdentity,
terminalPlacementKey,
terminalRouteKey,
} from './terminalRuntime.js'
import type { TmuxRuntimeRef } from './terminalTypes.js'
const tmux: TmuxRuntimeRef = { backend: 'tmux', paneId: '%3' }
describe('terminal runtime identity', () => {
it('merges observed runtimes without duplicating a placement', () => {
const other: TmuxRuntimeRef = { backend: 'tmux', paneId: '%4' }
expect(terminalPlacementKey(tmux)).toBe(terminalRouteKey(tmux))
expect(mergeTerminalRuntimes([tmux], [other, { ...tmux }])).toEqual([tmux, other])
})
it('keys process identity without treating argv-derived executable as authoritative', () => {
const before = { pid: 42, executable: 'node', startMarker: 'Sat Aug 15 10:00:00 2026' }
const renamed = { ...before, executable: 'agent title' }
expect(sameProcessIdentity(before, renamed)).toBe(true)
expect(processIdentityKey('claude', before)).toBe(processIdentityKey('claude', renamed))
})
it('rejects separator injection into stable keys', () => {
expect(() => terminalRouteKey({ backend: 'tmux', paneId: '%1\u0000other' })).toThrow('invalid tmux pane id')
})
})