The gap
watch() takes a debounce argument (graphify/watch.py, default 3.0) and the module's own
help advertises it:
$ python -m graphify.watch --help
--debounce DEBOUNCE Seconds to wait after last change before updating (default: 3)
But the shipped sub-command never parses it — graphify/cli.py's watch branch accepts only
--semantic, --backend, --fallback-backend, and rejects everything else:
$ graphify watch /path --debounce 60
error: unknown watch option: --debounce # exit 2
So the knob is documented and unreachable through the command people actually run, and
graphify --help does not list it either.
Why the default is not always right (measured)
On a vault watched by graphify watch --semantic, three files written 6 seconds apart
produced two batches → two AST rebuilds → two graph.json writes → two downstream view
renders. The second batch is unavoidable at debounce=3: the rebuild itself takes ~46 s, and
every event landing during it becomes a fresh batch the moment the loop is free.
With the same burst and --debounce 60: one batch, one rebuild, one render. On this box a
render rewrites 31k view files, so a needless second batch is not free.
Suggested fix
Parse --debounce N / --debounce=N in the watch branch, reject a non-number and a negative
with exit 2, and pass nothing when the flag is absent so the watcher's own default keeps
living in one place. One line in graphify --help next to --semantic.
Implemented and tested in our fork (8 tests: both spellings, zero, absent-means-default, combined
with --semantic/--backend, both rejection paths, and the still-rejected unknown option) —
happy to open a PR against v8.
The gap
watch()takes adebounceargument (graphify/watch.py, default3.0) and the module's ownhelp advertises it:
But the shipped sub-command never parses it —
graphify/cli.py'swatchbranch accepts only--semantic,--backend,--fallback-backend, and rejects everything else:So the knob is documented and unreachable through the command people actually run, and
graphify --helpdoes not list it either.Why the default is not always right (measured)
On a vault watched by
graphify watch --semantic, three files written 6 seconds apartproduced two batches → two AST rebuilds → two
graph.jsonwrites → two downstream viewrenders. The second batch is unavoidable at
debounce=3: the rebuild itself takes ~46 s, andevery event landing during it becomes a fresh batch the moment the loop is free.
With the same burst and
--debounce 60: one batch, one rebuild, one render. On this box arender rewrites 31k view files, so a needless second batch is not free.
Suggested fix
Parse
--debounce N/--debounce=Nin thewatchbranch, reject a non-number and a negativewith exit 2, and pass nothing when the flag is absent so the watcher's own default keeps
living in one place. One line in
graphify --helpnext to--semantic.Implemented and tested in our fork (8 tests: both spellings, zero, absent-means-default, combined
with
--semantic/--backend, both rejection paths, and the still-rejected unknown option) —happy to open a PR against
v8.