>}
+ */
+ async _appleSiliconGPUInfo(name) {
+ const memOutput = await runCommand('sysctl', ['hw.memsize']);
+ const parsedMem = parseInt(
+ String(memOutput || '')
+ .split(':')[1]
+ ?.trim() || '',
+ 10
+ );
+ // os.totalmem() reads the same hw.memsize through libuv.
+ const totalMem = parsedMem > 0 ? parsedMem : os.totalmem();
+ const vramEstimate = Math.round(totalMem * 0.75);
+
+ return {
+ type: 'metal',
+ name,
+ vramBytes: vramEstimate,
+ vramMB: Math.round(vramEstimate / 1024 / 1024),
+ isAppleSilicon: true
+ };
}
async _detectWindowsGPU() {
diff --git a/src/main/services/ModelMemoryManager.js b/src/main/services/ModelMemoryManager.js
index 1e9a0e8..08d6311 100644
--- a/src/main/services/ModelMemoryManager.js
+++ b/src/main/services/ModelMemoryManager.js
@@ -12,6 +12,7 @@
const os = require('os');
const { createLogger } = require('../../shared/logger');
const { delay } = require('../../shared/promiseUtils');
+const { peekAvailableMemoryBytes } = require('../utils/systemMemory');
const logger = createLogger('ModelMemoryManager');
@@ -112,7 +113,7 @@ class ModelMemoryManager {
* Calculate maximum memory we can use.
*
* Budget = max(ramBudget, vramBudget) where
- * ramBudget = min(70% of free system RAM, 16 GiB)
+ * ramBudget = min(70% of available system RAM, 16 GiB)
* vramBudget = 80% of reported VRAM (0 when no GPU info)
*
* On discrete GPUs (e.g. NVIDIA), models are GPU-offloaded into VRAM which is
@@ -124,19 +125,24 @@ class ModelMemoryManager {
* pool there, so the VRAM share is additionally capped at total RAM minus
* UNIFIED_MEMORY_SYSTEM_RESERVE_BYTES; without the cap an 8 GB machine was
* budgeted at 4.8 GB for models alone.
+ *
+ * "Available" comes from systemMemory: os.freemem() on Windows and Linux,
+ * where it already counts reclaimable caches, and the kernel's available
+ * figure on macOS, where os.freemem() counts only free pages and a busy Mac
+ * shows a few hundred MB.
*/
_calculateMaxMemory() {
const totalMemory = os.totalmem();
- const freeMemory = os.freemem();
+ const availableMemory = peekAvailableMemoryBytes();
- // System RAM budget: 70% of free, capped at 16GB
- const ramBudget = Math.min(freeMemory * 0.7, 16 * 1024 * 1024 * 1024);
+ // System RAM budget: 70% of available, capped at 16GB
+ const ramBudget = Math.min(availableMemory * 0.7, 16 * 1024 * 1024 * 1024);
let maxUsable = ramBudget;
// When GPU info is available, use the larger of RAM and VRAM budgets.
// On discrete GPUs, models are loaded into VRAM via GPU offload, so system
- // RAM free-mem should not constrain the budget.
+ // RAM availability should not constrain the budget.
if (this._gpuInfo?.vramMB && this._gpuInfo.vramMB > 0) {
const vramBytes = this._gpuInfo.vramMB * 1024 * 1024;
let vramBudget = Math.floor(vramBytes * 0.8); // 80% of VRAM
@@ -157,7 +163,7 @@ class ModelMemoryManager {
} else {
logger.info('[Memory] Calculated max memory usage (no GPU VRAM info)', {
totalGB: Math.round(totalMemory / 1024 / 1024 / 1024),
- freeGB: Math.round(freeMemory / 1024 / 1024 / 1024),
+ availableGB: Math.round(availableMemory / 1024 / 1024 / 1024),
maxUsableGB: Math.round(maxUsable / 1024 / 1024 / 1024)
});
}
@@ -166,7 +172,7 @@ class ModelMemoryManager {
}
/**
- * Refresh the memory budget based on current free memory.
+ * Refresh the memory budget based on current available memory.
* Called before load decisions to avoid using a stale snapshot from constructor time.
*/
_refreshMemoryBudget() {
diff --git a/test/GPUMonitor.test.js b/test/GPUMonitor.test.js
index a3f9726..944b993 100644
--- a/test/GPUMonitor.test.js
+++ b/test/GPUMonitor.test.js
@@ -161,6 +161,123 @@ describe('GPUMonitor', () => {
expect(result.percentUsed).toBe(20);
});
+ describe('macOS detection', () => {
+ const os = require('os');
+ const MiB = 1024 * 1024;
+ const expectedUnifiedVramMB = (totalBytes) => Math.round(Math.round(totalBytes * 0.75) / MiB);
+
+ function macMonitor(arch) {
+ const monitor = new GPUMonitor();
+ monitor._platform = 'darwin';
+ monitor._arch = arch;
+ return monitor;
+ }
+
+ test('Apple Silicon reads the model name and sizes VRAM at 75% of hw.memsize', async () => {
+ const monitor = macMonitor('arm64');
+ mockExecFileAsync
+ .mockResolvedValueOnce({
+ stdout: JSON.stringify({ SPDisplaysDataType: [{ sppci_model: 'Apple M4 Pro' }] }),
+ stderr: ''
+ })
+ .mockResolvedValueOnce({ stdout: 'hw.memsize: 25769803776\n', stderr: '' });
+
+ const result = await monitor.detectGPU();
+
+ expect(result).toEqual({
+ type: 'metal',
+ name: 'Apple M4 Pro',
+ vramBytes: 19327352832,
+ vramMB: 18432,
+ isAppleSilicon: true
+ });
+ });
+
+ test('Apple Silicon stays Metal with unified VRAM when system_profiler fails or times out', async () => {
+ const monitor = macMonitor('arm64');
+ // runCommand turns every rejection (including the timeout kill) into null.
+ mockExecFileAsync.mockRejectedValue(new Error('system_profiler timed out'));
+
+ const result = await monitor.detectGPU();
+
+ expect(result).toEqual({
+ type: 'metal',
+ name: 'Apple Silicon GPU',
+ vramBytes: Math.round(os.totalmem() * 0.75),
+ vramMB: expectedUnifiedVramMB(os.totalmem()),
+ isAppleSilicon: true
+ });
+ expect(result.vramMB).toBeGreaterThan(0);
+ });
+
+ test('Apple Silicon keeps a GPU model name without "apple" in it', async () => {
+ const monitor = macMonitor('arm64');
+ mockExecFileAsync
+ .mockResolvedValueOnce({
+ stdout: JSON.stringify({ SPDisplaysDataType: [{ sppci_model: 'Integrated GPU' }] }),
+ stderr: ''
+ })
+ .mockResolvedValueOnce({ stdout: 'hw.memsize: 17179869184\n', stderr: '' });
+
+ const result = await monitor.detectGPU();
+
+ expect(result).toEqual(
+ expect.objectContaining({
+ type: 'metal',
+ name: 'Integrated GPU',
+ vramMB: 12288,
+ isAppleSilicon: true
+ })
+ );
+ });
+
+ test('an unreadable hw.memsize falls back to os.totalmem()', async () => {
+ const monitor = macMonitor('arm64');
+ mockExecFileAsync
+ .mockResolvedValueOnce({
+ stdout: JSON.stringify({ SPDisplaysDataType: [{ sppci_model: 'Apple M2' }] }),
+ stderr: ''
+ })
+ .mockRejectedValueOnce(new Error('sysctl not found'));
+
+ const result = await monitor.detectGPU();
+
+ expect(result.name).toBe('Apple M2');
+ expect(result.vramMB).toBe(expectedUnifiedVramMB(os.totalmem()));
+ expect(result.vramMB).toBeGreaterThan(0);
+ });
+
+ test('an Intel Mac still reports a CPU when system_profiler fails', async () => {
+ const monitor = macMonitor('x64');
+ mockExecFileAsync.mockRejectedValue(new Error('system_profiler timed out'));
+
+ const result = await monitor.detectGPU();
+
+ expect(result).toEqual({ type: 'cpu', name: 'CPU' });
+ expect(mockExecFileAsync).toHaveBeenCalledTimes(1);
+ });
+
+ test('an Intel Mac still reads a discrete GPU from system_profiler', async () => {
+ const monitor = macMonitor('x64');
+ mockExecFileAsync.mockResolvedValueOnce({
+ stdout: JSON.stringify({
+ SPDisplaysDataType: [{ sppci_model: 'AMD Radeon Pro 5500M', sppci_vram: '8 GB' }]
+ }),
+ stderr: ''
+ });
+
+ const result = await monitor.detectGPU();
+
+ expect(result).toEqual({
+ type: 'metal',
+ name: 'AMD Radeon Pro 5500M',
+ vramBytes: 8192 * MiB,
+ vramMB: 8192,
+ isAppleSilicon: false
+ });
+ });
+ });
+
describe('child process options', () => {
const { TIMEOUTS } = require('../src/shared/performanceConstants');
diff --git a/test/ModelMemoryManager.availableMemory.test.js b/test/ModelMemoryManager.availableMemory.test.js
new file mode 100644
index 0000000..0052969
--- /dev/null
+++ b/test/ModelMemoryManager.availableMemory.test.js
@@ -0,0 +1,111 @@
+/**
+ * @jest-environment node
+ *
+ * The RAM half of the model budget follows AVAILABLE memory (systemMemory),
+ * not os.freemem(). On macOS os.freemem() counts only free pages: a busy
+ * 24 GB Mac reports about 400 MB, and without a GPU memory figure the whole
+ * model budget fell to 280 MB, so models were evicted and reloaded for every
+ * file. On Windows and Linux the figure is os.freemem() as before.
+ */
+
+// isolateModules re-runs mock factories, so every copy shares these two.
+const mockTotalmem = jest.fn(() => 24 * 1024 * 1024 * 1024);
+const mockFreemem = jest.fn(() => 400 * 1024 * 1024);
+jest.mock('os', () => ({
+ totalmem: () => mockTotalmem(),
+ freemem: () => mockFreemem()
+}));
+
+jest.mock('../src/shared/logger', () => ({
+ createLogger: () => ({ info: jest.fn(), warn: jest.fn(), error: jest.fn(), debug: jest.fn() })
+}));
+
+// systemMemory probes `sysctl -n kern.memorystatus_level` on darwin.
+const mockAsyncSpawn = jest.fn();
+jest.mock('../src/main/utils/asyncSpawnUtils', () => ({
+ asyncSpawn: (...args) => mockAsyncSpawn(...args)
+}));
+
+const MiB = 1024 * 1024;
+const GiB = 1024 * MiB;
+
+const realPlatform = Object.getOwnPropertyDescriptor(process, 'platform');
+
+/**
+ * Load ModelMemoryManager and the shared systemMemory reader fresh, as on a
+ * host of the given platform (the shared reader fixes its platform on first use).
+ */
+function loadOn(platform) {
+ Object.defineProperty(process, 'platform', { value: platform, configurable: true });
+ let modules;
+ jest.isolateModules(() => {
+ modules = {
+ ModelMemoryManager: require('../src/main/services/ModelMemoryManager').ModelMemoryManager,
+ systemMemory: require('../src/main/utils/systemMemory')
+ };
+ });
+ return modules;
+}
+
+function createMockLlamaService() {
+ return { _models: {}, _contexts: {}, _loadModel: jest.fn() };
+}
+
+describe('ModelMemoryManager budget uses available memory', () => {
+ beforeEach(() => {
+ mockAsyncSpawn.mockReset();
+ });
+
+ afterEach(() => {
+ Object.defineProperty(process, 'platform', realPlatform);
+ });
+
+ test('on macOS without a GPU memory figure the budget follows the kernel available figure', async () => {
+ // 60% of 24 GiB available, while only 400 MB of pages are free.
+ mockAsyncSpawn.mockResolvedValue({ status: 0, stdout: '60\n' });
+ const { ModelMemoryManager, systemMemory } = loadOn('darwin');
+
+ const manager = new ModelMemoryManager(createMockLlamaService());
+ // The first reading has not landed yet; let it land, then refresh as
+ // every load decision does.
+ await systemMemory.getAvailableMemoryBytes();
+ manager._refreshMemoryBudget();
+
+ const available = Math.round((24 * GiB * 60) / 100);
+ expect(manager._maxMemoryUsage).toBeCloseTo(available * 0.7, -1);
+ // Without the available figure: 0.7 x 400 MB = 280 MB.
+ expect(manager._maxMemoryUsage).toBeGreaterThan(10 * GiB);
+ expect(mockAsyncSpawn).toHaveBeenCalledWith(
+ '/usr/sbin/sysctl',
+ ['-n', 'kern.memorystatus_level'],
+ expect.anything()
+ );
+ });
+
+ test('on macOS a GPU-less budget gets the same figure through setGpuInfo(null)', async () => {
+ mockAsyncSpawn.mockResolvedValue({ status: 0, stdout: '50\n' });
+ const { ModelMemoryManager, systemMemory } = loadOn('darwin');
+ await systemMemory.getAvailableMemoryBytes();
+
+ const manager = new ModelMemoryManager(createMockLlamaService());
+ // LlamaService passes null after a Metal init falls back to the CPU.
+ manager.setGpuInfo(null);
+
+ expect(manager._maxMemoryUsage).toBeCloseTo(12 * GiB * 0.7, -1);
+ });
+
+ test('on Windows the budget is still 70% of os.freemem() and nothing is spawned', () => {
+ mockFreemem.mockReturnValue(6 * GiB);
+ try {
+ const { ModelMemoryManager } = loadOn('win32');
+
+ const manager = new ModelMemoryManager(createMockLlamaService());
+ manager._refreshMemoryBudget();
+
+ expect(manager._maxMemoryUsage).toBeCloseTo(6 * GiB * 0.7, -1);
+ expect(mockAsyncSpawn).not.toHaveBeenCalled();
+ } finally {
+ mockFreemem.mockReturnValue(400 * MiB);
+ }
+ });
+});
diff --git a/test/ModelMemoryManager.extended.test.js b/test/ModelMemoryManager.extended.test.js
index 0ff7f6f..dbf334d 100644
--- a/test/ModelMemoryManager.extended.test.js
+++ b/test/ModelMemoryManager.extended.test.js
@@ -26,6 +26,13 @@ jest.mock('../src/shared/logger', () => ({
})
}));
+// The budget reads available memory through systemMemory, which asks the
+// kernel on a macOS host. Route it to the mocked os.freemem() above so the
+// budget figures below hold on every CI platform.
+jest.mock('../src/main/utils/systemMemory', () => ({
+ peekAvailableMemoryBytes: () => require('os').freemem()
+}));
+
const { ModelMemoryManager } = require('../src/main/services/ModelMemoryManager');
function createMockLlamaService() {
From df7f207b48c58bc30d7e9f989687f3dbd4bbdc7c Mon Sep 17 00:00:00 2001
From: Levy Tate <78818969+iLevyTate@users.noreply.github.com>
Date: Sat, 14 Nov 2026 14:13:37 -0500
Subject: [PATCH 5/6] fix(copy): Mac wording, readable MCP client names,
accurate rule wording and the documented Zed config
Finder instead of Explorer on a Mac; the Uncategorized access warning
names the right OS setting; MCP copy confirmations name the app; the
Advanced settings text drops "Save to apply"; Memory & Rules and the User
Guide no longer say a typed rule applies to every file of that type; the
Zed snippet drops the undocumented source key.
---
docs/USER_GUIDE.md | 12 ++--
src/main/core/customFolders.js | 18 ++++-
src/main/transports/mcp/configSnippets.js | 3 +-
src/renderer/components/SettingsPanel.jsx | 2 +-
.../organize/FeedbackMemoryPanel.jsx | 5 +-
.../components/search/nodes/FolderNode.jsx | 13 +++-
.../components/settings/McpServerSection.jsx | 9 ++-
.../organize/useOrganizeNotificationFocus.js | 12 +++-
test/components/FeedbackMemoryPanel.test.js | 7 +-
test/components/FolderNode.test.js | 30 +++++++-
test/components/McpServerSection.test.js | 32 ++++++++-
test/components/SettingsPanel.test.js | 3 +
test/customFolders.test.js | 34 +++++++++
test/unit/mcp/configSnippets.test.js | 15 ++--
test/useOrganizeNotificationFocus.test.js | 71 ++++++++++++++-----
15 files changed, 226 insertions(+), 40 deletions(-)
diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md
index 3cc376b..d53df9b 100644
--- a/docs/USER_GUIDE.md
+++ b/docs/USER_GUIDE.md
@@ -106,8 +106,10 @@ folder for the next such file. Its card then gives the reason _You moved 2 simil
Undoing those moves takes it back, and so does moving as many such files away from your folder when
StratoSort suggests it.
-To give a rule straight away, type it in **Settings > Performance > Memory & Rules** (see
-[Performance](#performance)).
+You can also type a rule in **Settings > Performance > Memory & Rules** (see
+[Performance](#performance)). A rule moves its folder up for files of that type when that folder is
+already one of the folders StratoSort considers for the file. It does not add a folder StratoSort
+did not consider. For a firm change, make the two corrections described above.
---
@@ -227,8 +229,10 @@ See [MCP_SERVER.md](MCP_SERVER.md).
### Performance
- **Auto-organize**: Watch Downloads (and related routing).
-- **Memory & Rules**: Type a rule such as "CSV files go to Reports" and it applies to every file of
- that type. Your corrections are listed here too; edit or delete any that are wrong.
+- **Memory & Rules**: Type a rule such as "CSV files go to Reports". It moves Reports up for CSV
+ files when Reports is already one of the folders StratoSort considers for them. Two corrections
+ teach a firm change (see [Teaching StratoSort](#teaching-stratosort)). Your corrections are listed
+ here too; edit or delete any that are wrong.
- **Background Mode**: Keep running in the tray.
- **Exclusion rules**: Skip paths or patterns from watchers and triage.
- **Processing limits** and **Search enrichment** (relationship expansion and the relationship index
diff --git a/src/main/core/customFolders.js b/src/main/core/customFolders.js
index 4f39ea2..e443c1c 100644
--- a/src/main/core/customFolders.js
+++ b/src/main/core/customFolders.js
@@ -115,6 +115,22 @@ async function probeFolder(op, label) {
}
}
+/**
+ * What to tell the user when the Uncategorized folder cannot be created: the
+ * setting that most often blocks it on this OS.
+ * @param {NodeJS.Platform} [platform]
+ * @returns {string}
+ */
+function uncategorizedAccessHint(platform = process.platform) {
+ if (platform === 'win32') {
+ return "If Windows Security's Controlled folder access is on, allow StratoSort Stack through it.";
+ }
+ if (platform === 'darwin') {
+ return 'Check that StratoSort Stack is allowed in System Settings > Privacy & Security > Files and Folders.';
+ }
+ return 'Check that you can write to that folder.';
+}
+
/**
* Create the directory for a new or healed Uncategorized entry. Never throws,
* and the entry always keeps `preferredPath`.
@@ -157,7 +173,7 @@ async function createUncategorizedDirectory(preferredPath) {
code: 'storage.uncategorized-unavailable',
subsystem: 'storage',
severity: 'warning',
- message: `StratoSort could not create the Uncategorized folder at ${preferredPath}, so files that match no smart folder cannot be moved there. If Windows Security's Controlled folder access is on, allow StratoSort Stack through it.`,
+ message: `StratoSort could not create the Uncategorized folder at ${preferredPath}, so files that match no smart folder cannot be moved there. ${uncategorizedAccessHint()}`,
detail: { path: preferredPath, code: created.error?.code }
});
} catch {
diff --git a/src/main/transports/mcp/configSnippets.js b/src/main/transports/mcp/configSnippets.js
index b17ba0b..441cf5f 100644
--- a/src/main/transports/mcp/configSnippets.js
+++ b/src/main/transports/mcp/configSnippets.js
@@ -28,7 +28,8 @@ function generateSnippet(client, { port, token }) {
case 'zed':
return JSON.stringify(
{
- context_servers: { stratosort: { source: 'http', url, headers: { Authorization: auth } } }
+ // Zed's documented remote shape: only url and headers.
+ context_servers: { stratosort: { url, headers: { Authorization: auth } } }
},
null,
2
diff --git a/src/renderer/components/SettingsPanel.jsx b/src/renderer/components/SettingsPanel.jsx
index c91a536..7ec1243 100644
--- a/src/renderer/components/SettingsPanel.jsx
+++ b/src/renderer/components/SettingsPanel.jsx
@@ -1637,7 +1637,7 @@ const SettingsPanel = React.memo(function SettingsPanel() {
{isSimpleMode
? 'Simple mode hides the advanced configuration panels and uses a streamlined retrieval path, while still embedding your files on-device in the background — so nothing needs re-processing if you switch to Advanced later.'
- : 'Advanced reveals every configuration panel — AI models, semantic search, chat-with-documents, and the knowledge graph — and enables graph-aware retrieval at search time. Save to apply.'}
+ : 'Advanced reveals every configuration panel — AI models, semantic search, chat-with-documents, and the knowledge graph — and enables graph-aware retrieval at search time.'}
diff --git a/src/renderer/components/organize/FeedbackMemoryPanel.jsx b/src/renderer/components/organize/FeedbackMemoryPanel.jsx
index 2fabfac..52cc820 100644
--- a/src/renderer/components/organize/FeedbackMemoryPanel.jsx
+++ b/src/renderer/components/organize/FeedbackMemoryPanel.jsx
@@ -105,8 +105,9 @@ function FeedbackMemoryPanel({ className = '', refreshToken }) {
Rules and notes that adjust future suggestions. A rule like “CSV files go to
- Bing” applies to every file of that type. Your corrections and folder descriptions are
- listed here too. Edit or delete any that are wrong.
+ Bing” moves that folder up for files of that type when it is already one of the
+ folders StratoSort considers for them. Your corrections and folder descriptions are listed
+ here too. Edit or delete any that are wrong.
diff --git a/src/renderer/components/search/nodes/FolderNode.jsx b/src/renderer/components/search/nodes/FolderNode.jsx
index bdff72a..4960e7d 100644
--- a/src/renderer/components/search/nodes/FolderNode.jsx
+++ b/src/renderer/components/search/nodes/FolderNode.jsx
@@ -6,6 +6,14 @@ import { IconButton } from '../../ui';
import { useAppSelector } from '../../../store/hooks';
import { selectSmartFolders } from '../../../store/selectors';
import { resolveSmartFolderPath } from '../utils/graphLayoutUtils';
+import { isMac, isWindows } from '../../../utils/platform';
+
+// Named after what the OS calls the window the folder opens in.
+function revealFolderLabel() {
+ if (isMac) return 'Reveal folder in Finder';
+ if (isWindows) return 'Reveal folder in File Explorer';
+ return 'Reveal folder in file manager';
+}
const FolderNode = memo(({ data, selected }) => {
const label = data?.label || 'Suggested folder';
@@ -15,6 +23,7 @@ const FolderNode = memo(({ data, selected }) => {
// its path on disk. Empty when the name matches no configured smart folder.
const smartFolders = useAppSelector(selectSmartFolders);
const folderPath = resolveSmartFolderPath(smartFolders, data?.label);
+ const revealLabel = revealFolderLabel();
const dispatchFolderAction = useCallback(
(action) => {
@@ -80,8 +89,8 @@ const FolderNode = memo(({ data, selected }) => {
icon={}
size="xs"
variant="ghost"
- title="Reveal folder in Explorer"
- aria-label="Reveal folder in Explorer"
+ title={revealLabel}
+ aria-label={revealLabel}
onClick={handleReveal}
/>
diff --git a/src/renderer/components/settings/McpServerSection.jsx b/src/renderer/components/settings/McpServerSection.jsx
index 9a30dc6..063dcc9 100644
--- a/src/renderer/components/settings/McpServerSection.jsx
+++ b/src/renderer/components/settings/McpServerSection.jsx
@@ -33,6 +33,13 @@ const TOOLS = [
{ name: 'list_smart_folders', desc: 'List your smart folders and where they are.' }
];
+// Names users know the clients by; the keys are the ids main expects.
+const CLIENT_NAMES = {
+ claudeDesktop: 'Claude Desktop',
+ cursor: 'Cursor',
+ zed: 'Zed'
+};
+
// Plain words for the lifecycle states; 'running' shows the address instead.
const STATUS_TEXT = {
starting: 'Starting…',
@@ -81,7 +88,7 @@ function McpServerSection({ addNotification }) {
const result = await dispatch(getConfigSnippet(client)).unwrap();
const snippet = result?.snippet || '';
await navigator.clipboard.writeText(snippet);
- addNotification?.(`Copied ${client} snippet.`, 'success');
+ addNotification?.(`Copied ${CLIENT_NAMES[client] || 'MCP'} config.`, 'success');
} catch (err) {
addNotification?.(err.message, 'error');
}
diff --git a/src/renderer/phases/organize/useOrganizeNotificationFocus.js b/src/renderer/phases/organize/useOrganizeNotificationFocus.js
index c68e611..da49f42 100644
--- a/src/renderer/phases/organize/useOrganizeNotificationFocus.js
+++ b/src/renderer/phases/organize/useOrganizeNotificationFocus.js
@@ -4,13 +4,21 @@ import { useAppDispatch, useAppSelector } from '../../store/hooks';
import { clearOrganizeFocus } from '../../store/slices/uiSlice';
import { findFileByPathOrName, findFileIndexByPathOrName } from '../../utils/findFileInList';
import { toCanonicalPath } from '../../utils/canonicalPath';
+import { isMac, isWindows } from '../../utils/platform';
import { createLogger } from '../../../shared/logger';
const logger = createLogger('OrganizeNotificationFocus');
+/** What the OS calls the window a revealed file is shown in. */
+function fileManagerName() {
+ if (isMac) return 'Finder';
+ if (isWindows) return 'File Explorer';
+ return 'your file manager';
+}
+
/**
* When the user clicks a download/watcher notification, jump to the matching
- * file in Organize (scroll + select + details), or reveal it in Explorer.
+ * file in Organize (scroll + select + details), or reveal it in the file manager.
*/
/**
* @param {{ unprocessedFiles: any[], processedFiles: any[], setSelectedFiles: Function, setFocusFileIndex: Function, setViewingFileDetails: Function, setShowHistoryModal: Function, addNotification: Function, revealFile: Function }} args
@@ -117,7 +125,7 @@ export function useOrganizeNotificationFocus({
await reveal(filePath);
if (!cancelled) {
addNotificationRef.current(
- fileName ? `Opened ${fileName} in Explorer` : 'Opened file in Explorer',
+ `Opened ${fileName || 'file'} in ${fileManagerName()}`,
'info',
3500
);
diff --git a/test/components/FeedbackMemoryPanel.test.js b/test/components/FeedbackMemoryPanel.test.js
index bde7906..4183656 100644
--- a/test/components/FeedbackMemoryPanel.test.js
+++ b/test/components/FeedbackMemoryPanel.test.js
@@ -76,7 +76,12 @@ describe('FeedbackMemoryPanel', () => {
test('says what a rule does without promising more', async () => {
render();
- expect(await screen.findByText(/applies to every file of that type/)).toBeInTheDocument();
+ expect(
+ await screen.findByText(
+ /moves that folder up for files of that type when it is already one of the folders StratoSort considers for them/
+ )
+ ).toBeInTheDocument();
+ expect(screen.queryByText(/applies to every file/)).not.toBeInTheDocument();
expect(screen.queryByText(/follow these/)).not.toBeInTheDocument();
});
});
diff --git a/test/components/FolderNode.test.js b/test/components/FolderNode.test.js
index 31a03ba..b0f49c2 100644
--- a/test/components/FolderNode.test.js
+++ b/test/components/FolderNode.test.js
@@ -29,6 +29,17 @@ jest.mock('../../src/renderer/components/ui', () => ({
)
}));
+// Read at render time, so each test can pick the platform.
+const mockPlatform = { isMac: false, isWindows: true };
+jest.mock('../../src/renderer/utils/platform', () => ({
+ get isMac() {
+ return mockPlatform.isMac;
+ },
+ get isWindows() {
+ return mockPlatform.isWindows;
+ }
+}));
+
const mockSmartFolders = [
{ id: 'sf-1', name: 'Invoices/2025', path: 'C:\\Docs\\Invoices\\2025' },
{ id: 'sf-2', name: 'Receipts', path: 'C:\\Docs\\Receipts' }
@@ -134,11 +145,28 @@ describe('FolderNode keyboard affordances', () => {
render();
fireEvent.click(screen.getByRole('button', { name: /Move connected files here/i }));
- fireEvent.click(screen.getByRole('button', { name: /Reveal folder in Explorer/i }));
+ fireEvent.click(screen.getByRole('button', { name: 'Reveal folder in File Explorer' }));
expect(handler).toHaveBeenCalledTimes(2);
expect(handler.mock.calls[0][0].detail.action).toBe('moveFilesHere');
expect(handler.mock.calls[1][0].detail.action).toBe('reveal');
window.removeEventListener('graph:folderAction', handler);
});
+
+ describe('reveal button names the platform file manager', () => {
+ afterEach(() => {
+ Object.assign(mockPlatform, { isMac: false, isWindows: true });
+ });
+
+ test.each([
+ ['Windows', { isMac: false, isWindows: true }, 'Reveal folder in File Explorer'],
+ ['macOS', { isMac: true, isWindows: false }, 'Reveal folder in Finder'],
+ ['Linux', { isMac: false, isWindows: false }, 'Reveal folder in file manager']
+ ])('on %s', (_name, platform, label) => {
+ Object.assign(mockPlatform, platform);
+ render();
+ expect(screen.getByRole('button', { name: label })).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /in Explorer$/ })).not.toBeInTheDocument();
+ });
+ });
});
diff --git a/test/components/McpServerSection.test.js b/test/components/McpServerSection.test.js
index 2690342..1f852c0 100644
--- a/test/components/McpServerSection.test.js
+++ b/test/components/McpServerSection.test.js
@@ -228,7 +228,37 @@ describe('McpServerSection', () => {
fireEvent.click(copyButton);
await waitFor(() => {
expect(navigator.clipboard.writeText).toHaveBeenCalledWith('claudeDesktop-snippet');
- expect(addNotification).toHaveBeenCalledWith('Copied claudeDesktop snippet.', 'success');
+ expect(addNotification).toHaveBeenCalledWith('Copied Claude Desktop config.', 'success');
+ });
+ });
+
+ test.each([
+ ['Copy Cursor config', 'cursor', 'Copied Cursor config.'],
+ ['Copy Zed config', 'zed', 'Copied Zed config.']
+ ])('"%s" confirms with the client name, not its id', async (buttonName, id, message) => {
+ const addNotification = jest.fn();
+ const store = configureStore({
+ reducer: { mcp: mcpReducer },
+ preloadedState: {
+ mcp: {
+ enabled: true,
+ status: 'running',
+ port: 53827,
+ tokenMasked: 'test',
+ lastError: null,
+ isWorking: false
+ }
+ }
+ });
+ render(
+
+
+
+ );
+ fireEvent.click(screen.getByRole('button', { name: buttonName }));
+ await waitFor(() => {
+ expect(navigator.clipboard.writeText).toHaveBeenCalledWith(`${id}-snippet`);
+ expect(addNotification).toHaveBeenCalledWith(message, 'success');
});
});
diff --git a/test/components/SettingsPanel.test.js b/test/components/SettingsPanel.test.js
index eb45ba7..b20322b 100644
--- a/test/components/SettingsPanel.test.js
+++ b/test/components/SettingsPanel.test.js
@@ -700,6 +700,9 @@ describe('SettingsPanel regression guards', () => {
expect(screen.getByText('Processing Limits Section')).toBeInTheDocument();
expect(screen.getByText('Graph Retrieval Section')).toBeInTheDocument();
expect(screen.getByText('Diagnostics Logs Section')).toBeInTheDocument();
+ // Settings save automatically, so the mode text must not ask for a save.
+ expect(screen.getByText(/^Advanced reveals every configuration panel/)).toBeInTheDocument();
+ expect(screen.queryByText(/Save to apply/)).not.toBeInTheDocument();
});
test('warns instead of reporting success when a vision model installs without its projector', async () => {
diff --git a/test/customFolders.test.js b/test/customFolders.test.js
index b56d685..a1ead89 100644
--- a/test/customFolders.test.js
+++ b/test/customFolders.test.js
@@ -860,6 +860,40 @@ describe('Custom Folders', () => {
);
});
+ describe.each([
+ ['win32', /Windows Security's Controlled folder access/],
+ ['darwin', /System Settings > Privacy & Security > Files and Folders/],
+ ['linux', /Check that you can write to that folder\./]
+ ])('the unwritable-Documents warning on %s', (platform, hint) => {
+ const realPlatform = Object.getOwnPropertyDescriptor(process, 'platform');
+
+ afterEach(() => {
+ Object.defineProperty(process, 'platform', realPlatform);
+ });
+
+ test('names the setting for that OS only', async () => {
+ Object.defineProperty(process, 'platform', { ...realPlatform, value: platform });
+ const eacces = Object.assign(new Error('EACCES: permission denied'), { code: 'EACCES' });
+ mockFs.mkdir.mockImplementation(async (dir) => {
+ if (String(dir).startsWith('/mock/documents')) throw eacces;
+ });
+
+ await customFolders.loadCustomFolders();
+
+ const flag = require('../src/main/services/DegradedStateTracker')
+ .getInstance()
+ .list()
+ .find((f) => f.code === 'storage.uncategorized-unavailable');
+ expect(flag.message).toMatch(hint);
+ if (platform !== 'win32') {
+ expect(flag.message).not.toMatch(/Windows|Controlled folder access/);
+ }
+ if (platform !== 'darwin') {
+ expect(flag.message).not.toMatch(/System Settings/);
+ }
+ });
+ });
+
test('a saved Documents path that still cannot be created is retried and flagged on every launch', async () => {
const eperm = Object.assign(new Error('EPERM: operation not permitted'), { code: 'EPERM' });
const enoent = Object.assign(new Error('ENOENT'), { code: 'ENOENT' });
diff --git a/test/unit/mcp/configSnippets.test.js b/test/unit/mcp/configSnippets.test.js
index 037d033..4a4bdd2 100644
--- a/test/unit/mcp/configSnippets.test.js
+++ b/test/unit/mcp/configSnippets.test.js
@@ -17,10 +17,17 @@ describe('configSnippets', () => {
expect(s).toContain('"http://127.0.0.1:53827/mcp"');
});
- test('zed returns expected shape', () => {
- const s = generateSnippet('zed', ctx);
- expect(s).toContain('context_servers');
- expect(s).toContain('stratosort');
+ test("zed returns Zed's documented remote shape: url and headers only", () => {
+ const parsed = JSON.parse(generateSnippet('zed', ctx));
+ expect(parsed).toEqual({
+ context_servers: {
+ stratosort: {
+ url: 'http://127.0.0.1:53827/mcp',
+ headers: { Authorization: `Bearer ${ctx.token}` }
+ }
+ }
+ });
+ expect(parsed.context_servers.stratosort).not.toHaveProperty('source');
});
test('throws on unknown client', () => {
diff --git a/test/useOrganizeNotificationFocus.test.js b/test/useOrganizeNotificationFocus.test.js
index cacf082..8c2f2fe 100644
--- a/test/useOrganizeNotificationFocus.test.js
+++ b/test/useOrganizeNotificationFocus.test.js
@@ -23,6 +23,17 @@ jest.mock('../src/renderer/store/hooks', () => ({
})
}));
+// Read at call time, so each test can pick the platform.
+const mockPlatform = { isMac: false, isWindows: true };
+jest.mock('../src/renderer/utils/platform', () => ({
+ get isMac() {
+ return mockPlatform.isMac;
+ },
+ get isWindows() {
+ return mockPlatform.isWindows;
+ }
+}));
+
jest.mock('../src/renderer/store/slices/uiSlice', () => ({
clearOrganizeFocus: jest.fn(() => ({ type: 'ui/clearOrganizeFocus' }))
}));
@@ -115,29 +126,51 @@ describe('useOrganizeNotificationFocus', () => {
expect(mockDispatch).toHaveBeenCalledWith({ type: 'ui/clearOrganizeFocus' });
});
- test('reveals file in Explorer when not in organize lists', async () => {
- mockOrganizeFocusRequest = {
- filePath: '/downloads/new.pdf',
- fileName: 'new.pdf',
- openDetails: true,
- requestedAt: 3000
- };
+ describe.each([
+ ['Windows', { isMac: false, isWindows: true }, 'File Explorer'],
+ ['macOS', { isMac: true, isWindows: false }, 'Finder'],
+ ['Linux', { isMac: false, isWindows: false }, 'your file manager']
+ ])('on %s', (_name, platform, fileManager) => {
+ beforeEach(() => {
+ Object.assign(mockPlatform, platform);
+ });
- window.electronAPI = {
- analysisHistory: {
- getFileHistory: jest.fn().mockResolvedValue([])
- }
- };
+ afterEach(() => {
+ Object.assign(mockPlatform, { isMac: false, isWindows: true });
+ delete window.electronAPI;
+ });
+
+ test(`reveals a file not in the organize lists and names ${fileManager}`, async () => {
+ mockOrganizeFocusRequest = {
+ filePath: '/downloads/new.pdf',
+ fileName: 'new.pdf',
+ openDetails: true,
+ requestedAt: 3000
+ };
- const { revealFile, addNotification } = renderFocusHook();
+ window.electronAPI = {
+ analysisHistory: {
+ getFileHistory: jest.fn().mockResolvedValue([])
+ }
+ };
- await waitFor(() => {
- expect(revealFile).toHaveBeenCalledWith('/downloads/new.pdf');
- });
- expect(addNotification).toHaveBeenCalledWith('Opened new.pdf in Explorer', 'info', 3500);
- expect(mockDispatch).toHaveBeenCalledWith({ type: 'ui/clearOrganizeFocus' });
+ const { revealFile, addNotification } = renderFocusHook();
- delete window.electronAPI;
+ await waitFor(() => {
+ expect(revealFile).toHaveBeenCalledWith('/downloads/new.pdf');
+ });
+ expect(addNotification).toHaveBeenCalledWith(
+ `Opened new.pdf in ${fileManager}`,
+ 'info',
+ 3500
+ );
+ expect(addNotification).not.toHaveBeenCalledWith(
+ expect.stringMatching(/in Explorer$/),
+ expect.anything(),
+ expect.anything()
+ );
+ expect(mockDispatch).toHaveBeenCalledWith({ type: 'ui/clearOrganizeFocus' });
+ });
});
test('ignores duplicate focus requests with the same requestedAt', () => {
From cf3d86ef689ac06bc198ae2dfa736343414ec2fd Mon Sep 17 00:00:00 2001
From: Levy Tate <78818969+iLevyTate@users.noreply.github.com>
Date: Sat, 14 Nov 2026 14:13:42 -0500
Subject: [PATCH 6/6] docs(changelog): add the final-review fixes to 5.3.0
---
CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d202dce..0d33425 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,44 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed
+- **Two files given the same new name no longer stop the whole Move.** Two exports from the same
+ day, for example, could both be renamed to the same name in the same folder, and Organize refused
+ the run with "Cannot organize: 2 files have destination conflicts". The second file now gets a
+ number (`_1`), as it does when a file of that name is already in the folder, and Preview marks it
+ "Name taken — number added". If files still clash, the message lists their own names, not the
+ shared new name.
+- **Correcting a file whose AI label already named the right folder now teaches StratoSort.** When
+ the label was right but the ranking put another folder first, the correction was saved without the
+ label, so two such corrections never changed later suggestions.
+- **A short, accurate summary that uses a Smart Folder description's words is no longer erased.** It
+ was taken for a copy of the description: the summary or reason was removed, the confidence was cut
+ to 50% and the file could be held for review. Words that also appear in the file no longer count
+ as copied, and the reason may cite the folder's description, as the analysis asks it to. Real
+ copies of a description or of the instructions are still caught.
+- **A label that paraphrases a folder name no longer goes to whichever folder was added first.**
+ With folders such as "GSC exports" and "Bing exports", a label like "Google Search Console
+ exports" matched every folder on the shared word "exports", and the first folder in the list won.
+ Words that several folder names share are now ignored, and a tie is decided by the folder
+ descriptions.
+- **On a Mac, models are no longer unloaded and loaded again between files when the GPU check gives
+ no answer.** The model memory budget was based on free memory pages only, which macOS keeps low,
+ so a busy Mac could get a budget of a few hundred MB. It now uses the memory macOS reports as
+ available, and an Apple Silicon Mac is always treated as having its Metal GPU.
+- **A Move the app refuses as a whole now says why.** When another run was still in progress, or the
+ batch was too large, the app said only "Check the logs for details" and listed every file as if
+ the run had ended before it. The reason is now shown in the run summary and on each file.
+- **A card whose folder you changed no longer shows a confidence score.** The score was for
+ StratoSort's own choice, so beside your choice it looked like the app agreed with it.
+- **On a Mac, messages name Finder instead of Explorer,** and a warning that the Uncategorized
+ folder could not be created points to System Settings > Privacy & Security instead of Windows
+ Security. The MCP copy buttons confirm with the app's name (Claude Desktop, Cursor, Zed) instead
+ of an internal id, and the Advanced settings text no longer says "Save to apply", since settings
+ save automatically.
+- **Memory & Rules no longer says a typed rule applies to every file of that type.** A rule moves
+ its folder up when StratoSort already considers that folder for a file; two corrections teach a
+ firm change. The User Guide says the same.
+- **The Zed MCP config matches the format in Zed's documentation.** It no longer includes a
+ `"source": "http"` entry.
- **Two identical files in one folder are no longer both sent to the trash when one run renames or
moves them.** Each was taken for a copy of the other that was already in place, so both were
removed instead of moved, and the run could then fail and be undone with the two files missing