diff --git a/.ai/contexts/build-release.md b/.ai/contexts/build-release.md index fae2b4b7c..bd155de2e 100644 --- a/.ai/contexts/build-release.md +++ b/.ai/contexts/build-release.md @@ -259,7 +259,7 @@ actual postinstall is `scripts/postinstall.js`; `scripts/**` also covers the entitlements and the DMG background. The builder configuration is inline in `package.json`; there is no separate electron-builder config. Dependencies are covered by the lockfile. The filter is packaging only: application source -(`*.js`, `src/**`, `workers/**`, `public/**`, `harnesses/**`) and `CHANGELOG.md` +(`*.js`, `src/**`, `workers/**`, `public/**`) and `CHANGELOG.md` are deliberately absent, so a code PR builds no installers. A packaging break caused by source surfaces at the tag, where strict publish blocks it (accepted risk, maintainer decision). diff --git a/.ai/contexts/cli-harnesses.md b/.ai/contexts/cli-harnesses.md index f0d4893f9..b11479488 100644 --- a/.ai/contexts/cli-harnesses.md +++ b/.ai/contexts/cli-harnesses.md @@ -1,10 +1,10 @@ --- covers: - "main.js" - - "harnesses/claude.js" - - "harnesses/codex.js" - - "harnesses/contract.js" - - "harnesses/index.js" + - "src/main/harnesses/claude.js" + - "src/main/harnesses/codex.js" + - "src/main/harnesses/contract.js" + - "src/main/harnesses/index.js" - "jsonl-scan.js" - "read-session-file.js" - "scripts/launcher-env.js" @@ -23,7 +23,7 @@ be tested with plain `require` without executing either launcher. Both isolated modes set `CODEX_HOME` to `/.codex` and drop inherited spellings case-insensitively. The default test-pr mode keeps the -user's Codex home. The audit of `harnesses/` and `src/` found no further +user's Codex home. The audit of `src/` (`src/main/harnesses/` included) found no further harness-state override: `CODEX_HOME` also controls Codex usage credentials and full-read roots; `SWITCHBOARD_DATA_DIR` and `SWITCHBOARD_TRIGGERS_DIR` already point inside the disposable home. Claude paths derive from that home, and @@ -127,7 +127,8 @@ launch tags, fork ownership or resume UUIDs. See session-cache.md for the day selector, metadata-only name repair and root relocation contracts. Issue #820 adds `harnesses/index.js`, `harnesses/claude.js` and -`harnesses/contract.js` at the upstream paths, before ADR 0005's context move. +`harnesses/contract.js` at the upstream paths; ADR 0005 step 10 (#1357) moves +them to `src/main/harnesses/`. The design follows Ali Basiri's upstream commits `ac72985f` and `f5e38a75`; the fork's transcript and lifecycle implementations remain in place. @@ -169,7 +170,7 @@ harness" below. `assertHarness()` validates metadata, methods, boolean capability flags and the optional usage provider. Features use `capabilities` (`subagents`, `continuations`, `liveElsewhere`, `bgJobs`, `ideBridge`, `sandbox`, `schedule`, -`remote`, `deleteTranscript`; `CAPABILITIES` in `harnesses/contract.js`), rather than runtime-name comparisons. These flags describe the CLI +`remote`, `deleteTranscript`; `CAPABILITIES` in `src/main/harnesses/contract.js`), rather than runtime-name comparisons. These flags describe the CLI integration; existing platform, host and settings checks still decide whether a feature is usable for a particular launch. @@ -210,8 +211,8 @@ value is parsed but not offered. There is no MCP configuration, browser process or browser capability contract. Main calls the builder synchronously at the existing launch extraction anchors. -The registry (`harnesses/index.js`) holds the Claude and Codex adapters. -`harnesses/**` ships in `build.files`, receives Node ESLint rules and is +The registry (`src/main/harnesses/index.js`) holds the Claude and Codex adapters. +`src/main/harnesses/` ships through `build.files` `src/**/*`, receives Node ESLint rules and is included in the module-layout resolver. No new top-level JS file is added, so `test/fixtures/root-app-modules.json` remains unchanged. @@ -238,7 +239,7 @@ writable-store reconciliation, not the worker transport or Electron's binding. ## Codex adapter (#821) -`harnesses/codex.js` is a port of Ali Basiri's upstream adapter (doctly/switchboard +`src/main/harnesses/codex.js` is a port of Ali Basiri's upstream adapter (doctly/switchboard `896783ba`, `e71e6f0c`, the title index of `fe7fba01`, the viewer half of `966715db`, the argv builder of the final `upstream/main:harnesses/codex.js`), re-shaped for the fork's contract. Measured against 237 rollouts on @@ -296,7 +297,7 @@ re-shaped for the fork's contract. Measured against 237 rollouts on picked up by the next reconcile pass, not by the watcher (the index sits outside the sessions root). - Capabilities: all false, including `deleteTranscript` (Claude true) - (`harnesses/codex.js`, `capabilities`). Its activity methods are routed into + (`src/main/harnesses/codex.js`, `capabilities`). Its activity methods are routed into main as described in "Busy and attention per harness" below. ## Launching through the harness (#822) @@ -481,7 +482,7 @@ for the fetch, backoff and footer grouping (#1209). codex's own config", and `showCodexUsage: false`. `resolveDefaultSessionOptions` copies the non-empty Codex keys into the launch options; the Codex builder validates them and the Claude builder ignores them. -- Guard: `assertHarnessSettings(fields)` (`harnesses/index.js`) refuses a +- Guard: `assertHarnessSettings(fields)` (`src/main/harnesses/index.js`) refuses a `disabledHarnesses` that is not a string list or that leaves no registered CLI on (`code: 'HARNESS_GUARD'`). It runs inside the writer, on `patchGlobal` (`session-index-commands.js`) and on a raw diff --git a/.ai/contexts/managed-browser.md b/.ai/contexts/managed-browser.md index 467370109..dfd442f32 100644 --- a/.ai/contexts/managed-browser.md +++ b/.ai/contexts/managed-browser.md @@ -31,7 +31,7 @@ is what users see of #812. `BROWSER_MODES` lists `off`, `claude-in-chrome` and `claude-in-chrome`, an invalid value to `off` (main logs the warning once per scope and value, `normalizeStoredBrowserSettings`), and drops `chrome`. The Claude adapter adds `--chrome` only for `claude-in-chrome` -(`harnesses/claude.js`). `managed` is filtered out of the Settings, New Session +(`src/main/harnesses/claude.js`). `managed` is filtered out of the Settings, New Session and Resume pickers, and a stored `managed` shows and saves as Off: nothing launches the managed browser from the UI. diff --git a/.ai/contexts/session-cache.md b/.ai/contexts/session-cache.md index 64cd64c72..9df25f105 100644 --- a/.ai/contexts/session-cache.md +++ b/.ai/contexts/session-cache.md @@ -587,7 +587,7 @@ Issue #1255. | `src/main/session-index/session-refs.js` | ~95 | Search body refs (`collectRefs`, `mergeSearchBodyRefs`; see "Search" and ADR 0006). | | `session-continuations.js` | ~260 | Continuation ids, stamps and the continuation index (see "Continuation rows (#564)" and "Continuation index (#518B)"). | | `subagent-attribution.js` | ~45 | Which transcript path is a root, subagent or workflow agent (see [subagent-observability](subagent-observability.md)). | -| `harnesses/` (`index.js`, `claude.js`, `codex.js`, `contract.js`) | | Per-CLI adapters: folder ownership, transcript paths and Codex rollout reading (see [cli-harnesses](cli-harnesses.md)). | +| `src/main/harnesses/` (`index.js`, `claude.js`, `codex.js`, `contract.js`) | | Per-CLI adapters: folder ownership, transcript paths and Codex rollout reading (see [cli-harnesses](cli-harnesses.md)). | ## Public surface @@ -4267,7 +4267,7 @@ disposable HOME/USERPROFILE with synthetic `.codex/sessions` rollouts and an unset CODEX_HOME, never the developer's history. No production default changes. A folder key with a harness prefix (`codex/2026/08/26`) belongs to a CLI whose -store is not `~/.claude/projects`; `harnessForFolder` (`harnesses/index.js`) +store is not `~/.claude/projects`; `harnessForFolder` (`src/main/harnesses/index.js`) picks the adapter. `refreshFolder` dispatches such a key to `refreshHarnessFolder(harness, folder)` before any continuation preparation: it resolves the directory with `harness.folderPath` (null for a malformed key, diff --git a/.ai/contexts/session-index-writer.md b/.ai/contexts/session-index-writer.md index 2d7576534..e0aee63e0 100644 --- a/.ai/contexts/session-index-writer.md +++ b/.ai/contexts/session-index-writer.md @@ -302,7 +302,7 @@ session-index-writer-client.js follows the house Worker factory/event pattern. workers/session-index-writer.js opens the writable store inside its thread. The worker path uses path.join(__dirname,'workers',...). package.json `build.files` ships root *.js, `src/**/*` (the main-side `src/main/projects/*` writer modules), -`harnesses/**` and workers/**/* and unpacks better-sqlite3 and node-pty through +(the harness adapters under `src/main/harnesses/` included) and workers/**/* and unpacks better-sqlite3 and node-pty through the normal dependency packaging. No native rebuild is introduced. The optional `onSessionsChanged(ids, change)` observer runs after the write ACK diff --git a/.ai/contexts/trigger-watcher.md b/.ai/contexts/trigger-watcher.md index f9dc3d3b2..6f423bde4 100644 --- a/.ai/contexts/trigger-watcher.md +++ b/.ai/contexts/trigger-watcher.md @@ -317,7 +317,7 @@ The canonical name (`new.name.trim()`) travels `operation.name` → the broker's record → `permitView` (new mode only, frozen) → `open-terminal`, which reads it from the consumed permit alone and hands it to `buildLaunchArgs({ name })`. Renderer options, defaults and placeholder labels cannot supply it. Only -`harnesses/claude.js` turns it into `--name `, on a fresh launch; resume +`src/main/harnesses/claude.js` turns it into `--name `, on a fresh launch; resume and fork ignore it. The argv element is passed whole through the shell encoders (`quoteArgForShell`: POSIX single quotes, fish single quotes with doubled backslashes, nushell double-quoted strings with `\\` and `\"` escapes, PowerShell diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index c57dbdb92..c76ea200a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -7,3 +7,4 @@ a0cf5bed6178eb49215bfa90d15734e419f6b079 37bda70a0b6b2dc10f0f3ec922b0fef85832e2d4 e6f6a87ab23252c05cde25b05ab70dd072f69264 890702a918826844e54c56172e7b7091d38f2f79 +b2b2b8a2f4c1e1383c7c88b8284cbb3d6ed8944b diff --git a/docs/changelog.md b/docs/changelog.md index 7055ed009..beccd93d7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -102,7 +102,7 @@ The `changelog` job of `.github/workflows/test.yml` runs on every pull request. It is a required check of the `main-protection` and `release-protection` rulesets, so a PR to `main` or `release/*` that it fails cannot be merged. It fails when the PR changes app code and not `CHANGELOG.md`. App code is what electron-builder ships: the `*.js` files at -the root (`eslint.config.js` excepted), `public/`, `workers/`, `src/`, `harnesses/` and +the root (`eslint.config.js` excepted), `public/`, `workers/`, `src/` and `scripts/claude-sandbox.sh`. The PR is judged on its whole diff: `git diff ...`, from the PR's @@ -138,7 +138,7 @@ for the summary, changelog entry or `no-changelog` waiver, and test results. The PR-only `docs` job in `.github/workflows/test.yml` invokes `scripts/check-docs.js`. It shares the changelog check's app path classification: root JavaScript except `eslint.config.js`, `src/`, `public/`, `workers/`, -`harnesses/`, and `scripts/claude-sandbox.sh`. +and `scripts/claude-sandbox.sh`. Each eligible agent context and user page documenting code declares YAML front matter at the start of the file. For example: diff --git a/docs/development.md b/docs/development.md index 279d50b95..ac72af570 100644 --- a/docs/development.md +++ b/docs/development.md @@ -216,9 +216,8 @@ src/main/triggers/ The file-based trigger API and delivery context src/main/remote/ Remote inventory, mirror, watch, attach and stop src/main/integrations/mcp/ The IDE emulation MCP server src/main/app/ Window, menu, zoom, shutdown and changelog -src/main/ Other contexts: bg-agents, browser, changes, cli, files, +src/main/ Other contexts: bg-agents, browser, changes, cli, files, harnesses, projects, session-index, shared, terminals, usage, viewer -harnesses/ Claude and Codex CLI adapters remote-activity.js Remote activity state (still at root) e2e/ Playwright journeys resources/ Packaged runtime resources diff --git a/docs/launching-sessions.md b/docs/launching-sessions.md index 3cf117cd4..bb9e85083 100644 --- a/docs/launching-sessions.md +++ b/docs/launching-sessions.md @@ -1,6 +1,6 @@ --- covers: - - "harnesses/*.js" + - "src/main/harnesses/*.js" - "public/dialogs.js" - "src/main/terminals/plain-terminal-shell.js" - "src/main/terminals/shell-profiles.js" diff --git a/eslint.config.js b/eslint.config.js index 0d01d41fe..4bf2e162b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -837,7 +837,6 @@ module.exports = [ { files: [ '*.js', - 'harnesses/**/*.js', 'workers/**/*.js', 'scripts/**/*.{js,cjs}', 'src/main/**/*.js', diff --git a/main.js b/main.js index de2f72ba0..17152e701 100644 --- a/main.js +++ b/main.js @@ -640,7 +640,7 @@ ipcMain.handle('whats-new-dismissed', async () => await whatsNew.dismissed()); // --- Session cache helpers --- const { resolveSessionRealCwd, sessionTranscriptExists, isGitRepo } = require('./derive-project-path'); -const { getHarness, prefixedHarnesses, allHarnesses, DEFAULT_HARNESS } = require('./harnesses'); +const { getHarness, prefixedHarnesses, allHarnesses, DEFAULT_HARNESS } = require('./src/main/harnesses'); const { resolveRowDeletionTargets } = require('./delete-session-target'); // Session cache → session-cache.js diff --git a/package.json b/package.json index a1bb4faf4..cf3bef3bc 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,6 @@ "files": [ "src/**/*", "*.js", - "harnesses/**", "CHANGELOG.md", "workers/**/*", "public/**/*", diff --git a/scripts/check-changelog.js b/scripts/check-changelog.js index 91db241a3..4d633efb3 100644 --- a/scripts/check-changelog.js +++ b/scripts/check-changelog.js @@ -7,7 +7,7 @@ const { execFileSync } = require('child_process'); const WAIVER_LABEL = 'no-changelog'; function isAppPath(file) { - if (file.startsWith('public/') || file.startsWith('workers/') || file.startsWith('src/') || file.startsWith('harnesses/')) return true; + if (file.startsWith('public/') || file.startsWith('workers/') || file.startsWith('src/')) return true; if (file === 'scripts/claude-sandbox.sh') return true; return /^[^/]+\.js$/.test(file) && file !== 'eslint.config.js'; } diff --git a/scripts/doc-refs-allow.json b/scripts/doc-refs-allow.json index 6d90f6a40..08a382e40 100644 --- a/scripts/doc-refs-allow.json +++ b/scripts/doc-refs-allow.json @@ -35,7 +35,6 @@ { "doc": "docs/decisions/0004-session-index-study.md", "ref": "line:*", "reason": "study line numbers are measurements at its stated baseline commits; db.js has since moved" }, { "doc": "docs/decisions/0004-session-index-study.md", "ref": "probe-session-index.cjs", "reason": "throwaway probe of the study, never committed" }, { "doc": "docs/decisions/0004-session-index-study.md", "ref": "symbol:*", "reason": "symbols are cited at their baseline-commit location (db.js:); db.js has since moved" }, - { "doc": "docs/decisions/0005-main-process-context-layout.md", "ref": "harnesses/claude/", "reason": "target layout this ADR plans, not yet reached" }, { "doc": "docs/decisions/0005-main-process-context-layout.md", "ref": "src/main/main.js", "reason": "target layout this ADR plans, not yet reached" }, { "doc": "docs/decisions/0005-main-process-context-layout.md", "ref": "src/preload/preload.js", "reason": "target layout this ADR plans, not yet reached" }, { "doc": "docs/live-testing.md", "ref": "live.js", "reason": "script the reader writes in a scratch directory" }, diff --git a/scripts/module-paths.js b/scripts/module-paths.js index b2aafc9e6..8ac1fb4a1 100644 --- a/scripts/module-paths.js +++ b/scripts/module-paths.js @@ -22,7 +22,7 @@ function walk(root, directory, accept = isJavaScript) { function appFiles(root) { return [ ...fs.readdirSync(root).filter(isJavaScript), - ...walk(root, 'workers'), ...walk(root, 'src'), ...walk(root, 'scripts'), ...walk(root, 'harnesses'), + ...walk(root, 'workers'), ...walk(root, 'src'), ...walk(root, 'scripts'), ].sort(); } diff --git a/session-cache.js b/session-cache.js index 27c1588a7..dfa5ab9b9 100644 --- a/session-cache.js +++ b/session-cache.js @@ -30,7 +30,7 @@ async function shutdownProducers() { } const { getFolderIndexMtimeMs } = require('./folder-index-state'); -const { getHarness, DEFAULT_HARNESS, harnessForFolder, prefixedHarnesses, harnessFolderIndexMtimeMs } = require('./harnesses'); +const { getHarness, DEFAULT_HARNESS, harnessForFolder, prefixedHarnesses, harnessFolderIndexMtimeMs } = require('./src/main/harnesses'); const { setRemappedProjectReader } = require('./encode-project-path'); const { deriveProjectPath, storedProjectPathMatchesFolder, resolveWorktreePath } = require('./derive-project-path'); const { readSessionFile, readSessionDisplayHeader, readSessionEntrypoint, isSdkEntrypoint, enumerateSessionFiles, resolveJsonlPath, mergeBridgeGroups, isCanonicalWorkflowPath } = require('./read-session-file'); diff --git a/session-index-commands.js b/session-index-commands.js index 626e53ecd..47dcdcea8 100644 --- a/session-index-commands.js +++ b/session-index-commands.js @@ -10,7 +10,7 @@ const { createHash } = require('node:crypto'); const path = require('node:path'); const { archiveProjectIdentity: projectIdentity } = require('./src/main/projects/project-archive-workflow'); const { parseFolderKey, enabledHosts } = require('./src/main/remote/remote-hosts'); -const { assertHarnessSettings } = require('./harnesses'); +const { assertHarnessSettings } = require('./src/main/harnesses'); const requestError = (code, message) => Object.assign(new Error(message), { code }); const requestBytes = value => Buffer.isBuffer(value) || (ArrayBuffer.isView(value) && value.BYTES_PER_ELEMENT === 1); diff --git a/session-transitions.js b/session-transitions.js index 2501d17ba..a1f15d89d 100644 --- a/session-transitions.js +++ b/session-transitions.js @@ -1135,7 +1135,7 @@ function resolvePendingLaunches(harness, candidatePaths) { } function sweepPendingLaunches() { - const { getHarness } = require('./harnesses'); + const { getHarness } = require('./src/main/harnesses'); const since = new Map(); for (const [, session] of pendingLaunchSessions()) { const harness = getHarness(session.runtime); diff --git a/harnesses/claude.js b/src/main/harnesses/claude.js similarity index 85% rename from harnesses/claude.js rename to src/main/harnesses/claude.js index a14b686db..ab110ca7d 100644 --- a/harnesses/claude.js +++ b/src/main/harnesses/claude.js @@ -3,16 +3,16 @@ const fs = require('node:fs'); const os = require('node:os'); const path = require('node:path'); -const transcripts = require('../read-session-file'); -const { classifyTranscriptPath } = require('../subagent-attribution'); -const projects = require('../derive-project-path'); -const { encodeProjectPath } = require('../encode-project-path'); -const { resolveContinuations, resolveContinuationsSync } = require('../session-continuations'); -const { liveElsewhere } = require('../cli-session-state'); -const { getCachedJobs } = require('../src/main/bg-agents/bg-agents'); -const { resolveWindowsClaude } = require('../claude-binary'); -const { classifyTitleActivity } = require('../classify-title-activity'); -const { normalizeBrowserSettings } = require('../public/setting-defaults'); +const transcripts = require('../../../read-session-file'); +const { classifyTranscriptPath } = require('../../../subagent-attribution'); +const projects = require('../../../derive-project-path'); +const { encodeProjectPath } = require('../../../encode-project-path'); +const { resolveContinuations, resolveContinuationsSync } = require('../../../session-continuations'); +const { liveElsewhere } = require('../../../cli-session-state'); +const { getCachedJobs } = require('../bg-agents/bg-agents'); +const { resolveWindowsClaude } = require('../../../claude-binary'); +const { classifyTitleActivity } = require('../../../classify-title-activity'); +const { normalizeBrowserSettings } = require('../../../public/setting-defaults'); function parseAddDirs(value) { if (!value) return []; diff --git a/harnesses/codex.js b/src/main/harnesses/codex.js similarity index 97% rename from harnesses/codex.js rename to src/main/harnesses/codex.js index 7f1b695ed..81e60677c 100644 --- a/harnesses/codex.js +++ b/src/main/harnesses/codex.js @@ -4,10 +4,10 @@ const fs = require('node:fs'); const os = require('node:os'); const path = require('node:path'); -const { scanLines, readHead } = require('../jsonl-scan'); -const { observation, fullReadStamp } = require('../src/main/session-index/full-read-state'); -const { bodyRead, readAuxiliaryFile } = require('../src/main/session-index/read-counters'); -const { collectRefs, newestFirst } = require('../src/main/session-index/session-refs'); +const { scanLines, readHead } = require('../../../jsonl-scan'); +const { observation, fullReadStamp } = require('../session-index/full-read-state'); +const { bodyRead, readAuxiliaryFile } = require('../session-index/read-counters'); +const { collectRefs, newestFirst } = require('../session-index/session-refs'); const id = 'codex'; const label = 'Codex'; @@ -271,7 +271,7 @@ function readSessionFile(filePath, folder, opts) { aiTitle, }; } catch (error) { - require('../src/main/session-index/read-counters').failedRead(filePath); + require('../session-index/read-counters').failedRead(filePath); if (opts?.startup) { opts.outcome.status = ['ENOENT', 'ENOTDIR'].includes(error.code) ? 'absent' : 'failed'; opts.outcome.error = error.code || error.name || 'ReadError'; diff --git a/harnesses/contract.js b/src/main/harnesses/contract.js similarity index 100% rename from harnesses/contract.js rename to src/main/harnesses/contract.js diff --git a/harnesses/index.js b/src/main/harnesses/index.js similarity index 92% rename from harnesses/index.js rename to src/main/harnesses/index.js index 2fb4df2bc..3f047afdf 100644 --- a/harnesses/index.js +++ b/src/main/harnesses/index.js @@ -3,8 +3,8 @@ const claude = require('./claude'); const codex = require('./codex'); const { assertHarness } = require('./contract'); -const { parseFolderKey } = require('../src/main/remote/remote-hosts'); -const { getTranscriptsIndexMtimeMs } = require('../folder-index-state'); +const { parseFolderKey } = require('../remote/remote-hosts'); +const { getTranscriptsIndexMtimeMs } = require('../../../folder-index-state'); const HARNESSES = { [claude.id]: assertHarness(claude), [codex.id]: assertHarness(codex) }; const DEFAULT_HARNESS = claude.id; @@ -65,7 +65,7 @@ function readHarnessFolder(harness, folder) { const dir = harness.folderPath(folder); if (!dir) return null; const files = harness.listTranscripts(dir); - require('../src/main/session-index/read-counters').enumerateReads(files); + require('../session-index/read-counters').enumerateReads(files); const sessions = []; for (const file of files) { try { diff --git a/src/main/session-index/full-read-state.js b/src/main/session-index/full-read-state.js index 3aaeb043f..cd8307313 100644 --- a/src/main/session-index/full-read-state.js +++ b/src/main/session-index/full-read-state.js @@ -67,7 +67,7 @@ function matchesFullRead(file, serialized, runtime = 'claude', relativePath, tit const dependencies = stamp.dependencies; if (!dependencies || typeof dependencies !== 'object') return false; if (runtime === 'codex') { - const codex = require('../../../harnesses/codex'); + const codex = require('../harnesses/codex'); const snapshot = titleSnapshot === undefined ? codex.readTitleSnapshot() : titleSnapshot; if (!snapshot || !Object.hasOwn(dependencies, 'title') || (dependencies.title !== null && typeof dependencies.title !== 'string') @@ -87,7 +87,7 @@ function sourceRelativePath(row) { if (stamp?.format === 1 && stamp.runtime === 'claude' && (row.runtime || 'claude') === 'claude' && safeRelativePath(stamp.relativePath)) return stamp.relativePath; if (stamp?.format === 1 && stamp.runtime === 'codex' && row.runtime === 'codex') { const file = startupSourcePath('', row.folder, stamp.relativePath); - const codex = require('../../../harnesses/codex'); + const codex = require('../harnesses/codex'); if (file && row.sessionFile && path.resolve(row.sessionFile) === file && codex.sessionIdFromPath(file) === row.sessionId) return stamp.relativePath; } } catch {} @@ -96,7 +96,7 @@ function sourceRelativePath(row) { function startupFolderPath(projectsDir, folder) { if (typeof folder !== 'string') return null; - const harness = require('../../../harnesses').harnessForFolder(folder); + const harness = require('../harnesses').harnessForFolder(folder); if (harness.folderPrefix && folder.startsWith(harness.folderPrefix)) return harness.folderPath(folder); return folder && folder !== '.' && folder !== '..' && !/[\\/:]/.test(folder) ? path.join(projectsDir, folder) : null; } @@ -104,7 +104,7 @@ function startupFolderPath(projectsDir, folder) { function startupSourcePath(projectsDir, folder, relativePath) { const dir = startupFolderPath(projectsDir, folder); if (!dir || !safeRelativePath(relativePath)) return null; - const harness = require('../../../harnesses').harnessForFolder(folder); + const harness = require('../harnesses').harnessForFolder(folder); if (harness.folderPrefix && folder.startsWith(harness.folderPrefix) && (relativePath.includes('/') || !harness.sessionIdFromPath(relativePath))) return null; return path.join(dir, relativePath); } @@ -139,7 +139,7 @@ function deferStartupSources(result, paths) { const rows = [...result.inventory.rows, ...result.sessions]; const deferred = new Set([...(result.deferred || []), ...paths]); const rejected = new Set([...deferred].map(relativePath => { - const harness = require('../../../harnesses').harnessForFolder(result.folder); + const harness = require('../harnesses').harnessForFolder(result.folder); if (harness.folderPrefix && result.folder.startsWith(harness.folderPrefix)) return harness.sessionIdFromPath(relativePath); const known = rows.find(row => sourceRelativePath(row) === relativePath); if (known) return known.sessionId; diff --git a/test/check-changelog.test.js b/test/check-changelog.test.js index 8d25128b4..d2a578ce3 100644 --- a/test/check-changelog.test.js +++ b/test/check-changelog.test.js @@ -13,7 +13,7 @@ const { isAppPath, checkChangelog, parseLabels } = require('../scripts/check-cha test('app code is what electron-builder ships: root scripts, public/, workers/, the sandbox wrapper', () => { for (const file of ['main.js', 'preload.js', 'src/main/changes/git-changes.js', 'public/app.js', 'public/style.css', 'public/index.html', 'workers/search-worker.js', 'scripts/claude-sandbox.sh', - 'src/main/viewer/file-lists-path.js', 'src/preload/preload.js', 'harnesses/claude.js', 'harnesses/codex.js']) { + 'src/main/viewer/file-lists-path.js', 'src/preload/preload.js', 'src/main/harnesses/claude.js', 'src/main/harnesses/codex.js']) { assert.equal(isAppPath(file), true, file); } }); @@ -131,7 +131,7 @@ test('end to end: an app change with an entry passes', (t) => { test('end to end: a harness-only change requires an entry or an explicit waiver', (t) => { const repo = makeRepo(t); - const head = repo.commit({ 'harnesses/codex.js': 'module.exports = {};\n' }, 'harness'); + const head = repo.commit({ 'src/main/harnesses/codex.js': 'module.exports = {};\n' }, 'harness'); const r = check(repo, ['--base', repo.base, '--head', head, '--labels', '[]']); assert.equal(r.status, 1, r.out); assert.match(r.out, /harnesses\/codex\.js/); diff --git a/test/check-docs.test.js b/test/check-docs.test.js index b9b9d846e..923e645e2 100644 --- a/test/check-docs.test.js +++ b/test/check-docs.test.js @@ -14,7 +14,7 @@ const SOURCE = fs.readFileSync(SCRIPT, 'utf8'); test('each runtime path requires documentation, including non-JS renderer files', () => { for (const file of ['main.js', 'preload.js', 'session-cache.js', 'src/main/service.js', 'public/app.js', 'public/index.html', 'public/style.css', 'workers/search.js', - 'harnesses/claude.js', 'scripts/claude-sandbox.sh']) { + 'src/main/harnesses/claude.js', 'scripts/claude-sandbox.sh']) { const result = checkDocs({ files: [file, 'test/fixture.js'], labels: [] }); assert.equal(result.ok, false, file); assert.ok(result.message.includes(file)); diff --git a/test/child-session-env.test.js b/test/child-session-env.test.js index 5dda630ab..77179d7e9 100644 --- a/test/child-session-env.test.js +++ b/test/child-session-env.test.js @@ -111,7 +111,7 @@ function mainContext() { scheduleProjects: () => ({ add: async () => {} }), createComposerState: require('../src/main/terminals/composer-state').createComposerState, parseAddDirs: () => [], sessionTranscriptExists: () => true, - getHarness: require('../harnesses').getHarness, + getHarness: require('../src/main/harnesses').getHarness, revealIfSdkSession() {}, wireSessionPty() {}, notifyRendererProjectsChanged() {}, getMcpState: () => null, JOB_ID_RE: /^[0-9a-f]{8}$/, }); diff --git a/test/codex-index.test.js b/test/codex-index.test.js index df227581f..3ea099965 100644 --- a/test/codex-index.test.js +++ b/test/codex-index.test.js @@ -95,8 +95,8 @@ test('Codex full readers record stable certificates and the effective external t f.write(ID_A, [['user', 'certificate corpus']]); const titleFile = path.join(f.codexHome, 'session_index.jsonl'); fs.writeFileSync(titleFile, JSON.stringify({ id: ID_A, thread_name: 'Title witness' }) + '\n'); - const harness = require('../harnesses/codex'); - const full = require('../harnesses').readHarnessFolder(harness, FOLDER).sessions[0]; + const harness = require('../src/main/harnesses/codex'); + const full = require('../src/main/harnesses').readHarnessFolder(harness, FOLDER).sessions[0]; assert.ok(full.fullReadStamp, 'full harness scan proposes a certificate'); const stamp = JSON.parse(full.fullReadStamp); assert.equal(stamp.runtime, 'codex'); @@ -115,7 +115,7 @@ test('Codex failed title observation cannot certify a full read', t => { return original.call(this, file, ...args); }; t.after(() => { fs.statSync = original; }); - const row = require('../harnesses/codex').readSessionFile(f.file(ID_A), FOLDER); + const row = require('../src/main/harnesses/codex').readSessionFile(f.file(ID_A), FOLDER); assert.ok(row, 'failed auxiliary reads retain existing parser behavior'); assert.equal(row.fullReadStamp, null, 'failed title reads do not prove title absence'); }); @@ -131,7 +131,7 @@ test('Codex title race cannot certify the previously read title', t => { if (file === titleFile) fs.appendFileSync(titleFile, JSON.stringify({ id: ID_A, thread_name: 'After' }) + '\n'); return value; }); - const row = require('../harnesses/codex').readSessionFile(f.file(ID_A), FOLDER); + const row = require('../src/main/harnesses/codex').readSessionFile(f.file(ID_A), FOLDER); assert.equal(row.aiTitle, 'Before', 'display parsing keeps existing semantics'); assert.equal(row.fullReadStamp, null, 'changed auxiliary source prevents certification'); }); @@ -146,7 +146,7 @@ test('Codex certification requires the title-index read to reach observed EOF', const bytes = read.call(this, file, ...args); return file === titleFile ? bytes.subarray(0, bytes.length - 1) : bytes; }); - const row = require('../harnesses/codex').readSessionFile(f.file(ID_A), FOLDER); + const row = require('../src/main/harnesses/codex').readSessionFile(f.file(ID_A), FOLDER); assert.equal(row.fullReadStamp, null, 'short title-index read cannot certify observed EOF'); }); diff --git a/test/codex-launch-ownership.test.js b/test/codex-launch-ownership.test.js index 46d29c567..3e38dc98b 100644 --- a/test/codex-launch-ownership.test.js +++ b/test/codex-launch-ownership.test.js @@ -6,7 +6,7 @@ const assert = require('node:assert/strict'); const fs = require('node:fs'); const os = require('node:os'); const path = require('node:path'); -const codex = require('../harnesses/codex'); +const codex = require('../src/main/harnesses/codex'); const transitions = require('../session-transitions'); const cache = require('../session-cache'); const openStore = require('./fixtures/conversation-store.cjs'); diff --git a/test/codex-viewer-and-guard.test.js b/test/codex-viewer-and-guard.test.js index 2591f6faa..4476f4891 100644 --- a/test/codex-viewer-and-guard.test.js +++ b/test/codex-viewer-and-guard.test.js @@ -21,7 +21,7 @@ test('the transcript follower maps every record through the harness transform, o t.after(() => fs.rmSync(dir, { recursive: true, force: true })); const file = path.join(dir, 'rollout.jsonl'); fs.writeFileSync(file, JSON.stringify({ type: 'session_meta', payload: { cwd: '/p' } }) + '\n' + codexLines(['first', 'reply'])); - const { toViewerEntry } = require('../harnesses/codex'); + const { toViewerEntry } = require('../src/main/harnesses/codex'); const follower = createTranscriptFollower(); const opened = follower.open(ID, file, undefined, toViewerEntry); assert.deepEqual(opened.entries.map(e => [e.type, e.message.content[0].text]), [['user', 'first'], ['assistant', 'reply']]); @@ -43,7 +43,7 @@ test('the transcript follower maps every record through the harness transform, o }); test('deleting a session whose CLI does not allow it is refused before any live check', async () => { - const { getHarness } = require('../harnesses'); + const { getHarness } = require('../src/main/harnesses'); const rows = new Map([[ID, { sessionId: ID, runtime: 'codex', sessionFile: '/sessions/x.jsonl' }], ['c1', { sessionId: 'c1' }]]); const guard = makeDeleteSessionGuard({ activeSessions: new Map(), sessionHasPty: () => false, ptyPids: new Set(), diff --git a/test/delete-session-guard-r3.test.js b/test/delete-session-guard-r3.test.js index e8bfa7ac0..98e0cba55 100644 --- a/test/delete-session-guard-r3.test.js +++ b/test/delete-session-guard-r3.test.js @@ -21,7 +21,7 @@ function setup() { bgAgents: { liveJobCheck: () => ({ known: true, job: null }) }, cliSessionState: { getSidebarDescriptors: () => [], liveElsewhereChecked: async () => ({ known: true, live: null }) }, sessionHasPty: () => false, ptyPids: () => [], - getCachedSession: id => rows.find(row => row.sessionId === id) || null, getHarness: require('../harnesses').getHarness, + getCachedSession: id => rows.find(row => row.sessionId === id) || null, getHarness: require('../src/main/harnesses').getHarness, }); const guard = vm.runInContext(source.slice(start, end) + '\ndeleteSessionGuard;', context, { filename: 'main.js' }); return { activeSessions, guard }; diff --git a/test/delete-session-guard.test.js b/test/delete-session-guard.test.js index 7bd765295..78e024dd5 100644 --- a/test/delete-session-guard.test.js +++ b/test/delete-session-guard.test.js @@ -81,7 +81,7 @@ test('the main-process delete guard reads merged member ids from the current cac makeDeleteSessionGuard, activeSessions: new Map([[SID, { exited: false }]]), bgAgents, cliSessionState, sessionHasPty: () => false, ptyPids: () => [], getAllCached: () => rows, sessionCache: require('../sidebar-bg-sessions'), - getCachedSession: id => rows.find(row => row.sessionId === id) || null, getHarness: require('../harnesses').getHarness, + getCachedSession: id => rows.find(row => row.sessionId === id) || null, getHarness: require('../src/main/harnesses').getHarness, }); const guard = vm.runInContext(source.slice(start, end) + '\ndeleteSessionGuard;', context, { filename: 'main.js' }); assert.equal(await guard('REPRESENTATIVE'), 'session is still running in this window — use Stop on its row in the sidebar, then retry Delete'); diff --git a/test/dom-resume-runtime.test.js b/test/dom-resume-runtime.test.js index 07aa19b1f..f430aea46 100644 --- a/test/dom-resume-runtime.test.js +++ b/test/dom-resume-runtime.test.js @@ -4,7 +4,7 @@ const test = require('node:test'); const assert = require('node:assert/strict'); const { setupSidebarDom } = require('./dom-setup'); const { loadAppFunctions } = require('./app-source'); -const { getHarness } = require('../harnesses'); +const { getHarness } = require('../src/main/harnesses'); function setup(t, effective = {}, platform = 'linux') { const ctx = setupSidebarDom(); diff --git a/test/fixtures/trigger-main-open.cjs b/test/fixtures/trigger-main-open.cjs index 42af918ce..ecabb0608 100644 --- a/test/fixtures/trigger-main-open.cjs +++ b/test/fixtures/trigger-main-open.cjs @@ -21,7 +21,7 @@ function fixture(overrides = {}) { isWslShell: () => false, log: { info() {}, warn() {}, error() {} }, encodeProjectPath: () => 'folder', sessionTransitions: { snapshotContinuationsBeforeSpawn: async () => null }, sessionTranscriptExists: () => false, isGitRepo: () => false, - getHarness: require('../../harnesses').getHarness, + getHarness: require('../../src/main/harnesses').getHarness, claudeCommand: (_shell, args, o = {}) => (o.prefix ? o.prefix + ' ' : '') + 'claude ' + args.join(' '), quoteArgvForShell: (_shell, args) => args.join(' '), shellArgs: (_shell, cmd) => [cmd], startMcpServer: async () => ({ port: 12345 }), shutdownMcpServer() {}, cleanPtyEnv: {}, scheduleProjects: () => ({ add: async () => {} }), diff --git a/test/fixtures/warm-start-1152.cjs b/test/fixtures/warm-start-1152.cjs index e7dc678b5..26c25eff4 100644 --- a/test/fixtures/warm-start-1152.cjs +++ b/test/fixtures/warm-start-1152.cjs @@ -52,7 +52,7 @@ function scanFixture(t) { require('./isolated-codex-home.cjs')(t); const root = fs.mkdtempSync(path.join(require('node:os').tmpdir(), 'codex-scan-1152-')); t.after(() => fs.rmSync(root, { recursive: true, force: true })); - const folder = 'codex/2026/08/26', adapter = require('../../harnesses/codex'); + const folder = 'codex/2026/08/26', adapter = require('../../src/main/harnesses/codex'); const dir = adapter.folderPath(folder); fs.mkdirSync(dir, { recursive: true }); const file = path.join(dir, 'rollout-example-' + ids[0] + '.jsonl'); diff --git a/test/harness-activity.test.js b/test/harness-activity.test.js index c7a98ab4d..78a81247a 100644 --- a/test/harness-activity.test.js +++ b/test/harness-activity.test.js @@ -7,8 +7,8 @@ const path = require('node:path'); const { setupSidebarDom } = require('./dom-setup'); const { loadAppFunctions } = require('./app-source'); -const codex = require('../harnesses/codex'); -const claude = require('../harnesses/claude'); +const codex = require('../src/main/harnesses/codex'); +const claude = require('../src/main/harnesses/claude'); test('Codex titles: a spinner frame is busy, "Action Required" is attention, anything else is idle', () => { const table = [ @@ -39,7 +39,7 @@ test('OSC 9 notifications: Codex says approval or done, Claude keeps the rendere assert.equal(claude.classifyNotification('Claude Code wants to enter plan mode'), 'attention'); assert.equal(claude.classifyNotification('Claude is waiting for your input'), 'idle'); assert.equal(claude.classifyNotification('Task completed'), null); - const { assertHarness } = require('../harnesses/contract'); + const { assertHarness } = require('../src/main/harnesses/contract'); assert.throws(() => assertHarness({ ...claude, classifyNotification: undefined }), /classifyNotification/); }); @@ -77,7 +77,7 @@ test('a Codex title that asks for action raises attention once, through the noti const ptyProcess = { pid: 7, onData: fn => { handlers.data = fn; }, onExit: fn => { handlers.exit = fn; }, kill() {} }; const session = { pty: ptyProcess, runtime: 'codex', exited: false, isPlainTerminal: false, outputBuffer: [], outputBufferSize: 0, projectPath: '/p' }; const context = { - getHarness: require('../harnesses').getHarness, mainWindow: { isDestroyed: () => false, webContents: { send: (...args) => sent.push(args) } }, + getHarness: require('../src/main/harnesses').getHarness, mainWindow: { isDestroyed: () => false, webContents: { send: (...args) => sent.push(args) } }, log: { debug() {}, info() {}, warn() {}, error() {} }, LOG_DEBUG_ON: false, TRACE: { on: false }, trace() {}, codePoints: () => '', busyDecision: () => '', progressDecision: () => '', Date, setTimeout, clearTimeout, Buffer, activeSessions: new Map([['codex-tab', session]]), cliSessionState: { deliveryPtyStart: () => 'start' }, ptyGenerationCounter: 0, cancellationIn: () => false, diff --git a/test/harness-codex-launch.test.js b/test/harness-codex-launch.test.js index 6a41d163b..e60512a8e 100644 --- a/test/harness-codex-launch.test.js +++ b/test/harness-codex-launch.test.js @@ -8,8 +8,8 @@ const os = require('node:os'); const path = require('node:path'); const vm = require('node:vm'); -const codex = require('../harnesses/codex'); -const { getHarness } = require('../harnesses'); +const codex = require('../src/main/harnesses/codex'); +const { getHarness } = require('../src/main/harnesses'); test('Codex selection leaves launch ownership and resume IDs intact', { skip: !require('./fixtures/conversation-store.cjs').supported && 'SQLite requires native binding or Node 22' }, async t => { diff --git a/test/harness-codex.test.js b/test/harness-codex.test.js index 70b7f486e..ea7ca352f 100644 --- a/test/harness-codex.test.js +++ b/test/harness-codex.test.js @@ -7,7 +7,7 @@ const fs = require('node:fs'); const os = require('node:os'); const path = require('node:path'); -const codexPath = path.join(__dirname, '../harnesses/codex.js'); +const codexPath = path.join(__dirname, '../src/main/harnesses/codex.js'); function rollout({ cwd, turns, meta, model }) { const lines = [ @@ -51,9 +51,9 @@ const ID = '01a03f6c-fdf9-7c83-86e3-c388f81d765c'; const NAME = `rollout-2026-08-26T11-55-02-${ID}.jsonl`; test('the Codex adapter exists and is registered under its own runtime', () => { - assert.ok(fs.existsSync(codexPath), 'harnesses/codex.js must exist'); - const codex = require('../harnesses/codex'); - const { HARNESSES, getHarness, harnessForFolder } = require('../harnesses'); + assert.ok(fs.existsSync(codexPath), 'src/main/harnesses/codex.js must exist'); + const codex = require('../src/main/harnesses/codex'); + const { HARNESSES, getHarness, harnessForFolder } = require('../src/main/harnesses'); assert.equal(HARNESSES.codex, codex); assert.equal(getHarness('codex'), codex); assert.equal(harnessForFolder('codex/2026/08/26'), codex); @@ -65,11 +65,11 @@ test('the Codex adapter exists and is registered under its own runtime', () => { assert.equal(codex.capabilities.subagents, false); assert.equal(codex.capabilities.continuations, false); assert.equal(codex.capabilities.deleteTranscript, false); - assert.equal(require('../harnesses/claude').capabilities.deleteTranscript, true); + assert.equal(require('../src/main/harnesses/claude').capabilities.deleteTranscript, true); }); test('parses a rollout into the shape the cache expects', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withFixture({ [NAME]: rollout({ cwd: '/Users/me/proj', turns: [['user', 'fix the parser'], ['assistant', 'done'], ['user', 'thanks']] }) }, dir => { const s = codex.readSessionFile(path.join(dir, NAME), 'codex/2026/08/26'); @@ -89,7 +89,7 @@ test('parses a rollout into the shape the cache expects', () => { }); test('a codex exec rollout is marked like an SDK session; interactive originators are not', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const turns = [['user', 'review this change'], ['assistant', 'done']]; withFixture({ [NAME]: rollout({ cwd: '/p', turns, meta: { originator: 'codex_exec', source: 'exec', thread_source: 'user' } }) }, dir => { assert.equal(codex.readSessionFile(path.join(dir, NAME), 'f').entrypoint, 'sdk-codex-exec'); @@ -107,7 +107,7 @@ test('a codex exec rollout is marked like an SDK session; interactive originator }); test('the session id comes from the file name, not session_meta', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withFixture({ [NAME]: rollout({ cwd: '/p', turns: [['user', 'hi']] }) }, dir => { const s = codex.readSessionFile(path.join(dir, NAME), 'f'); assert.equal(s.sessionId, ID); @@ -116,7 +116,7 @@ test('the session id comes from the file name, not session_meta', () => { }); test('injected user turns never become the summary', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const injected = ['\nnoise\n', 'x', 'y', 'z', '# AGENTS.md instructions for C:\\Serveur\\project\n\n\nread me\n']; @@ -130,7 +130,7 @@ test('injected user turns never become the summary', () => { }); test('a session with no user turn and a subagent rollout are skipped', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withFixture({ [NAME]: rollout({ cwd: '/p', turns: [] }) }, dir => { assert.equal(codex.readSessionFile(path.join(dir, NAME), 'f'), null); }); @@ -143,7 +143,7 @@ test('a session with no user turn and a subagent rollout are skipped', () => { }); test('large tool output is streamed and a final Unicode turn needs no newline', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const body = rollout({ cwd: '/p', turns: [['user', 'first']] }) + JSON.stringify({ type: 'response_item', payload: { type: 'function_call_output', output: 'discard this tool output '.repeat(50000) } }) + '\n' + JSON.stringify({ type: 'response_item', payload: { type: 'message', role: 'assistant', content: [{ type: 'text', text: 'Finished 🦒 '.repeat(30000) }] } }); @@ -162,7 +162,7 @@ test('large tool output is streamed and a final Unicode turn needs no newline', }); test('a rollout with no cwd is skipped and a corrupt line does not lose the rest', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const noCwd = JSON.stringify({ timestamp: '2026-08-26T10:00:00Z', type: 'session_meta', payload: { session_id: 'x' } }) + '\n' + JSON.stringify({ timestamp: '2026-08-26T10:00:01Z', type: 'response_item', payload: { type: 'message', role: 'user', content: [{ type: 'text', text: 'hi' }] } }) + '\n'; withFixture({ [NAME]: noCwd }, dir => assert.equal(codex.readSessionFile(path.join(dir, NAME), 'f'), null)); @@ -175,7 +175,7 @@ test('a rollout with no cwd is skipped and a corrupt line does not lose the rest }); test('created and modified come from conversation records, not the file or settings', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withFixture({ [NAME]: rollout({ cwd: '/p', turns: [['user', 'hello'], ['assistant', 'done']] }) }, dir => { const file = path.join(dir, NAME); const before = codex.readSessionFile(file, 'f'); @@ -200,7 +200,7 @@ test('created and modified come from conversation records, not the file or setti }); test('daily metrics come from turn_context models and token_usage_record usage', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const body = rollout({ cwd: '/p', turns: [['user', 'q'], ['assistant', 'a']], model: 'gpt-6' }) + JSON.stringify({ timestamp: '2026-08-26T10:00:05.000Z', type: 'response_item', payload: { type: 'custom_tool_call', call_id: 'c1', name: 'exec', input: 'ls' } }) + '\n' + JSON.stringify({ timestamp: '2026-08-26T10:00:06.000Z', type: 'token_usage_record', payload: { usage: { @@ -218,7 +218,7 @@ test('daily metrics come from turn_context models and token_usage_record usage', }); test('only rollout files are listed, ids are read without opening them, and sessionFile is the only way back', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withFixture({ [NAME]: 'ignored', 'notes.jsonl': 'ignored', 'rollout-broken.jsonl': 'ignored' }, dir => { const found = codex.listTranscripts(dir); assert.deepEqual(found.map(f => path.basename(f)), [NAME]); @@ -232,7 +232,7 @@ test('only rollout files are listed, ids are read without opening them, and sess }); test('folder keys are date paths under the codex prefix and malformed keys resolve nowhere', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withCodexHome(home => { const sessions = path.join(home, 'sessions'); assert.equal(codex.available(), false); @@ -252,7 +252,7 @@ test('folder keys are date paths under the codex prefix and malformed keys resol }); test('thread names come from session_index.jsonl, newest record first, a cleared name wins', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withCodexHome(home => { assert.deepEqual([...codex.readSessionTitles()], [], 'a missing index is an empty state'); fs.writeFileSync(path.join(home, 'session_index.jsonl'), [ @@ -276,7 +276,7 @@ test('thread names come from session_index.jsonl, newest record first, a cleared }); test('viewer entries map codex records onto the transcript shape the viewer renders', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const entries = [ { type: 'session_meta', payload: { cwd: '/p' } }, { type: 'response_item', timestamp: 't1', payload: { type: 'message', role: 'developer', content: [{ type: 'text', text: 'scaffold' }] } }, @@ -303,12 +303,12 @@ test('viewer entries map codex records onto the transcript shape the viewer rend assert.equal(out[5].message.content[0].content, 'ok'); assert.equal(codex.toViewerEntry(entries[1]), null); assert.deepEqual(codex.toViewerEntry(entries[3]), out[0]); - const claude = require('../harnesses/claude'); + const claude = require('../src/main/harnesses/claude'); assert.equal(claude.toViewerEntries(entries), entries); assert.equal(claude.toViewerEntry(entries[0]), entries[0]); }); test('CODEX_HOME relocates the sessions root', () => { - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); withCodexHome(home => assert.equal(codex.sessionsRoot(), path.join(home, 'sessions'))); }); diff --git a/test/harness-contract.test.js b/test/harness-contract.test.js index 846e25b13..5ba9417fc 100644 --- a/test/harness-contract.test.js +++ b/test/harness-contract.test.js @@ -7,9 +7,9 @@ const path = require('node:path'); const os = require('node:os'); test('every registered adapter conforms and invalid ports are rejected', () => { - assert.ok(fs.existsSync(path.join(__dirname, '../harnesses/contract.js')), 'harness contract must exist'); - const { assertHarness, CAPABILITIES } = require('../harnesses/contract'); - const { allHarnesses, getHarness, harnessForFolder, HARNESSES, availableHarnesses, transcriptPath } = require('../harnesses'); + assert.ok(fs.existsSync(path.join(__dirname, '../src/main/harnesses/contract.js')), 'harness contract must exist'); + const { assertHarness, CAPABILITIES } = require('../src/main/harnesses/contract'); + const { allHarnesses, getHarness, harnessForFolder, HARNESSES, availableHarnesses, transcriptPath } = require('../src/main/harnesses'); assert.ok(allHarnesses().length); for (const adapter of allHarnesses()) { assert.equal(assertHarness(adapter), adapter); @@ -46,15 +46,15 @@ test('every registered adapter conforms and invalid ports are rejected', () => { for (const method of ['sessionIdFromPath', 'needsIdDetection']) { test(`the contract rejects a missing ${method} method`, () => { - const { assertHarness } = require('../harnesses/contract'); - const claude = require('../harnesses/claude'); + const { assertHarness } = require('../src/main/harnesses/contract'); + const claude = require('../src/main/harnesses/claude'); assert.throws(() => assertHarness({ ...claude, [method]: undefined }), new RegExp(method)); }); } test('the contract requires project grouping metadata and accepts an ungrouped store', () => { - const { assertHarness } = require('../harnesses/contract'); - const claude = require('../harnesses/claude'); + const { assertHarness } = require('../src/main/harnesses/contract'); + const claude = require('../src/main/harnesses/claude'); for (const groupsByProject of [undefined, null, 'true', 1]) { assert.throws(() => assertHarness({ ...claude, groupsByProject }), /groupsByProject/); } @@ -65,7 +65,7 @@ test('the contract requires project grouping metadata and accepts an ungrouped s }); test('Claude exposes project grouping, parent identity and launch detection semantics', () => { - const claude = require('../harnesses/claude'); + const claude = require('../src/main/harnesses/claude'); assert.equal(claude.groupsByProject, true); assert.equal(claude.sessionIdFromPath(path.join('project', 'parent.jsonl')), 'parent'); assert.equal(claude.needsIdDetection({ isNew: true }), false); @@ -79,14 +79,14 @@ for (const [layout, file] of [ ['legacy', path.join('project', 'parent', 'agent-child.jsonl')], ]) { test(`Claude maps ${layout} subagent paths to cached session identity`, () => { - const { createClaudeHarness } = require('../harnesses/claude'); + const { createClaudeHarness } = require('../src/main/harnesses/claude'); const claude = createClaudeHarness({ projectsDir: path.resolve('.') }); assert.equal(claude.sessionIdFromPath(file), 'sub:parent:child'); }); } test('Claude delegates fork transcript, continuation, state, job and binary contracts', () => { - const claude = require('../harnesses/claude'); + const claude = require('../src/main/harnesses/claude'); const transcripts = require('../read-session-file'); const projects = require('../derive-project-path'); for (const key of ['readSessionFile', 'enumerateSessionFiles']) assert.equal(claude[key], transcripts[key]); @@ -97,7 +97,7 @@ test('Claude delegates fork transcript, continuation, state, job and binary cont assert.equal(claude.resolveWindowsLaunch, require('../claude-binary').resolveWindowsClaude); assert.equal(claude.classifyTitleActivity, require('../classify-title-activity').classifyTitleActivity); assert.deepEqual(claude.classifyTitleActivity('plain title'), { busy: false, idle: false, via: null }); - const pending = [require.cache[require.resolve('../harnesses')]]; + const pending = [require.cache[require.resolve('../src/main/harnesses')]]; const seen = new Set(); while (pending.length) { const module = pending.pop(); @@ -109,15 +109,15 @@ test('Claude delegates fork transcript, continuation, state, job and binary cont }); test('harness modules ship in the package and remain visible to the layout guard', () => { - assert.ok(require('../package.json').build.files.includes('harnesses/**')); + assert.ok(require('../package.json').build.files.includes('src/**/*')); const files = require('../scripts/module-paths').appFiles(path.join(__dirname, '..')); - for (const file of ['harnesses/index.js', 'harnesses/claude.js', 'harnesses/contract.js']) assert.ok(files.includes(file), file); + for (const file of ['src/main/harnesses/index.js', 'src/main/harnesses/claude.js', 'src/main/harnesses/contract.js']) assert.ok(files.includes(file), file); }); test('Claude store enumerates parent, preferred and legacy subagents under an isolated root', t => { const root = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-contract-')); t.after(() => fs.rmSync(root, { recursive: true, force: true })); - const { createClaudeHarness } = require('../harnesses/claude'); + const { createClaudeHarness } = require('../src/main/harnesses/claude'); const claude = createClaudeHarness({ projectsDir: root }); const folder = claude.folderForProject(root); const dir = claude.folderPath(folder); diff --git a/test/harness-launch.test.js b/test/harness-launch.test.js index 501b4be5d..5ca6bf96f 100644 --- a/test/harness-launch.test.js +++ b/test/harness-launch.test.js @@ -43,8 +43,8 @@ for (const [name, isNew, exists, git, options, expected] of cases) { launchMode: null, isGitRepo: () => git, parseAddDirs: value => String(value || '').split(',').map(s => s.trim()).filter(Boolean), log: { info() {}, warn() {} }, - getHarness: id => require('../harnesses').getHarness(id), - launchHarness: require('../harnesses').getHarness(), cachedRow: null, fs, + getHarness: id => require('../src/main/harnesses').getHarness(id), + launchHarness: require('../src/main/harnesses').getHarness(), cachedRow: null, fs, }; vm.runInNewContext(source.slice(start, end) + '\nglobalThis.result = claudeArgs;', context, { filename }); assert.deepEqual(Array.from(context.result), expected); @@ -52,8 +52,8 @@ for (const [name, isNew, exists, git, options, expected] of cases) { } test('Claude pure argv builder exposes the characterized launch contract', () => { - assert.ok(fs.existsSync(path.join(__dirname, '../harnesses/claude.js')), 'Claude adapter must exist'); - const { buildLaunchArgs } = require('../harnesses/claude'); + assert.ok(fs.existsSync(path.join(__dirname, '../src/main/harnesses/claude.js')), 'Claude adapter must exist'); + const { buildLaunchArgs } = require('../src/main/harnesses/claude'); for (const [, isNew, exists, git, options, expected] of cases) { const startsFresh = isNew || (!options.forkFrom && !exists); const effective = { ...options, worktree: options.worktree && git }; @@ -61,7 +61,7 @@ test('Claude pure argv builder exposes the characterized launch contract', () => } }); -const { buildLaunchArgs: claudeArgs } = require('../harnesses/claude'); +const { buildLaunchArgs: claudeArgs } = require('../src/main/harnesses/claude'); const awkwardNames = ['smithy hardening', `it's "quoted"`, 'a\\', 'C:\\dir\\', '$HOME `id` $(id) %PATH% !x ^y', 'a&b|c>d { }); test('the writer refuses a global patch that switches every CLI off', () => { - const { assertHarnessSettings, enabledHarnesses, allHarnesses } = require('../harnesses'); + const { assertHarnessSettings, enabledHarnesses, allHarnesses } = require('../src/main/harnesses'); const ids = allHarnesses().map(h => h.id); assert.ok(ids.includes('claude') && ids.includes('codex')); assert.throws(() => assertHarnessSettings({ disabledHarnesses: ids }), /at least one CLI/i); @@ -119,7 +119,7 @@ test('main exposes the CLI list and model catalog over IPC and restarts the harn const preload = fs.readFileSync(path.join(__dirname, '../preload.js'), 'utf8'); assert.match(preload, /getHarnesses: \(\) => ipcRenderer\.invoke\('get-harnesses'\)/); assert.match(preload, /getHarnessModels: \(runtime\) => ipcRenderer\.invoke\('get-harness-models', runtime\)/); - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); assert.equal(typeof codex.readModelCatalog, 'function'); }); diff --git a/test/harness-worktree-grouping.test.js b/test/harness-worktree-grouping.test.js index 3ae17aa18..51a5d18f3 100644 --- a/test/harness-worktree-grouping.test.js +++ b/test/harness-worktree-grouping.test.js @@ -175,7 +175,7 @@ for (const deleted of [false, true]) { } }; h.write('claude-source'); - const codex = require('../harnesses/codex'); + const codex = require('../src/main/harnesses/codex'); const folder = 'codex/2026/11/20'; const dir = codex.folderPath(folder); fs.mkdirSync(dir, { recursive: true }); @@ -254,7 +254,7 @@ for (const fork of [false, true]) { const context = vm.createContext({ projectPath: h.repo, triggerPermit: null, sessionOptions: fork ? { forkFrom: 'source' } : {}, isNew: fork, sessionId: fork ? 'new-fork' : 'source', PROJECTS_DIR: h.projects, - getCachedSession: () => null, getHarness: require('../harnesses').getHarness, + getCachedSession: () => null, getHarness: require('../src/main/harnesses').getHarness, encodeProjectPath, resolveSessionRealCwd, fs }); vm.runInContext(source.slice(start, end), context, { filename }); assert.equal(vm.runInContext('spawnCwd', context), h.cwd); diff --git a/test/module-layout.test.js b/test/module-layout.test.js index 84321a284..e9085a9d5 100644 --- a/test/module-layout.test.js +++ b/test/module-layout.test.js @@ -72,14 +72,14 @@ test('new app modules cannot be added at root; move PRs must shrink the allow-li test('the resolver guard detects lazy broken requires at root, in workers/src/scripts and required public modules', (t) => { const root = fs.mkdtempSync(path.join(os.tmpdir(), 'module-layout-')); t.after(() => fs.rmSync(root, { recursive: true, force: true })); - for (const file of ['entry.js', 'workers/w.js', 'src/main/nested/a.js', 'scripts/s.js', 'harnesses/claude.js', 'public/shared.js']) { + for (const file of ['entry.js', 'workers/w.js', 'src/main/nested/a.js', 'scripts/s.js', 'public/shared.js']) { fs.mkdirSync(path.dirname(path.join(root, file)), { recursive: true }); fs.writeFileSync(path.join(root, file), "function lazy() { return require('./missing'); }"); } fs.appendFileSync(path.join(root, 'entry.js'), "\nrequire('./public/shared'); // require('./comment')"); fs.writeFileSync(path.join(root, 'public/browser-only.js'), "require('./not-main-code');"); const failures = unresolved(root); - assert.equal(failures.length, 6, failures.join('\n')); + assert.equal(failures.length, 5, failures.join('\n')); assert.ok(failures.every((f) => f.includes('./missing'))); assert.deepEqual(walk(root, 'src'), ['src/main/nested/a.js']); }); diff --git a/test/open-terminal-attach.test.js b/test/open-terminal-attach.test.js index a058ea4e0..375d6b5ff 100644 --- a/test/open-terminal-attach.test.js +++ b/test/open-terminal-attach.test.js @@ -25,7 +25,7 @@ function launchFixture() { resolveShell: () => ({ path: '/bin/bash' }), isWslShell: () => false, log: { info() {}, warn() {}, error() {} }, sessionTransitions: { snapshotContinuationsBeforeSpawn: async () => null }, armLaunchSweep() {}, - sessionTranscriptExists: () => true, getHarness: require('../harnesses').getHarness, + sessionTranscriptExists: () => true, getHarness: require('../src/main/harnesses').getHarness, claudeCommand: (_shell, args, o = {}) => (o.prefix ? o.prefix + ' ' : '') + 'claude ' + args.join(' '), quoteArgvForShell: (_shell, args) => args.join(' '), shellArgs: (_shell, cmd) => [cmd], cleanPtyEnv: {}, scheduleProjects: () => ({ add: async () => {} }), activityReporter: { sessionStarted() {} }, diff --git a/test/read-session-file-golden.test.js b/test/read-session-file-golden.test.js index 82f2f67bc..fddd4be41 100644 --- a/test/read-session-file-golden.test.js +++ b/test/read-session-file-golden.test.js @@ -54,7 +54,7 @@ test('parser output requires a content version bump for Claude, bridge and Codex const canonicalFixture = path.join(root, path.basename(FIXTURE_PATH)); fs.writeFileSync(canonicalFixture, fs.readFileSync(FIXTURE_PATH, 'utf8').replace(/\r\n/g, '\n')); const rows = [readSessionFile(canonicalFixture, 'folder', '/fixture'), ...merged.toUpsert, - require('../harnesses/codex').readSessionFile(codexFile, 'codex/2024/01/01')]; + require('../src/main/harnesses/codex').readSessionFile(codexFile, 'codex/2024/01/01')]; const normalize = value => { if (Array.isArray(value)) return value.map(normalize); if (!value || typeof value !== 'object') return value; diff --git a/test/read-session-file-streaming-1180.test.js b/test/read-session-file-streaming-1180.test.js index df9e9189d..9670e03e7 100644 --- a/test/read-session-file-streaming-1180.test.js +++ b/test/read-session-file-streaming-1180.test.js @@ -81,7 +81,7 @@ for (const terminated of [false, true]) { const rollout = path.join(root, 'rollout-example-' + codex.ids[0] + '.jsonl'); const largeMessage = JSON.stringify({ type: 'response_item', payload: { type: 'message', role: 'user', content: [{ type: 'text', text: 'x'.repeat(300 * 1024) }] } }); fs.writeFileSync(rollout, codex.body(root, 'good') + largeMessage + (terminated ? '\n' + codex.body(root, 'after') : '')); - const codexRow = require('../harnesses/codex').readSessionFile(rollout, 'codex/2026/08/26'); + const codexRow = require('../src/main/harnesses/codex').readSessionFile(rollout, 'codex/2026/08/26'); assert.equal(codexRow.messageCount, terminated ? 2 : 1); }); } diff --git a/test/restore-fresh-runtime.test.js b/test/restore-fresh-runtime.test.js index dd79b9be7..d09850bfe 100644 --- a/test/restore-fresh-runtime.test.js +++ b/test/restore-fresh-runtime.test.js @@ -8,7 +8,7 @@ const fs = require('node:fs'); const path = require('node:path'); const vm = require('node:vm'); const { loadAppFunctions } = require('./app-source'); -const { getHarness } = require('../harnesses'); +const { getHarness } = require('../src/main/harnesses'); const PROJECT = 'D:/project'; const HARNESSES = [ diff --git a/test/sandbox-control-launch.test.js b/test/sandbox-control-launch.test.js index b9ab65d4d..2f2cbf349 100644 --- a/test/sandbox-control-launch.test.js +++ b/test/sandbox-control-launch.test.js @@ -77,7 +77,7 @@ for (const mode of ['new', 'resume', 'fork', 'schedule']) { scheduleProjects: () => ({ add: async () => {}, list: async () => [] }), resolveScheduleSandbox: () => true, scheduleLaunchRefusal: require('../src/main/schedules/schedule-runner').scheduleLaunchRefusal, - getHarness: require('../harnesses').getHarness, + getHarness: require('../src/main/harnesses').getHarness, isProjectSettingsArchived: () => false, log: { info() {}, warn() {}, error() {} }, cliSessionState: { trackScheduleRun() {}, ensureWatching: () => true, deliveryPtyStart: () => null }, diff --git a/test/scheduled-run-liveness-814.test.js b/test/scheduled-run-liveness-814.test.js index cf3f47d87..5717eef20 100644 --- a/test/scheduled-run-liveness-814.test.js +++ b/test/scheduled-run-liveness-814.test.js @@ -25,7 +25,7 @@ function transcriptFixture(t) { vm.runInNewContext(source.slice(start, end), { fs, path, Buffer, transcriptFollower: follower, getCachedFolder: () => 'fixture', projectsDirForFolder: () => root, - getCachedSession: () => ({ folder: 'fixture' }), getHarness: require('../harnesses').getHarness, + getCachedSession: () => ({ folder: 'fixture' }), getHarness: require('../src/main/harnesses').getHarness, ipcMain: { handle: (name, handler) => { assert.equal(name, 'read-session-jsonl'); invoke = handler; } }, }, { filename, lineOffset: source.slice(0, start).split('\n').length - 1 }); const file = path.join(root, 'run.jsonl'); diff --git a/test/search-refs-1255.test.js b/test/search-refs-1255.test.js index a4cf9992f..d44a45e48 100644 --- a/test/search-refs-1255.test.js +++ b/test/search-refs-1255.test.js @@ -133,7 +133,7 @@ test('a PR number that only a Codex tool returned is searchable', { skip }, t => { type: 'response_item', timestamp: '2026-11-20T10:00:04.000Z', payload: { type: 'custom_tool_call_output', call_id: 'c2', output: 'merged !777' } }, ]; fs.writeFileSync(file, lines.map(line => JSON.stringify(line)).join('\n') + '\n'); - const row = require('../harnesses/codex').readSessionFile(file, 'codex/2026/11/20'); + const row = require('../src/main/harnesses/codex').readSessionFile(file, 'codex/2026/11/20'); assert.ok(row, 'the rollout parses'); store.upsertSearchEntries([{ id: row.sessionId, type: 'session', folder: row.folder, title: row.summary, body: searchBody(row.textContent, row.refs) }]); for (const query of ['4242', 'o/r#4242', '!777']) assert.deepEqual(store.searchByType('session', query).map(r => r.id), [row.sessionId], query); diff --git a/test/session-cache-warm-start.test.js b/test/session-cache-warm-start.test.js index becb2d87a..bd7df5045 100644 --- a/test/session-cache-warm-start.test.js +++ b/test/session-cache-warm-start.test.js @@ -303,7 +303,7 @@ test('Codex title-only changes select affected UUIDs', f.titles([[f.ids[2], 'unrelated']]); assert.equal((await f.restart()).ok, true); assert.equal(f.codexScans()[0].bytesRead, 0, 'unrelated title entries do not dirty bodies'); - assert.equal(f.db.getFolderMeta(f.codexFolder).indexMtimeMs, require('../harnesses').harnessFolderIndexMtimeMs(require('../harnesses/codex'), require('../harnesses/codex').folderPath(f.codexFolder), require('../harnesses/codex').listTranscripts(require('../harnesses/codex').folderPath(f.codexFolder)))); + assert.equal(f.db.getFolderMeta(f.codexFolder).indexMtimeMs, require('../src/main/harnesses').harnessFolderIndexMtimeMs(require('../src/main/harnesses/codex'), require('../src/main/harnesses/codex').folderPath(f.codexFolder), require('../src/main/harnesses/codex').listTranscripts(require('../src/main/harnesses/codex').folderPath(f.codexFolder)))); await f.writer.renameSession(f.ids[0], 'useroverride'); f.titles([[f.ids[0], 'hiddennewtitle']]); assert.equal((await f.restart()).ok, true); @@ -377,7 +377,7 @@ test('Disabled Codex performs no startup I/O', assert.equal((await f.cache.populateCacheViaWorker()).ok, true); await f.writer.setSetting('global', { disabledHarnesses: ['codex'] }); fs.unlinkSync(file); - const adapter = require('../harnesses/codex'); + const adapter = require('../src/main/harnesses/codex'); const spies = ['listFolders', 'listTranscripts', 'readSessionFile', 'readSessionTitles', 'readTitleSnapshot', 'titleIndexMtimeMs'] .map(name => t.mock.method(adapter, name, () => assert.fail('disabled Codex called ' + name))); const inventory = [...f.db.getAllFolderMeta()].map(([folder, meta]) => ({ folder, meta, rows: f.db.getCachedByFolder(folder) })); diff --git a/test/session-status-main.test.js b/test/session-status-main.test.js index 9491077f0..d1bf16a72 100644 --- a/test/session-status-main.test.js +++ b/test/session-status-main.test.js @@ -201,7 +201,7 @@ test('m4: ordinary spawns retain the v1 capture condition and have a separate st cliSessionState: { deliveryPtyStart: () => 'start' }, launchMode: null, resumeSourceId: null, launchStartedAt: 1, projectPath: '', spawnCwd: '', projectFolder: '', knownJsonlFiles: new Set(), continuationSnapshot: null, isPlainTerminal: false, panelOwnerId: null, sessionOptions: {}, isAttach: false, attachJobId: null, - mcpServer: null, mcpError: null, createComposerState: () => ({}), launchHarness: require('../harnesses').getHarness() }); + mcpServer: null, mcpError: null, createComposerState: () => ({}), launchHarness: require('../src/main/harnesses').getHarness() }); vm.runInContext(declaration, context, { filename }); const session = vm.runInContext('session', context, { filename }); assert.equal(Object.hasOwn(session, 'hostPtyStart'), !!triggerPermit, 'v1 pin capture remains trigger-only'); diff --git a/test/working-set-schedules-migration.test.js b/test/working-set-schedules-migration.test.js index dcdbd2c32..f56f78766 100644 --- a/test/working-set-schedules-migration.test.js +++ b/test/working-set-schedules-migration.test.js @@ -19,7 +19,7 @@ function writerStore(global) { const node = espree.parse(source, { ecmaVersion: 'latest', range: true }).body .find(entry => entry.type === 'FunctionDeclaration' && entry.id.name === 'targetUnits'); const worker = vm.createContext({ db, commands: createWriterCommands(db), rawCommands: new Set(['setSetting']), - assertHarnessSettings: require('../harnesses').assertHarnessSettings }); + assertHarnessSettings: require('../src/main/harnesses').assertHarnessSettings }); vm.runInContext(source.slice(...node.range), worker, { filename: workerFile }); const run = (name, args) => { worker.unitArgs = [name, args]; diff --git a/workers/scan-projects.js b/workers/scan-projects.js index bd7b9b2b4..1a537ebec 100644 --- a/workers/scan-projects.js +++ b/workers/scan-projects.js @@ -7,7 +7,7 @@ const { setRemappedProjectReader } = require('../encode-project-path'); const { readSessionFile, enumerateSessionFiles, mergeBridgeGroups, subagentSessionId, isCanonicalWorkflowPath } = require('../read-session-file'); const { classifyTranscriptPath } = require('../subagent-attribution'); const { continuationMtime } = require('../session-continuations'); -const { prefixedHarnesses, readHarnessFolder, harnessFolderIndexMtimeMs } = require('../harnesses'); +const { prefixedHarnesses, readHarnessFolder, harnessFolderIndexMtimeMs } = require('../src/main/harnesses'); const { enumerateReads, measureFolder } = require('../src/main/session-index/read-counters'); const { fullIndexConfig, SESSION_CONTENT_INDEX_VERSION, observation, fullReadStamp, matchesFullRead, sourceRelativePath, safeRelativePath, deferStartupSources, readFailures, failureStamp, deterministicReadFailure } = require('../src/main/session-index/full-read-state'); diff --git a/workers/session-index-writer.js b/workers/session-index-writer.js index 019dbdedc..ff85daa67 100644 --- a/workers/session-index-writer.js +++ b/workers/session-index-writer.js @@ -5,7 +5,7 @@ const { setTimeout: delay, setImmediate: yieldTurn } = require('node:timers/prom const { performance } = require('node:perf_hooks'); const { openSessionIndexStore } = require('../session-index-store'); const { createWriterCommands } = require('../session-index-commands'); -const { assertHarnessSettings } = require('../harnesses'); +const { assertHarnessSettings } = require('../src/main/harnesses'); const { createProjectDeleteProgress, commitTransaction } = require('../src/main/projects/project-delete-progress'); const { completeProjectDeletion, bindDeletionProducer, assertDeletionProducer } = require('../src/main/projects/project-delete-writer'); const { folderReadWitness } = require('../src/main/session-index/full-read-state');