fix(packaging): anchor traces/ gitignore pattern so hatch ships it in the wheel

Fixes #372.

The `.gitignore` had `traces/` (unanchored), which matches any directory
named `traces/` anywhere in the tree — including the runtime module at
`src/openjarvis/traces/`. hatchling honors `.gitignore` when building
the wheel, so it silently dropped the entire `openjarvis/traces/`
package.

Effect: every fresh `pip install openjarvis==1.0.1` failed at import
time with `ModuleNotFoundError: No module named 'openjarvis.traces'`
the moment the user touched `jarvis ask`, learning, or the server.
Confirmed by @gilbert-barajas with a clean repro on macOS Apple Silicon.

Reproduced locally by running `uv build --wheel` on a clean checkout
of `main`:
- Before this change: `openjarvis/traces/` absent from the wheel.
- After this change: all 4 expected files present
  (`__init__.py`, `analyzer.py`, `collector.py`, `store.py`).

Anchored the pattern to `/traces/` so it only matches a top-level
`traces/` directory (where ad-hoc trace dumps may live during
development), not any nested `traces/` subdir. Added a comment in the
gitignore explaining the gotcha so it doesn't recur.

The other unanchored directory patterns in the file (`results/`,
`logs/`, `htmlcov/`, `site/`, `build/`, `dist/`, `venv/`, `env/`)
were audited — none collide with any directory currently under
`src/openjarvis/`. Left them unanchored to keep the diff minimal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
krypticmouse
2026-05-23 15:17:12 +00:00
co-authored by Claude Opus 4.7
parent 71c5b2bce1
commit 2d6d6ed7bd
+5 -1
View File
@@ -48,7 +48,11 @@ Thumbs.db
*.log
results/
logs/
traces/
# Anchored to repo root — DO NOT use the unanchored form `traces/`.
# hatchling honors .gitignore when building the wheel; an unanchored
# `traces/` pattern matches src/openjarvis/traces/ and silently drops
# the runtime module from the wheel (issue #372).
/traces/
coding_task_*
get-pip.py
# Junk from mocked-path tests that write to their mock's __repr__ as a path