contribution

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound           = errors.New("contribution: not found")
	ErrMissingOpportunity = errors.New("contribution: opportunity is required")
	ErrEmptyGuidance      = errors.New("contribution: guidance is required")
	ErrMissingApproach    = errors.New("contribution: approach is required")
)

Functions

This section is empty.

Types

type IssueDraft

type IssueDraft struct {
	OpportunityID string
	Title         string
	Body          string
	RenderedAt    time.Time
	ManifestID    string
}

IssueDraft is a rendered issue body ready for review.

type IssueInput

type IssueInput struct {
	Opportunity *investigation.Opportunity
	Evidence    []*evidence.Evidence
	Guidance    string
	Repo        domain.RepoRef
	Success     string
	ManifestID  string
}

IssueInput supplies the verified facts and repository guidance used to render an issue.

type PullRequestDraft

type PullRequestDraft struct {
	OpportunityID string
	Title         string
	Body          string
	RenderedAt    time.Time
	ManifestID    string
}

PullRequestDraft is a rendered PR body ready for review.

type PullRequestInput

type PullRequestInput struct {
	Opportunity   *investigation.Opportunity
	Evidence      []*evidence.Evidence
	Guidance      string
	Repo          domain.RepoRef
	Approach      string
	Changes       string
	Compatibility string
	Limitations   string
	LinkedIssue   string
	ManifestID    string
}

PullRequestInput supplies the verified facts and repository guidance used to render a PR.

type Renderer

type Renderer struct{}

Renderer builds deterministic Markdown drafts from verified facts only.

func NewRenderer

func NewRenderer() *Renderer

NewRenderer returns a deterministic contribution renderer.

func (*Renderer) RenderIssue

func (r *Renderer) RenderIssue(in IssueInput) (*IssueDraft, error)

RenderIssue builds an issue draft from the supplied opportunity, evidence, and repository guidance. It does not invent claims beyond the input.

func (*Renderer) RenderPullRequest

func (r *Renderer) RenderPullRequest(in PullRequestInput) (*PullRequestDraft, error)

RenderPullRequest builds a PR draft from the supplied opportunity, evidence, repository guidance, and explicit approach details.

type Repository

type Repository interface {
	SaveIssueDraft(ctx context.Context, d *IssueDraft) error
	GetIssueDraft(ctx context.Context, opportunityID string) (*IssueDraft, error)
	SavePullRequestDraft(ctx context.Context, d *PullRequestDraft) error
	GetPullRequestDraft(ctx context.Context, opportunityID string) (*PullRequestDraft, error)
}

Repository is a narrow persistence boundary for contribution drafts. Concrete stores live outside this package; production code never uses an in-memory store.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service prepares contribution drafts and persists them through a narrow Repository.

func NewService

func NewService(repo Repository) *Service

NewService returns a ContributionService backed by repo and renderer.

func (*Service) PrepareIssue

func (s *Service) PrepareIssue(ctx context.Context, in IssueInput) (*IssueDraft, error)

PrepareIssue renders an issue draft and stores it.

func (*Service) PreparePullRequest

func (s *Service) PreparePullRequest(ctx context.Context, in PullRequestInput) (*PullRequestDraft, error)

PreparePullRequest renders a pull request draft and stores it.

Jump to

Keyboard shortcuts

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