feat: add selection filter DSL parser

Implement parser for filter strings like "species:duck sex:female -tag:old".
Supports AND (space), OR (|), negation (-), and quoted values.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-29 15:19:11 +00:00
parent 457f403e32
commit 6e9fd17327
5 changed files with 456 additions and 7 deletions

12
PLAN.md
View File

@@ -190,12 +190,12 @@ Check off items as completed. Each phase builds on the previous.
## Phase 5: Selection & Historical Queries
### Step 5.1: Selection Filter DSL Parser
- [ ] Create `selection/parser.py` for filter parsing
- [ ] Support: AND (default), OR (|), negate (-), quotes
- [ ] Fields: location, species, sex, life_stage, identified, tag
- [ ] Create `selection/ast.py` for filter AST nodes
- [ ] Write tests for all filter syntax variations
- [ ] **Commit checkpoint**
- [x] Create `selection/parser.py` for filter parsing
- [x] Support: AND (default), OR (|), negate (-), quotes
- [x] Fields: location, species, sex, life_stage, identified, tag
- [x] Create `selection/ast.py` for filter AST nodes
- [x] Write tests for all filter syntax variations
- [x] **Commit checkpoint**
### Step 5.2: Historical State Resolver
- [ ] Update `selection/resolver.py` for point-in-time resolution