{"record":{"id":"3d552f122f46f18e","repo":"mvanhorn/last30days-skill","slug":"unsupported-emit-mode-emit","errorCode":null,"errorMessage":"Unsupported emit mode: {emit}","messagePattern":"Unsupported emit mode: (.+?)","errorType":"validation","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/last30days/scripts/last30days.py","lineNumber":413,"sourceCode":"        return html_render.render_html(\n            report,\n            fun_level=fun_level,\n            save_path=save_path,\n            synthesis_md=synthesis_md,\n            register=register,\n        )\n    if emit in {\"compact\", \"md\"}:\n        return render.render_compact(\n            report,\n            fun_level=fun_level,\n            save_path=save_path,\n            register=register,\n        )\n    if emit == \"context\":\n        return render.render_context(report)\n    if emit == \"brief\":\n        return render.render_brief(report)\n    raise SystemExit(f\"Unsupported emit mode: {emit}\")\n\n\ndef emit_comparison_output(\n    entity_reports: list[tuple[str, schema.Report]],\n    emit: str,\n    fun_level: str = \"medium\",\n    save_path: str | None = None,\n    synthesis_md: str | None = None,\n    json_profile: str = \"agent\",\n) -> str:\n    if emit == \"json\":\n        payload = {\n            \"comparison\": True,\n            \"entities\": [label for label, _ in entity_reports],\n            \"reports\": [\n                {\n                    \"entity\": label,\n                    \"report\": (","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/skills/last30days/scripts/last30days.py#L395-L431","documentation":"The single-report emit dispatcher in last30days.py accepts only a fixed set of emit modes (json, html, compact/md, context, brief) and raises SystemExit for anything else. This is argparse-independent validation: the --emit value reached the renderer without matching a supported mode.","triggerScenarios":"Calling the engine with --emit=markdown, --emit=csv, --emit=compact2, or any typo — the string falls through all if-blocks in emit_output() and hits the final raise.","commonSituations":"Agent or script guessing flag values instead of reading --help; emit modes renamed between skill versions; copy-paste from outdated SKILL.md/README examples.","solutions":["Run with --help or check emit_output() to enumerate valid modes: json, html, compact, md, context, brief.","Fix the flag value, e.g. --emit=md instead of --emit=markdown.","If wiring automated callers, validate the emit string against the supported set before invoking."],"exampleFix":"# before\n--emit=markdown\n\n# after\n--emit=md","handlingStrategy":"validation","validationCode":"SUPPORTED_EMIT = {'json', 'html', 'compact', 'md', 'context', 'brief'}\nif emit not in SUPPORTED_EMIT:\n    raise ValueError(f'unsupported emit {emit!r}; choose from {sorted(SUPPORTED_EMIT)}')","typeGuard":"def is_supported_emit(value: str) -> TypeGuard[str]:\n    return value in {'json', 'html', 'compact', 'md', 'context', 'brief'}","tryCatchPattern":null,"preventionTips":["Validate --emit against the engine's supported set before building the command.","Prefer canonical short tokens (md, json) over guesses like markdown."],"tags":["cli","validation","emit","arguments"],"backgroundTag":null,"analyzedSha":"c7460f6114449ddfe6ea3fc2f23c3d910c0e740c","analyzedAt":"2026-08-15T03:34:49.540Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}