{"record":{"id":"f667f03f7bf9b314","repo":"pbakaus/impeccable","slug":"e-dynamic-error-string-from-bundle-resolve-lin","errorCode":null,"errorMessage":"{e} (dynamic error string from bundle::resolve_link_source)","messagePattern":"(.+?) \\(dynamic error string from bundle::resolve_link_source\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/skills/src/commands.rs","lineNumber":463,"sourceCode":"    hook_manifest::set_hook_consent(root, if accepted { \"accepted\" } else { \"declined\" }).map_err(Flow::Throw)?;\n    Ok(accepted)\n}\n\n// ─── link ────────────────────────────────────────────────────────────────────\n\n/// JS: link(flags)\nfn link(flags: &[String], io: &mut Io) -> R<()> {\n    let (sys, mut prompt) = ctx(io);\n    let force = has_flag(flags, \"--force\");\n    let yes = has_flag(flags, \"-y\") || has_flag(flags, \"--yes\");\n    let source_value = get_flag_value(flags, \"--source\");\n    let providers_value = get_flag_value(flags, \"--providers\");\n    let root = sys.find_project_root();\n\n    let source = match bundle::resolve_link_source(source_value, &root) {\n        Ok(s) => s,\n        Err(e) => {\n            err(io, &e);\n            return Err(Flow::Exit(1));\n        }\n    };\n    let targets = sys.resolve_install_targets(&root, providers_value);\n    if targets.is_empty() {\n        err(io, \"Could not determine a target harness folder.\");\n        err(io, \"Pass one explicitly, e.g. --providers=claude,cursor\");\n        return Err(Flow::Exit(1));\n    }\n    if !yes {\n        out(io, &format!(\"Source checkout: {}\", source.checkout_root));\n        out(io, &format!(\"Target harness folder(s): {}\", targets.join(\", \")));\n        let ans = prompt.ask(io, &format!(\"Link impeccable skills into {} folder(s)? (Y/n) \", targets.len()))?;\n        if ans == \"n\" || ans == \"no\" {\n            out(io, \"Aborted. Re-run with --providers=<names> to choose explicitly (e.g. --providers=claude,cursor).\");\n            return Err(Flow::Exit(0));\n        }\n    }","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/skills/src/commands.rs#L445-L481","documentation":"The `link` command resolves the source checkout to link skills from via `bundle::resolve_link_source`. When that fails (e.g. the checkout root or bundle directory cannot be located), the error message is printed and the process exits with code 1. It indicates the command could not determine a valid source to link from.","triggerScenarios":"Running `impeccable link` outside a project root, or from a checkout missing the built bundle directory (e.g. `dist/` never built).","commonSituations":"Developers cloning the repo without running the build first, or invoking the CLI from a random directory with no discoverable project root.","solutions":["Run `bun run build` in the source checkout to produce the bundle artifacts","Run the link command from the repository root of the checkout","Pass an explicit source path if supported and verify it exists"],"exampleFix":"// before\nimpeccable link  # run from ~/somewhere\n// after\ncd ~/code/impeccable && bun run build && impeccable link","handlingStrategy":"validation","validationCode":"if !fs.existsSync(path.join(checkoutRoot, 'dist')) { console.error('Bundle missing; run `bun run build` before linking.'); process.exit(1); }","typeGuard":null,"tryCatchPattern":"try { await link(); } catch (e) { if (/resolve_link_source|bundle/.test(String(e))) { console.error('Source checkout not found; run from repo root and build first.'); } throw e; }","preventionTips":["Always run the link command from the source checkout root","Build the bundle before linking","Verify bundle directory exists before invoking CLI"],"tags":["cli","link","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}