Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
cf2104e
chore(release): update manifests (dev) → v4.260519.1
May 19, 2026
31b241e
fix(db): native genie → autopg/pgserve-v3 migration (embed migrations…
claude May 19, 2026
caf7041
fix(db): address PR review — gate native-DB to v3 runtime.json, decou…
claude May 19, 2026
4087168
Merge pull request #2456 from automagik-dev/fix/native-pgserve-v3-mig…
namastex888 May 19, 2026
2d95bf3
chore(release): update manifests (dev) → v4.260519.2
May 19, 2026
23dbfc1
chore(release): update manifests (dev) → v4.260519.3
May 19, 2026
bca0067
Merge pull request #2459 from automagik-dev/dev
namastex888 May 20, 2026
9521906
chore(release): update manifests (dev,homolog,stable) → v4.260519.3
May 20, 2026
4e642f0
chore(release): update manifests (dev) → v4.260520.1
May 20, 2026
f4ed9bf
chore(release): update manifests (dev) → v4.260520.2
May 20, 2026
813827f
Merge pull request #2461 from automagik-dev/dev
namastex888 May 20, 2026
e6b83ce
chore(release): update manifests (dev,homolog,stable) → v4.260520.2
May 20, 2026
a668285
chore(release): update manifests (dev) → v4.260520.3
May 20, 2026
455c25a
Merge pull request #2467 from automagik-dev/dev
namastex888 May 20, 2026
df68018
chore(release): update manifests (dev,homolog,stable) → v4.260520.3
May 20, 2026
24f4d38
chore(release): update manifests (dev) → v4.260521.1
May 21, 2026
010c729
chore(release): update manifests (dev) → v4.260522.1
May 22, 2026
d612c7d
chore(release): update manifests (dev) → v4.260522.2
May 22, 2026
f1507ae
chore(release): update manifests (dev) → v4.260522.3
May 22, 2026
453d0cf
chore(release): update manifests (dev) → v4.260522.4
May 22, 2026
89c2dd3
chore(release): update manifests (dev) → v4.260522.5
May 22, 2026
0ea1050
chore(release): update manifests (dev) → v4.260522.6
May 22, 2026
35d378d
Merge pull request #2473 from automagik-dev/dev
namastex888 May 22, 2026
1d4ab64
chore(release): update manifests (dev,homolog,stable) → v4.260522.6
May 22, 2026
6824da7
chore(release): update manifests (dev) → v4.260522.7
May 22, 2026
172c706
chore(release): update manifests (dev) → v4.260522.8
May 22, 2026
fceb5be
Merge pull request #2475 from automagik-dev/dev
namastex888 May 22, 2026
4809393
chore(release): update manifests (dev,homolog,stable) → v4.260522.8
May 22, 2026
b6a1661
chore(release): update manifests (dev) → v4.260522.9
May 22, 2026
11b7278
Merge pull request #2476 from automagik-dev/dev
namastex888 May 22, 2026
0a17089
chore(release): update manifests (dev,homolog,stable) → v4.260522.9
May 22, 2026
c04892a
chore(release): update manifests (dev) → v4.260522.10
May 22, 2026
47d9c66
chore(release): update manifests (dev) → v4.260522.11
May 22, 2026
e347ffa
chore(release): update manifests (dev) → v4.260522.12
May 22, 2026
9f3461c
chore(release): update manifests (dev) → v4.260522.13
May 22, 2026
c8be701
Merge pull request #2477 from automagik-dev/dev
namastex888 May 22, 2026
fda69cb
chore(release): update manifests (dev) → v4.260522.14
May 22, 2026
cf5b728
chore(release): update manifests (dev,homolog,stable) → v4.260522.14
May 22, 2026
1cecf8f
chore(release): update manifests (dev) → v4.260522.15
May 22, 2026
64d54aa
chore(release): update manifests (dev) → v4.260522.16
May 22, 2026
d991ece
Merge pull request #2478 from automagik-dev/dev
namastex888 May 22, 2026
f061f65
chore(release): update manifests (dev,homolog,stable) → v4.260522.16
May 22, 2026
967c044
chore(release): update manifests (dev) → v4.260522.17
May 22, 2026
c088c0f
Merge pull request #2479 from automagik-dev/dev
namastex888 May 22, 2026
c582083
chore(release): update manifests (dev,homolog,stable) → v4.260522.17
May 22, 2026
3b8cee4
chore(release): update manifests (dev) → v4.260522.18
May 22, 2026
112dfc6
chore(release): update manifests (dev) → v4.260522.19
May 22, 2026
f922d7e
Merge pull request #2480 from automagik-dev/dev
namastex888 May 22, 2026
8480ae3
chore(release): update manifests (dev,homolog,stable) → v4.260522.19
May 22, 2026
e24c992
chore(release): update manifests (dev) → v4.260522.20
May 22, 2026
b2d3c32
Merge pull request #2481 from automagik-dev/dev
namastex888 May 22, 2026
a52ef64
chore(release): update manifests (dev,homolog,stable) → v4.260522.20
May 22, 2026
e6decc6
fix: report standalone brain install in serve status
automagik-genie May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .well-known/dev.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schema_version": 1,
"channel": "dev",
"version": "4.260518.5",
"released_at": "2026-05-18T17:16:33Z",
"tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260518.5",
"version": "4.260522.20",
"released_at": "2026-05-22T20:41:26Z",
"tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260522.20",
"platforms": ["linux-x64-glibc", "linux-x64-musl", "linux-arm64", "darwin-arm64"]
}
6 changes: 3 additions & 3 deletions .well-known/homolog.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schema_version": 1,
"channel": "homolog",
"version": "4.260518.5",
"released_at": "2026-05-18T17:16:33Z",
"tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260518.5",
"version": "4.260522.20",
"released_at": "2026-05-22T20:41:26Z",
"tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260522.20",
"platforms": ["linux-x64-glibc", "linux-x64-musl", "linux-arm64", "darwin-arm64"]
}
6 changes: 3 additions & 3 deletions .well-known/latest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schema_version": 1,
"channel": "stable",
"version": "4.260518.5",
"released_at": "2026-05-18T17:16:33Z",
"tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260518.5",
"version": "4.260522.20",
"released_at": "2026-05-22T20:41:26Z",
"tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260522.20",
"platforms": ["linux-x64-glibc", "linux-x64-musl", "linux-arm64", "darwin-arm64"]
}
14 changes: 14 additions & 0 deletions src/term-commands/serve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const {
getTuiKeybindings,
getTuiQuitBindingArgs,
isStoppingLockActive,
printStandaloneBrainStatus,
startBrainServerIfEnabled,
startTuiTmuxServer,
writeStoppingLockSync,
Expand Down Expand Up @@ -245,6 +246,19 @@ describe('brain startup integration', () => {
}
});

