///|
fn research_bootstrap_quality_repair_prompt() -> String {
  research_bootstrap_prompt([
    "Execute the final deep-research review gate for ${proposal.title}.",
    research_bootstrap_quality_repair_inputs_prompt(),
    "Use tools to count English word tokens, lines, sections, tables, Mermaid blocks, and included source rows.",
    "If raw/bootstrap/REFERENCE_OUTPUT.md exists, count its lines but do not load the full reference report unless REFERENCE_STYLE.md is insufficient.",
    "If no reference exists, do not ask for one; the skill is the quality contract.",
    "First judge whether the report already passes; if it passes, record a no-op review with measured counts and do not rewrite for churn.",
    "If fixable gaps remain, repair in-place in \{@research_policy.deep_report_path()} rather than creating v2/v3/v4 files or a new book.",
    @research_policy.bootstrap_quality_repair_depth_prompt(),
    @research_policy.bootstrap_quality_repair_expansion_axes_prompt(),
    "Do not add unsupported claims, do not copy reference facts, and do not hard-code topic facts outside screened evidence.",
    "Also revise \{@research_policy.marketing_brief_path()} only if the report title or thesis changed.",
    "Return plain Markdown with before/after word counts, line counts, section count, source count, whether repair was needed, and remaining quality gaps.",
  ])
}

///|
fn research_bootstrap_quality_repair_inputs_prompt() -> String {
  research_bootstrap_prompt([
    "Read \{@research_policy.bootstrap_quality_repair_input_artifacts().join(", ")}.",
    "Also read optional raw/bootstrap/QUALITY_REPAIR.md, \{@research_policy.research_report_skill_path()}, and optional raw/bootstrap/REFERENCE_STYLE.md.",
  ])
}