|
| 1 | +# HEDit Project |
| 2 | + |
| 3 | +> **Note**: This project is being rebranded from `hed-bot` to `HEDit` and will migrate to the Annotation Garden organization. See plan.md for the v0.6.0 roadmap. |
| 4 | +
|
| 5 | +## Project Goal |
| 6 | +Multi-agent system for converting natural language event descriptions into valid HED annotations using LangGraph. Part of the Annotation Garden Initiative (AGI). |
| 7 | + |
| 8 | +## Tech Stack |
| 9 | +- **Language**: Python 3.12+ |
| 10 | +- **Package Manager**: uv (fast Python package installer) |
| 11 | +- **Agent Framework**: LangGraph |
| 12 | +- **LLM Provider**: OpenRouter API (production default) |
| 13 | +- **Validation**: HED JavaScript validator + HED Python tools |
| 14 | +- **Backend**: FastAPI |
| 15 | +- **Frontend**: Cloudflare Pages |
| 16 | +- **API Hosting**: api.annotation.garden (SCCN VM via Apache reverse proxy) |
| 17 | + |
| 18 | +## Environment Setup |
| 19 | +```bash |
| 20 | +# Create virtual environment and install dev dependencies |
| 21 | +uv venv |
| 22 | +source .venv/bin/activate |
| 23 | +uv pip install -e ".[dev]" |
| 24 | + |
| 25 | +# Run tests |
| 26 | +uv run pytest |
| 27 | + |
| 28 | +# Run specific test file |
| 29 | +uv run pytest tests/test_hed_lsp.py -v |
| 30 | +``` |
| 31 | + |
| 32 | +## Project Structure |
| 33 | +``` |
| 34 | +hedit/ # (currently hed-bot, renaming in v0.6.0) |
| 35 | +├── src/ |
| 36 | +│ ├── agents/ # LangGraph agent implementations |
| 37 | +│ ├── validation/ # HED validation integration |
| 38 | +│ ├── utils/ # Helper functions |
| 39 | +│ └── api/ # FastAPI backend |
| 40 | +├── frontend/ # Web interface (Cloudflare Pages) |
| 41 | +├── docs/ # Additional documentation |
| 42 | +├── tests/ # Test suite with pytest + coverage |
| 43 | +├── .context/ # Context files for Claude |
| 44 | +├── .rules/ # Rule files for Claude |
| 45 | +└── plan.md # Detailed project planning (see this for tasks) |
| 46 | +``` |
| 47 | + |
| 48 | +## Context Files |
| 49 | +- `.context/hed-schemas.md`: HED schema structure and access |
| 50 | +- `.context/hed-validation.md`: Validation tools and feedback |
| 51 | +- `.context/hed-annotation-rules.md`: Core annotation semantics |
| 52 | +- `.context/agent-architecture.md`: Multi-agent system design |
| 53 | + |
| 54 | +## Branching Strategy |
| 55 | +- **main**: Production-ready code (stable releases) |
| 56 | +- **develop**: Default target for PRs; active development branch (alpha releases) |
| 57 | +- **feature branches**: Create from develop, merge back to develop (dev releases) |
| 58 | +- PRs should target `develop` by default, not `main` |
| 59 | + |
| 60 | +## Versioning |
| 61 | +- Use `scripts/bump_version.py` for version bumping (never edit version manually) |
| 62 | +- **Version suffix rules by target branch**: |
| 63 | + - PRs to `develop`: Use `.dev` suffix (e.g., `0.6.8.dev0`) |
| 64 | + - PRs to `main`: Use `a` (alpha) suffix (e.g., `0.6.8a1`) |
| 65 | + - After merge to main for release: Use `b` (beta) or stable |
| 66 | +- **Tag rules**: |
| 67 | + - Tags should ONLY be pushed after the PR is merged |
| 68 | + - Never push tags from feature branches |
| 69 | +- Prerelease labels: |
| 70 | + - `dev`: Feature branches being merged to develop (goes to TestPyPI) |
| 71 | + - `alpha`: develop branch merged to main (goes to PyPI as pre-release) |
| 72 | + - `beta`: Release candidates on main |
| 73 | + - `stable`: Production releases on main |
| 74 | +- Example: `python scripts/bump_version.py patch --prerelease dev` |
| 75 | + |
| 76 | +### Develop Branch Sync Rule |
| 77 | +After syncing develop with main (post-release), always bump patch and set to `.dev0`: |
| 78 | +- Example: main at `0.6.7a2` → develop becomes `0.6.8.dev0` |
| 79 | +- For ongoing work on develop, increment dev number: `.dev0` → `.dev1` → `.dev2` |
| 80 | +- Never use alpha versions on develop; keep alpha exclusive to main |
| 81 | + |
| 82 | +**Version flow:** |
| 83 | +``` |
| 84 | +develop: 0.6.8.dev0 → 0.6.8.dev1 → 0.6.8.dev2 (TestPyPI) |
| 85 | + ↓ (PR merge to main) |
| 86 | +main: 0.6.8a1 → 0.6.8a2 → 0.6.8 (PyPI) |
| 87 | + ↓ (sync back to develop) |
| 88 | +develop: 0.6.9.dev0 (next cycle) |
| 89 | +``` |
| 90 | + |
| 91 | +This keeps clear separation: TestPyPI = dev builds, PyPI = alpha/beta/stable releases. |
| 92 | + |
| 93 | +## Development Guidelines |
| 94 | +1. **Atomic commits**: Make small, focused commits for each logical change |
| 95 | +2. **Testing**: Use `uv run pytest` with coverage; avoid mock tests; use real API calls with OPENROUTER_API_KEY_FOR_TESTING |
| 96 | +3. **Linting**: Ruff pre-commit hooks with --fix and --unsafe-fixes |
| 97 | +4. **Documentation**: Keep plan.md updated with progress |
| 98 | +5. **Integration tests**: Run with `uv run pytest -m integration`; skip with `uv run pytest -m "not integration"` |
| 99 | + |
| 100 | +## External Resources |
| 101 | +- HED Schemas: `/Users/yahya/Documents/git/HED/hed-schemas` |
| 102 | +- HED Validation: `/Users/yahya/Documents/git/HED/hed-javascript` |
| 103 | +- HED Documentation: `/Users/yahya/Documents/git/HED/hed-resources` |
| 104 | + |
| 105 | +## Deployment URLs |
| 106 | +- **Production API**: https://api.annotation.garden/hedit (planned) |
| 107 | +- **Development API**: https://api.annotation.garden/hedit-dev (planned) |
| 108 | +- **Frontend**: https://hedit.pages.dev (Cloudflare Pages, planned) |
| 109 | +- **PyPI Package**: `hedit` (planned) |
| 110 | + |
| 111 | +## Current Phase |
| 112 | +See plan.md for detailed roadmap and current tasks. |
| 113 | +- **v0.6.0**: HEDit rebrand + api.annotation.garden migration |
| 114 | +- **v0.6.1**: CLI implementation |
| 115 | +- Use `uv` for all Python development |
0 commit comments