Report live correction progress through CommandKit

This commit is contained in:
2026-11-16 15:12:06 +00:00
parent 891d4aac2c
commit 11f314d995
14 changed files with 289 additions and 11 deletions

View File

@@ -13,9 +13,10 @@ import (
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/runner"
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/structuredoutput"
"gitea.maximumdirect.net/eric/audita/v3/internal/modules"
pk "go.maximumdirect.net/promptkit"
)
func executePipeline(ctx context.Context, loaded *processInputs, prepared *preparedProcess, normalized *schema.Transcript, warn func(error)) (processResult, error) {
func executePipeline(ctx context.Context, loaded *processInputs, prepared *preparedProcess, normalized *schema.Transcript, warn func(error), progress func(string)) (processResult, error) {
cfg := &loaded.Configuration.Config
specs := prepared.Prepared.Specs
debug := prepared.Prepared.Debug
@@ -26,6 +27,15 @@ func executePipeline(ctx context.Context, loaded *processInputs, prepared *prepa
observer = llm.NewObservationCollector()
hooks = observer.Hooks()
}
if progress != nil {
observe := hooks.OnEventWithCall
hooks.OnEventWithCall = func(callID uint64, coordinates structuredoutput.DiagnosticContext, event pk.ExecutionEvent) {
if observe != nil {
observe(callID, coordinates, event)
}
reportModelProgress(progress, coordinates, event)
}
}
for i := range specs {
item := &specs[i]
setupFailure := func(role string, cause error) error {
@@ -58,7 +68,7 @@ func executePipeline(ctx context.Context, loaded *processInputs, prepared *prepa
}
output, runErr := runner.New(modules.NewFactory()).Run(ctx, runner.RunInput{
Config: cfg, Transcript: normalized, ModuleSpecs: specs,
Interactions: interactions, Evidence: &evidence,
Interactions: interactions, Evidence: &evidence, Progress: runnerProgress(progress),
})
if debug != nil {
for _, warning := range writer.Warnings() {