Documentation
¶
Index ¶
- func Register(r Rule)
- func Run(c *Context) []model.Flag
- func TurnScopes(c *Context) map[string]*Scope
- type AddedLine
- type Context
- func (c *Context) Added(h model.Hunk) []AddedLine
- func (c *Context) AgentLines(h model.Hunk) int
- func (c *Context) AgentSteps(h model.Hunk) []string
- func (c *Context) FileAgentTouched(path string) bool
- func (c *Context) FilePatch(path string) (gitx.FilePatch, bool)
- func (c *Context) HunksOf(path string) []model.Hunk
- func (c *Context) IsSourceFile(path string) bool
- func (c *Context) Lines(h model.Hunk, kind byte) []string
- func (c *Context) RelPath(p string) string
- func (c *Context) SessionOfHunk(h model.Hunk) string
- type Rule
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TurnScopes ¶
TurnScopes gives each step the scope of its turn. The scope is conservative and grows over the session: the paths and identifiers in the prompts so far, the directories the agent read or named in a shell command before the first edit of each turn, the configured scope.paths, files whose added lines use a prompt identifier, and test files that mirror an in-scope file.
Types ¶
type Context ¶
type Context struct {
Change model.Change
Hunks []model.Hunk
Files []gitx.FilePatch
Sessions []*store.SessionData
Provenance map[string][]model.HunkProvenance
StepSession map[string]string
ActorKind map[string]string
RawPatches map[string]string
RepoTop string
Cfg config.Config
Tests *testdetect.Detector
Redactor *redact.Redactor
}
func NewContext ¶
func NewContext(res *attribution.Result, sessions []*store.SessionData, repoTop string, cfg config.Config, red *redact.Redactor) *Context
func (*Context) Added ¶
Added gives the added lines of a hunk with their line numbers in the new file.
func (*Context) FileAgentTouched ¶
func (*Context) IsSourceFile ¶
Click to show internal directories.
Click to hide internal directories.