{"record":{"id":"7be1ed6e5b16365e","repo":"ruvnet/RuView","slug":"refusing-cli-access-homecore-repository-markers-a","errorCode":null,"errorMessage":"Refusing CLI access: Homecore repository markers are missing (${missing.join(', ')})","messagePattern":"Refusing CLI access: Homecore repository markers are missing \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"harness/homecore/src/repo-trust.js","lineNumber":75,"sourceCode":"    const parent = dirname(current);\n    if (parent === current) return null;\n    current = parent;\n  }\n}\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":57,"sourceCodeEnd":83,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/harness/homecore/src/repo-trust.js#L57-L83","documentation":"Homecore verifies the trusted root contains every entry of REQUIRED_MARKERS: .git, README.md, v2/Cargo.toml, v2/crates/homecore/Cargo.toml, v2/crates/homecore-server/Cargo.toml, and docs/adr/ADR-126-ruview-native-ha-port-master.md. The error message enumerates exactly which markers are missing so the gap is immediately visible.","triggerScenarios":"Running the CLI against an exported source archive without .git, a sparse or partial checkout missing docs/, a fork that moved v2/ or the ADR file, or a non-RuView directory that merely contains a README.md.","commonSituations":"Downloaded tarballs from GitHub (no .git), shallow CI clones excluding docs, directory restructures across harness versions, running from a parent directory holding several projects.","solutions":["Clone the full repository with git clone instead of using an archive","Restore the missing markers if the layout legitimately moved (git init for .git, reinstate the ADR file)","Run the command from the actual repository root"],"exampleFix":"# before\n$ tar xf RuView-main.tar.gz && cd RuView-main && homecore doctor --repo .   # no .git marker\n\n# after\n$ git clone https://github.com/ruvnet/RuView && cd RuView && homecore doctor --repo .","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nconst REQUIRED_MARKERS = ['.git', 'README.md', 'v2/Cargo.toml', 'v2/crates/homecore/Cargo.toml', 'v2/crates/homecore-server/Cargo.toml', 'docs/adr/ADR-126-ruview-native-ha-port-master.md'];\nfunction missingMarkers(root) {\n  return REQUIRED_MARKERS.filter((m) => !existsSync(join(root, m)));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Work from a full git clone, not a source archive, when using trust-gated harness commands","Keep sparse-checkout exclusions from dropping docs/ or v2/ markers","After restructuring the repo, update REQUIRED_MARKERS consumers in the same change"],"tags":["security","filesystem","cli","homecore","markers"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}