odant-work 1.0.115 → 1.0.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/panel.js +11 -2
  2. package/$server/$folder/lib/consultant/consultant.js +1 -1
  3. package/$server/$folder/lib/node-explorer/node-explorer.js +3 -0
  4. package/.graphifyignore +6 -0
  5. package/.graphifyrc +4 -0
  6. package/.opencode/commands/graphify.md +5 -0
  7. package/.opencode/commands/grill-me.md +7 -0
  8. package/.opencode/opencode.jsonc +11 -0
  9. package/.opencode/plugins/graphify.js +62 -0
  10. package/.opencode/skills/graphify/.graphify_version +1 -0
  11. package/.opencode/skills/graphify/SKILL.md +863 -0
  12. package/.opencode/skills/graphify/references/add-watch.md +56 -0
  13. package/.opencode/skills/graphify/references/exports.md +91 -0
  14. package/.opencode/skills/graphify/references/extraction-spec.md +86 -0
  15. package/.opencode/skills/graphify/references/github-and-merge.md +46 -0
  16. package/.opencode/skills/graphify/references/hooks.md +48 -0
  17. package/.opencode/skills/graphify/references/query.md +319 -0
  18. package/.opencode/skills/graphify/references/transcribe.md +52 -0
  19. package/.opencode/skills/graphify/references/update.md +233 -0
  20. package/.opencode/skills/grill-me/SKILL.md +31 -0
  21. package/.opencode/skills/grilling/SKILL.md +30 -0
  22. package/.well-known/appspecific/com.chrome.devtools.json +1 -1
  23. package/AGENTS.md +14 -0
  24. package/graphify-out/.graphify_analysis.json +11093 -0
  25. package/graphify-out/.graphify_build.json +1 -0
  26. package/graphify-out/.graphify_build_state.json +1 -0
  27. package/graphify-out/.graphify_detect.json +1 -0
  28. package/graphify-out/.graphify_labels.json +1 -0
  29. package/graphify-out/.graphify_labels.json.sig +1 -0
  30. package/graphify-out/.graphify_labels.pending.json +785 -0
  31. package/graphify-out/.graphify_python +1 -0
  32. package/graphify-out/.graphify_root +1 -0
  33. package/graphify-out/GRAPH_REPORT.md +1466 -0
  34. package/graphify-out/cache/.gfy-replace-bak-gci0at1b.tmp +1 -0
  35. package/graphify-out/cache/.gfy-replace-bak-jzyyumxe.tmp +1 -0
  36. package/graphify-out/cache/.gfy-replace-bak-zdzf7c5s.tmp +1 -0
  37. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/0362f8d78d0065532bbf3c258155da406e5d639fd8ab8b36f32aaec824797834.json +1 -0
  38. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/1279dd107c5cc425aebc191663bd8f5c44e6053b525cd4f5e06abac0427837b1.json +1 -0
  39. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/244d428606dc285d4e32c5930cf8126bfe4fe5fda192f8b9b5b1d932cfc8daea.json +1 -0
  40. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/2573255306d9de54325f188793d7dc7d76199a6017942e0a79f8ca9822da27ab.json +1 -0
  41. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/270cb0d9ad25da63476322ac8ba9a6eba1fdb21cd7a8b80fe1c33e7d13119d94.json +1 -0
  42. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/28a975c1a8d50bf16faf7dfc6b521bbeee5789a5ef49231541145d13f06ff722.json +1 -0
  43. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/2d64ab31df06d57558b3a282d06158dc8df565b36c0727c384645800b1168ef8.json +1 -0
  44. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/3e75114e18fd75627a71d987a27f2579779bd26f5b157f1e9f261f2467800a48.json +1 -0
  45. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/420740aeef9e97428bf0d87c10eb9c0f7819f004cee96d7d0faa2d1a5407d6e1.json +1 -0
  46. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/4c6bb77a1a9434986f0aac8251d69e42f45ef4c31775f7237be4bd0cf1eb8d9e.json +1 -0
  47. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/776c646738b485c922e7d3e9d8a3560f26e2ed133b142619313be1fdae4ffd05.json +1 -0
  48. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/7938cb04be94e0d03fe46b4ed7288c3224af872a3563e7f0e331ed1ad04acfc2.json +1 -0
  49. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/7af0aa1c83bfce5b5f81f06c5f3852af9035307fe749781868bb27b75906c2b0.json +1 -0
  50. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/8def1210ca7df1c5adaa6d61bf71f2e11ca01ebc3ff94fabacf709003f200b8b.json +1 -0
  51. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/900d4cdb722e1902c4290e90a974086c4eba207a774b7587a38b0ede1f57c103.json +1 -0
  52. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/921ccbb389bc155c99e169a4e5f468d8806266fd0e53754da101785025fc9fce.json +1 -0
  53. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/99df5157a64d630b4ce57b0ab9f361d128badc17950233f51d584d8ab4e508f5.json +1 -0
  54. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/9a22abb0c6e8377b47387564ed38cf500e4269a5a1f0d195cd6c998aed9a7b61.json +1 -0
  55. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/9b81fc1dd7bb2dd1a55f0ed0662f596c1143d82952e2ac130304148201459ac5.json +1 -0
  56. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/9e6d299cbc85dee4ebdc75fd63622ddb880fea951e7ab042d65f130f67cd909c.json +1 -0
  57. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/b0a6be035aa7e3542e91cc04e9a603cb36a365f07226eab1866912cc3b9e774e.json +1 -0
  58. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/c37392ffea17fa391016c1d44db36169f3a6563de1d272e7e9a32c7d3814035f.json +1 -0
  59. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/c698a4e0df28e868bf3ce3547cd5144ff5336dbded6fb92646c517950c2b7a32.json +1 -0
  60. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/e49652b2c1c4921d955e7e22364f928c79ff9fbe332982acbdc9caf8921bed8b.json +1 -0
  61. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/f057a3e4987d66fa18b0868dad26158ee152e0ff06790be37ff4e6e22ffd9cff.json +1 -0
  62. package/graphify-out/cache/ast/v0.9.108-s45-g460503b3f2a4/fb385b3957c22c09f9f6c2dde66f28f3193b56209c50bd062fa8d52fd3e1196a.json +1 -0
  63. package/graphify-out/cache/last_query_stamp +1 -0
  64. package/graphify-out/cache/stat-index.json +1 -0
  65. package/graphify-out/graph.html +477 -0
  66. package/graphify-out/graph.json +1 -0
  67. package/graphify-out/manifest.json +8146 -0
  68. package/oda/components/layouts/app-layout/app-layout.js +1 -1
  69. package/package.json +1 -1
  70. package/sources/host/auto-updater.js +0 -1
  71. package/sources/modules/agent/extensions.js +2 -0
  72. package/sources/modules/agent/index.js +4 -2
  73. package/sources/modules/agent/loop.js +3 -3
  74. package/sources/modules/agent/mcp-pool.js +2 -0
  75. package/sources/modules/agent/node-rules.js +1 -2
  76. package/sources/modules/agent/permissions.js +5 -5
  77. package/sources/modules/agent/scheduler.js +13 -2
  78. package/sources/modules/agent/scope.js +2 -2
  79. package/sources/modules/agent/session.js +5 -2
  80. package/sources/modules/agent/taint.js +4 -0
  81. package/sources/modules/agent/tools/browser.js +2 -1
  82. package/sources/modules/agent/tools/tool-groups.js +9 -9
  83. package/sources/modules/agent/triggers.js +5 -3
  84. package/sources/page.html +12 -2
  85. package/#system/auto-update.json.4727984.tmp +0 -15
  86. package/#system/license-base-WORK-PAK-BED9C508.lic.json.4714304.tmp +0 -0
