Documentation
¶
Index ¶
- Constants
- Variables
- func ClassifyHunk(tests *testdetect.Detector, fp gitx.FilePatch, lines []gitx.Line) model.ChangeType
- func ContentHash(added []string) string
- func Contributor(prov []model.HunkProvenance, actorKind map[string]string) string
- func GroupDeterministic(changeID string, hunks []model.Hunk) []model.ReviewUnit
- func ParseBlame(out []byte) map[int]string
- func ResolveSession(st *store.Store, repoID, id string) (model.Session, error)
- func UnitID(changeID, key string) string
- type Engine
- type Options
- type Result
Constants ¶
const ( ModeSession = "session" ModeStaged = "staged" ModeRange = "range" ModePR = "pr" )
Variables ¶
var ErrNoSession = errors.New("no session found for this repository")
Functions ¶
func ClassifyHunk ¶
func ClassifyHunk(tests *testdetect.Detector, fp gitx.FilePatch, lines []gitx.Line) model.ChangeType
func ContentHash ¶
ContentHash is the Agent Trace range hash: 32-bit MurmurHash3 (seed 0) of the added lines, whitespace-normalized and joined with "\n".
func Contributor ¶
func Contributor(prov []model.HunkProvenance, actorKind map[string]string) string
func GroupDeterministic ¶
func GroupDeterministic(changeID string, hunks []model.Hunk) []model.ReviewUnit
GroupDeterministic groups hunks by change type, then by top-level directory, and orders the units behavior → config/dependency → tests → refactor → docs → generated. It sets ReviewUnitID on every hunk.
func ParseBlame ¶
ParseBlame maps each final line number to the commit that blame gives it.
func ResolveSession ¶
ResolveSession finds a session by xis ID, agent session ID or a prefix of either. An empty id means the session of the repository with the latest activity that has a prompt; a session that was opened and closed without one is skipped. A long session that started first can be the latest one.
Types ¶
type Engine ¶
type Engine struct {
Redact func(string) string
Cfg config.Config
Store *store.Store
Repo snapshot.Repo
Shadow *snapshot.Shadow
Tests *testdetect.Detector
}
type Result ¶
type Result struct {
Change model.Change
Sessions []model.Session
Hunks []model.Hunk
Provenance []model.HunkProvenance
Units []model.ReviewUnit
Files []gitx.FilePatch
AttribCommit string
BaseCommit string
StepSession map[string]string
ActorKind map[string]string
LineSteps map[string]map[int]string
// RawPatches holds the unredacted hunk patches in memory only, for the secret rule.
RawPatches map[string]string
}
func (*Result) ProvenanceOf ¶
func (r *Result) ProvenanceOf(hunkID string) []model.HunkProvenance