generate

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package generate orchestrates the codebase-to-vault pipeline: scan, parse, normalize, compute metrics, render, and write.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

Generate runs the full repository-to-vault pipeline and returns a structured summary of the generated topic.

func GenerateWithObserver

func GenerateWithObserver(ctx context.Context, opts models.GenerateOptions, observer Observer) (models.GenerationSummary, error)

GenerateWithObserver runs the full pipeline and emits structured events to the provided observer while returning the final summary.

Types

type Event

type Event struct {
	Kind           EventKind      `json:"kind"`
	Stage          string         `json:"stage"`
	Completed      int            `json:"completed,omitempty"`
	DurationMillis int64          `json:"durationMillis,omitempty"`
	Error          string         `json:"error,omitempty"`
	Fields         map[string]any `json:"fields,omitempty"`
	Total          int            `json:"total,omitempty"`
}

Event reports structured progress from the generate pipeline.

type EventKind

type EventKind string

EventKind identifies one generation lifecycle event.

const (
	EventStageStarted   EventKind = "stage_started"
	EventStageProgress  EventKind = "stage_progress"
	EventStageCompleted EventKind = "stage_completed"
	EventStageFailed    EventKind = "stage_failed"
)

type Observer

type Observer interface {
	ObserveGenerateEvent(context.Context, Event)
}

Observer receives structured generation events.

type ObserverFunc

type ObserverFunc func(context.Context, Event)

ObserverFunc adapts a function into an Observer.

func (ObserverFunc) ObserveGenerateEvent

func (fn ObserverFunc) ObserveGenerateEvent(ctx context.Context, event Event)

ObserveGenerateEvent implements Observer.

Jump to

Keyboard shortcuts

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