@theglitchking/babel-fish 2.4.2 → 2.4.3

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.
@@ -30,7 +30,12 @@ def load_generate(project_root: Path):
30
30
  spec.loader.exec_module(mod)
31
31
  finally:
32
32
  sys.argv = argv
33
- mod.PROJECT_ROOT = project_root
33
+ # configure_paths(), not `mod.PROJECT_ROOT = ...`: generate.py binds MAP_DIR,
34
+ # SECTIONS_DIR, CHECKSUMS, LEARNED_VOC and GLOSSARY at import time from
35
+ # __file__, and rebinds them only here. Setting PROJECT_ROOT alone left every
36
+ # output path aimed at the real repo, so the suite overwrote its own
37
+ # glossary.json with fixture data and still passed (#18).
38
+ mod.configure_paths(project_root)
34
39
  return mod
35
40
 
36
41
 
@@ -232,7 +237,11 @@ def test_glossary_survives_foreign_project_root(g):
232
237
  PROJECT_ROOT when --project-root points elsewhere. That combination raised
233
238
  ValueError from relative_to()."""
234
239
  import json
235
- g.write_glossary([], g.load_stack()) # PROJECT_ROOT is the temp fixture here
240
+ # Recreate the mismatch explicitly. It used to arrive for free because the
241
+ # loader left SECTIONS_DIR pointing at the script dir — the same leak that
242
+ # let this test write into the real repo (#18).
243
+ g.SECTIONS_DIR = HERE / "sections"
244
+ g.write_glossary([], g.load_stack())
236
245
  data = json.loads(g.GLOSSARY.read_text())
237
246
  assert data["source"].endswith("01-vocabulary.md"), data["source"]
238
247
 
@@ -28,7 +28,10 @@ def load_miner(project_root: Path, cursor_dir: Path):
28
28
  spec.loader.exec_module(mod)
29
29
  finally:
30
30
  sys.argv = argv
31
- mod.PROJECT_ROOT = project_root
31
+ # configure_paths(), not `mod.PROJECT_ROOT = ...` — see the same note in
32
+ # test_generate.py (#18). LEARNED_VOC is bound at import time from __file__,
33
+ # so assigning PROJECT_ROOT alone leaves it aimed at the real repo.
34
+ mod.configure_paths(project_root)
32
35
  mod.MINE_CURSOR = cursor_dir / ".mine-cursor.json"
33
36
  return mod
34
37
 
@@ -6,13 +6,13 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for babel-fish - Codebase introspection and vocabulary translation for AI coding assistants",
9
- "version": "2.4.2"
9
+ "version": "2.4.3"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "babel-fish",
14
14
  "description": "Auto-generates a project map, vocabulary translation layer, and developer skill for any codebase. Introspects routes, models, services, features, infrastructure, and session history to give Claude instant full-stack context. Self-updates via pre-commit hook.",
15
- "version": "2.4.2",
15
+ "version": "2.4.3",
16
16
  "author": {
17
17
  "name": "TheGlitchKing"
18
18
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babel-fish",
3
3
  "description": "Auto-generates a project map, vocabulary translation layer, and developer skill for any codebase. Introspects routes, models, services, features, infrastructure, and session history to give Claude instant full-stack context. Self-updates via pre-commit hook.",
4
- "version": "2.4.2",
4
+ "version": "2.4.3",
5
5
  "author": {
6
6
  "name": "TheGlitchKing",
7
7
  "email": "theglitchking@users.noreply.github.com"
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.4.3] - 2026-09-05
6
+
7
+ ### Fixed
8
+
9
+ - **`npm test` overwrote the map it was testing, and still reported every test
10
+ passing** ([#18](https://github.com/TheGlitchKing/babel-fish/issues/18)). A run
11
+ rewrote the working tree's `.claude/project-map/glossary.json` with fixture
12
+ data — 10 entries down to 1 — and printed a clean pass. Caught only by
13
+ diffing before a commit during the 2.4.2 release.
14
+
15
+ `generate.py` and `mine-sessions.py` bind `MAP_DIR`, `SECTIONS_DIR`,
16
+ `CHECKSUMS`, `LEARNED_VOC` and `GLOSSARY` at import time from `__file__`, and
17
+ rebind them only inside `configure_paths()`. Both test loaders assigned
18
+ `mod.PROJECT_ROOT` and stopped there, so every output path stayed aimed at the
19
+ real repo while the tests believed they were in a temp fixture; whichever test
20
+ called `write_glossary()` last won. This is the [#15](https://github.com/TheGlitchKing/babel-fish/issues/15)
21
+ defect class — writes escaping to the script's own directory — surviving in
22
+ the harness after being fixed in the scripts themselves.
23
+
24
+ Both loaders now call `configure_paths(fixture_root)`.
25
+ `test_glossary_survives_foreign_project_root` depended on the leak (it needs
26
+ `SECTIONS_DIR` outside `PROJECT_ROOT`, which used to arrive for free) and now
27
+ recreates that mismatch explicitly, so it still covers the `ValueError` from
28
+ `relative_to()` without writing outside its fixture — verified by mutation:
29
+ deleting the `try`/`except` in `_relative_source()` fails that test and only
30
+ that one. `test_grader.py` is deliberately untouched; its loader assigns a map
31
+ dir rather than a project root.
32
+
33
+ 38 tests pass across the three suites, and a full run now leaves the tree
34
+ clean.
35
+
5
36
  ## [2.4.2] - 2026-09-05
6
37
 
7
38
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theglitchking/babel-fish",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Gives your AI coding assistant instant, accurate knowledge of every route, model, service, feature, and infrastructure element in your codebase.",
5
5
  "type": "module",
6
6
  "bin": {