Repository navigation
Expand file tree
/
Copy pathlogs.py
More file actions
1144 lines (1093 loc) · 55.2 KB
/
Copy pathlogs.py
File metadata and controls
1144 lines (1093 loc) · 55.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Provider logs
PROVIDER_REGISTERED = "Registered provider: {name}"
# Graph loading logs
LOADING_GRAPH = "Loading graph from {path}"
LOADED_GRAPH = "Loaded {nodes} nodes and {relationships} relationships with indexes"
ENSURING_PROJECT = "Ensuring Project: {name}"
# Pass logs
PASS_1_STRUCTURE = "--- Pass 1: Identifying Packages and Folders ---"
PASS_2_FILES = (
"\n--- Pass 2: Processing Files, Caching ASTs, and Collecting Definitions ---"
)
PASS_3_CALLS = "--- Pass 3: Processing Function Calls from AST Cache ---"
PASS_4_EMBEDDINGS = "--- Pass 4: Generating semantic embeddings ---"
CPP_FRONTEND_RUNNING = "--- C/C++ libclang frontend: {path} ---"
EMITTING_FRONTEND_PROBE_FAILED = (
"Emitting frontend for {lang} raised while probing availability; skipping "
"it and falling back to tree-sitter for that language."
)
CPP_FRONTEND_UNAVAILABLE = (
"C/C++ libclang frontend enabled but libclang is unavailable; using "
"tree-sitter only (no macro Function nodes or #include IMPORTS). "
'Enable it with: pip install "code-graph-rag[cpp]"'
)
CPP_FRONTEND_NO_COMPDB = (
"C/C++ libclang frontend enabled but no compile_commands.json found; "
"using tree-sitter only (no macro Function nodes or #include IMPORTS). "
"Generate one with: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON (or: "
"bear -- make)"
)
CPP_FRONTEND_COVERED = "C/C++ libclang frontend covered {count} file(s)"
CPP_FRONTEND_HYBRID_PENDING = (
"C/C++ hybrid frontend queued {count} macro use(s) for span attribution"
)
CPP_FRONTEND_MACRO_CALLS = "Resolved {count} hybrid macro CALLS edge(s)"
CPP_FRONTEND_EXPANSION_CALLS = "Resolved {count} hybrid expansion CALLS edge(s)"
CSHARP_FRONTEND_RUNNING = "--- C# Roslyn frontend: {path} ---"
CSHARP_FRONTEND_UNAVAILABLE = (
"C# Roslyn frontend enabled but dotnet is unavailable; using tree-sitter"
)
CSHARP_FRONTEND_AUTO_FALLBACK = (
"C# frontend AUTO: dotnet not found; using tree-sitter only"
)
CSHARP_FRONTEND_NO_PROJECT = (
"C# Roslyn frontend enabled but no .csproj/.sln found; using tree-sitter"
)
CSHARP_FRONTEND_BUILD_FAILED = (
"C# Roslyn frontend tool failed to build; using tree-sitter"
)
CSHARP_FRONTEND_TYPES = "C# Roslyn frontend classified {count} type base list(s)"
CSHARP_FRONTEND_FACTS = (
"C# Roslyn frontend facts: {calls} call site(s), {partials} partial group(s), "
"{queries} query call(s), {externals} external site(s)"
)
CSHARP_FRONTEND_PARTIALS_JOINED = (
"C# Roslyn frontend merged {count} partial-type group(s)"
)
CSHARP_FRONTEND_QUERY_EDGES = (
"C# Roslyn frontend emitted {count} LINQ query CALLS edge(s)"
)
CSHARP_FRONTEND_PARSE_FAILED = (
"C# Roslyn frontend produced no parseable JSON; using tree-sitter.\n"
"stdout: {stdout}\nstderr: {stderr}"
)
CSHARP_FRONTEND_RUN_FAILED = (
"C# Roslyn frontend tool did not finish ({error}); using tree-sitter"
)
CSHARP_FRONTEND_NO_FACTS = (
"C# Roslyn frontend produced no facts; every join falls back to "
"tree-sitter. Tool diagnostics:\n{stderr}"
)
GO_FRONTEND_RUNNING = "--- Go go/types frontend: {path} ---"
GO_FRONTEND_UNAVAILABLE = (
"Go frontend enabled but the go toolchain is unavailable; using tree-sitter"
)
GO_FRONTEND_AUTO_FALLBACK = "Go frontend AUTO: go not found; using tree-sitter only"
GO_FRONTEND_FACTS = (
"Go go/types frontend facts: {calls} call site(s), {externals} external site(s)"
)
GO_FRONTEND_IMPLEMENTS_JOINED = (
"Go go/types frontend: {count} IMPLEMENTS edge(s) joined to Pass-2 type nodes"
)
GO_FRONTEND_BUILD_FAILED = (
"Go frontend tool failed to build; using tree-sitter.\nstderr: {stderr}"
)
GO_FRONTEND_PARSE_FAILED = (
"Go frontend produced no parseable JSON; using tree-sitter.\n"
"stdout: {stdout}\nstderr: {stderr}"
)
GO_FRONTEND_RUN_FAILED = "Go frontend tool did not finish ({error}); using tree-sitter"
GO_FRONTEND_ANCHOR_DEGRADED = (
"Go frontend tool failed for module anchor {anchor}; that module falls back "
"to tree-sitter while the others keep their compiler facts. Recorded in "
"degraded_modules so the mixture is not silent."
)
GO_FRONTEND_NO_FACTS = (
"Go frontend produced no facts; every join falls back to tree-sitter. "
"Tool diagnostics:\n{stderr}"
)
# A run rooted at a path that is neither a file nor a directory used to walk
# nothing and report success (issue #1651): a deleted or mistyped target was
# indistinguishable from one that was indexed.
REPO_PATH_MISSING = (
"Repository path {path} does not exist as a file or a directory; nothing "
"was indexed"
)
GRAPH_ALREADY_IN_SYNC = (
"Knowledge graph already in sync (hash cache matches every file). Skipping passes."
)
EXCLUSION_SET_CHANGED = (
"Exclusion set changed since the last sync ({previous} -> {current}); "
"re-running so newly excluded files leave the graph and newly included "
"ones enter it."
)
EXCLUSION_STATE_MISSING = (
"No recorded exclusion set for this graph, so it cannot be shown "
"unchanged; re-running once to establish it. Expect this exactly once "
"per existing index."
)
EXCLUSION_STATE_NOT_RECORDED = (
"The graph could not be asked for its module paths, so newly excluded "
"files may still be indexed; the exclusion set is not recorded and the "
"next run will reconcile again."
)
# Analysis logs
FOUND_FUNCTIONS = "\n--- Found {count} functions/methods in codebase ---"
REGISTRY_REHYDRATED = "Rehydrated {count} definitions from the graph for resolution"
INCREMENTAL_REBUILD_INBOUND = "Rebuilding inbound edges from {count} dependent files"
ANALYSIS_COMPLETE = "\n--- Analysis complete. Flushing all data to database... ---"
REMOVING_STATE = "Removing in-memory state for: {path}"
REMOVED_FROM_CACHE = " - Removed from ast_cache"
REMOVING_QNS = " - Removing {count} QNs from function_registry"
CLEANED_SIMPLE_NAME = " - Cleaned simple_name '{name}'"
# Function ingest logs
FUNC_FOUND = " Found Function: {name} (qn: {qn})"
FUNC_EXPECTED_NODE = "Expected Node but got {actual_type}: {value}"
METHOD_FOUND = " Found Method: {name} (qn: {qn})"
EXPORT_FOUND = " Found {export_type}: {name} (qn: {qn})"
# Definition processor logs
DEF_PARSING_AST = "Parsing and Caching AST for {language}: {path}"
DEF_UNSUPPORTED_LANGUAGE = "Unsupported language '{language}' for {path}"
DEF_NO_PARSER = "No parser available for {language}"
DEF_PARSE_FAILED = "Failed to parse or ingest {path}: {error}"
DEF_PARSING_DEPENDENCY = " Parsing dependency file: {path}"
DEF_FOUND_DEPENDENCY = " Found dependency: {name} (spec: {spec})"
# Semantic/embedding logs
SEMANTIC_NOT_AVAILABLE = (
"Semantic search dependencies not available, skipping embedding generation"
)
INGESTOR_NO_QUERY = "Ingestor does not support querying, skipping embedding generation"
EMBEDDINGS_SKIPPED = (
"Skipping semantic embedding generation (--no-embeddings / CGR_SKIP_EMBEDDINGS)"
)
EMBEDDING_DEVICE_UNAVAILABLE = (
"Requested embedding device '{device}' is unavailable, falling back to"
" automatic selection"
)
NO_FUNCTIONS_FOR_EMBEDDING = "No functions or methods found for embedding generation"
GENERATING_EMBEDDINGS = "Generating embeddings for {count} functions/methods"
EMBEDDING_PROGRESS = "Generated {done}/{total} embeddings"
EMBEDDING_FAILED = "Failed to embed {name}: {error}"
EMBEDDING_SNIPPET_FAILED = (
"Failed to generate embedding for code snippet of length {length}"
)
EMBEDDING_BATCH_COMPUTE_FAILED = "Failed to embed batch of {count}: {error}"
CONTEXT_TOKEN_COUNT_FAILED = "Context token count failed: {error}"
# A rejected credential, distinct from a transient failure: the user must
# change something, so it is warned rather than logged at debug (issue #1493).
CONTEXT_TOKEN_COUNT_AUTH_FAILED = (
"Context token counting disabled for this session: {error}"
)
NO_SOURCE_FOR = "No source code found for {name}"
EMBEDDINGS_COMPLETE = "Successfully generated {count} semantic embeddings"
EMBEDDING_GENERATION_FAILED = "Failed to generate semantic embeddings: {error}"
EMBEDDING_STORE_FAILED = "Failed to store embedding for {name}: {error}"
EMBEDDING_STORE_RETRY = "Vector store upsert failed (attempt {attempt}/{max_attempts}), retrying in {delay:.1f}s: {error}"
EMBEDDING_BATCH_STORED = "Stored batch of {count} embeddings in vector store"
EMBEDDING_BATCH_FAILED = "Failed to store embedding batch: {error}"
EMBEDDING_SEARCH_FAILED = "Failed to search embeddings: {error}"
EMBEDDING_RECONCILE_OK = (
"Vector store reconciliation: all {count} expected embeddings found"
)
EMBEDDING_RECONCILE_MISSING = "Vector store reconciliation: {missing} of {expected} embeddings missing (IDs: {sample_ids})"
EMBEDDING_RECONCILE_FAILED = "Vector store reconciliation check failed: {error}"
VECTOR_STORE_BACKEND_UNAVAILABLE = (
"Vector store backend '{backend}' dependencies are not available"
)
VECTOR_STORE_BACKEND_UNKNOWN = "Unknown vector store backend '{backend}'"
VECTOR_STORE_DELETE_PROJECT = (
"Deleting {count} {backend} vectors for project '{project}'"
)
VECTOR_STORE_DELETE_PROJECT_DONE = "Deleted {backend} vectors for project '{project}'"
VECTOR_STORE_DELETE_PROJECT_FAILED = (
"Failed to delete {backend} vectors for project '{project}': {error}"
)
VECTOR_STORE_CLEARED = "Cleared all {backend} vectors"
QDRANT_DELETE_PROJECT = "Deleting {count} Qdrant vectors for project '{project}'"
QDRANT_DELETE_PROJECT_DONE = "Deleted Qdrant vectors for project '{project}'"
QDRANT_DELETE_PROJECT_FAILED = (
"Failed to delete Qdrant vectors for project '{project}': {error}"
)
QDRANT_LOCK_ERROR = (
"Failed to open embedded Qdrant at '{path}': {error}. The storage folder is "
"locked by another process; look for the '.lock' sentinel inside it. Embedded "
"Qdrant allows only one process at a time, so a running MCP server and a CLI "
"indexing run cannot share it. Set QDRANT_URL to point at a shared Qdrant "
"server for concurrent access."
)
EMBEDDING_CACHE_HIT = "Embedding cache hit for {count} snippets"
EMBEDDING_CACHE_LOADED = "Loaded embedding cache with {count} entries from {path}"
EMBEDDING_CACHE_SAVE_FAILED = "Failed to save embedding cache to {path}: {error}"
EMBEDDING_CACHE_LOAD_FAILED = "Failed to load embedding cache from {path}: {error}"
# Multimodal attachment logs
MULTIMODAL_ATTACHED = "Attached multimodal content: {path}"
MULTIMODAL_NOT_FOUND = "Multimodal path referenced but not found: {path}"
MULTIMODAL_READ_FAILED = "Failed to read multimodal file '{path}': {error}"
# Protobuf service logs
PROTOBUF_INIT = "ProtobufFileIngestor initialized to write to: {path}"
PROTOBUF_NO_MESSAGE_CLASS = (
"No Protobuf message class found for label '{label}'. Skipping node."
)
PROTOBUF_NO_ONEOF_MAPPING = (
"No 'oneof' field mapping found for label '{label}'. Skipping node."
)
PROTOBUF_UNKNOWN_REL_TYPE = (
"Unknown relationship type '{rel_type}'. Setting to UNSPECIFIED."
)
PROTOBUF_INVALID_REL = (
"Invalid relationship: source_id={source_id}, target_id={target_id}"
)
PROTOBUF_FLUSH_SUCCESS = "Successfully flushed {nodes} unique nodes and {rels} unique relationships to {path}"
PROTOBUF_FLUSHING = "Flushing data to {path}..."
# Parser loader logs
BUILDING_BINDINGS = "Building Python bindings for {lang}..."
BUILD_FAILED = "Failed to build {lang} bindings: stdout={stdout}, stderr={stderr}"
BUILD_SUCCESS = "Successfully built {lang} bindings"
IMPORTING_MODULE = "Attempting to import module: {module}"
LOADED_FROM_SUBMODULE = (
"Successfully loaded {lang} from submodule bindings using {attr}"
)
NO_LANG_ATTR = (
"Module {module} imported but has no language attribute. Available: {available}"
)
SUBMODULE_LOAD_FAILED = "Failed to load {lang} from submodule bindings: {error}"
LIB_NOT_AVAILABLE = "Tree-sitter library for {lang} not available."
LOCALS_QUERY_FAILED = "Failed to create locals query for {lang}: {error}"
GRAMMAR_LOADED = "Successfully loaded {lang} grammar."
GRAMMAR_LOAD_FAILED = "Failed to load {lang} grammar: {error}"
PARSERS_LAZY_READY = "Parser registry ready; grammars load on first use."
# Ignore pattern logs
CGRIGNORE_LOADED = (
"Loaded {exclude_count} exclude and {unignore_count} unignore patterns from {path}"
)
CGRIGNORE_READ_FAILED = "Failed to read {path}: {error}"
CGR_INSTRUCTIONS_LOADED = "Loaded project instructions from {path} ({chars} chars)"
CGR_INSTRUCTIONS_READ_FAILED = "Failed to read project instructions {path}: {error}"
# File watcher logs
WATCHER_ACTIVE = "File watcher is now active."
WATCHER_DEBOUNCE_ACTIVE = (
"File watcher active with debouncing (debounce={debounce}s, max_wait={max_wait}s)"
)
CHANGE_DETECTED = "Change detected: {event_type} on {path}. Updating graph."
CHANGE_DEBOUNCING = (
"Change detected: {event_type} on {name} (debouncing for {debounce}s)"
)
DEBOUNCE_RESET = "Reset debounce timer for {path}"
DEBOUNCE_MAX_WAIT = "Max wait ({max_wait}s) exceeded for {path}, processing now"
DEBOUNCE_SCHEDULED = (
"Scheduled update for {path} in {debounce}s (max wait: {remaining}s remaining)"
)
DEBOUNCE_PROCESSING = "Processing debounced change: {path}"
DEBOUNCE_NO_EVENT = "No pending event for {path}, skipping"
DEBOUNCE_MAX_WAIT_ADJUSTED = (
"max_wait ({max_wait}s) is less than debounce ({debounce}s). "
"Setting max_wait to debounce value."
)
DELETION_QUERY = "Ran deletion query for path: {path}"
EDIT_TX_REJECTED = "Edit transaction {tx} rejected by verification: {why}"
EDIT_TX_APPLIED = "Edit transaction {tx} applied {count} file(s)"
EDIT_TX_RESTORE_FAILED = "Edit transaction could not restore {path}: {error}"
REINGEST_DONE = "Re-ingested {reparsed} file(s) (+{affected} dependent, -{removed} removed) in {ms} ms"
REINGEST_SKIPPED_IGNORED = "Re-ingest skipped path(s) the ignore rules exclude: {paths}"
TRUNCATED_SYMBOL_NAME = (
"{path}: the name {name!r} was extracted from bytes that are not valid "
"UTF-8; the grammar splits the token at the bad byte, so this symbol is "
"indexed under a truncated name and its callers will not resolve to it "
"(issue #1810)"
)
REINGEST_UNREADABLE = (
"Re-ingest could not read {path} after classifying it from disk "
"({error}); it is not reported as re-parsed"
)
TYPE_EDGES_EMITTED = "Emitted {count} RETURNS/ACCEPTS edges from type annotations"
GRAPH_UPDATED = "Graph updated successfully for change in: {name}"
WATCHER_REINGEST_REFUSED = "Re-ingest refused for {path}: {error}"
# A refusal and an abort leave the graph untouched; anything else may have
# deleted the affected subtrees without rebuilding them, so the retained
# updater describes a graph that no longer exists (issue #1681).
WATCHER_REINGEST_FAILED = (
"Re-ingest FAILED for {path}: {error}. The graph may be partial, so the "
"next change triggers a full re-index before any scoped update."
)
WATCHER_REBUILD_FAILED = (
"Re-index after a failed re-ingest also FAILED: {error}. The graph is still "
"partial; the next change will try again. Run 'cgr start --update-graph' if "
"this persists."
)
WATCHER_REBUILDING_AFTER_FAILURE = (
"Re-indexing the whole repository before this change, because the last "
"re-ingest failed part way through."
)
INITIAL_SCAN = "Performing initial full codebase scan..."
INITIAL_SCAN_DONE = "Initial scan complete. Starting real-time watcher."
WATCHING = "Watching for changes in: {path}"
LOGGER_CONFIGURED = "Logger configured for Real-Time Updater."
# Build logs
BUILD_BINARY = "Building binary: {name}"
BUILD_PROGRESS = "This may take a few minutes..."
BUILD_READY = "Binary is ready for distribution!"
BINARY_INFO = "Binary: {path}"
BINARY_SIZE = "Size: {size:.1f} MB"
BUILD_STDOUT = "STDOUT: {stdout}"
BUILD_STDERR = "STDERR: {stderr}"
# Graph summary logs
GRAPH_SUMMARY = "Graph Summary:"
GRAPH_TOTAL_NODES = " Total nodes: {count:,}"
GRAPH_TOTAL_RELS = " Total relationships: {count:,}"
GRAPH_EXPORTED_AT = " Exported at: {timestamp}"
GRAPH_NODE_TYPES = "Node Types:"
GRAPH_NODE_COUNT = " {label}: {count:,} nodes"
GRAPH_REL_TYPES = "Relationship Types:"
GRAPH_REL_COUNT = " {rel_type}: {count:,} relationships"
GRAPH_FOUND_NODES = "Found {count} '{label}' nodes."
GRAPH_EXAMPLE_NAMES = " Example {label} names:"
GRAPH_EXAMPLE_NAME = " - {name}"
GRAPH_MORE_NODES = " ... and {count} more"
GRAPH_ANALYZING = "Analyzing graph from: {path}"
GRAPH_ANALYSIS_COMPLETE = "Analysis complete!"
GRAPH_ANALYSIS_ERROR = "Error analyzing graph: {error}"
GRAPH_FILE_NOT_FOUND = "Graph file not found: {path}"
# FQN logs
FQN_RESOLVE_FAILED = "Failed to resolve FQN for node at {path}: {error}"
FQN_FIND_FAILED = "Failed to find function by FQN {fqn} in {path}: {error}"
FQN_EXTRACT_FAILED = "Failed to extract function FQNs from {path}: {error}"
# Source extraction logs
SOURCE_FILE_NOT_FOUND = "Source file not found: {path}"
SOURCE_INVALID_RANGE = "Invalid line range: {start}-{end}"
SOURCE_RANGE_EXCEEDS = "Line range {start}-{end} exceeds file length {length} in {path}"
SOURCE_EXTRACT_FAILED = "Failed to extract source from {path}: {error}"
SOURCE_AST_FAILED = "AST extraction failed for {name}: {error}"
# Memgraph logs
MG_CONNECTING = "Connecting to Memgraph at {host}:{port}..."
MG_CONNECTED = "Successfully connected to Memgraph."
MG_EXCEPTION = "An exception occurred: {error}. Attempting best-effort flush..."
MG_FLUSH_ERROR = "Failed to flush during cleanup: {error}"
MG_DISCONNECTED = "\nDisconnected from Memgraph."
MG_CYPHER_ERROR = "!!! Cypher Error: {error}"
MG_CYPHER_QUERY = " Query: {query}"
MG_CYPHER_PARAMS = " Params: {params}"
MG_BATCH_ERROR = "!!! Batch Cypher Error: {error}"
MG_BATCH_PARAMS_TRUNCATED = " Params (first 10 of {count}): {params}..."
MG_CLEANING_DB = "--- Cleaning database... ---"
MG_DB_CLEANED = "--- Database cleaned. ---"
MG_LIST_PROJECTS_FAILED = (
"Could not list existing projects before --clean: {error}. "
"Proceeding without the other-project confirmation."
)
MG_DELETING_PROJECT = "--- Deleting project: {project_name} ---"
MG_PROJECT_DELETED = "--- Project {project_name} deleted. ---"
MG_ENSURING_CONSTRAINTS = "Ensuring constraints..."
MG_CONSTRAINTS_DONE = "Constraints checked/created."
MG_LEGACY_PURGE = (
"Purged {count} Folder/File node(s) written by the superseded "
"relative-path key (issue #897); re-run with --update-graph for "
"affected projects to rebuild their containment."
)
MG_ENSURING_INDEXES = "Ensuring label-property indexes for MERGE performance..."
MG_INDEXES_DONE = "Indexes checked/created."
MG_NODE_BUFFER_FLUSH = (
"Node buffer reached batch size ({size}). Performing incremental flush."
)
MG_REL_BUFFER_FLUSH = (
"Relationship buffer reached batch size ({size}). Performing incremental flush."
)
MG_NO_CONSTRAINT = "No unique constraint defined for label '{label}'. Skipping flush."
MG_MISSING_PROP = (
"Skipping {label} node missing required '{key}' property (keys: {prop_keys})"
)
MG_NODES_FLUSHED = "Flushed {flushed} of {total} buffered nodes."
MG_NODES_SKIPPED = (
"Skipped {count} buffered nodes due to missing identifiers or constraints."
)
MG_CALLS_FAILED = "Failed to create {count} CALLS relationships - nodes may not exist"
MG_CALLS_SAMPLE = " Sample {index}: {from_label}.{from_val} -> {to_label}.{to_val}"
MG_RELS_FLUSHED = (
"Flushed {total} relationships ({success} successful, {failed} failed)."
)
MG_FLUSH_START = "--- Flushing all pending writes to database... ---"
MG_FLUSH_COMPLETE = "--- Flushing complete. ---"
MG_PARALLEL_FLUSH_NODES = (
"Parallel flushing {count} label groups with {workers} workers"
)
MG_PARALLEL_FLUSH_RELS = (
"Parallel flushing {count} relationship groups with {workers} workers"
)
MG_LABEL_FLUSH_ERROR = "Error flushing label group '{label}': {error}"
MG_REL_FLUSH_ERROR = "Error flushing relationship group '{pattern}': {error}"
MG_NO_CONN_NODES = "No database connection for label '{label}', skipping flush."
MG_NO_CONN_RELS = (
"No database connection for relationship group '{pattern}', skipping flush."
)
MG_FETCH_QUERY = "Executing fetch query: {query} with params: {params}"
MG_WRITE_QUERY = "Executing write query: {query} with params: {params}"
MG_EXPORTING = "Exporting graph data..."
MG_EXPORTED = "Exported {nodes} nodes and {rels} relationships"
# LLM/Cypher logs
CYPHER_GENERATING = " [CypherGenerator] Generating query for: '{query}'"
CYPHER_GENERATED = " [CypherGenerator] Generated Cypher: {query}"
CYPHER_ERROR = " [CypherGenerator] Error: {error}"
# Tool file logs
TOOL_FILE_READ = "[FileReader] Attempting to read file: {path}"
TOOL_FILE_READ_SUCCESS = "[FileReader] Successfully read text from {path}"
TOOL_FILE_BINARY = "[FileReader] {message}"
TOOL_FILE_WRITE = "[FileWriter] Creating file: {path}"
TOOL_FILE_WRITE_SUCCESS = "[FileWriter] Successfully wrote {chars} characters to {path}"
TOOL_FILE_EDIT = "[FileEditor] Attempting full file replacement: {path}"
TOOL_FILE_EDIT_SUCCESS = "[FileEditor] Successfully replaced entire file: {path}"
TOOL_FILE_EDIT_SURGICAL = (
"[FileEditor] Attempting surgical block replacement in: {path}"
)
TOOL_FILE_EDIT_SURGICAL_SUCCESS = (
"[FileEditor] Successfully applied surgical block replacement in: {path}"
)
TOOL_QUERY_RECEIVED = "[Tool:QueryGraph] Received NL query: '{query}'"
TOOL_QUERY_ERROR = "[Tool:QueryGraph] Error during query execution: {error}"
TOOL_QUERY_TIMEOUT = (
"[Tool:QueryGraph] Query exceeded {timeout:.1f}s and was cancelled: {query}"
)
QUERY_RESULTS_TRUNCATED = (
"[Tool:QueryGraph] Results truncated: showing {kept} of {total} rows "
"({tokens} tokens, limit {max_tokens})"
)
TOOL_SHELL_EXEC = "Executing shell command: {cmd}"
TOOL_SHELL_RETURN = "Return code: {code}"
TOOL_SHELL_STDOUT = "Stdout: {stdout}"
TOOL_SHELL_STDERR = "Stderr: {stderr}"
TOOL_SHELL_KILLED = "Process killed due to timeout."
TOOL_SHELL_ALREADY_TERMINATED = (
"Process already terminated when timeout kill was attempted."
)
TOOL_SHELL_ERROR = "An error occurred while executing command: {error}"
# Shell timing log
SHELL_TIMING = "'{func}' executed in {time:.2f}ms"
# Generic function timing log
FUNC_TIMING = "{func} completed in {time:.2f}ms"
# File editor logs
EDITOR_NO_PARSER = "No parser available for {path}"
EDITOR_NO_LANG_CONFIG = "No language config found for extension {ext}"
EDITOR_FUNC_NOT_FOUND_AT_LINE = "No function '{name}' found at line {line}"
EDITOR_FUNC_NOT_FOUND_QN = "No function found with qualified name '{name}'"
EDITOR_AMBIGUOUS = (
"Ambiguous function name '{name}' in {path}. "
"Found {count} matches: {details}. "
"Using first match. Consider using qualified name (e.g., 'ClassName.{name}') "
"or specify line number for precise targeting."
)
EDITOR_FUNC_NOT_IN_FILE = "Function '{name}' not found in {path}."
EDITOR_PATCHES_NOT_CLEAN = "Patches for function '{name}' did not apply cleanly."
EDITOR_NO_CHANGES = "No changes detected after replacement."
EDITOR_REPLACE_SUCCESS = "Successfully replaced function '{name}' in {path}."
EDITOR_PATCH_FAILED = "Some patches failed to apply cleanly to {path}"
EDITOR_PATCH_SUCCESS = "Successfully applied patch to {path}"
EDITOR_PATCH_ERROR = "Error applying patch to {path}: {error}"
EDITOR_FILE_NOT_FOUND = "File not found: {path}"
EDITOR_BLOCK_NOT_FOUND = "Target block not found in {path}"
EDITOR_LOOKING_FOR = "Looking for: {block}"
EDITOR_MULTIPLE_OCCURRENCES = (
"Multiple occurrences of target block found. Only replacing first occurrence."
)
EDITOR_NO_CHANGES_IDENTICAL = (
"No changes detected - target and replacement are identical"
)
EDITOR_SURGICAL_FAILED = "Surgical patches failed to apply cleanly"
EDITOR_SURGICAL_ERROR = "Error during surgical block replacement: {error}"
# Directory lister logs
DIR_LISTING = "Listing contents of directory: {path}"
DIR_LIST_ERROR = "Error listing directory {path}: {error}"
# Semantic search logs
SEMANTIC_NO_MATCH = "No semantic matches found for query: {query}"
SEMANTIC_FOUND = "Found {count} semantic matches for: {query}"
SEMANTIC_FAILED = "Semantic search failed for query '{query}': {error}"
SEMANTIC_NODE_NOT_FOUND = "No node found with ID: {id}"
SEMANTIC_INVALID_LOCATION = "Missing or invalid source location info for node {id}"
SEMANTIC_SOURCE_FAILED = "Failed to get source code for node {id}: {error}"
SEMANTIC_TOOL_SEARCH = "[Tool:SemanticSearch] Searching for: '{query}'"
SEMANTIC_TOOL_SOURCE = "[Tool:GetFunctionSource] Retrieving source for node ID: {id}"
# Code retrieval logs
CODE_RETRIEVER_INIT = "CodeRetriever initialized with root: {root}"
CODE_RETRIEVER_SEARCH = "[CodeRetriever] Searching for: {name}"
CODE_RETRIEVER_ERROR = "[CodeRetriever] Error: {error}"
CODE_TOOL_RETRIEVE = "[Tool:GetCode] Retrieving code for: {name}"
# Tool init logs
FILE_EDITOR_INIT = "FileEditor initialized with root: {root}"
FILE_READER_INIT = "FileReader initialized with root: {root}"
SHELL_COMMANDER_INIT = "ShellCommander initialized with root: {root}"
# Tool error logs
FILE_EDITOR_WARN = "[FileEditor] {msg}"
FILE_EDITOR_ERR = "[FileEditor] {msg}"
FILE_EDITOR_ERR_EDIT = "[FileEditor] Error editing file {path}: {error}"
FILE_READER_ERR = "Error reading file {path}: {error}"
# File writer logs
FILE_WRITER_INIT = "FileWriter initialized with root: {root}"
FILE_WRITER_CREATE = "[FileWriter] Creating file: {path}"
FILE_WRITER_SUCCESS = "[FileWriter] Successfully wrote {chars} characters to {path}"
# Error logs (used with logger.error/warning)
UNEXPECTED = "An unexpected error occurred: {error}"
EXPORT_ERROR = "Export error: {error}"
STATS_ERROR = "Stats error: {error}"
DEADCODE_SCANNING = "Scanning project '{project_name}' for dead code"
DEADCODE_ERROR = "Dead code scan error: {error}"
DUPLICATES_SCANNING = "Scanning project '{project_name}' for duplicated code"
DUPLICATES_ERROR = "Duplicate scan error: {error}"
DUPLICATES_GROUPS_TRUNCATED = (
"Similar-group enumeration stopped at the cap of {cap} groups; the report "
"is truncated. Raise --threshold or --min-size to narrow the scan."
)
DUPLICATES_PAIRS_TRUNCATED = (
"Candidate-pair generation stopped at the budget of {cap} pairs; the "
"report is truncated. Raise --threshold or --min-size to narrow the scan."
)
INDEXING_FAILED = "Indexing failed"
PATH_NOT_IN_QUESTION = (
"Could not locate path token in user message for attachment: {path}"
)
FILE_OUTSIDE_ROOT = "Security risk: Attempted to {action} file outside of project root."
# Call processor logs
CALL_PROCESSING_FILE = "Processing calls in cached AST for: {path}"
CALL_PROCESSING_FAILED = "Failed to process calls in {path}: {error}"
# Re-reading a file evicted from the bounded AST cache is tolerate-and-continue,
# not a pass failure, and must not borrow the message above: the test harness
# fails a run on that one (issue #1070).
AST_RELOAD_FAILED = "Could not re-read {path} for call attribution: {error}"
CALL_FOUND_NODES = "Found {count} call nodes in {language} for {caller}"
CALL_SKIP_CLASS = "Skipping CALLS edge from {caller} to {call_name} (callee is Class node: {callee_qn})"
CALL_FOUND = (
"Found call from {caller} to {call_name} (resolved as {callee_type}:{callee_qn})"
)
CALL_NESTED_FOUND = "Found nested call from {caller} to {call_name} (resolved as {callee_type}:{callee_qn})"
CALL_DIRECT_IMPORT = "Direct import resolved: {call_name} -> {qn}"
CALL_TYPE_INFERRED = "Type-inferred object method resolved: {call_name} -> {method_qn} (via {obj}:{var_type})"
CALL_TYPE_INFERRED_INHERITED = (
"Type-inferred inherited object method resolved: {call_name} -> {method_qn} "
"(via {obj}:{var_type})"
)
CALL_IMPORT_STATIC = "Import-resolved static call: {call_name} -> {method_qn}"
CALL_OBJECT_METHOD = "Object method resolved: {call_name} -> {method_qn}"
CALL_INSTANCE_ATTR = (
"Instance-resolved self-attribute call: {call_name} -> {method_qn} "
"(via {attr_ref}:{var_type})"
)
CALL_INSTANCE_ATTR_INHERITED = (
"Instance-resolved inherited self-attribute call: {call_name} -> {method_qn} "
"(via {attr_ref}:{var_type})"
)
CALL_IMPORT_QUALIFIED = "Import-resolved qualified call: {call_name} -> {method_qn}"
CALL_INSTANCE_QUALIFIED = "Instance-resolved qualified call: {call_name} -> {method_qn} (via {class_name}:{var_type})"
CALL_INSTANCE_INHERITED = "Instance-resolved inherited call: {call_name} -> {method_qn} (via {class_name}:{var_type})"
CALL_WILDCARD = "Wildcard-resolved call: {call_name} -> {qn}"
CALL_SAME_MODULE = "Same-module resolution: {call_name} -> {qn}"
CALL_TRIE_FALLBACK = "Trie-based fallback resolution: {call_name} -> {qn}"
CALL_PACKAGE_MEMBER = "Package-member resolved call: {member} -> {qn}"
CALL_UNRESOLVED = "Could not resolve call: {call_name}"
CALL_CHAINED = (
"Resolved chained call: {call_name} -> {method_qn} (via {obj_expr}:{obj_type})"
)
CALL_CHAINED_INHERITED = "Resolved chained inherited call: {call_name} -> {method_qn} (via {obj_expr}:{obj_type})"
CALL_SUPER_NO_CONTEXT = "No class context provided for super() call: {call_name}"
CALL_SUPER_NO_INHERITANCE = "No inheritance info for class {class_qn}"
CALL_SUPER_NO_PARENTS = "No parent classes found for {class_qn}"
CALL_SUPER_RESOLVED = "Resolved super() call: {call_name} -> {method_qn}"
CALL_SUPER_UNRESOLVED = (
"Could not resolve super() call: {call_name} in parents of {class_qn}"
)
CALL_JAVA_RESOLVED = "Java method call resolved: {call_text} -> {method_qn}"
CALL_UNEXPECTED_PARENT = (
"Unexpected parent type for node {node}: {parent_type}. Skipping."
)
# Dependency parser logs
DEP_PARSE_ERROR_PYPROJECT = "Error parsing pyproject.toml {path}: {error}"
DEP_PARSE_ERROR_REQUIREMENTS = "Error parsing requirements.txt {path}: {error}"
DEP_PARSE_ERROR_PACKAGE_JSON = "Error parsing package.json {path}: {error}"
DEP_PARSE_ERROR_CARGO = "Error parsing Cargo.toml {path}: {error}"
DEP_PARSE_ERROR_GOMOD = "Error parsing go.mod {path}: {error}"
DEP_PARSE_ERROR_GEMFILE = "Error parsing Gemfile {path}: {error}"
DEP_PARSE_ERROR_COMPOSER = "Error parsing composer.json {path}: {error}"
DEP_PARSE_ERROR_CSPROJ = "Error parsing .csproj {path}: {error}"
DEP_PARSE_ERROR_PUBSPEC = "Error parsing pubspec.yaml {path}: {error}"
# Import processor logs
IMP_TOOL_NOT_AVAILABLE = "External tool '{tool}' not available for stdlib introspection"
IMP_CACHE_LOADED = "Loaded stdlib cache from {path}"
IMP_CACHE_LOAD_ERROR = "Could not load stdlib cache: {error}"
IMP_CACHE_SAVED = "Saved stdlib cache to {path}"
IMP_CACHE_SAVE_ERROR = "Could not save stdlib cache: {error}"
IMP_CACHE_CLEARED = "Cleared stdlib cache from disk"
IMP_CACHE_CLEAR_ERROR = "Could not clear stdlib cache from disk: {error}"
IMP_PARSED_COUNT = "Parsed {count} imports in {module}"
IMP_CREATED_RELATIONSHIP = (
" Created IMPORTS relationship: {from_module} -> {to_module} (from {full_name})"
)
IMP_PARSE_FAILED = "Failed to parse imports in {module}: {error}"
IMP_DROPPED_PHANTOM_TARGET = (
" Dropped IMPORTS edge to unverifiable internal target: "
"{from_module} -> {to_module}"
)
IMP_IMPORT = " Import: {local} -> {full}"
IMP_ALIASED_IMPORT = " Aliased import: {alias} -> {full}"
IMP_WILDCARD_IMPORT = " Wildcard import: * -> {module}"
IMP_FROM_IMPORT = " From import: {local} -> {full}"
IMP_JS_DEFAULT = "JS default import: {name} -> {module}.default"
IMP_JS_NAMED = "JS named import: {local} -> {module}.{name}"
IMP_JS_NAMESPACE = "JS namespace import: {name} -> {module}"
IMP_JS_REQUIRE = "JS require: {var} -> {module}"
IMP_JS_REEXPORT = "JS re-export: {exported} -> {module}.{original}"
IMP_JS_NAMESPACE_REEXPORT = "JS namespace re-export: * -> {module}"
IMP_JAVA_WILDCARD = "Java wildcard import: {path}.*"
IMP_JAVA_STATIC = "Java static import: {name} -> {path}"
IMP_JAVA_IMPORT = "Java import: {name} -> {path}"
IMP_RUST = "Rust import: {name} -> {path}"
IMP_CSHARP = "C# using: {name} -> {path}"
IMP_GO = "Go import: {package} -> {path}"
IMP_GO_MODULE_PATH = "Go module path: {module} -> {path}"
IMP_JS_WORKSPACE_PACKAGE = "JS workspace package: {package} -> {path}"
CONTRACT_OPERATIONS = "Contract operations: {count} declared, {created} artefact links"
CONTRACT_YAML_UNAVAILABLE = (
"PyYAML is not installed; skipping YAML contract spec {path}"
)
IMP_CPP_INCLUDE = "C++ include: {local} -> {full} (system: {system})"
IMP_CPP_MODULE = "C++20 module import: {local} -> {full}"
IMP_CPP_MODULE_IMPL = "C++20 module implementation: {name}"
IMP_CPP_MODULE_IFACE = "C++20 module interface: {name}"
IMP_CPP_PARTITION = "C++20 module partition import: {partition} -> {full}"
IMP_GENERIC = "Generic import parsing for {language}: {node_type}"
IMP_PY_SOURCE_ROOT = "Python source root: {name} -> {path}"
# Structure processor logs
STRUCT_IDENTIFIED_PACKAGE = " Identified Package: {package_qn}"
STRUCT_IDENTIFIED_FOLDER = " Identified Folder: '{relative_root}'"
# Class ingest logs
CLASS_CPP_MODULE_INTERFACE = " Found C++ Module Interface: {qn}"
CLASS_CPP_MODULE_IMPL = " Found C++ Module Implementation: {qn}"
CLASS_FOUND_INTERFACE = " Found Interface: {name} (qn: {qn})"
CLASS_FOUND_ENUM = " Found Enum: {name} (qn: {qn})"
CLASS_FOUND_TYPE = " Found Type: {name} (qn: {qn})"
CLASS_FOUND_STRUCT = " Found Struct: {name} (qn: {qn})"
CLASS_FOUND_UNION = " Found Union: {name} (qn: {qn})"
CLASS_FOUND_TEMPLATE = " Found Template {node_type}: {name} (qn: {qn})"
CLASS_FOUND_EXPORTED_STRUCT = " Found Exported Struct: {name} (qn: {qn})"
CLASS_FOUND_EXPORTED_UNION = " Found Exported Union: {name} (qn: {qn})"
CLASS_FOUND_EXPORTED_TEMPLATE = " Found Exported Template Class: {name} (qn: {qn})"
CLASS_FOUND_EXPORTED_CLASS = " Found Exported Class: {name} (qn: {qn})"
CLASS_FOUND_CLASS = " Found Class: {name} (qn: {qn})"
CLASS_FOUND_INLINE_MODULE = " Found Inline Module: {name} (qn: {qn})"
CLASS_PASS_4 = "--- Pass 4: Processing Method Override Relationships ---"
CLASS_METHOD_OVERRIDE = "Method override: {method_qn} OVERRIDES {parent_method_qn}"
CLASS_CPP_INHERITANCE = "Found C++ inheritance: {parent_name} -> {parent_qn}"
# Java type inference logs
JAVA_VAR_TYPE_MAP_BUILT = "Built Java variable type map with {count} entries"
JAVA_VAR_TYPE_MAP_FAILED = "Failed to build Java variable type map: {error}"
JAVA_PARAM = "Parameter: {name} -> {type}"
JAVA_VARARGS_PARAM = "Varargs parameter: {name} -> {type}"
JAVA_LOCAL_VAR_INFERRED = "Local variable (inferred): {name} -> {type}"
JAVA_LOCAL_VAR_DECLARED = "Local variable (declared): {name} -> {type}"
JAVA_CLASS_FIELD = "Class field: {name} -> {type}"
JAVA_ASSIGNMENT = "Assignment: {name} -> {type}"
JAVA_NO_METHOD_NAME = "No method name found in call node"
JAVA_RESOLVING_CALL = "Resolving Java method call: method={method}, object={object}"
JAVA_RESOLVING_STATIC = "Resolving static/local method: {method}"
JAVA_FOUND_STATIC = "Found static/local method: {result}"
JAVA_STATIC_NOT_FOUND = "Static/local method not found: {method}"
JAVA_RESOLVING_OBJ_TYPE = "Resolving object type for: {object}"
JAVA_OBJ_TYPE_UNKNOWN = "Could not determine type of object: {object}"
JAVA_OBJ_TYPE_RESOLVED = "Object type resolved to: {type}"
JAVA_FOUND_INSTANCE = "Found instance method: {result}"
JAVA_INSTANCE_NOT_FOUND = "Instance method not found: {type}.{method}"
JAVA_ENHANCED_FOR_VAR = "Enhanced for loop variable: {name} -> {type}"
JAVA_ENHANCED_FOR_VAR_ALT = "Enhanced for loop variable (alt): {name} -> {type}"
# JS type inference logs
JS_VAR_DECLARATOR_FOUND = "Found variable declarator: {var_name} in {module_qn}"
JS_VAR_INFERRED = "Inferred JS variable: {var_name} -> {var_type}"
JS_VAR_INFER_FAILED = "Could not infer type for variable: {var_name}"
JS_VAR_TYPE_MAP_BUILT = "Built JS variable type map with {count} variables (found {declarator_count} declarators total)"
JS_INFER_VALUE_NODE = "Inferring type from value node type: {node_type}"
JS_CALL_EXPR_FUNC_NODE = "Call expression func_node type: {func_type}"
JS_EXTRACTED_METHOD_CALL = "Extracted method call: {method_call}"
JS_TYPE_INFERRED = "JS type inference: {method_call}() returns {inferred_type}"
JS_RETURN_TYPE_INFER_FAILED = "Could not infer return type for {method_call}()"
JS_NO_PATTERN_MATCHED = (
"No type inference pattern matched for value node type: {node_type}"
)
JS_METHOD_CALL_INVALID = "Method call {method_call} doesn't have 2 parts"
JS_CLASS_RESOLVE_FAILED = (
"Could not resolve class name {class_name} in module {module_qn}"
)
JS_CLASS_RESOLVED = "Resolved {class_name} to {class_qn}"
JS_LOOKING_FOR_METHOD = "Looking for method {method_qn} in function registry"
JS_METHOD_AST_NOT_FOUND = "Could not find AST node for method {method_qn}"
JS_RETURN_ANALYZED = (
"Analyzed return statements for {method_qn}, got type: {return_type}"
)
JS_METHOD_RETURN_ERROR = (
"Error inferring JS method return type for {method_call}: {error}"
)
# Lua type inference logs
LUA_VAR_TYPE_MAP_BUILT = "Built Lua variable type map with {count} variables"
LUA_VAR_INFERRED = "Inferred Lua variable: {var_name} -> {var_type}"
LUA_TYPE_INFERENCE_RETURN = (
"Lua type inference: {class_name}:{method_name}() returns {class_qn}"
)
# Python type inference logs
PY_BUILD_VAR_MAP_FAILED = "Failed to build local variable type map: {error}"
PY_PARAM_TYPE_INFERRED = "Inferred parameter type: {param} -> {type}"
PY_TYPE_INFER_ATTEMPT = (
"Attempting to infer type for parameter '{param}' in module '{module}'"
)
PY_AVAILABLE_CLASSES = "Available classes in scope: {classes}"
PY_BEST_MATCH = "Best match for '{param}' is '{match}' with score {score}"
PY_INSTANCE_VAR_INFERRED = "Inferred instance variable: {attr} -> {type}"
PY_LOOP_VAR_INFERRED = "Inferred loop variable type: {var} -> {type}"
PY_TYPE_SIMPLE = "Inferred type (simple): {var} -> {type}"
PY_TYPE_COMPLEX = "Inferred type (complex): {var} -> {type}"
PY_TYPE_INFERRED = "Inferred type: {var} -> {type}"
PY_RECURSION_GUARD = "Recursion guard (method call): skipping {method}"
PY_RECURSION_GUARD_QN = "Recursion guard: skipping {method_qn}"
PY_RESOLVED_METHOD = "Resolved {class_name}.{method_name} to {method_qn}"
PY_INFER_ATTR_FAILED = "Failed to analyze instance variables for {attr}: {error}"
PY_INFER_RETURN_FAILED = "Failed to infer return type for {method}: {error}"
PY_VAR_FROM_CONTEXT = "Found variable type from method context: {var} -> {type}"
PY_VAR_CANNOT_INFER = "Cannot infer type for variable reference: {var}"
PY_NO_CONTAINING_CLASS = "No containing class found for method"
PY_NO_INIT_METHOD = "No __init__ method found in class"
PY_FOUND_INIT = "Found __init__ method, analyzing self assignments..."
PY_FOUND_CLASS_AT_LEVEL = "Found class_definition at level {level}"
PY_SEARCHING_LEVEL = "Level {level}: node type = {node_type}"
PY_NO_CLASS_IN_HIERARCHY = "No class_definition found in parent hierarchy"
PY_SEARCHING_INIT = "Searching for __init__ method in class with {count} children"
PY_CHILD_TYPE = " Child type: {type}"
PY_NO_CLASS_BODY = " No class body (block) found"
PY_SEARCHING_BODY = " Searching in class body with {count} children"
PY_BODY_CHILD = " Body child type: {type}"
PY_FOUND_METHOD = " Found method: {name}"
PY_FOUND_INIT_METHOD = " Found __init__ method!"
PY_INIT_NOT_FOUND = " No __init__ method found in class body"
# JS/TS ingest logs
JS_PROTOTYPE_INHERITANCE = "Prototype inheritance: {child_qn} INHERITS {parent_qn}"
JS_PROTOTYPE_INHERITANCE_FAILED = "Failed to detect prototype inheritance: {error}"
JS_PROTOTYPE_METHOD_FOUND = " Found Prototype Method: {method_name} (qn: {method_qn})"
JS_PROTOTYPE_METHOD_DEFINES = "Prototype method: {constructor_qn} DEFINES {method_qn}"
JS_PROTOTYPE_METHODS_FAILED = "Failed to detect prototype methods: {error}"
JS_OBJECT_METHOD_FOUND = " Found Object Method: {method_name} (qn: {method_qn})"
JS_OBJECT_METHODS_PROCESS_FAILED = "Failed to process object literal methods: {error}"
JS_OBJECT_METHODS_DETECT_FAILED = "Failed to detect object literal methods: {error}"
JS_OBJECT_ARROW_FOUND = (
" Found Object Arrow Function: {function_name} (qn: {function_qn})"
)
JS_ASSIGNMENT_ARROW_FOUND = (
" Found Assignment Arrow Function: {function_name} (qn: {function_qn})"
)
JS_ASSIGNMENT_FUNC_EXPR_FOUND = (
" Found Assignment Function Expression: {function_name} (qn: {function_qn})"
)
JS_ASSIGNMENT_ARROW_QUERY_FAILED = (
"Failed to process assignment arrow functions query: {error}"
)
JS_ASSIGNMENT_ARROW_DETECT_FAILED = (
"Failed to detect assignment arrow functions: {error}"
)
# JS/TS module system logs
JS_COMMONJS_DESTRUCTURE_FAILED = (
"Failed to process CommonJS destructuring pattern: {error}"
)
JS_MISSING_IMPORT_PATTERNS_FAILED = "Failed to detect missing import patterns: {error}"
JS_COMMONJS_VAR_DECLARATOR_FAILED = (
"Failed to process variable declarator for CommonJS: {error}"
)
JS_COMMONJS_IMPORT_FAILED = "Failed to process CommonJS import {imported_name}: {error}"
JS_MISSING_IMPORT_PATTERN = (
"Missing pattern: {module_qn} IMPORTS {imported_name} from {resolved_source_module}"
)
JS_COMMONJS_EXPORTS_QUERY_FAILED = "Failed to process CommonJS exports query: {error}"
JS_COMMONJS_EXPORTS_DETECT_FAILED = "Failed to detect CommonJS exports: {error}"
JS_ES6_EXPORTS_QUERY_FAILED = "Failed to process ES6 exports query: {error}"
JS_ES6_EXPORTS_DETECT_FAILED = "Failed to detect ES6 exports: {error}"
# MCP tool logs
MCP_INDEXING_REPO = "[MCP] Indexing repository at: {path}"
MCP_CLEARING_DB = "[MCP] Clearing existing database to avoid conflicts..."
MCP_DB_CLEARED = "[MCP] Database cleared. Starting fresh indexing..."
MCP_CLEARING_PROJECT = "[MCP] Clearing existing data for project '{project_name}'..."
MCP_ERROR_INDEXING = "[MCP] Error indexing repository: {error}"
MCP_LISTING_PROJECTS = "[MCP] Listing all projects..."
MCP_ERROR_LIST_PROJECTS = "[MCP] Error listing projects: {error}"
MCP_DELETING_PROJECT = "[MCP] Deleting project: {project_name}"
MCP_ERROR_DELETE_PROJECT = "[MCP] Error deleting project: {error}"
MCP_WIPING_DATABASE = "[MCP] Wiping entire database!"
MCP_ERROR_WIPE = "[MCP] Error wiping database: {error}"
MCP_QUERY_CODE_GRAPH = "[MCP] query_code_graph: {query}"
MCP_QUERY_RESULTS = "[MCP] Query returned {count} results"
MCP_ERROR_QUERY = "[MCP] Error querying code graph: {error}"
MCP_GET_CODE_SNIPPET = "[MCP] get_code_snippet: {name}"
MCP_ERROR_CODE_SNIPPET = "[MCP] Error retrieving code snippet: {error}"
MCP_SURGICAL_REPLACE = "[MCP] surgical_replace_code in {path}"
MCP_ERROR_REPLACE = "[MCP] Error replacing code: {error}"
MCP_READ_FILE = "[MCP] read_file: {path} (offset={offset}, limit={limit})"
MCP_ERROR_READ = "[MCP] Error reading file: {error}"
MCP_WRITE_FILE = "[MCP] write_file: {path}"
MCP_ERROR_WRITE = "[MCP] Error writing file: {error}"
MCP_LIST_DIR = "[MCP] list_directory: {path}"
MCP_ERROR_LIST_DIR = "[MCP] Error listing directory: {error}"
MCP_SEMANTIC_NOT_AVAILABLE = (
"[MCP] Semantic search not available. Install with: uv sync --extra semantic"
)
MCP_UPDATING_REPO = "[MCP] Updating repository at: {path}"
MCP_ERROR_UPDATING = "[MCP] Error updating repository: {error}"
MCP_REINGESTING = "[MCP] Re-ingesting {count} file(s)"
MCP_DELTA_FAILED = "[MCP] Structural delta failed: {error}"
MCP_ERROR_REINGEST = "[MCP] Error re-ingesting files: {error}"
MCP_GRAPH_QUERY_ERROR = "[MCP] Error running {tool}: {error}"
MCP_SEMANTIC_SEARCH = "[MCP] semantic_search: {query}"
MCP_ASK_AGENT = "[MCP] ask_agent: {question}"
MCP_ASK_AGENT_ERROR = "[MCP] Error running ask_agent: {error}"
# MCP server logs
MCP_SERVER_INFERRED_ROOT = "[GraphCode MCP] Using inferred project root: {path}"
MCP_SERVER_NO_ROOT = (
"[GraphCode MCP] No project root configured, using current directory: {path}"
)
MCP_SERVER_ROOT_RESOLVED = "[GraphCode MCP] Project root resolved to: {path}"
MCP_SERVER_USING_ROOT = "[GraphCode MCP] Using project root: {path}"
MCP_SERVER_CONFIG_ERROR = "[GraphCode MCP] Configuration error: {error}"
MCP_SERVER_INIT_SERVICES = "[GraphCode MCP] Initializing services..."
MCP_SERVER_INIT_SUCCESS = "[GraphCode MCP] Services initialized successfully"
MCP_SERVER_CALLING_TOOL = "[GraphCode MCP] Calling tool: {name}"
MCP_SERVER_UNKNOWN_TOOL = "[GraphCode MCP] Unknown tool: {name}"
MCP_SERVER_TOOL_ERROR = "[GraphCode MCP] Error executing tool '{name}': {error}"
MCP_SERVER_STARTING = "[GraphCode MCP] Starting MCP server..."
MCP_SERVER_CREATED = "[GraphCode MCP] Server created, starting stdio transport..."
MCP_SERVER_CONNECTED = "[GraphCode MCP] Connected to Memgraph at {host}:{port}"
MCP_SERVER_FATAL_ERROR = "[GraphCode MCP] Fatal error: {error}"
# The incomplete-run marker (issue #1679). Both are warnings rather than
# errors: the run itself is unaffected, but the cross-process guard silently
# degrades to the in-process flag, which an operator can only notice here.
MCP_INCOMPLETE_MARKER_STUCK_AFTER_ABORT = (
"[GraphCode MCP] A run for {project} stopped before writing anything to "
"the graph, but its incomplete-run marker could not be cleared. The marker "
"records that nothing was written, so the next scoped reingest or process "
"clears it once the graph store accepts writes again."
)
MCP_INCOMPLETE_MARKER_FAILED = (
"[GraphCode MCP] Could not persist the incomplete-run marker for "
"{project} (incomplete={incomplete}): {error}. A crash from here would "
"leave the next process unable to tell the update did not finish."
)
MCP_INCOMPLETE_MARKER_UNREADABLE = (
"[GraphCode MCP] Could not read the incomplete-run marker for {project}: "
"{error}. Refusing scoped reingest until it can be read; update_repository "
"recovers either way."
)
MCP_INCOMPLETE_MARKER_RECOVERED = (
"[GraphCode MCP] The incomplete-run marker for {project} was left by a run "
"that stopped before its first graph write, so the graph is as that run "
"found it; cleared it and continuing."
)
MCP_SERVER_SHUTDOWN = "[GraphCode MCP] Shutting down server..."
MCP_HTTP_SERVER_STARTING = "[GraphCode MCP] Starting HTTP server on {host}:{port}..."
MCP_HTTP_EXPOSURE_REFUSED = (
"Refusing to bind the HTTP MCP server to {host}: the endpoint has no "
"authentication unless MCP_HTTP_AUTH_TOKEN is set. Configure a token to "
"expose it beyond loopback, or bind to 127.0.0.1."
)
MCP_HTTP_SERVER_READY = (
"[GraphCode MCP] HTTP server ready. MCP endpoint: http://{host}:{port}/mcp"
)
# Incremental update logs
HASH_CACHE_LOADED = "Loaded hash cache with {count} entries from {path}"
HASH_CACHE_LOAD_FAILED = "Failed to load hash cache from {path}: {error}"
HASH_CACHE_SAVED = "Saved hash cache with {count} entries to {path}"
# `errno` and `strerror` as well as the message: a publish failure names a
# path and a bare message otherwise, which is not enough to tell WHICH
# syscall refused on a platform the developer cannot reproduce on. A bare
# `OSError("...")` carries errno None, so the value also distinguishes a
# real syscall failure from one this module raised itself.
HASH_CACHE_SAVE_FAILED = (
"Failed to save hash cache to {path}: {error} "
"(errno={errno} strerror={strerror} failing_path={failing_path})"
)
# A scoped re-ingest backdates the hash cache to the instant it observed
# (`_reingest_update_hashes`); these name that step, distinct from the
# atomic publish's own temporary-file cleanup below.
REINGEST_CACHE_STAMP_FAILED = (
"Could not backdate {path} to the observed instant ({error}); removing it so "
"the next run rebuilds rather than trusting a stamp that can hide edits"
)
REINGEST_CACHE_STAMP_CLEANUP_FAILED = (
"Could not remove {path} after its backdate failed ({error}); it keeps a write "
"time later than any edit made during this run, so the next run may skip that "
"file. Delete it by hand, or re-run once the path is writable"
)
CACHE_STAMP_CLEANUP_FAILED = (
"Could not remove the temporary cache file {path} ({error}); it is inert, since "
"nothing reads a .tmp path, but it can be deleted by hand"
)
PERIODIC_FLUSH = "Periodic flush after {count} files processed"
INCREMENTAL_SKIPPED = "Skipped {count} unchanged files"
INCREMENTAL_CHANGED = "Re-indexing {count} changed files"
INCREMENTAL_AFFECTED_CALLERS = (
"Re-parsing {count} dependent caller file(s) of re-indexed targets"
)
INCREMENTAL_DELETED = "Removed state for {count} deleted files"
REINGEST_MODULE_PATHS_UNKNOWN = (
"Re-ingest aborted: the graph's module paths could not be read, so the "
"module qns already taken are unknown"
)
REINGEST_CONTAINER_KIND_UNKNOWN = (
"Re-ingest aborted: a directory's recorded container kind could not be "
"read, so whether it is new or has diverged from disk is unknown"
)
INCREMENTAL_FILE_FAILED = (
"Failed to index {path}; the remaining changed files are still rebuilt "
"before the error is raised: {error}"
)
INCREMENTAL_FORCE = "Force mode enabled, bypassing hash cache"
HASH_CACHE_ORPHANED = (
"Hash cache exists but project '{project}' has no modules in the graph; "
"the database was likely wiped since the last sync. Discarding the cache "
"and rebuilding fully."
)
HASH_CACHE_DISCARD_FAILED = (
"Could not discard the orphaned cache file {path} ({error}); this run "
"ignores it and rebuilds fully, so nothing is lost, but the stale file is "
"still on disk and EVERY later run pays the same full rebuild until it "
"goes. Delete it by hand, or re-run once the path is writable"
)
PARSER_FINGERPRINT_SAVE_FAILED = "Failed to save parser fingerprint to {path}: {error}"
PARSER_FINGERPRINT_MISMATCH = (
"A parser input changed since this graph was built: parser code, a grammar "
"or toolchain version, a frontend mode, or the capture selection. Every "
"eligible file of this repository (excluded and ignored ones aside) is "
"re-parsed on this run, so what the new inputs "
"emit is written for files not touched since the last sync too, and the "
"'.cgr-hash-cache.json', '.cgr-dir-mtimes.json' and "
"'.cgr-parser-fingerprint' stamps are rewritten when it completes; other "
"projects in a shared database are untouched. That is a partial rebuild, "
"not a clean one: it adds what the new inputs emit, but a re-parse only "
"removes what the re-parsed module DEFINES, so nodes and edges the old "
"inputs left outside that subtree survive it. Measured on one repository, "
"12 of 82 stale edges outlived a cache deletion because their other end "
"was an inferred or external node the re-parse never touched (issue "
"#1649), and a partial result looks exactly like the remedy working. When "
"names or node kinds changed, or when superseded EDGES must go rather "
"than new ones merely being added, the only reliable rebuild is to index "
"the source as a NEW project -- 'cgr start --repo-path <path> "