{"record":{"id":"1b0b7653f72869aa","repo":"jdx/mise","slug":"contains-task-placeholder-start-but-no-ta","errorCode":null,"errorMessage":"{} contains `{TASK_PLACEHOLDER_START}` but no `{TASK_PLACEHOLDER_END}` after it, --inject requires both markers","messagePattern":"(.+?) contains `(.+?)` but no `(.+?)` after it, --inject requires both markers","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/task_docs.rs","lineNumber":155,"sourceCode":"/// 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}\n\n#[cfg(test)]\nmod tests {\n    use super::{TASK_PLACEHOLDER_END, TASK_PLACEHOLDER_START, inject_task_docs};\n    use std::path::Path;\n\n    fn inject(contents: &str) -> eyre::Result<String> {\n        inject_task_docs(contents, \"\\n## `task`\\n\", Path::new(\"README.md\"))\n    }\n","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/generate/task_docs.rs#L137-L173","documentation":"`mise generate task-docs --inject` requires both markers, with the end marker after the start marker. When the file contains TASK_PLACEHOLDER_START but no TASK_PLACEHOLDER_END after it, mise bails rather than replacing to end-of-file, because it cannot determine where the injected block should stop.","triggerScenarios":"Running task-docs injection on a file where someone deleted the end marker, a partial edit removed everything after the start marker, or the end marker appears before the start marker (so the post-start search misses it).","commonSituations":"Manual cleanup of a generated docs file that accidentally removed the closing marker; a truncated file from a failed merge; markers reordered when rearranging sections.","solutions":["Re-add the TASK_PLACEHOLDER_END marker after the start marker, then rerun --inject","Restore the complete marker pair from the generated (non-injected) output or git history","Verify ordering: the end marker must appear strictly after the start marker in the file"],"exampleFix":"// before (docs/tasks.md)\n<!-- TASK_PLACEHOLDER_START -->\n| task | description |\n\n// after\n<!-- TASK_PLACEHOLDER_START -->\n| task | description |\n<!-- TASK_PLACEHOLDER_END -->\n// then: mise generate task-docs --inject","handlingStrategy":"validation","validationCode":"# ensure both markers, in order, before injecting\ngrep -n 'TASK_PLACEHOLDER_START\\|TASK_PLACEHOLDER_END' docs/tasks.md\n# start line must be < end line; if END is missing, re-add it:\n# printf '<!-- TASK_PLACEHOLDER_END -->\\n' >> docs/tasks.md","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the marker pair as an atomic unit when editing generated docs","Restore markers from git history after manual edits","Keep the end marker immediately after the generated table so reordering never drops it"],"tags":["cli","documentation","markers","code-generation"],"backgroundTag":"missing-required-config-field","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"}