prdoc

package
v0.0.0-...-78728ec Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package prdoc parses PR descriptions and commit messages into chunks for the PR corpus index. Each PR produces 1-3 chunks:

  • ChunkPRBackground — the "Background" / "Context" section
  • ChunkPRSolution — the "Solution" / "Changes" section
  • ChunkCommitMessage — one per commit (concatenated into one chunk)

The parser reuses prregress.ExtractBackground for section splitting and expects the caller to have already fetched the PR metadata via the gh CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(meta PRMeta) []types.Chunk

Parse splits a PR's description and commit messages into chunks. The File field on each chunk is set to a synthetic path "pr/<repo>#<number>" so retrieval citations point back to the PR.

Types

type PRMeta

type PRMeta struct {
	Repo           string
	PRNumber       int
	Title          string
	Body           string
	CommitMessages []string
	ChangedFiles   []string
	MergedAt       time.Time
}

PRMeta is the input from the gh CLI. Mirrors the subset of prregress.Meta that the parser needs, decoupled so we don't import the prregress package (which brings exec/os deps).

Jump to

Keyboard shortcuts

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