Skip to content

Commit 7a21b11

Browse files
authored
engine: wire LLM TOC builder in cmd/engine (toc_tree was always NULL) (#44)
cmd/engine's Pipeline construction set HyDE + SummaryAxes but never set TOCEnabled/TOCModel/TOCConcurrency/TOCCheckPages, so Pipeline.TOCEnabled defaulted to false, runTOCBuilder never ran, and documents.toc_tree stayed NULL on the standalone engine — the binary the OSS launch, --local mode, and the Docker image all use. That silently disabled the treewalk citation title_path (HAL-70): BuildHeadingPaths got an empty TOC and returned nothing. cmd/server already wired these; this mirrors it. Also surfaces ingest_mode + toc_enabled in the startup log so a misconfig is visible at boot. Closes HAL-317.
1 parent 80f7110 commit 7a21b11

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

cmd/engine/main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ func run() error {
6969
"queue_driver", cfg.Queue.Driver,
7070
"llm_driver", cfg.LLM.Driver,
7171
"retrieval_strategy", cfg.Retrieval.Strategy,
72+
"ingest_mode", cfg.Ingest.Mode,
73+
"toc_enabled", cfg.Ingest.TOC.Enabled,
7274
)
7375

7476
// Surface any model with no price-book entry: its cost reads $0, which
@@ -199,7 +201,15 @@ func run() error {
199201
SummaryAxesMaxTopics: cfg.Ingest.SummaryAxes.MaxTopics,
200202
SummaryAxesMaxEntities: cfg.Ingest.SummaryAxes.MaxEntities,
201203
SummaryAxesMaxNumbers: cfg.Ingest.SummaryAxes.MaxNumbers,
202-
GlobalLLMConcurrency: cfg.Ingest.GlobalLLMConcurrency,
204+
// Wire the LLM TOC builder (cmd/server already does this). Without
205+
// these, Pipeline.TOCEnabled defaults to false, runTOCBuilder never
206+
// runs, documents.toc_tree stays NULL, and the treewalk citation
207+
// title_path (HAL-70) can never resolve on the standalone engine.
208+
TOCEnabled: cfg.Ingest.TOC.Enabled,
209+
TOCModel: cfg.Ingest.TOC.Model,
210+
TOCConcurrency: cfg.Ingest.TOC.Concurrency,
211+
TOCCheckPages: cfg.Ingest.TOC.TOCCheckPages,
212+
GlobalLLMConcurrency: cfg.Ingest.GlobalLLMConcurrency,
203213
})
204214
if cfg.Ingest.Mode == ingest.ModeMinimal {
205215
logger.Info("ingest: MINIMAL mode — parse→persist→ready; skipping summarize/HyDE/multi-axis/TOC + table extraction")

0 commit comments

Comments
 (0)