{"record":{"id":"7f0abdda8efb0c6e","repo":"ruvnet/RuView","slug":"refusing-cli-access-readme-does-not-identify-a-ru","errorCode":null,"errorMessage":"Refusing CLI access: README does not identify a RuView checkout","messagePattern":"Refusing CLI access: README does not identify a RuView checkout","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"harness/homecore/src/repo-trust.js","lineNumber":79,"sourceCode":"}\n\nexport function assertTrustedHomecoreRepo(repoRoot, { trustedRoot = repoRoot } = {}) {\n  if (!repoRoot || !trustedRoot) throw new TypeError('repoRoot and trustedRoot are required');\n  const root = realpathSync(repoRoot);\n  const trustAnchor = realpathSync(trustedRoot);\n  if (!isWithin(trustAnchor, root) || root !== trustAnchor) {\n    throw new Error('Refusing CLI access: repository does not match the configured trusted root');\n  }\n  if (!statSync(root).isDirectory()) {\n    throw new Error('Refusing CLI access: trusted root is not a directory');\n  }\n  const missing = REQUIRED_MARKERS.filter((marker) => !existsSync(join(root, marker)));\n  if (missing.length) {\n    throw new Error(`Refusing CLI access: Homecore repository markers are missing (${missing.join(', ')})`);\n  }\n  const readme = readContainedPrefix(root, join(root, 'README.md'), 131_072);\n  if (!/\\b(?:RuView|wifi[- ]densepose)\\b/i.test(readme)) {\n    throw new Error('Refusing CLI access: README does not identify a RuView checkout');\n  }\n  return root;\n}\n","sourceCodeStart":61,"sourceCodeEnd":83,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/harness/homecore/src/repo-trust.js#L61-L83","documentation":"After the marker files exist, repo-trust reads the first 131072 bytes (128 KiB) of README.md and requires /\\b(?:RuView|wifi[- ]densepose)\\b/i to match, proving the checkout self-identifies as a RuView project. A README without those tokens anywhere in the prefix fails the trust check.","triggerScenarios":"Pointing --repo at a different repository whose README never says RuView or wifi-densepose/wifi densepose, an emptied or rewritten README, or a very long README whose identifying words appear only after the first 128 KiB.","commonSituations":"Renamed forks, template or generated READMEs replacing the original, pointing at the wrong clone in a multi-repo workspace.","solutions":["Run against a genuine RuView checkout","Ensure README.md contains the literal token 'RuView' (or 'wifi-densepose') near the top","If the README is huge, add the project name to the first heading so it lands inside the 128 KiB prefix"],"exampleFix":"# before\n# README.md\n# My Custom Fork — sensor tooling   (never names the project)\n\n# after\n# README.md\n# RuView fork — camera-free RF perception","handlingStrategy":"validation","validationCode":"import { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nfunction identifiesRuView(root) {\n  try {\n    const prefix = readFileSync(join(root, 'README.md')).subarray(0, 131_072).toString('utf8');\n    return /\\b(?:RuView|wifi[- ]densepose)\\b/i.test(prefix);\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the project identity ('RuView') in the first heading of README.md","Never point the harness at unrelated repositories that merely pass the file-marker check","Remember only the first 128 KiB of README.md is scanned"],"tags":["security","documentation","cli","homecore"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}