comment

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(r TriageResult) string

Build constructs the consolidated markdown comment from all phase results. Returns empty string if there is nothing to report.

func DebugInstructions added in v0.1.1

func DebugInstructions(r TriageResult) string

DebugInstructions returns the collapsible debug log instructions block, or empty string if debug logs are not missing or no debug command is configured.

func Footer(r TriageResult) string

Footer returns the bot disclosure footer line based on which phases produced output.

func RewriteBareUpstreamRefs added in v0.1.1

func RewriteBareUpstreamRefs(text string, upstreamRefs []UpstreamRef, localIssueHints map[int]bool) string

RewriteBareUpstreamRefs rewrites bare `#NNN` references in text to the qualified `OWNER/REPO#NNN` form when the number matches an upstream reference. It does NOT touch numbers inside markdown link text/URLs, already-qualified `owner/repo#NNN` refs, or full URLs. When a number appears in localIssueHints, the rewrite is skipped (local takes precedence over upstream — bare `#NNN` in maintainer prose conventionally means the host repo). The rewrite is idempotent.

func SanitizeLLMOutput added in v0.1.1

func SanitizeLLMOutput(s string) string

SanitizeLLMOutput strips images, dangerous links, script tags, and HTML from LLM text.

Types

type TriageResult

type TriageResult struct {
	IsBug         bool
	IsEnhancement bool
	IsDocBug      bool   // documentation/meta bug — skip PWA note and debug log prompt
	DocsURL       string // project documentation site URL (empty = omit doc links)
	DebugCommand  string // shell command for capturing debug logs (empty = omit debug section)
	Phase1        phases.Phase1Result
	Phase2        []phases.Suggestion
	Phase4a       []phases.ContextMatch
}

TriageResult holds all phase outputs for building the consolidated comment. Phase 3 (duplicate detection) and Phase 4b (misclassification) were removed in favour of GitHub native tooling. See docs/plans/2026-03-15-lean-bot-pivot-design.md.

type UpstreamRef added in v0.1.1

type UpstreamRef struct {
	Owner  string
	Repo   string
	Number int
}

UpstreamRef identifies an upstream GitHub repository issue/PR reference parsed from a doc_url. It is used by rewriteBareUpstreamRefs to qualify bare `#NNN` references in synthesised prose.

func ExtractUpstreamRefs added in v0.1.1

func ExtractUpstreamRefs(docURLs []string) []UpstreamRef

ExtractUpstreamRefs parses GitHub issue/PR URLs out of the given doc URLs and returns the matching UpstreamRef set. URLs that do not point to a GitHub issue or pull request are skipped.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL