Introduction¶
The ecosystem philosophy of DeepSeek Harness (DSH) is “Everything is a Plugin.” When using Graphify to build knowledge graphs, if code is modified via an external editor or command line, DSH’s workspace/changes signal usually fails to detect these changes. graphify watch natively supports monitoring file changes and automatically rebuilding the graph, but it requires a long-running process to maintain it. dsh-plugin-graphify-watch is designed specifically to solve this problem; it takes over the process lifecycle management of graphify watch, ensuring that code changes automatically trigger graph rebuilds.
Core Features¶
This plugin focuses on process management rather than file detection.
- Process Hosting: Launches and maintains a
graphify watchprocess for each configured project root directory. - Automatic Recovery: Automatically restarts using an exponential backoff strategy (maximum delay 60 seconds) after a process crash.
- State Filtering:
- If
graphify-out/graph.jsondoes not exist in the project root directory, the plugin skips startup and prompts the user to run/graphifyfirst. - If already watched by the current process, it skips; if already watched by another process, it also skips to avoid conflicts.
- If
- Change Handling:
- Code Changes: Triggers the rebuilding of
graph.jsonandGRAPH_REPORT.md. - Document/Image Changes: Does not directly rebuild the graph but writes a
graphify-out/needs_updateflag, prompting the user to manually run/graphify --update.
- Code Changes: Triggers the rebuilding of
- Resource Cleanup: Terminates the entire process tree upon plugin uninstallation to prevent residual processes from consuming resources.
Installation and Activation¶
Since this plugin depends on local absolute paths and contains dependency links, it must be installed via the DSH application, not the dsh CLI.
- Open the sidebar of the DSH application and navigate to the Plugins page.
- Click Add plugin and enter the plugin’s local absolute path:
C:\documents\dsh\dsh-plugin-graphify-watch. - Find
dsh-plugin-graphify-watchin the plugin list and enable the corresponding bundle. - Restart DSH. Adding local file dependencies requires a process restart to clear Node’s path cache.
Typical Usage¶
After installation, you typically need to specify the project paths to be watched in the configuration file.
# Override configuration in ~/.dsh/profiles/desktop/cordis.patch.yml
- id: graphify-watch
name: dsh-plugin-graphify-watch
config:
enabled: true
roots:
- C:\Users\Administrator\Documents\my-project
exePath: ""
maxRestarts: 3
restartBackoffMs: 2000
logRebuilds: true
Verify that the process is running correctly:
# Check graphify.exe process in PowerShell
Get-CimInstance Win32_Process -Filter "Name='graphify.exe'" | Select-Object ProcessId,CommandLine
Trigger a rebuild:
# Modify a source file to trigger code rebuild
Add-Content <root>\src\thing.py "`ndef probe():`n return 1`n"
# The timestamp of graph.json should update at this point
(Get-Item <root>\graphify-out\graph.json).LastWriteTime
Use Cases and Notes¶
- Use Cases: Use this when you need to integrate Graphify into workflows outside of DSH environments, or when you want code modifications to be automatically reflected in the knowledge graph.
- Not Responsible for Detection: This plugin only manages the startup, restart, and termination of processes; it is not responsible for file system change detection. The actual detection and debouncing logic (default 3 seconds) are handled internally by
graphify watch. - Document Update Strategy: The plugin intentionally does not automatically handle document-level updates (such as PDFs, images) because this typically consumes LLM tokens. It only flags
needs_update, leaving it to you to decide when to run/graphify --update. - No Dependencies: The plugin does not depend on
@deepseek-ai/schemastery, so it will not be blocked by DSH version compatibility checks. - Process Termination: On Windows,
graphify.exeis the launcher, and the actual Python process is a child process. The plugin usestaskkill /T /Fto terminate the entire tree, ensuring thorough cleanup.
Summary¶
dsh-plugin-graphify-watch solves the problem of graph desynchronization after code modifications via external editors by taking over the process lifecycle of graphify watch. In a zero-dependency, lightweight manner, it allows code changes to be automatically reflected in the knowledge graph. You can obtain the source code via the directory link: joslynSmall/dsh-plugin-graphify-watch.