Skip to content

--watch mode: semantic re-extraction not triggered for doc/image changes — add graphify check-update or --auto-update flag #483

Closed

Description

@aturner71

Summary

The --watch watcher correctly detects doc/paper/image file changes and writes a graphify-out/needs_update flag. However, it stops there — it does not trigger semantic re-extraction. This means a corpus with active doc additions (e.g. research notes, scout findings, weekly reports) can sit stale for hours while the watcher is alive and healthy.

The watcher log says:

Non-code files changed — semantic re-extraction requires LLM. Run `/graphify --update` in Claude Code to update the graph.

This is correct by design (semantic extraction requires LLM tokens), but it creates a gap: the user cannot configure automatic semantic refresh without manually triggering /graphify --update themselves.


Current behavior

  • --watch watcher detects non-code file changes ✅
  • Writes graphify-out/needs_update flag ✅
  • Logs that the user should run --update manually ✅
  • Does NOT trigger semantic re-extraction (by design — LLM call needed)
  • Does NOT provide any mechanism for automated semantic refresh

Result: in an active session where doc files accumulate over hours (e.g. a research scout drops new markdown files every 30 minutes), the semantic graph never auto-updates. The watcher is ALIVE but the corpus is STALE.


Proposed fix: graphify check-update command

Add a lightweight CLI entry point that is safe to invoke from a system cron or task scheduler:

graphify check-update ~/my-corpus

Behavior:

  1. Check if graphify-out/needs_update flag exists.
  2. If not: exit 0 silently (nothing to do).
  3. If yes: run the incremental --update pipeline (detect_incremental → semantic extraction → merge → cluster → report → remove flag).
  4. Exit 0 on success, exit 1 on error.

This is designed to be idempotent and cron-safe:

*/30 * * * * graphify check-update ~/my-corpus >> ~/.graphify-cron.log 2>&1

Alternative: --watch --auto-update flag

graphify ~/my-corpus --watch --auto-update

Behavior: when non-code changes are detected, instead of writing the flag and stopping, trigger the --update pipeline inline. The watcher already has all the infrastructure for incremental detection — it just needs to call run_update() instead of writing a flag.

Users who want LLM calls from the watcher opt in explicitly with --auto-update. Default remains flag-only (no surprise token spend).


Workaround (documented for other users)

Until this is shipped, the workaround is a periodic Claude Code cron that checks for the flag and triggers /graphify --update:

*/30 * * * * — if graphify-out/needs_update exists, run /graphify --update

This requires a live Claude Code session and active REPL. A proper graphify check-update CLI command would be system-independent (could be invoked by launchd, systemd timer, or cron without Claude running).


Environment

  • graphifyy v0.4.23
  • --watch daemon running 7+ hours, healthy
  • Corpus: 21,625 nodes / 68,276 edges (Catalyst autonomous trading platform)
  • Doc additions: research scout markdown files written to research-findings/ every 30-60 minutes
  • Semantic graph was stale for ~7 hours despite watcher being alive and needs_update flag set

Activity

  1. safishamsi commented on Apr 22, 2026

    @safishamsi
    Member

    Fixed in v0.4.31: added graphify check-update <path> CLI subcommand. It checks for the graphify-out/needs_update flag and prints a reminder to run /graphify --update if pending changes exist. Notification-only (always returns True, never clears the flag — that's the LLM's job).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions