Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix: support provisioning locks on macOS

auroracapitalbee28df1b20c
diff --git a/claude-ops/scripts/account-rotation/__tests__/coordination-provisioning.test.mjs b/claude-ops/scripts/account-rotation/__tests__/coordination-provisioning.test.mjs
index 259c2e97..c755f817 100755
--- a/claude-ops/scripts/account-rotation/__tests__/coordination-provisioning.test.mjs
+++ b/claude-ops/scripts/account-rotation/__tests__/coordination-provisioning.test.mjs
@@ -12,7 +12,7 @@ import {
unlinkSync,
writeFileSync,
} from 'node:fs';
-import { tmpdir } from 'node:os';
+import { platform, tmpdir } from 'node:os';
import { join } from 'node:path';
import { spawnSync } from 'node:child_process';
@@ -191,8 +191,22 @@ for (const file of [f.paths['linux-unit'], f.paths['macos-plist']])
assert.equal(f.paths.trust.startsWith(join(f.root, 'mutable')), false, 'trust outside mutable roots');
assert.deepEqual(readFileSync(f.paths['runtime-inventory']), readFileSync(f.inventory));
-const selfStat = readFileSync(`/proc/${process.pid}/stat`, 'utf8');
-const selfStart = selfStat.slice(selfStat.lastIndexOf(') ') + 2).split(' ')[19];
+const selfStart =
+ platform() === 'darwin'
+ ? String(
+ Date.parse(
+ spawnSync('ps', ['-o', 'lstart=', '-p', String(process.pid)], {
+ encoding: 'utf8',
+ env: { ...process.env, LC_ALL: 'C' },
+ })
+ .stdout.trim()
+ .replace(/\s+/g, ' '),
+ ),
+ )
+ : (() => {
+ const selfStat = readFileSync(`/proc/${process.pid}/stat`, 'utf8');
+ return selfStat.slice(selfStat.lastIndexOf(') ') + 2).split(' ')[19];
+ })();
const malformedLiveLock = fixture();
mkdirSync(join(malformedLiveLock.root, 'locks'), { mode: 0o700 });
writeFileSync(
diff --git a/claude-ops/scripts/account-rotation/provision-coordination.mjs b/claude-ops/scripts/account-rotation/provision-coordination.mjs
index 1e1ace68..7312b136 100755
--- a/claude-ops/scripts/account-rotation/provision-coordination.mjs
+++ b/claude-ops/scripts/account-rotation/provision-coordination.mjs
@@ -20,6 +20,7 @@ import {
} from 'node:fs';
import { createHash, createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
+import { platform } from 'node:os';
import { fileURLToPath } from 'node:url';
import { spawnSync } from 'node:child_process';
import { canonicalJson, parseManifestBytes, readDeploymentConfig } from './staged-enrollment.mjs';
@@ -118,6 +119,14 @@ function processStart(pid) {
return error?.code === 'ESRCH' ? { state: 'dead' } : { state: 'unknown' };
}
try {
+ if (platform() === 'darwin') {
+ const result = spawnSync('ps', ['-o', 'lstart=', '-p', String(pid)], {
+ encoding: 'utf8',
+ env: { ...process.env, LC_ALL: 'C' },
+ });
+ const startedAt = result.status === 0 ? Date.parse(result.stdout.trim().replace(/\s+/g, ' ')) : Number.NaN;
+ return Number.isSafeInteger(startedAt) ? { state: 'live', value: String(startedAt) } : { state: 'unknown' };
+ }
const stat = readFileSync(`/proc/${pid}/stat`, 'utf8');
const fields = stat.slice(stat.lastIndexOf(') ') + 2).split(' ');
if (!/^\d+$/.test(fields[19] || '')) return { state: 'unknown' };