fix(indexing): surface index config properly and stop silent degradation

Follow-up to c924281, which introduced two defects of its own.

1. indexing.Config was a private config island: index paths existed nowhere
   in internal/config or config.example.toml, so they were undiscoverable
   and unsettable by anyone reading the real configuration.

   Now [indexing] in config.toml, defined in its own internal/config/
   indexer.go rather than appended to the 21-struct config.go, and its
   defaulting lives with it as IndexingConfig.withDefaults so finalize
   delegates instead of growing. Paths default off work_dir, keeping the
   two archied instances on one host from sharing an index. Documented in
   config.example.toml.

   internal/indexing keeps its own plain Config and does NOT import
   internal/config, so it stays a straight diff against its tau original.

2. A failed index build was invisible. refreshAsync wrote the reason to a
   database column with no reader and degraded to unindexed search in
   silence — the failure mode that costs hours precisely because nothing
   appears to be wrong. Every give-up path now logs, and a successful
   build logs once.

The logger is resolved at the point of use, not in the constructor: a
Manager can be built as a struct literal (the ported tests do), and
constructor-only defaulting panicked on the build goroutine, where a panic
takes the daemon with it. Regression test covers the zero and nil Manager.
This commit is contained in:
sam committed 2026-07-28 01:37:19 +10:00
1 parent 446dc6b3de
commit 05cfc30da3
8 files changed
+145 -13

No files matched your search

+4
View File
@@ -73,6 +73,10 @@ command = "archie-agent" # executable path for subprocess mode (not used in n
# The worker still runs as the daemon user until the Docker sandbox phase lands.
# env = ["GOCACHE"] # extra environment variable names forwarded to the worker
[indexing] # workspace codesearch index; both paths default under work_dir
# index_dir = "/var/lib/archie/indexes" # codesearch sidecar files
# db_path = "/var/lib/archie/workspace-indexes.db" # index lifecycle metadata
[web] # observability dashboard (read-only, no auth -- keep it local/tailnet)
listen = "127.0.0.1:8484" # "off" disables