witan-code 0.32.0__tar.gz → 0.32.1__tar.gz

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 (116) hide show
  1. {witan_code-0.32.0 → witan_code-0.32.1}/CHANGELOG.md +6 -0
  2. {witan_code-0.32.0 → witan_code-0.32.1}/PKG-INFO +1 -1
  3. {witan_code-0.32.0 → witan_code-0.32.1}/pyproject.toml +2 -2
  4. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_xref.py +37 -0
  5. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/xref.py +2 -0
  6. {witan_code-0.32.0 → witan_code-0.32.1}/.gitignore +0 -0
  7. {witan_code-0.32.0 → witan_code-0.32.1}/README.md +0 -0
  8. {witan_code-0.32.0 → witan_code-0.32.1}/changelog.d/README.md +0 -0
  9. {witan_code-0.32.0 → witan_code-0.32.1}/config/claude.json +0 -0
  10. {witan_code-0.32.0 → witan_code-0.32.1}/config/copilot.json +0 -0
  11. {witan_code-0.32.0 → witan_code-0.32.1}/config/pi.json +0 -0
  12. {witan_code-0.32.0 → witan_code-0.32.1}/conftest.py +0 -0
  13. {witan_code-0.32.0 → witan_code-0.32.1}/docs/BRANCH_INDEXING.md +0 -0
  14. {witan_code-0.32.0 → witan_code-0.32.1}/docs/CLI_REFERENCE.md +0 -0
  15. {witan_code-0.32.0 → witan_code-0.32.1}/docs/EDGE_PRECISION_TIERS.md +0 -0
  16. {witan_code-0.32.0 → witan_code-0.32.1}/docs/PACKAGE_MAP.md +0 -0
  17. {witan_code-0.32.0 → witan_code-0.32.1}/docs/STAGE2_STITCHING.md +0 -0
  18. {witan_code-0.32.0 → witan_code-0.32.1}/docs/SYMBOL_FORMAT.md +0 -0
  19. {witan_code-0.32.0 → witan_code-0.32.1}/docs/SYMBOL_TABLE.md +0 -0
  20. {witan_code-0.32.0 → witan_code-0.32.1}/docs/USER_GUIDE.md +0 -0
  21. {witan_code-0.32.0 → witan_code-0.32.1}/install.sh +0 -0
  22. {witan_code-0.32.0 → witan_code-0.32.1}/tests/__init__.py +0 -0
  23. {witan_code-0.32.0 → witan_code-0.32.1}/tests/conftest.py +0 -0
  24. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_batched_deletes.py +0 -0
  25. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_branches.py +0 -0
  26. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_branches_served.py +0 -0
  27. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_bridge.py +0 -0
  28. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_chunked_load.py +0 -0
  29. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_cli_dispatch.py +0 -0
  30. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_cli_help_docstrings.py +0 -0
  31. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_cli_hooks.py +0 -0
  32. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_cli_output_format.py +0 -0
  33. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_cli_selected_target.py +0 -0
  34. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_config_targets.py +0 -0
  35. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_context.py +0 -0
  36. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_crossrepo.py +0 -0
  37. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_diff_impact.py +0 -0
  38. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_edges.py +0 -0
  39. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_elicit.py +0 -0
  40. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_enrichment.py +0 -0
  41. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_github_app.py +0 -0
  42. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_graph.py +0 -0
  43. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_hooks.py +0 -0
  44. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_identity.py +0 -0
  45. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_index_failure_diagnostics.py +0 -0
  46. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_index_reports_its_store.py +0 -0
  47. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_index_requires_a_repo_key.py +0 -0
  48. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_indexer.py +0 -0
  49. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_indexer_scope.py +0 -0
  50. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_ingest.py +0 -0
  51. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_languages.py +0 -0
  52. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_maintenance.py +0 -0
  53. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_package_map.py +0 -0
  54. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_reaper.py +0 -0
  55. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_rebuild_honours_the_repo_key.py +0 -0
  56. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_refusal_audit.py +0 -0
  57. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_remote_proxy.py +0 -0
  58. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_remote_store.py +0 -0
  59. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_repo.py +0 -0
  60. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_search_docstrings.py +0 -0
  61. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_server.py +0 -0
  62. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_setup.py +0 -0
  63. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_stitch.py +0 -0
  64. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_store.py +0 -0
  65. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_symbol_table.py +0 -0
  66. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_tasks.py +0 -0
  67. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_tool_schema.py +0 -0
  68. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_views.py +0 -0
  69. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_visualize.py +0 -0
  70. {witan_code-0.32.0 → witan_code-0.32.1}/tests/test_why.py +0 -0
  71. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/__init__.py +0 -0
  72. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/__main__.py +0 -0
  73. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/bridge.py +0 -0
  74. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/bridge_extractors.py +0 -0
  75. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/cli.py +0 -0
  76. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/config.py +0 -0
  77. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/context.py +0 -0
  78. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/diff_impact.py +0 -0
  79. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/edges.py +0 -0
  80. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/elicit.py +0 -0
  81. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/extensions/pi/codegraph.ts +0 -0
  82. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/github_app.py +0 -0
  83. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/graph.py +0 -0
  84. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/hooks.py +0 -0
  85. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/identity.py +0 -0
  86. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/indexer.py +0 -0
  87. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/ingest.py +0 -0
  88. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/maintenance.py +0 -0
  89. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/output.py +0 -0
  90. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/package_map.py +0 -0
  91. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries/bridge.gq +0 -0
  92. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries/code_mutations.gq +0 -0
  93. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries/code_read.gq +0 -0
  94. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries/delete.gq +0 -0
  95. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries_ts/bash.scm +0 -0
  96. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries_ts/hcl.scm +0 -0
  97. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries_ts/python.scm +0 -0
  98. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries_ts/sql.scm +0 -0
  99. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries_ts/typescript.scm +0 -0
  100. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/queries_ts/yaml.scm +0 -0
  101. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/reaper.py +0 -0
  102. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/remote/__init__.py +0 -0
  103. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/remote/oidc.py +0 -0
  104. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/remote/proxy.py +0 -0
  105. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/remote/store.py +0 -0
  106. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/repo.py +0 -0
  107. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/schema/bridge-schema.pg +0 -0
  108. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/schema/code-schema.pg +0 -0
  109. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/selected_target.py +0 -0
  110. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/server.py +0 -0
  111. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/setup.py +0 -0
  112. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/skills/witan-code/SKILL.md +0 -0
  113. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/stitch.py +0 -0
  114. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/store.py +0 -0
  115. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/views.py +0 -0
  116. {witan_code-0.32.0 → witan_code-0.32.1}/witan_code/visualize.py +0 -0
