From 76f7659246c8f4a028b25c8759e5fcdafbff297a Mon Sep 17 00:00:00 2001 From: isink17 <39876158+isink17@users.noreply.github.com> Date: Thu, 23 Apr 2026 15:50:58 +0200 Subject: [PATCH 1/2] cli/index: stabilize --jsonl scan payloads (add scan_kind, include parse_ms) --- internal/cli/app.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/cli/app.go b/internal/cli/app.go index 8cb1a36..c210a28 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -626,10 +626,12 @@ func runIndex(ctx context.Context, cfg config.Config, stdout io.Writer, cmdName return err } if jsonl { + scanKind := map[bool]string{true: "update", false: "index"}[update] if err := writeJSONL(stdout, map[string]any{ - "type": "scan_summary", - "command": map[bool]string{true: "update", false: "index"}[update], - "data": summary, + "type": "scan_summary", + "command": scanKind, + "scan_kind": scanKind, + "data": summary, }); err != nil { return err } @@ -641,6 +643,7 @@ func runIndex(ctx context.Context, cfg config.Config, stdout io.Writer, cmdName "process_wall_ms": summary.ProcessWallMS, "task_ms": summary.TaskMS, "task_other_ms": summary.TaskOtherMS, + "parse_ms": summary.ParseMS, "read_ms": summary.ReadMS, "hash_ms": summary.HashMS, "adapter_parse_ms": summary.AdapterParseMS, From 230138c2a29135aaee5f6a6891054cd3c13991a9 Mon Sep 17 00:00:00 2001 From: isink17 <39876158+isink17@users.noreply.github.com> Date: Thu, 23 Apr 2026 16:04:02 +0200 Subject: [PATCH 2/2] indexer: fix parse_ms semantics and drop redundant adapter_parse_ms from scan summaries --- internal/cli/app.go | 1 - internal/indexer/indexer.go | 6 +++--- internal/store/store.go | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/cli/app.go b/internal/cli/app.go index c210a28..6e78e38 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -646,7 +646,6 @@ func runIndex(ctx context.Context, cfg config.Config, stdout io.Writer, cmdName "parse_ms": summary.ParseMS, "read_ms": summary.ReadMS, "hash_ms": summary.HashMS, - "adapter_parse_ms": summary.AdapterParseMS, "write_ms": summary.WriteMS, "write_metadata_ms": summary.WriteMetadataMS, "write_replace_ms": summary.WriteReplaceMS, diff --git a/internal/indexer/indexer.go b/internal/indexer/indexer.go index c026b3d..677eccd 100644 --- a/internal/indexer/indexer.go +++ b/internal/indexer/indexer.go @@ -529,10 +529,10 @@ func (i *Indexer) run(ctx context.Context, opts Options) (store.ScanSummary, err summary.ProcessWallMS = time.Since(processWallStart).Milliseconds() summary.TaskMS = taskDur.Milliseconds() summary.TaskOtherMS = taskOtherDur.Milliseconds() - summary.ParseMS = taskDur.Milliseconds() + // ParseMS is the time spent parsing file content (adapter parse), excluding read/hash/DB writes. + summary.ParseMS = adapterParseDur.Milliseconds() summary.ReadMS = readDur.Milliseconds() summary.HashMS = hashDur.Milliseconds() - summary.AdapterParseMS = adapterParseDur.Milliseconds() summary.WriteMS = writeDur.Milliseconds() summary.WriteMetadataMS = writeMetadataDur.Milliseconds() summary.WriteReplaceMS = writeReplaceDur.Milliseconds() @@ -623,7 +623,7 @@ func (i *Indexer) run(ctx context.Context, opts Options) (store.ScanSummary, err {Phase: "task_other", MS: summary.TaskOtherMS}, {Phase: "read", MS: summary.ReadMS}, {Phase: "hash", MS: summary.HashMS}, - {Phase: "adapter_parse", MS: summary.AdapterParseMS}, + {Phase: "parse", MS: summary.ParseMS}, {Phase: "write", MS: summary.WriteMS}, {Phase: "write_metadata", MS: summary.WriteMetadataMS}, {Phase: "write_replace", MS: summary.WriteReplaceMS}, diff --git a/internal/store/store.go b/internal/store/store.go index a4c6ff9..25eee6e 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -113,7 +113,6 @@ type ScanSummary struct { ParseMS int64 `json:"parse_ms,omitempty"` ReadMS int64 `json:"read_ms,omitempty"` HashMS int64 `json:"hash_ms,omitempty"` - AdapterParseMS int64 `json:"adapter_parse_ms,omitempty"` WriteMS int64 `json:"write_ms,omitempty"` WriteMetadataMS int64 `json:"write_metadata_ms,omitempty"` WriteReplaceMS int64 `json:"write_replace_ms,omitempty"`