Expand description
Command implementations for the gonzalo admin CLI.
Structs§
- Debouncer
- Coalesces a burst of filesystem change notifications so a rapid series of
edits triggers a single re-index rather than one per event. The clock is
injected (
now), so the logic is deterministic and unit-testable without real sleeps — the seam the watcher loop drives withInstant::now(). - GcSummary
- Summary returned by
gc. - Horizon
- A collection horizon as the operator typed it, plus its parsed value, so command output can echo the horizon it used (spec §3.10, §8.2).
- Ignored
Counts - How many paths a walk declined to index.
- Index
Filter - Decides which repo-relative paths are eligible for indexing.
- Index
Options - The optional knobs of an indexing run (#331).
- Index
Summary - Summary returned by
index. - Migrate
Summary - Summary returned by
migrate. - Source
Files - What a full walk found: the parseable files, plus what was excluded on purpose and what gonzalo has no grammar for.
- Sync
Summary - Summary returned by
sync_stores. - Ticket
Sync Report - Per-connection ingest result.
- Unindexed
Counts - Files seen during a walk but not parsed, because their extension names no language gonzalo knows.
- Watch
Config - Timing knobs for
watch.
Enums§
- Delete
Outcome - Outcome of
delete. - Parse
Mode - How an index run will parse.
- Worker
Source - Where a parse worker was found.
Constants§
- CLI_
AUTHOR - The identity the CLI stamps on records it writes. Matches
migrateabove (which uses this constant) and theticket sync --authordefault. The CLI opens onlyFsStore, which honours a named deleter; over a daemon, spec §3.6 applies instead and a non-admin token is stamped as itself. - EXIT_
CONFLICT - Exit code for a write conflict (
deletewith a stale--expected, orresetleaving any record live). Distinct from 1 (error, via anyhow) and 2 (usage error, via clap), so automation can tell “retry” from “broken” (spec §3.10).
Functions§
- collect
- Purge tombstones at least
horizonold via [gonzalo_core::collect].namespace == Nonecollects across the whole store. - delete
- Delete one record by writing a tombstone attributed to
CLI_AUTHOR(spec §3.1–§3.2). Deleting an absent or already-deleted key isDeleted. - gc
- Sweep unreferenced blobs from the store at
root(gonzalo#292). - get
- Fetch a single record, or
Noneif it does not exist. - index
- Index the source files under
srcinto the(repo, view)code-graph view: parse each file into a content-addressed slice, then reconcile the view’s manifest to the tree (ADR 0012). Re-running updates the view. - index_
with index, with control over which paths enter the view.- index_
with_ gc index_with_optionsfor the common case: default filter, resolved parse worker, and the sweep governed bygc_after/min_age.- index_
with_ options indexthe(repo, view)view, then — whenopts.gc_after— sweep unreferenced blobs. The opt-in post-index trigger of gonzalo#104: the sweep runs only after a successful index and always goes throughgc, which marks against every record in the store (never a per-view subset), so a slice the just-indexed view dropped but another view still references is preserved.- index_
with_ worker index_with, with the parse worker pinned rather than resolved.- list
- Return all record keys in the store, optionally filtered by namespace / collection.
- migrate
- Recursively import every file under
srcas a record in the fs store atroot. Idempotent: if the key already exists, skip it. - named_
skips - Skipped paths for the index summary, bounded, with a count of what was left out so a tree full of crashes does not become a wall of text.
- open_
store - Open the fs store at
rootwith an explicit ancestor cap (spec §3.9). A cap of 0 is rejected here, before any record is touched. - parse_
duration - Parse a duration of one positive whole number followed by exactly one unit:
d,h,mors(e.g.30d,12h). Hand-rolled on purpose. The workspace has nohumantime, and a horizon never needs compound or fractional forms. - parse_
horizon - clap value parser for
--older-than. - parse_
revision - clap value parser for
--expected: a revision as JSON, exactly asgonzalo getprints it, e.g.{"counter":1,"hash":"…"}. - purge
- Physically remove the tombstone at
namespace/collection/id, discarding the restore window it holds. - reset
- Tombstone every live record in
namespace(optionally onecollection) viagonzalo_core::reset_as, attributing each tombstone toCLI_AUTHOR. - reset_
exit_ code - The process exit code for a finished
reset: 0 with no conflicts,EXIT_CONFLICTotherwise (re-run to finish, spec §3.10). - resolve_
parse_ worker - Locate the
gonzalo-parse-workerbinary for crash-isolated parsing: theGONZALO_PARSE_WORKERoverride, else a sibling of the current executable, elsePATH. Falls back to in-process parsing when none of those has one — reporting where it looked (#212). - status
- Count of records grouped by
"namespace/collection". - sync_
exit_ code - The process exit code for a finished
sync: 0 when it converged with no conflicts,EXIT_CONFLICTwhen it reports conflicts to resolve or gave up before converging. Both are recoverable outcomes a script retries or acts on, matchingdelete,resetandcollect(#290). - sync_
stores - Sync two filesystem stores via [
gonzalo_core::sync], at the default ancestor cap. - sync_
stores_ with_ cap sync_storeswith an explicit ancestor cap for both stores (spec §3.9).- ticket_
move - Move a board card to the column for
category. Selects the connection namedconnection, or the sole connection if there is exactly one. - ticket_
sync - Load the ticket config, build each connection’s source, and ingest its
tickets into the fs store at
root. - undelete
- Restore the record at
namespace/collection/idfrom its tombstone. - watch
- Watch
srcand keep the(repo, view)code-graph view in sync until Ctrl-C. Runs one index up front, then re-indexes on a debounced burst of filesystem changes and on a periodic full-reconcile tick. Long-running: returnsOk(())on graceful shutdown.