@@ -8,6 +8,12 @@ a MINOR bump may include breaking changes).
8
8
 
9
9
  <!-- scriv-insert-here -->
10
10
 
11
+ ## [0.32.1] - 2026-11-18
12
+
13
+ ### Fixed
14
+
15
+ - A TS/JS import that names the repo root (`import { f } from '.'` or `'./'` in a root-level file, `'..'` from one directory down) resolves to the root `index.ts`/`index.js`. It used to resolve to the path `.`, which matched no file, so those calls had no `Calls` edge and `code_callers` missed them. Existing stores get the edges when the importing file is next indexed, or with one `witan-code reindex`.
16
+
11
17
  ## [0.32.0] - 2026-11-17
12
18
 
13
19
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: witan-code
3
- Version: 0.32.0
3
+ Version: 0.32.1
4
4
  Summary: witan-code — tree-sitter code graph + cross-repo bridge (mounts under `witan code`)
5
5
  Project-URL: Homepage, https://github.com/mitodl/agent-kit/tree/main/mcp/servers/witan-code
6
6
  Project-URL: Repository, https://github.com/mitodl/agent-kit
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "witan-code"
3
- version = "0.32.0"
3
+ version = "0.32.1"
4
4
  description = "witan-code — tree-sitter code graph + cross-repo bridge (mounts under `witan code`)"