@@ -0,0 +1,52 @@
1
+ # graphify reference: transcribe video and audio
2
+
3
+ Load this only when `detect` reported one or more `video` files. A corpus with no video never reads this.
4
+
5
+ ### Step 2.5 - Transcribe video / audio files (only if video files detected)
6
+
7
+ Skip this step entirely if `detect` returned zero `video` files.
8
+
9
+ Video and audio files cannot be read directly. Transcribe them to text first, then treat the transcripts as doc files in Step 3.
10
+
11
+ **Strategy:** Read the god nodes from `graphify-out/.graphify_detect.json` (or the analysis file if it exists from a previous run). You are already a language model — write a one-sentence domain hint yourself from those labels. Then pass it to Whisper as the initial prompt. No separate API call needed.
12
+
13
+ **However**, if the corpus has *only* video files and no other docs/code, use the generic fallback prompt: `"Use proper punctuation and paragraph breaks."`
14
+
15
+ **Step 1 - Write the Whisper prompt yourself.**
16
+
17
+ Read the top god node labels from detect output or analysis, then compose a short domain hint sentence, for example:
18
+
19
+ - Labels: `transformer, attention, encoder, decoder` → `"Machine learning research on transformer architectures and attention mechanisms. Use proper punctuation and paragraph breaks."`
20
+ - Labels: `kubernetes, deployment, pod, helm` → `"DevOps discussion about Kubernetes deployments and Helm charts. Use proper punctuation and paragraph breaks."`
21
+
22
+ **Export** it as `GRAPHIFY_WHISPER_PROMPT` (the exact name the transcriber reads — and it must be `export`ed so the child Python process sees it) for the next command.
23
+
24
+ **Step 2 - Transcribe:**
25
+
26
+ ```bash
27
+ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported)
28
+ export GRAPHIFY_WHISPER_PROMPT="<the one-sentence domain hint you composed in Step 1>"
29
+ $(cat graphify-out/.graphify_python) -c "
30
+ import json, os, sys
31
+ from pathlib import Path
32
+ from graphify.transcribe import transcribe_all
33
+
34
+ detect = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
35
+ video_files = detect.get('files', {}).get('video', [])
36
+ prompt = os.environ.get('GRAPHIFY_WHISPER_PROMPT', 'Use proper punctuation and paragraph breaks.')
37
+
38
+ transcript_paths = transcribe_all(video_files, initial_prompt=prompt)
39
+ # Write the JSON from Python (NOT a shell '>' redirect): transcribe_all/Whisper
40
+ # print progress to stdout, which would otherwise corrupt the JSON file (#1392).
41
+ Path('graphify-out/.graphify_transcripts.json').write_text(json.dumps(transcript_paths, ensure_ascii=False), encoding=\"utf-8\")
42
+ print(f'Transcribed {len(transcript_paths)} file(s)', file=sys.stderr)
43
+ "
44
+ ```
45
+
46
+ After transcription:
47
+ - Read the transcript paths from `graphify-out/.graphify_transcripts.json`
48
+ - Add them to the docs list before dispatching semantic subagents in Step 3B
49
+ - Print how many transcripts were created: `Transcribed N video file(s) -> treating as docs`
50
+ - If transcription fails for a file, print a warning and continue with the rest
51
+
52
+ **Whisper model:** Default is `base`. If the user passed `--whisper-model <name>`, `export GRAPHIFY_WHISPER_MODEL=<name>` (it must be exported, not just assigned) before running the command above.
@@ -0,0 +1,233 @@
1
+ # graphify reference: incremental update and cluster-only
2
+
3
+ Load this only when the user passed `--update` or `--cluster-only`. A first-time full build never reads this file.
4
+
5
+ ## For --update (incremental re-extraction)
6
+
7
+ Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time.
8
+
9
+ ```bash
10
+ $(cat graphify-out/.graphify_python) -c "
11
+ import sys, json
12
+ from graphify.detect import detect_incremental, save_manifest
13
+ from pathlib import Path
14
+
15
+ from graphify.paths import out_path
16
+ from graphify.watch import _read_build_excludes, _read_build_gitignore
17
+ # Step B3.5 lists the files this run reads only partway, and the manifest write (and Step 9,
18
+ # if it runs) keeps them unstamped. Only B3.5 rewrites the list, so drop one an earlier run
19
+ # left: it would keep a file this run serves from the cache unstamped on every run (#4807).
20
+ Path('graphify-out/.graphify_partial.txt').unlink(missing_ok=True)
21
+ INPUT_PATH = Path('graphify-out/.graphify_root').read_text(encoding=\"utf-8-sig\").strip()
22
+ result = detect_incremental(Path(INPUT_PATH), extra_excludes=_read_build_excludes(out_path()), gitignore=_read_build_gitignore(out_path()))
23
+ new_total = result.get('new_total', 0)
24
+ nf = result.get('new_files', {})
25
+ print(json.dumps({
26
+ 'new_total': new_total,
27
+ 'deleted': len(result.get('deleted_files', [])),
28
+ 'new_by_type': {t: len(v) for t, v in nf.items()},
29
+ 'total_files': result.get('total_files'),
30
+ 'total_words': result.get('total_words'),
31
+ 'skipped_sensitive': result.get('skipped_sensitive', []),
32
+ }, indent=2, ensure_ascii=False))
33
+ print('Full result: graphify-out/.graphify_incremental.json')
34
+ Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
35
+ deleted = list(result.get('deleted_files', []))
36
+ if new_total == 0 and not deleted:
37
+ print('No files changed since last run. Nothing to update.')
38
+ raise SystemExit(0)
39
+ if deleted:
40
+ print(f'{len(deleted)} deleted file(s) to prune.')
41
+ if new_total > 0:
42
+ print(f'{new_total} new/changed file(s) to re-extract.')
43
+ "
44
+ ```
45
+
46
+ Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context:
47
+
48
+ ```bash
49
+ $(cat graphify-out/.graphify_python) -c "
50
+ import json
51
+ from pathlib import Path
52
+ r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
53
+ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({
54
+ 'files': r.get('new_files', {}),
55
+ 'all_files': r.get('files', {}),
56
+ 'total_files': r.get('new_total', 0),
57
+ 'total_words': r.get('total_words', 0),
58
+ 'skipped_sensitive': r.get('skipped_sensitive', []),
59
+ 'needs_graph': True,
60
+ }, ensure_ascii=False), encoding=\"utf-8\")
61
+ "
62
+ ```
63
+
64
+ If new files exist, first check whether all changed files are code files:
65
+
66
+ ```bash
67
+ $(cat graphify-out/.graphify_python) -c "
68
+ import json
69
+ from pathlib import Path
70
+
71
+ result = json.loads(open('graphify-out/.graphify_incremental.json', encoding='utf-8').read()) if Path('graphify-out/.graphify_incremental.json').exists() else {}
72
+ code_exts = {'.py','.ts','.js','.go','.rs','.java','.cpp','.c','.rb','.swift','.kt','.cs','.scala','.php','.cc','.cxx','.hpp','.h','.kts','.lua','.toc','.f','.F','.f90','.F90','.f95','.F95','.f03','.F03','.f08','.F08'}
73
+ new_files = result.get('new_files', {})
74
+ all_changed = [f for files in new_files.values() for f in files]
75
+ code_only = all(Path(f).suffix.lower() in code_exts for f in all_changed)
76
+ print('code_only:', code_only)
77
+ "
78
+ ```
79
+
80
+ If `code_only` is True: print `[graphify update] Code-only changes detected - skipping semantic extraction (no LLM needed)`, run Step 3A (AST) on the changed files, then follow only Part B's **Fast path** to overwrite `.graphify_semantic.json` with an empty result and run Part C to create `.graphify_extract.json` from the fresh AST result. Skip semantic cache checks/writes and subagents (Steps B0–B3); do not reuse semantic sidecars from a prior run. Continue to the incremental merge and Steps 4–8 only after Part C has completed.
81
+
82
+ If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.
83
+
84
+
85
+ If no new files exist (only deletions), create an empty extraction so the merge step can prune:
86
+
87
+ ```bash
88
+ if [ ! -f graphify-out/.graphify_extract.json ]; then
89
+ echo '[graphify update] Only deletions -- creating empty extraction for merge.'
90
+ $(cat graphify-out/.graphify_python) -c "
91
+ import json
92
+ from pathlib import Path
93
+ Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8')
94
+ "
95
+ fi
96
+ ```
97
+
98
+
99
+ Then:
100
+
101
+ ```bash
102
+ $(cat graphify-out/.graphify_python) -c "
103
+ import json
104
+ from pathlib import Path
105
+ from graphify.build import build_merge
106
+ from graphify.detect import save_manifest
107
+
108
+ # Load new extraction and incremental state
109
+ new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
110
+ incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
111
+ INPUT_PATH = Path('graphify-out/.graphify_root').read_text(encoding=\"utf-8-sig\").strip()
112
+ deleted = list(incremental.get('deleted_files', []))
113
+ # prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
114
+ # handled by build_merge's replace-on-re-extract (#1344): every source_file in
115
+ # new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
116
+ # Do NOT add changed here: with root= passed, prune_set relativizes to the same base
117
+ # as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
118
+ # now that replace — not the dedup pass — reconciles changed files).
119
+ prune = list(deleted) or None
120
+
121
+ # Use build_merge() — reads graph.json directly without NetworkX round-trip
122
+ # so edge direction (calls, implements, imports) is always preserved (#801).
123
+ # Pass root= so prune_sources (absolute paths from detect_incremental) are
124
+ # relativized to match the graph's relative source_file values; without it
125
+ # nothing is pruned and stale nodes accumulate on every update (#1361).
126
+ # directed=IS_DIRECTED: replace IS_DIRECTED with True if --directed was given, else
127
+ # False. Without it a --directed --update silently rebuilds undirected and collapses
128
+ # reciprocal A<->B edges (#1392).
129
+ G = build_merge(
130
+ [new_extraction],
131
+ graph_path='graphify-out/graph.json',
132
+ prune_sources=prune,
133
+ root=INPUT_PATH,
134
+ directed=IS_DIRECTED,
135
+ )
136
+ print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges')
137
+
138
+ # Write merged result back to .graphify_extract.json so Step 4 sees the full graph
139
+ merged_out = {
140
+ 'nodes': [{'id': n, **d} for n, d in G.nodes(data=True)],
141
+ 'edges': [
142
+ # Explicit source/target last so they win over any stale attrs in d.
143
+ {**{k: val for k, val in d.items() if k not in ('_src', '_tgt', 'source', 'target')},
144
+ 'source': d.get('_src', u), 'target': d.get('_tgt', v)}
145
+ for u, v, d in G.edges(data=True)
146
+ ],
147
+ # G.graph["hyperedges"] holds hyperedges from both existing graph.json
148
+ # and new_extraction (build_merge combines them). Falling back to
149
+ # new_extraction only would silently drop prior-run hyperedges (#801).
150
+ 'hyperedges': list(G.graph.get('hyperedges', [])),
151
+ 'input_tokens': new_extraction.get('input_tokens', 0),
152
+ 'output_tokens': new_extraction.get('output_tokens', 0),
153
+ }
154
+ Path('graphify-out/.graphify_extract.json').write_text(json.dumps(merged_out, ensure_ascii=False), encoding=\"utf-8\")
155
+ print(f'[graphify update] Merged extraction written ({len(merged_out[\"nodes\"])} nodes, {len(merged_out[\"edges\"])} edges)')
156
+
157
+ # Save manifest so next --update diffs against today's state, not the
158
+ # prior run's baseline (prevents ghost-node reports on subsequent updates).
159
+ # root= matches the build_merge call above so the manifest keys stay relative to
160
+ # the scan root — portable across clones/machines, so --update keeps matching
161
+ # cached files instead of missing every one after a move (#1417).
162
+ #
163
+ # Only stamp semantic files (docs/papers/images) that ACTUALLY produced output
164
+ # THIS run (new_extraction is this run's fresh extraction, read above before the
165
+ # merge overwrote the file): a changed doc whose chunk failed must stay unstamped
166
+ # so the next --update re-queues it, otherwise it is marked done and its content
167
+ # is lost forever (#2015). Mirrors the library extract path
168
+ # (cli._stamped_manifest_files + clear_semantic + scan_corpus).
169
+ from graphify.cli import _stamped_manifest_files
170
+ # A file a subagent only partly read (Step B3.5 lists it) DID produce output, so the
171
+ # filter alone would stamp it and the next --update would never re-queue it. Pass the
172
+ # list as Step 9 does after a full build, so it stays unstamped and is retried (#2225, #4807).
173
+ # Leave the list on disk: Step 9 reads it too if it runs after the update.
174
+ _pf = Path('graphify-out/.graphify_partial.txt')
175
+ _partial = {l.strip() for l in _pf.read_text(encoding='utf-8').splitlines() if l.strip()} if _pf.exists() else set()
176
+ _manifest_files = _stamped_manifest_files(incremental['files'], new_extraction, Path(INPUT_PATH), partial_source_files=_partial)
177
+ # Changed semantic files dispatched this run but NOT stamped had their chunk fail
178
+ # or be omitted; clear any stale semantic_hash so they are re-queued (#1948).
179
+ _sem_types = ('document', 'paper', 'image')
180
+ _dispatched = {f for t, fl in incremental.get('new_files', {}).items() if t in _sem_types for f in fl}
181
+ _stamped = {f for fl in _manifest_files.values() for f in fl}
182
+ _cleared = _dispatched - _stamped
183
+ # scan_corpus = the RAW full corpus so in-root files newly excluded since last run
184
+ # are dropped rather than masquerading as deletions; untouched rows preserved (#1908).
185
+ _scan = {f for fl in incremental['files'].values() for f in fl}
186
+ save_manifest(_manifest_files, root=INPUT_PATH, scan_corpus=_scan, clear_semantic=_cleared or None)
187
+ print('[graphify update] Manifest saved.')
188
+ "
189
+ ```
190
+
191
+ Then run Steps 4–8 on the merged graph as normal.
192
+
193
+ After Step 4, show the graph diff:
194
+
195
+ ```bash
196
+ $(cat graphify-out/.graphify_python) -c "
197
+ import json
198
+ from graphify.analyze import graph_diff
199
+ from graphify.build import build_from_json
200
+ from graphify.paths import load_node_link_graph
201
+ import networkx as nx
202
+ from pathlib import Path
203
+
204
+ # Load old graph (before update) from backup written before merge
205
+ old_data = json.loads(Path('graphify-out/.graphify_old.json').read_text(encoding=\"utf-8\")) if Path('graphify-out/.graphify_old.json').exists() else None
206
+ new_extract = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
207
+ G_new = build_from_json(new_extract, directed=IS_DIRECTED)
208
+
209
+ if old_data:
210
+ G_old = load_node_link_graph(old_data)
211
+ diff = graph_diff(G_old, G_new)
212
+ print(diff['summary'])
213
+ if diff['new_nodes']:
214
+ print('New nodes:', ', '.join(n['label'] for n in diff['new_nodes'][:5]))
215
+ if diff['new_edges']:
216
+ print('New edges:', len(diff['new_edges']))
217
+ "
218
+ ```
219
+
220
+ Before the merge step, save the old graph: `cp graphify-out/graph.json graphify-out/.graphify_old.json`
221
+ Clean up after: `rm -f graphify-out/.graphify_old.json`
222
+
223
+ ---
224
+
225
+ ## For --cluster-only
226
+
227
+ Skip Steps 1–3. Re-run clustering on the existing graph:
228
+
229
+ ```bash
230
+ graphify cluster-only .
231
+ ```
232
+
233
+ `graphify cluster-only .` is **self-contained**: it re-clusters, names communities, and regenerates `GRAPH_REPORT.md`, `graph.json`, and `graph.html` from the existing graph. **Do not re-run Steps 5–9** — they read intermediate files (`.graphify_extract.json`, `.graphify_detect.json`, `.graphify_analysis.json`) that a prior build's cleanup (Step 9) already deleted, so they raise `FileNotFoundError` (#1392). When it finishes, present the refreshed `GRAPH_REPORT.md` summary as usual.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: grill-me
3
+ description: A relentless interview to sharpen a plan or design.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
8
+
9
+ Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled: the questions you can ask _now_ without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
10
+
11
+ Format a round like so:
12
+
13
+ ```
14
+ ❓ **Q1** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
15
+
16
+ ➡️ <your recommended answer>
17
+
18
+ ---
19
+
20
+ ❓ **Q2** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
21
+
22
+ ➡️ <your recommended answer>
23
+ ```
24
+
25
+ Word each question so "yes" accepts your recommended answer.
26
+
27
+ Each round the user answers reshapes the tree: settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a _later_ round, not this one.
28
+
29
+ Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), dispatch a sub-agent with a fresh context window to find it; don't ask the user for anything you could look up yourself. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report; ask the rest of the frontier now. The _decisions_ are the user's: put each to them and wait.
30
+
31
+ The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Do not act on it until the user confirms you have reached a shared understanding.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: grilling
3
+ description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
4
+ ---
5
+
6
+ Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
7
+
8
+ Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled: the questions you can ask _now_ without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
9
+
10
+ Format a round like so:
11
+
12
+ ```
13
+ ❓ **Q1** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
14
+
15
+ ➡️ <your recommended answer>
16
+
17
+ ---
18
+
19
+ ❓ **Q2** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
20
+
21
+ ➡️ <your recommended answer>
22
+ ```
23
+
24
+ Word each question so "yes" accepts your recommended answer.
25
+
26
+ Each round the user answers reshapes the tree: settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a _later_ round, not this one.
27
+
28
+ Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), dispatch a sub-agent with a fresh context window to find it; don't ask the user for anything you could look up yourself. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report; ask the rest of the frontier now. The _decisions_ are the user's: put each to them and wait.
29
+
30
+ The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Do not act on it until the user confirms you have reached a shared understanding.
@@ -1 +1 @@
1
- {}
1
+ {}
package/AGENTS.md CHANGED
@@ -60,3 +60,17 @@
60
60
  - Консоль PowerShell искажает кириллицу — читать через `read`/`grep`, писать через `edit`/`write` (UTF-8 без BOM).
