ruvnet/RuView · error · Error

Refusing CLI access: trusted root is not a directory

Error message

Refusing CLI access: trusted root is not a directory

What it means

Once repoRoot and trustedRoot are confirmed equal, repo-trust stats the resolved root and requires a directory. If the shared path exists but is not a directory (a regular file, archive, or replaced node), trust verification aborts with this error.

Source

Thrown at harness/homecore/src/repo-trust.js:71

  const root = parse(current).root;
  while (true) {
    if (looksLikeHomecoreRepo(current)) return realpathSync(current);
    if (current === root) return null;
    const parent = dirname(current);
    if (parent === current) return null;
    current = parent;
  }
}

export function assertTrustedHomecoreRepo(repoRoot, { trustedRoot = repoRoot } = {}) {
  if (!repoRoot || !trustedRoot) throw new TypeError('repoRoot and trustedRoot are required');
  const root = realpathSync(repoRoot);
  const trustAnchor = realpathSync(trustedRoot);
  if (!isWithin(trustAnchor, root) || root !== trustAnchor) {
    throw new Error('Refusing CLI access: repository does not match the configured trusted root');
  }
  if (!statSync(root).isDirectory()) {
    throw new Error('Refusing CLI access: trusted root is not a directory');
  }
  const missing = REQUIRED_MARKERS.filter((marker) => !existsSync(join(root, marker)));
  if (missing.length) {
    throw new Error(`Refusing CLI access: Homecore repository markers are missing (${missing.join(', ')})`);
  }
  const readme = readContainedPrefix(root, join(root, 'README.md'), 131_072);
  if (!/\b(?:RuView|wifi[- ]densepose)\b/i.test(readme)) {
    throw new Error('Refusing CLI access: README does not identify a RuView checkout');
  }
  return root;
}

View on GitHub (pinned to 4685618388)

Solutions

  1. Pass the checkout directory itself, not any file inside or beside it
  2. Pre-check with statSync(p).isDirectory() before calling
  3. Re-clone the repository if the checkout is corrupted

Example fix

// before
await runVerification({ repo: '/opt/ruview.tar.gz' });

// after
await runVerification({ repo: '/opt/RuView' });
Defensive patterns

Strategy: validation

Validate before calling

import { statSync } from 'node:fs';
function isDirectory(p) {
  try {
    return statSync(p).isDirectory();
  } catch {
    return false;
  }
}
// use: if (!isDirectory(repoRoot)) throw new Error('repo must be a directory');

Prevention

When it happens

Trigger: assertTrustedHomecoreRepo('/path/ruview.tar.gz') where the same file path is used for both arguments, or the checkout directory being swapped for a file between configuration and call.

Common situations: Passing a file (README.md, repo archive) where the repository root is expected, typos pointing at a similarly named file, corrupted checkouts.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/e94efd4c3154ab00. Report an issue: GitHub.