Safely flushes all committed transactions from the WAL file into the main database file
and truncates the WAL to zero bytes. Returns an error if the database is busy and unable to truncate.
Ensures the symbols_fts (words) and symbol_names_tri (name trigrams) FTS5 virtual tables
and their synchronization triggers exist in the SQLite database, and that both hold every
symbol except locals and parameters. An index built under an earlier rule, or one left
without content or without one of the tables, is repopulated once inside a single
transaction; the rule marker is written last so an interrupted migration reruns.
The migration takes the write lock up front, so a second process waits for the busy
timeout instead of failing at once, and re-checks readiness under the lock so it never
repeats a migration another process just finished.
julie may write a local before its enclosing function, so the insert trigger also drops any
same-file variable that became local when its parent arrived.
Ensures the FTS5 index on symbols exists at the specified database file path. The
connection waits up to 60 s for another process’s migration; a large index takes seconds.
SQL predicate that is true for a symbols row that is a local variable or a parameter:
a variable declared inside a function, method, or constructor, directly or through
enclosing variables such as closures.
Retargets the root_path key in artifact_metadata to a new workspace canonical root.
This is essential when cloning or copying an artifact database (e.g. into a git worktree),
ensuring julie-extract update, delete, and scan recognize the new root without root mismatch errors.