test('reports a standalone brain binary as installed even when no server is running', async () => {
const logs: string[] = [];

const handled = await printStandaloneBrainStatus({
readActiveConfig: () => null,
getStandaloneVersion: () => '1.64.0',
log: (message: string) => logs.push(message),
});

expect(handled).toBe(true);
expect(logs).toEqual([' brain: installed standalone (1.64.0, server not running)']);
});

test('schedules a later brain vault while an earlier start is pending', async () => {
const root = join(tmpdir(), `genie-serve-brain-parallel-${Date.now()}-${Math.random().toString(36).slice(2)}`);
const first = makeVault(root, 'first');
Expand Down
37 changes: 31 additions & 6 deletions src/term-commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1577,20 +1577,45 @@ function readActiveBrainConfigFile(): ActiveBrainConfigFile | null {
}
}

async function printStandaloneBrainStatus(): Promise<boolean> {
const config = readActiveBrainConfigFile();
if (!config?.port) return false;
function getStandaloneBrainVersion(): string | null {
try {
const resp = await fetch(`http://127.0.0.1:${config.port}/healthz`);
const result = spawnSync('brain', ['--version'], { encoding: 'utf-8' });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's a good practice to include a timeout when spawning external processes to prevent the CLI from hanging indefinitely if the command (e.g., 'brain --version') fails to respond or hangs. Hardcoded limits are acceptable here to prevent performance issues.

Suggested change
const result = spawnSync('brain', ['--version'], { encoding: 'utf-8' });
const result = spawnSync('brain', ['--version'], { encoding: 'utf-8', timeout: 2000 });
References
  1. It is acceptable to use hardcoded numeric limits (magic numbers) in non-critical fallback logic, especially when they serve as intentional caps to prevent performance issues like excessive I/O.

if (result.status !== 0) return null;
const version = (result.stdout || result.stderr || '').trim().split(/\s+/)[0];
return version || 'unknown version';
} catch {
return null;
}
}

interface StandaloneBrainStatusDeps {
readActiveConfig?: () => ActiveBrainConfigFile | null;
getStandaloneVersion?: () => string | null;
fetchImpl?: typeof fetch;
log?: (message: string) => void;
}

export async function printStandaloneBrainStatus(deps: StandaloneBrainStatusDeps = {}): Promise<boolean> {
const log = deps.log ?? console.log;
const config = (deps.readActiveConfig ?? readActiveBrainConfigFile)();
if (!config?.port) {
const version = (deps.getStandaloneVersion ?? getStandaloneBrainVersion)();
if (!version) return false;
log(` brain: installed standalone (${version}, server not running)`);
return true;
}
try {
const fetchHealth = deps.fetchImpl ?? fetch;
const resp = await fetchHealth(`http://127.0.0.1:${config.port}/healthz`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding a timeout to the health check fetch prevents the 'serve status' command from hanging if the network request to the local brain server takes too long. Hardcoded limits are acceptable here to prevent performance issues.

Suggested change
const resp = await fetchHealth(`http://127.0.0.1:${config.port}/healthz`);
const resp = await fetchHealth('http://127.0.0.1:' + config.port + '/healthz', { signal: AbortSignal.timeout(2000) });
References
  1. It is acceptable to use hardcoded numeric limits (magic numbers) in non-critical fallback logic, especially when they serve as intentional caps to prevent performance issues like excessive I/O.

const label = config.brainSlug ?? config.database ?? `port ${config.port}`;
console.log(
log(
resp.ok
? ` brain: running (${label}, port ${config.port})`
: ` brain: unhealthy (${label}, status ${resp.status})`,
);
return true;
} catch {
console.log(` brain: stopped (port ${config.port} unreachable)`);
log(` brain: stopped (port ${config.port} unreachable)`);
return true;
}
}
Expand Down