# internal/core/reviewcontext

Package reviewcontext models the exact context packet given to review providers.

## ErrRequiredContextTooLarge

```go
var ErrRequiredContextTooLarge = errors.New("required context exceeds budget")
```

ErrRequiredContextTooLarge is returned when required provider context cannot fit the configured packet budget.

## RenderMarkdown

```go
func RenderMarkdown(packet Packet, opts Options) string
```

RenderMarkdown renders a packet into deterministic provider-readable Markdown.

## RenderMarkdownStrict

```go
func RenderMarkdownStrict(packet Packet, opts Options) (string, error)
```

RenderMarkdownStrict renders a provider packet after validating that the full required context fits the configured packet budget.

## SourceForContent

```go
func SourceForContent(kind string, path string, content []byte) Source
```

SourceForContent returns stable provenance for source text.

## SourceMarkdownSection

```go
func SourceMarkdownSection(key string, title string, order int, path string, content []byte) Section
```

SourceMarkdownSection returns the canonical source-contract section for agent-facing packets. Required sections must render in full.

## Options

```go
type Options struct {
	MaxBytes         int
	RequiredMaxBytes int
	Title            string
}
```

Options controls packet rendering.

- `MaxBytes: int`: 
- `RequiredMaxBytes: int`: 
- `Title: string`: 

## Packet

```go
type Packet struct {
	TaskID   string
	Title    string
	Status   string
	Sections []Section
}
```

Packet is the deterministic reviewer brief before provider-specific transport.

- `TaskID: string`: 
- `Title: string`: 
- `Status: string`: 
- `Sections: []Section`: 

## Section

```go
type Section struct {
	Key      string
	Title    string
	Order    int
	Body     string
	Required bool
	Sources  []Source
}
```

Section is one ordered part of the reviewer brief.

- `Key: string`: 
- `Title: string`: 
- `Order: int`: 
- `Body: string`: 
- `Required: bool`: 
- `Sources: []Source`: 

## Source

```go
type Source struct {
	Kind   string
	Path   string
	SHA256 string
	Bytes  int
}
```

Source identifies material used to construct a section.

- `Kind: string`: 
- `Path: string`: 
- `SHA256: string`: 
- `Bytes: int`:
