Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: address release local review findings

[._.]/ Adam Eivy6e58b0a496a2
diff --git a/client/src/lib/callAudioBridge.js b/client/src/lib/callAudioBridge.js
index f109b69cd8..ba4fd5ea9c 100644
--- a/client/src/lib/callAudioBridge.js
+++ b/client/src/lib/callAudioBridge.js
@@ -22,8 +22,6 @@ export const CALL_FRAME_SAMPLES = 320;
// reply into BlackHole 2ch; without it the assistant would talk to the room
// instead of into the call.
const REQUIRED_APIS = Object.freeze([
- { name: 'MediaStreamTrackProcessor', test: (scope) => typeof scope?.MediaStreamTrackProcessor === 'function' },
- { name: 'MediaStreamTrackGenerator', test: (scope) => typeof scope?.MediaStreamTrackGenerator === 'function' },
{ name: 'AudioWorklet', test: (scope) => typeof scope?.AudioWorkletNode === 'function' },
{ name: 'mediaDevices.enumerateDevices', test: (scope) => typeof scope?.navigator?.mediaDevices?.enumerateDevices === 'function' },
{ name: 'HTMLMediaElement.setSinkId', test: (scope) => typeof scope?.HTMLMediaElement?.prototype?.setSinkId === 'function' },
diff --git a/client/src/lib/callAudioBridge.test.js b/client/src/lib/callAudioBridge.test.js
index b91a5abfc5..bf2746dcda 100644
--- a/client/src/lib/callAudioBridge.test.js
+++ b/client/src/lib/callAudioBridge.test.js
@@ -12,8 +12,6 @@ import {
} from './callAudioBridge.js';
const fullScope = () => ({
- MediaStreamTrackProcessor: function processor() {},
- MediaStreamTrackGenerator: function generator() {},
AudioWorkletNode: function worklet() {},
HTMLMediaElement: { prototype: { setSinkId: () => {} } },
navigator: { mediaDevices: { enumerateDevices: () => {} }, locks: { request: () => {} } },
@@ -31,8 +29,6 @@ describe('call host capability probe', () => {
});
it.each([
- ['MediaStreamTrackProcessor'],
- ['MediaStreamTrackGenerator'],
['AudioWorklet'],
['mediaDevices.enumerateDevices'],
['HTMLMediaElement.setSinkId'],
@@ -49,7 +45,7 @@ describe('call host capability probe', () => {
});
it('reports every gap at once rather than one per reload', () => {
- expect(missingCallHostApis({})).toHaveLength(6);
+ expect(missingCallHostApis({})).toHaveLength(4);
});
});
diff --git a/client/src/pages/Settings.jsx b/client/src/pages/Settings.jsx
index 89e1d7013c..ff5d86044f 100644
--- a/client/src/pages/Settings.jsx
+++ b/client/src/pages/Settings.jsx
@@ -24,6 +24,8 @@ const REDIRECTS = {
imessage: '/messages/imessage?settings=1',
signal: '/messages/signal',
catalog: '/catalog?settings=1',
+ spotify: '/brain/spotify',
+ youtube: '/brain/youtube',
};
export default function Settings() {
diff --git a/client/src/pages/Settings.redirects.test.jsx b/client/src/pages/Settings.redirects.test.jsx
index f1928e95b2..b0e90faeb2 100644
--- a/client/src/pages/Settings.redirects.test.jsx
+++ b/client/src/pages/Settings.redirects.test.jsx
@@ -27,6 +27,8 @@ describe('Settings — retired tabs redirect to their new home', () => {
['/settings/imessage', '/messages/imessage?settings=1'],
['/settings/signal', '/messages/signal'],
['/settings/catalog', '/catalog?settings=1'],
+ ['/settings/spotify', '/brain/spotify'],
+ ['/settings/youtube', '/brain/youtube'],
])('%s → %s', (from, to) => {
render(
<MemoryRouter initialEntries={[from]}>
diff --git a/client/src/pages/VoiceCallHost.test.jsx b/client/src/pages/VoiceCallHost.test.jsx
index 282f0cffa2..fea9460b89 100644
--- a/client/src/pages/VoiceCallHost.test.jsx
+++ b/client/src/pages/VoiceCallHost.test.jsx
@@ -18,8 +18,6 @@ import socket from '../services/socket';
import VoiceCallHost from './VoiceCallHost';
const grantCapabilities = () => {
- vi.stubGlobal('MediaStreamTrackProcessor', function processor() {});
- vi.stubGlobal('MediaStreamTrackGenerator', function generator() {});
vi.stubGlobal('AudioWorkletNode', function worklet() {});
window.HTMLMediaElement.prototype.setSinkId = () => Promise.resolve();
navigator.mediaDevices = { enumerateDevices: vi.fn(), getUserMedia: vi.fn() };
@@ -48,15 +46,15 @@ describe('VoiceCallHost', () => {
});
it('names every missing browser API at once instead of one per reload', async () => {
- vi.stubGlobal('MediaStreamTrackProcessor', undefined);
vi.stubGlobal('AudioWorkletNode', undefined);
+ window.HTMLMediaElement.prototype.setSinkId = undefined;
render(<VoiceCallHost />, { wrapper: MemoryRouter });
await act(async () => { fireEvent.click(screen.getByText('Attach call host')); });
const alert = await screen.findByRole('alert');
- expect(alert.textContent).toMatch(/MediaStreamTrackProcessor/);
expect(alert.textContent).toMatch(/AudioWorklet/);
+ expect(alert.textContent).toMatch(/setSinkId/);
// Nothing was opened and nothing was claimed on a browser that cannot do it.
expect(navigator.mediaDevices.enumerateDevices).not.toHaveBeenCalled();
expect(socket.emit).not.toHaveBeenCalledWith('voice:call:attach');
diff --git a/server/routes/voice.test.js b/server/routes/voice.test.js
index 603ffdea5b..2ea6bbcc61 100644
--- a/server/routes/voice.test.js
+++ b/server/routes/voice.test.js
@@ -45,6 +45,12 @@ vi.mock('../services/voice/proactiveSpeech.js', async () => {
speakProactive: vi.fn(),
};
});
+vi.mock('../services/voice/facetimeBridge.js', () => ({
+ checkSetup: vi.fn(),
+ probe: vi.fn(),
+ call: vi.fn(),
+ hangup: vi.fn(),
+}));
import * as config from '../services/voice/config.js';
import * as health from '../services/voice/health.js';
@@ -54,6 +60,7 @@ import { ServerError } from '../lib/errorHandler.js';
import * as piperVoices from '../services/voice/piper-voices.js';
import * as proactiveSpeech from '../services/voice/proactiveSpeech.js';
import * as kokoro from '../services/voice/tts-kokoro.js';
+import * as facetimeBridge from '../services/voice/facetimeBridge.js';
import voiceRoutes from './voice.js';
import { errorEvents } from '../lib/errorHandler.js';
@@ -406,4 +413,34 @@ describe('Voice Routes', () => {
expect(bootstrap.stopWhisper).not.toHaveBeenCalled();
});
});
+
+ describe('FaceTime Audio control plane', () => {
+ it('GET /api/voice/facetime/status reports setup without spawning the helper', async () => {
+ facetimeBridge.checkSetup.mockResolvedValue({ ready: true });
+ const res = await request(buildApp()).get('/api/voice/facetime/status');
+ expect(res.status).toBe(200);
+ expect(res.body).toEqual({ ready: true });
+ expect(facetimeBridge.probe).not.toHaveBeenCalled();
+ });
+
+ it.each(['probe', 'call', 'hangup'])('POST /api/voice/facetime/%s dispatches to the matching bridge command', async (command) => {
+ facetimeBridge[command].mockResolvedValue({ ok: true, command });
+ const res = await request(buildApp()).post(`/api/voice/facetime/${command}`).send({});
+ expect(res.status).toBe(200);
+ expect(res.body).toEqual({ ok: true, command });
+ expect(facetimeBridge[command]).toHaveBeenCalledTimes(1);
+ });
+
+ it('POST /api/voice/facetime/probe propagates a bridge failure as an error response', async () => {
+ facetimeBridge.probe.mockRejectedValue(new ServerError('helper not installed', { status: 409 }));
+ const res = await request(buildApp()).post('/api/voice/facetime/probe').send({});
+ expect(res.status).toBe(409);
+ });
+
+ it('rejects an unexpected body field with 400 without touching the bridge', async () => {
+ const res = await request(buildApp()).post('/api/voice/facetime/call').send({ extra: 'nope' });
+ expect(res.status).toBe(400);
+ expect(facetimeBridge.call).not.toHaveBeenCalled();
+ });
+ });
});
diff --git a/server/services/fableLoom/weave.test.js b/server/services/fableLoom/weave.test.js
index 8849a4b9f8..d063407564 100644
--- a/server/services/fableLoom/weave.test.js
+++ b/server/services/fableLoom/weave.test.js
@@ -379,12 +379,22 @@ describe('playTurn', () => {
await updateNode(loomId, episodeId, originalGate.id, {
playbackMode: 'cut', audienceConnection: 'disconnected',
});
+ // `elsewhereId` deliberately targets a DIFFERENT node than transitions[0]
+ // (insideId): a non-interactive scene resolves via the graph's own first
+ // transition, not the caller's requested transitionId, and asserting
+ // against insideId only pins that if the alternate path leads somewhere
+ // else — otherwise both paths land on the same node and the assertion
+ // can't distinguish "used transitions[0]" from "honored transitionId".
+ const withElsewhere = await addNode(loomId, episodeId, { title: 'Elsewhere', prose: 'Fog.', fromNodeId: originalGate.id, fromIntent: 'go the other way' });
+ const elsewhereId = withElsewhere.episodes[0].nodes.find((n) => n.title === 'Elsewhere').id;
await mutateLoom(loomId, (loom) => {
const gate = loom.episodes[0].nodes.find((node) => node.id === originalGate.id);
- gate.transitions.push({ id: 'alternate-path', targetNodeId: insideId, intent: 'Choose a different route' });
+ gate.transitions = gate.transitions.filter((t) => t.targetNodeId !== elsewhereId);
+ gate.transitions.push({ id: 'alternate-path', targetNodeId: elsewhereId, intent: 'Choose a different route' });
return loom;
});
const gate = (await getLoom(loomId)).episodes[0].nodes.find((node) => node.id === originalGate.id);
+ expect(gate.transitions[0].targetNodeId).toBe(insideId);
await expect(playTurn(loomId, episodeId, { nodeId: gate.id, message: 'Can you hear me?' }))
.rejects.toMatchObject({ code: 'AUDIENCE_DISCONNECTED' });
diff --git a/server/services/idealoomObsidian.js b/server/services/idealoomObsidian.js
index 8ece19333c..90aeee44f7 100644
--- a/server/services/idealoomObsidian.js
+++ b/server/services/idealoomObsidian.js
@@ -119,17 +119,17 @@ const parseFrontmatter = (lines) => {
index = propertyIndex - 1;
continue;
}
+ if (key === 'tags' && rawValue.trim().startsWith('[') && rawValue.trim().endsWith(']')) {
+ const inner = rawValue.trim().slice(1, -1).trim();
+ values.tags = inner ? inner.split(',').map((entry) => decodeScalar(entry)).filter(Boolean).map((tag) => tag.replace(/^#/, '')) : [];
+ continue;
+ }
if (key === 'tags') {
const tag = decodeScalar(rawValue);
if (tag === null) return { error: `invalid tags at line ${index + 1}` };
values.tags = [tag.replace(/^#/, '')];
continue;
}
- if (key === 'tags' && rawValue.trim().startsWith('[') && rawValue.trim().endsWith(']')) {
- const inner = rawValue.trim().slice(1, -1).trim();
- values.tags = inner ? inner.split(',').map((entry) => decodeScalar(entry)).filter(Boolean).map((tag) => tag.replace(/^#/, '')) : [];
- continue;
- }
const value = decodeScalar(rawValue);
if (value === null) return { error: `empty frontmatter value for ${key}` };
values[key] = value;
diff --git a/server/services/idealoomObsidian.test.js b/server/services/idealoomObsidian.test.js
index a771a13470..ab10dad4b5 100644
--- a/server/services/idealoomObsidian.test.js
+++ b/server/services/idealoomObsidian.test.js
@@ -112,6 +112,12 @@ describe('IdeaLoom Markdown contract', () => {
.toEqual(expect.objectContaining({ ok: true }));
});
+ it('accepts YAML flow-sequence tags alongside the block-list and bare-scalar shapes', () => {
+ const rendered = renderIdeaLoomMarkdown(list());
+ const withFlowTags = rendered.replace('tags:\n - "idea-loom"', 'tags: [idea-loom, other-note]');
+ expect(parseIdeaLoomMarkdown(withFlowTags)).toEqual(expect.objectContaining({ ok: true }));
+ });
+
it('rejects malformed metadata and non-dense numbered ideas', () => {
const rendered = renderIdeaLoomMarkdown(list());
expect(parseIdeaLoomMarkdown(rendered.replace(`id: "${LIST_ID}"`, 'id: "not-a-uuid"')).ok).toBe(false);