review

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 6 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

Overview

Package review renders the agent's own answer as a second pull request comment, apart from Costroid's report.

The answer is the agent's text, and the agent read the pull request, so the comment treats it as data: it sits in a fenced code block no line of it can close, so no link, mention, image or HTML in it renders. The comment says the words are the agent's.

Index

Constants

View Source
const (
	// Marker opens the answer's comment, which is how the next run finds it.
	// It differs from the report's marker, so neither run edits the other's.
	Marker = "<!-- costroid:review -->"
	// MaxAnswerBytes is the most of the answer the comment shows. A fence is
	// at most half the answer's length plus one, so the body stays under the
	// 65535 characters GitHub stores in a comment.
	MaxAnswerBytes = 30000
	// MaxFileBytes is the most of the answer the agent's job keeps and the
	// report's job reads.
	MaxFileBytes = 1 << 20
)

Variables

This section is empty.

Functions

func Clean

func Clean(text string) (string, bool)

Clean makes the answer safe to fence: valid UTF-8 with line feeds for line ends, with every control character but tab and line feed, and every direction override, shown as U+FFFD, and no blank lines around it. It cuts the result to MaxAnswerBytes at a character boundary and says whether it cut.

func Fence

func Fence(text string) string

Fence returns the code fence for text: of backticks or of tildes, whichever text holds the shorter run of, and one longer than that run, at least three. A fence closes only on a line of at least as many of its own character, so no line of text can close it.

func Render

func Render(answer Answer) string

Render returns the comment's body.

Types

type Answer

type Answer struct {
	// Text is the agent's answer. Empty says the run kept none.
	Text string
	// Head is the commit the agent ran on. A value that is not a commit
	// leaves the commit out of the comment.
	Head string
}

Answer is what one run left for the comment.

Jump to

Keyboard shortcuts

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