61
61
  7. Правило изменений (канон, п. 11). Любая новая возможность выражается как файл или папка в нужном типе плюс штатное наследование. Если запрос так выразить нельзя, спецслучай не делается: остановись и сформулируй развилку — как запрос ложится в архитектуру либо что в каноне придётся изменить. Решение принимает владелец проекта.
62
62
  8. Инварианты канона (п. 10) закрыты тестом `tests/architecture.test.js`. Известные отклонения кода записаны в реестре `docs/architecture-deviations.json`; он только сокращается. Новое отклонение роняет тест — в реестр его не добавляют, а устраняют. Исправил отклонение — вычеркни: `node scripts/check-architecture.mjs --prune`.
63
+
64
+ ## graphify
65
+
66
+ This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships.
67
+
68
+ When the user types `/graphify`, use the installed graphify skill or instructions before doing anything else.
69
+
70
+ Rules:
71
+ - When graphify-out/graph.json exists, run `graphify query "<question>"` before your first grep, search or source-file read for a codebase question, and put this rule in every subagent prompt that explores code. Read raw files only for lines the graph or an earlier read already located. Use `graphify path "<A>" "<B>"` for relationships and `graphify explain "<concept>"` for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output.
72
+ - Dirty graphify-out/ files are expected after hooks or incremental updates; dirty graph files are not a reason to skip graphify. Only skip graphify if the task is about stale or incorrect graph output, or the user explicitly says not to use it.
73
+ - If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
74
+ - Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
75
+ - After modifying code, run `graphify update .` to keep the graph current (AST-only, no API cost).
76
+ - A committed graphify-out/graph.json is rewritten whole on every build, so a large diff to it in a pull request is expected. Do not flag it as churn or suggest skipping the graph rebuild or its hooks.