{"record":{"id":"24e3de9a6575ae59","repo":"jdx/mise","slug":"does-not-contain-the-task-placeholder-start","errorCode":null,"errorMessage":"{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:\n\n{TASK_PLACEHOLDER_START}\n{TASK_PLACEHOLDER_END}","messagePattern":"(.+?) does not contain the `(.+?)` marker required by --inject, add:\n\n(.+?)\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/task_docs.rs","lineNumber":145,"sourceCode":"            let mut out = vec![];\n            for task in &visible_tasks {\n                out.push(task.render_markdown(&config).await?);\n            }\n            miseprintln!(\"{}\", out.join(\"\\n\\n\").trim());\n        }\n        Ok(())\n    }\n}\n\n/// Replace everything between the mise-tasks markers in `contents` with `doc`.\n///\n/// Both markers must be present, with the end marker after the start marker. When\n/// a marker is missing this errors instead of writing anything: falling back to\n/// \"the block starts at byte 0\" truncated files that had no markers at all, and\n/// panicked outright on files shorter than the marker (discussions/4676).\nfn inject_task_docs(contents: &str, doc: &str, output: &Path) -> eyre::Result<String> {\n    let Some(start) = contents.find(TASK_PLACEHOLDER_START) else {\n        bail!(\n            \"{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:\\n\\n{TASK_PLACEHOLDER_START}\\n{TASK_PLACEHOLDER_END}\",\n            file::display_path(output)\n        );\n    };\n    let body_start = start + TASK_PLACEHOLDER_START.len();\n    let Some(end) = contents[body_start..]\n        .find(TASK_PLACEHOLDER_END)\n        .map(|e| e + body_start)\n    else {\n        bail!(\n            \"{} contains `{TASK_PLACEHOLDER_START}` but no `{TASK_PLACEHOLDER_END}` after it, --inject requires both markers\",\n            file::display_path(output)\n        );\n    };\n    let mut contents = contents.to_string();\n    contents.replace_range(body_start..end, doc);\n    Ok(contents)\n}","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/generate/task_docs.rs#L127-L163","documentation":"With `mise generate task-docs --inject`, inject_task_docs requires the target markdown file to contain the TASK_PLACEHOLDER_START marker (with the end marker later). If the start marker is absent, mise errors instead of guessing — earlier behavior of falling back to 'block starts at byte 0' truncated files that had no markers at all (discussion #4676). Nothing is written when this fires.","triggerScenarios":"Running `mise generate task-docs --inject` against an output file whose contents lack the TASK_PLACEHOLDER_START marker entirely, or a file shorter than the marker string; called from run/inject.","commonSituations":"Creating a fresh README/docs file by hand and forgetting to add the placeholder block; deleting the markers during a cleanup; pointing --output at a brand-new empty file.","solutions":["Add the placeholder block to the target file:\n<TASK_PLACEHOLDER_START>\n<TASK_PLACEHOLDER_END>\nthen rerun with --inject","Copy the marker block from mise's documented task-docs example into your docs file","Run without --inject once to generate the full doc (including markers) and merge manually"],"exampleFix":"// before (docs/tasks.md)\n# Tasks\n\n// after\n# Tasks\n<!-- generated tasks; do not edit -->\n<!-- TASK_PLACEHOLDER_START -->\n<!-- TASK_PLACEHOLDER_END -->\n// then: mise generate task-docs --inject","handlingStrategy":"validation","validationCode":"# ensure markers exist before injecting\nif ! grep -q 'TASK_PLACEHOLDER_START' docs/tasks.md; then\n  printf '<!-- TASK_PLACEHOLDER_START -->\\n<!-- TASK_PLACEHOLDER_END -->\\n' >> docs/tasks.md\nfi\nmise generate task-docs --inject","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bootstrap new docs files with the full marker block (start + end) from the start","Never delete the placeholder markers during doc cleanup","Generate task-docs once without --inject to see the canonical marker format"],"tags":["cli","documentation","markers","code-generation"],"backgroundTag":"missing-required-argument","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}