codecortex 0.26.0__py3-none-any.whl → 0.28.0__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codecortex
3
- Version: 0.26.0
3
+ Version: 0.28.0
4
4
  Summary: Local-first, MCP-native code-intelligence server — graph, LSP, and semantic search behind one safe code.query tool for coding agents.
5
5
  Author: Shammai Hamilton
6
6
  License-Expression: MIT
@@ -540,7 +540,7 @@ Register codeintel as an MCP server (`codeintel install`) and the agent gets fou
540
540
  | MCP tool | HTTP equivalent | Purpose |
541
541
  |---|---|---|
542
542
  | `code.query` | `POST /code/query` | The main call — search, trace, understand (the `op` table above) |
543
- | `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
543
+ | `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `indexed` (true when graph or semantic has indexed this repo; `indexed_by` names which) and `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
544
544
  | `code.doctor` | `POST /code/doctor` | Per-engine health + repo index status, with a fix for each gap |
545
545
  | `code.map` | — | Generate/refresh `CODE_INTEL.md`, a static orientation file for hosts without MCP |
546
546
 
@@ -1,5 +1,5 @@
1
- codecortex-0.26.0.dist-info/licenses/LICENSE,sha256=DIRvhlH8EulEUOYQxKDFFiimJrlVT5-kCKxQIgi2m7c,1073
2
- codeintel/__init__.py,sha256=S1dNBNSmHJkAHkq1vL1Yg-dFpQk0fri_CstNlL1u5qw,23
1
+ codecortex-0.28.0.dist-info/licenses/LICENSE,sha256=DIRvhlH8EulEUOYQxKDFFiimJrlVT5-kCKxQIgi2m7c,1073
2
+ codeintel/__init__.py,sha256=MRQGtOXBhcDKeeNOL0LiB-cllo6kfd8_KGJOvaDp0XQ,23
3
3
  codeintel/__main__.py,sha256=pO61R6PfyPnCQCp4Fmi514OD4JeboKhl2r2tcbSTD5k,39053
4
4
  codeintel/agent_prompt.py,sha256=iOk4CURZ3cO46KmseW5A2vYeuaR1J6usWzXOnvrr-eU,5544
5
5
  codeintel/auth.py,sha256=OwrLMs9UaR_1nMCSWTO4y3nD8l09wsjyHWxBD7hPvuk,7311
@@ -7,19 +7,19 @@ codeintel/c4.py,sha256=5QjslAYvWxevFj3hs55tU1vPAXklid6BBCB6B0rRL74,73104
7
7
  codeintel/c4_check.py,sha256=7mg18TgVygI8ERveVySvTaXxwaedH9iw7MzvGv_rbss,23112
8
8
  codeintel/c4_layers.py,sha256=PletSjV2xc2jE-sRFfis30ZcXntnJleEcdF0RTOm1pc,32744
9
9
  codeintel/cache.py,sha256=0qv9aRn11w1_-Ad-cy6jvFYYvJ4EpSYXdTnmWwuW6hM,4458
10
- codeintel/changed_range.py,sha256=QSmoUeGB_byVk3zA97FPwwu-Oghol_qoIQUk_miY2i8,23636
10
+ codeintel/changed_range.py,sha256=4VMfllLFyeEW3_PpEjoZoXuO1l_BSAYf57OzA9ye0WQ,23894
11
11
  codeintel/config.py,sha256=frNAiewuuFbtgZFzKcoQJyvZLLt8GLacXTGu0hjKhl4,5176
12
12
  codeintel/containment.py,sha256=5masRij8A-QHugA-aqjau12XqDYe_7GpU_b7S9bSIy0,5050
13
13
  codeintel/doctor.py,sha256=XLLlqzjizjXi_dBnd64iWOAJxZZJF9UW4Ox3jgc_LnI,24733
14
14
  codeintel/filelock.py,sha256=SUvHFO4PzNYcZ7yf3ffsG4v91yy3ktrHmdEHues7b_U,7078
15
- codeintel/gateway.py,sha256=KPeA0j7Uc0DGabnuuWW7h4MjH7iGhZC3WZT5wfNTOlQ,40832
16
- codeintel/graph_answer.py,sha256=UvsMiZjs6hskud3kjSFEDIBCqDj95FS2qgsDvVOPYx4,73983
15
+ codeintel/gateway.py,sha256=bBVXz4LKAoz5KGMo54i5UouvrmcqQ4l4-Emz-_abOhY,43231
16
+ codeintel/graph_answer.py,sha256=91KHaLZYPIGJpvCPlKBlXvKraWFhudVc7OgtR7p8v_c,92975
17
17
  codeintel/graph_backend.py,sha256=ksSGTNuhQlXjz6KrAq7eBe9jE6rLhep6rONsBvt5_tE,26085
18
- codeintel/graph_changed.py,sha256=r9mOmtxg0r4CHEAfMiaYIfKrxq0TUb21cMX8_kuCOh0,50958
19
- codeintel/graph_confidence.py,sha256=fs7MdR6OMvZiF4O5dCU5O3xepy9NHvZj234wl2B9Ous,22335
20
- codeintel/graph_dispatch.py,sha256=irdMuB4aiuKL-CSKfn7f9pj2c9UFrHsmp3FR0ZDkZL0,65071
21
- codeintel/graph_edges.py,sha256=hTaCy2oMG3kcLLBmyBaM3YfVge7ZXny_S7jQURcacZM,7533
22
- codeintel/graph_ops.py,sha256=trpJdMea4xF8chCC0u710hOpNBlJSuF9L1UEYQf8Yms,53125
18
+ codeintel/graph_changed.py,sha256=DAdRxR_FtET68gWrg42OJmeH3E1OldjIcpUc-cZt1pc,54959
19
+ codeintel/graph_confidence.py,sha256=7VYTF24Gup2PW5q-2sTYyoqjgi3cWPSnRWtuBPkrfhE,25651
20
+ codeintel/graph_dispatch.py,sha256=NioRhlpcCZMBUx7c8OjsUi4fFWN_TqIAmw17SaVosdE,68068
21
+ codeintel/graph_edges.py,sha256=43tg4H691xAhQAfFnWYRIqjsTodP31_Zae2JKyWxltA,7951
22
+ codeintel/graph_ops.py,sha256=qN1tUfOXLcsjff3VrxxM55auwKKBTHdWHDw5j0Iuyls,53521
23
23
  codeintel/graph_render.py,sha256=6url4zNY3xNI4RrNfdHpiMJqaaLM4KmpzsqaV9grTWc,16001
24
24
  codeintel/graph_resolution.py,sha256=JzJ1ogLiebsMmmhwYDpaBpgAtHfXjj9Xbcr5juon4V0,16029
25
25
  codeintel/graph_targets.py,sha256=elANx7EWdYvKb5ZmYFZ4EKpW0xVqzZnuobuUkOEFDhM,6649
@@ -39,17 +39,18 @@ codeintel/paths.py,sha256=BSojuftxxi5uDanDsxy9vrxol--mFEJtGAPPyzbApZU,1627
39
39
  codeintel/per_thread.py,sha256=2Ha6mVc-SfKrqzkn5K6TtMX_n37VSH3kUI-942YZDbs,2774
40
40
  codeintel/policy.py,sha256=3QVZzcSjRkJildbUfIjl6UL3l8ZsToZu4jG-WbXFRcQ,4296
41
41
  codeintel/progress.py,sha256=tUi8Gg8M5lpQLO3sneXuNbPGtnBtwZcbXFF5hHIIwuo,3233
42
- codeintel/provider.py,sha256=HB7jlstL61iRHKkvF3YLCW_nTTSaCNJzL5Bmkfx_NZw,12803
42
+ codeintel/provider.py,sha256=hlfZKVrDOI6ZzRlvABKn24Jcjp9VaotpvTY7xNnaaRw,13087
43
43
  codeintel/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
+ codeintel/qualifier_scan.py,sha256=gNd1b8q15X0HOwL9mGnkY0m4ZBMbSaqKTz0ty17shAk,20162
44
45
  codeintel/query_ops.py,sha256=QxaGA4Fnkys07n_nUD04ns5Ym24rF9qlZruY49thTv0,1862
45
46
  codeintel/redact.py,sha256=kM5yYsc5dLGMdTT9ABfQ1YmdveiPLh5bqdxR0bYWCkQ,9717
46
47
  codeintel/reindexer.py,sha256=Jj1onCWcBhBrDIOPbtgnde_-qP61b4EKIngWsh3w0YE,13191
47
48
  codeintel/reset.py,sha256=4McrbhQH9CXXoPf4azizheNe3DgDAfvjXur7sWBQx5U,12891
48
49
  codeintel/searcher.py,sha256=J3rkHdyqJx10eMPiGVAM0W4tqIlqIe4hjOqmir_n5bM,24922
49
50
  codeintel/semantic_db.py,sha256=F28FxM6SwzJr55tw_ie97mmtZ36fzXVWd_sasI9BI1g,30378
50
- codeintel/server.py,sha256=lsJwzjCX3mmkTvzxelm7JBDQ103tjC0bLb7L7kOdsMY,33831
51
+ codeintel/server.py,sha256=4pNIE_E_oBI41Lhs-FPYRd-VO0cLGYE2EvHSiuy9rak,38468
51
52
  codeintel/source_kind.py,sha256=0URayZ5v7rjtdWLlf4MuYElh4FB7a2Ds-nvWES1Q_2I,13068
52
- codeintel/symbol_diff.py,sha256=L3ga_iFYl2dEh6D3RjGKqCVlgyvNP1LpnzETIySA0ss,23245
53
+ codeintel/symbol_diff.py,sha256=zpgbcrS1VVD1W9KbpEJM-cYLlJRw8u_Lw9ltP-4gPCA,31329
53
54
  codeintel/term.py,sha256=FePzFnzk-TTyRwZiVY_Em5D0-WqULGZqTnKsSsjA8qY,17720
54
55
  codeintel/verify.py,sha256=M1fyNIzEJJMZrY0a9WQevepktD7j7lvDXgrk481kI5Y,15386
55
56
  codeintel/wire_text.py,sha256=cmM4Q3jaCDSdL3uGQcpyaJ5if00DSHk45jPozogeQq0,17528
@@ -71,14 +72,14 @@ codeintel/commands/setup.py,sha256=Td5A4zLvChqWUcHdd-s5UPZEBkWO6MAD6Put4l1Y1Cg,1
71
72
  codeintel/commands/status.py,sha256=DVl0MYfaDUPA94WnwVU5lJFFNeIQanuChVamXD4YQh4,4984
72
73
  codeintel/commands/uninstall.py,sha256=AFlC0PCg7pLjsb7Cq1yTKFen8p3n6HIlKt62Ml2VmNk,5117
73
74
  codeintel/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
- codeintel/providers/graph.py,sha256=zWUYYrEDhjzMMzoWnveiUNfTE5VAQmF7DZrSBwpfD0U,58755
75
+ codeintel/providers/graph.py,sha256=F9SGQRIliXPxxY8dA4L8FCRrxfhvc9qVzmTzgvre9yM,59463
75
76
  codeintel/providers/lsp.py,sha256=sF4Pa104lIsQPlMrdKDkwwDjL9OE5ApyrgV7BX0Ikxg,71083
76
77
  codeintel/providers/none.py,sha256=VI84XQkT7opQm6rBAEn0CdM8CNVlKGWYmjAhyeWbHeg,783
77
78
  codeintel/providers/semantic.py,sha256=Qu7yew4gzxUqknZ-a21Ir30dR5FAmvVY-LDTc0XRDMs,56868
78
79
  codeintel/viewer/__init__.py,sha256=CBbW19p3C8uYpuT-ghSEuBfU56gZTe7IDfSC0ZMTNOU,101
79
80
  codeintel/viewer/graph_template.html,sha256=Oi6IRS7Rsa5j8q_FCEfAQHf7UQi1JsH37jVuw-NvuNo,38786
80
- codecortex-0.26.0.dist-info/METADATA,sha256=-mzrupfljcYzgmMk8QV-bKxKn4jmSMq2hONHwGbt87g,48673
81
- codecortex-0.26.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
82
- codecortex-0.26.0.dist-info/entry_points.txt,sha256=zrYfo95-8JkK0G2e5f9d94sYqqim7ZrdCW8knIfSy2U,54
83
- codecortex-0.26.0.dist-info/top_level.txt,sha256=DF3TH1hHLWrrnX-7HhfMX0OnS2EXgqPRhPbiL_oSekw,10
84
- codecortex-0.26.0.dist-info/RECORD,,
81
+ codecortex-0.28.0.dist-info/METADATA,sha256=1lOTQPK-pAQILAYrnluo6XtIXGNslKkGHFnlUB3f_so,48765
82
+ codecortex-0.28.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
83
+ codecortex-0.28.0.dist-info/entry_points.txt,sha256=zrYfo95-8JkK0G2e5f9d94sYqqim7ZrdCW8knIfSy2U,54
84
+ codecortex-0.28.0.dist-info/top_level.txt,sha256=DF3TH1hHLWrrnX-7HhfMX0OnS2EXgqPRhPbiL_oSekw,10
85
+ codecortex-0.28.0.dist-info/RECORD,,
codeintel/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.26.0"
1
+ __version__ = "0.28.0"
@@ -28,6 +28,7 @@ from __future__ import annotations
28
28
 
29
29
  import os
30
30
  import re
31
+ import stat
31
32
  import subprocess
32
33
  import tempfile
33
34
  import threading
@@ -323,7 +324,10 @@ def read_new(root: str, path: str) -> str | None:
323
324
  if safe is None:
324
325
  return None
325
326
  try:
326
- if os.path.getsize(safe) > MAX_SOURCE_BYTES:
327
+ info = os.stat(safe)
328
+ # A regular file only. A FIFO planted at a tracked path has one link and a size of zero, passes
329
+ # containment, and blocks `open` forever — which would hang the whole answer.
330
+ if not stat.S_ISREG(info.st_mode) or info.st_size > MAX_SOURCE_BYTES:
327
331
  return None
328
332
  with open(safe, "rb") as fh:
329
333
  return fh.read().decode("utf-8", "replace")
codeintel/gateway.py CHANGED
@@ -83,6 +83,41 @@ def _is_retryable(result: Result) -> bool:
83
83
  )
84
84
 
85
85
 
86
+ def _states_live_file_contents(result: Result | dict[str, Result]) -> bool:
87
+ """Whether the answer states something read from the files on disk as it was asked — the qualifier
88
+ scan's verdicts (`qualifier_seen` on a row, or the `qualifier_absent` / `qualifier_present`
89
+ counts).
90
+
91
+ The cache is keyed by the target string and the index's freshness generation, and neither moves
92
+ when a caller file starts or stops writing the qualifier — only a reindex does. Caching such an
93
+ answer would serve a verdict about the files as they WERE, in prose that says "as they are on
94
+ disk": the reason `changed` is never cached, met by a narrower population. An answer whose scan
95
+ judged nothing printed only the command — but if it was eligible and judged nothing because a
96
+ call stalled, the budget ran out or a lookup timed out (`qualifier_checked`), caching that would
97
+ keep the check switched off for the symbol until the next reindex, long after the filesystem
98
+ recovered. So an answer whose check was attempted at all is not cached either.
99
+ Walks the whole answer, because a fan-out answer nests each engine's envelope."""
100
+ def walk(node: object, depth: int) -> bool:
101
+ if depth > 8:
102
+ return False
103
+ if isinstance(node, dict):
104
+ evidence = node.get("evidence")
105
+ if isinstance(evidence, dict) and (evidence.get("qualifier_absent")
106
+ or evidence.get("qualifier_present")
107
+ or evidence.get("qualifier_checked")):
108
+ return True
109
+ rows = node.get("rows")
110
+ if isinstance(rows, list) and any(
111
+ isinstance(r, dict) and r.get("qualifier_seen") is not None for r in rows):
112
+ return True
113
+ return any(walk(v, depth + 1) for v in node.values() if isinstance(v, (dict, list)))
114
+ if isinstance(node, list):
115
+ return any(walk(v, depth + 1) for v in node)
116
+ return False
117
+
118
+ return walk(result, 0)
119
+
120
+
86
121
  class Gateway:
87
122
  def __init__(self, graph=None, lsp=None, semantic=None, policy: TieringPolicy | None = None,
88
123
  reindexer: Reindexer | None = None, oneshot: bool = False):
@@ -682,7 +717,10 @@ class Gateway:
682
717
  engines = ["graph", "lsp"] if engine_str == "both" else ["graph", "lsp", "semantic"]
683
718
  fan_results = self._fan_out(engines, op_str, target_str, budget, project_root)
684
719
  result = self._merge(fan_results, op_str, target_str, engine_str)
685
- if not uncacheable and not _is_retryable(result):
720
+ # The merged answer drops each engine's `rows` and `evidence` but keeps their prose,
721
+ # so whether it states what the files hold now is read from the engines' own answers.
722
+ if (not uncacheable and not _is_retryable(result)
723
+ and not _states_live_file_contents(fan_results)):
686
724
  self._cache.put(op_str, target_str, cache_engine, root_str, result, freshness)
687
725
  return _mark_reindexing(result, reindexing)
688
726
 
@@ -721,7 +759,8 @@ class Gateway:
721
759
  result = self._cross_check_name_resolved(
722
760
  result, op_str, target_str, budget, project_root, was_auto)
723
761
 
724
- if not uncacheable and not _is_retryable(result):
762
+ if (not uncacheable and not _is_retryable(result)
763
+ and not _states_live_file_contents(result)):
725
764
  self._cache.put(op_str, target_str, cache_engine, root_str, result, freshness)
726
765
  return _mark_reindexing(result, reindexing)
727
766