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: canonicalize macOS coordination paths

auroracapital3cb93686b8e9
diff --git a/claude-ops/scripts/account-rotation/provision-coordination.mjs b/claude-ops/scripts/account-rotation/provision-coordination.mjs
index 7312b136..86c940f4 100755
--- a/claude-ops/scripts/account-rotation/provision-coordination.mjs
+++ b/claude-ops/scripts/account-rotation/provision-coordination.mjs
@@ -86,8 +86,11 @@ function canonicalProspective(path) {
}
return join(realpathSync(cursor), ...tail);
}
+function sameCanonicalPath(left, right) {
+ return typeof left === 'string' && typeof right === 'string' && canonicalProspective(left) === canonicalProspective(right);
+}
function assertSafeAncestors(path) {
- let cursor = existsSync(path) ? dirname(path) : dirname(canonicalProspective(path));
+ let cursor = dirname(canonicalProspective(path));
while (!existsSync(cursor)) cursor = dirname(cursor);
let immediate = true;
for (;;) {
@@ -330,7 +333,7 @@ function publishExclusiveRecord(path, bytes, code) {
fsyncDirectory(dirname(path));
if (
process.env.CLAUDE_COORDINATION_TESTING === '1' &&
- process.env.CLAUDE_COORDINATION_TEST_RECORD_TARGET === path &&
+ sameCanonicalPath(process.env.CLAUDE_COORDINATION_TEST_RECORD_TARGET, path) &&
process.env.CLAUDE_COORDINATION_TEST_FAULT === 'SIGKILL:RECORD_PRE_LINK'
)
process.kill(process.pid, 'SIGKILL');
@@ -339,7 +342,7 @@ function publishExclusiveRecord(path, bytes, code) {
} else linkSync(temp, path);
if (
process.env.CLAUDE_COORDINATION_TESTING === '1' &&
- process.env.CLAUDE_COORDINATION_TEST_RECORD_TARGET === path &&
+ sameCanonicalPath(process.env.CLAUDE_COORDINATION_TEST_RECORD_TARGET, path) &&
process.env.CLAUDE_COORDINATION_TEST_FAULT === 'SIGKILL:RECORD_LINKED'
)
process.kill(process.pid, 'SIGKILL');
@@ -347,7 +350,7 @@ function publishExclusiveRecord(path, bytes, code) {
if (!descriptorMatches(path, descriptor, code)) fail(code);
if (
process.env.CLAUDE_COORDINATION_TESTING === '1' &&
- process.env.CLAUDE_COORDINATION_TEST_RECORD_TARGET === path &&
+ sameCanonicalPath(process.env.CLAUDE_COORDINATION_TEST_RECORD_TARGET, path) &&
process.env.CLAUDE_COORDINATION_TEST_FAULT === 'SIGKILL:RECORD_DIR_FSYNCED'
)
process.kill(process.pid, 'SIGKILL');
@@ -662,7 +665,7 @@ function atomicWrite(path, data, written, onPrepared, modeBits = 0o600) {
// created final target (unlike rename(2)).
// Test-only adversarial writer used to prove link publication fails closed.
// CodeQL[js/file-system-race]
- if (process.env.CLAUDE_COORDINATION_TESTING === '1' && process.env.CLAUDE_COORDINATION_TEST_RACE_TARGET === path)
+ if (process.env.CLAUDE_COORDINATION_TESTING === '1' && sameCanonicalPath(process.env.CLAUDE_COORDINATION_TEST_RACE_TARGET, path))
writeFileSync(path, process.env.CLAUDE_COORDINATION_TEST_RACE_SAME === '1' ? data : 'competing-owner\n', {
flag: 'wx',
mode: 0o600,
@@ -681,7 +684,7 @@ function atomicWrite(path, data, written, onPrepared, modeBits = 0o600) {
process.kill(process.pid, 'SIGKILL');
if (
process.env.CLAUDE_COORDINATION_TESTING === '1' &&
- process.env.CLAUDE_COORDINATION_TEST_POST_LINK_REPLACE === path
+ sameCanonicalPath(process.env.CLAUDE_COORDINATION_TEST_POST_LINK_REPLACE, path)
) {
unlinkSync(path);
// Test-only post-publication inode replacement.
diff --git a/claude-ops/scripts/install-account-rotator-linux.sh b/claude-ops/scripts/install-account-rotator-linux.sh
index d4c62157..2dabf223 100755
--- a/claude-ops/scripts/install-account-rotator-linux.sh
+++ b/claude-ops/scripts/install-account-rotator-linux.sh
@@ -40,7 +40,9 @@ PREFLIGHT_JSON=$(node "$SCRIPT_DIR/account-rotation/provision-coordination.mjs"
CLAUDE_AUTH_COORDINATION_CONFIG=$(printf '%s' "$PREFLIGHT_JSON" | jq -er '.configPath') || die "invalid preflight config path"
CLAUDE_ROTATOR_CONFIG=$(printf '%s' "$PREFLIGHT_JSON" | jq -er '.runtimeInventoryPath') || die "invalid preflight inventory path"
REVIEWED_UNIT=$(printf '%s' "$PREFLIGHT_JSON" | jq -er '.linuxUnitPath') || die "invalid preflight unit path"
-[[ "$REVIEWED_UNIT" == "$UNIT_FILE" ]] || die "reviewed unit destination does not match installer destination"
+REVIEWED_UNIT_CANONICAL=$(realpath "$REVIEWED_UNIT") || die "cannot resolve reviewed unit destination"
+UNIT_FILE_CANONICAL=$(realpath "$UNIT_FILE") || die "cannot resolve installer unit destination"
+[[ "$REVIEWED_UNIT_CANONICAL" == "$UNIT_FILE_CANONICAL" ]] || die "reviewed unit destination does not match installer destination"
# ── Dry-run validation ────────────────────────────────────────────────────────