2.0.0-alpha: default 2.0 tests, cache safety, and docs

Testing:
- pytest defaults to tests_2.0 via pytest.ini
- README/TESTING updated; Quick Start uses `pip install -e . && pip install pytest`

Safety:
- Add test-cache sentinel + centralized checks
- Strict delete guard via MLXK2_STRICT_TEST_DELETE=1
- Hide sentinel from 2.0 list output

Portability:
- Remove site-specific paths; generic test/user cache detection (mlxk2_test_ prefix + sentinel)

Docs:
- Environment & Caches, HF cache integrity
- Local-only hooks/excludes and local test script (excluded from VCS)
This commit is contained in:
Local Test
2025-08-29 16:55:34 +02:00
parent d375e1bd3e
commit de7ccf9018
27 changed files with 3320 additions and 70 deletions
+43 -9
View File
@@ -228,17 +228,20 @@ done
## Testing
The test suite provides comprehensive coverage with production-quality isolation:
The 2.0 test suite runs by default (pytest discovery points to `tests_2.0/`):
```bash
# Run all tests
python -m pytest tests_2.0/ -v
# Run 2.0 tests (default)
pytest -v
# Test categories:
# - ADR-002 edge cases (13 tests)
# - Integration scenarios (12 tests)
# - Model naming logic (9 tests)
# - Robustness testing (11 tests)
# Explicitly run legacy 1.x tests (not maintained on this branch)
pytest tests/ -v
# Test categories (2.0 example):
# - ADR-002 edge cases
# - Integration scenarios
# - Model naming logic
# - Robustness testing
# Current status: 45/45 passing ✅
```
@@ -311,4 +314,35 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
---
*MLX-Knife 2.0.0-alpha - Built for automation, tested for reliability, designed for the future.*
*MLX-Knife 2.0.0-alpha - Built for automation, tested for reliability, designed for the future.*
## Local Safety Setup (Optional)
To keep local coordination files out of Git and avoid accidental pushes during development:
- Ignore locally (branch-independent): add to `.git/info/exclude`
- `AGENTS.md`
- `CLAUDE.md`
- Local hooks (not versioned):
- `.git/hooks/pre-commit` blocks commits including `AGENTS.md`/`CLAUDE.md`.
- `.git/hooks/pre-push` blocks pushes of the current branch. Override once with `ALLOW_PUSH=1 git push`.
Minimal pre-commit example:
```bash
#!/usr/bin/env bash
set -euo pipefail
staged=$(git diff --cached --name-only || true)
for f in AGENTS.md CLAUDE.md; do
echo "$staged" | grep -qx "$f" && { echo "Commit blocked: $f" >&2; exit 1; }
done
```
Minimal pre-push example:
```bash
#!/usr/bin/env bash
set -euo pipefail
[ "${ALLOW_PUSH:-}" = "1" ] && exit 0
br=$(git rev-parse --abbrev-ref HEAD)
while read -r l _ r _; do [ "$l" = "refs/heads/$br" ] && { echo "Push blocked: $br" >&2; exit 1; }; done
exit 0
```