5
5
  readme = "README.md"
6
6
  license = "BSD-3-Clause"
@@ -314,7 +314,7 @@ testpaths = ["tests"]
314
314
  packages = ["witan_code"]
315
315
 
316
316
  [tool.bumpversion]
317
- current_version = "0.32.0"
317
+ current_version = "0.32.1"
318
318
  allow_dirty = true
319
319
 
320
320
  [[tool.bumpversion.files]]
@@ -117,6 +117,19 @@ def test_ts_calls_resolve_through_relative_imports(source, call, expected):
117
117
  assert got == expected
118
118
 
119
119
 
120
+ @pytest.mark.parametrize(
121
+ ("importer", "spec"),
122
+ [("a.ts", "."), ("a.ts", "./"), ("web/a.ts", ".."), ("web/a.ts", "../")],
123
+ )
124
+ @pytest.mark.parametrize("index", ["index.ts", "index.js"])
125
+ def test_a_ts_import_of_the_repo_root_reaches_its_index(importer, spec, index):
126
+ files = {"a.ts", "web/a.ts", index}
127
+ source = f"import {{ f }} from '{spec}';\nimport * as root from '{spec}';\n"
128
+ for call, member in (("f", "f"), ("root.g", "g")):
129
+ got = _resolve(files, importer, source, call, language="typescript")
130
+ assert got == (index, member)
131
+
132
+
120
133
  # ── Through the indexer and code_callers ──────────────────────────
121
134
 
122
135
  B_PY = """\
@@ -359,3 +372,27 @@ def test_a_ts_call_into_another_module_is_a_caller(tmp_path, monkeypatch):
359
372
  monkeypatch.chdir(base)
360
373
  _index(base)
361
374
  assert _callers("b.ts::foo") == {"a.ts::one", "a.ts::two"}
375
+
376
+
377
+ @requires_stack
378
+ def test_a_ts_import_of_the_repo_root_is_a_caller(tmp_path, monkeypatch):
379
+ """`'.'` and `'./'` in a root-level file reach the root `index.ts`."""
380
+ from witan_code import config as cfg_mod
381
+ from witan_code import server as srv
382
+
383
+ monkeypatch.setenv("WITAN_REPO", REPO)
384
+ monkeypatch.setenv("WITAN_CODE_DIR", str(tmp_path / "code"))
385
+ monkeypatch.setattr(srv, "cfg", cfg_mod.load())
386
+ base = tmp_path / "r"
387
+ base.mkdir()
388
+ _git(base, "init", "-q", "-b", "main")
389
+ (base / "index.ts").write_text("export function f() {\n return 1;\n}\n")
390
+ (base / "a.ts").write_text(
391
+ "import { f } from '.';\n\nexport function viaDot() {\n return f();\n}\n"
392
+ )
393
+ (base / "b.ts").write_text(
394
+ "import { f } from './';\n\nexport function viaSlash() {\n return f();\n}\n"
395
+ )
396
+ monkeypatch.chdir(base)
397
+ _index(base)
398
+ assert _callers("index.ts::f") == {"a.ts::viaDot", "b.ts::viaSlash"}
@@ -190,6 +190,8 @@ def _py_candidates(path: str) -> list[str]:
190
190
 
191
191
 
192
192
  def _js_candidates(path: str) -> list[str]:
193
+ if path == ".": # the repo root, which only its index file can stand for
194
+ return [f"index{s}" for s in _JS_SUFFIXES]
193
195
  stem, suffix = posixpath.splitext(path)
194
196
  if suffix in _JS_SUFFIXES:
195
197
  return [path, *(stem + s for s in _JS_TO_TS.get(suffix, ()))]
File without changes
File without changes
File without changes
File without changes
File without changes