Deleted stale root-level Python files: - main.py (unused 'Hello world' script) - verify.py (unused table info script) - scraper.py (unused MotionScraper class) - scheduler.py (unused DataUpdateScheduler class) Deleted duplicate .mindmodel root YAML files (subdirectory versions are more comprehensive): - anti-patterns.yaml, architecture.yaml, conventions.yaml - dependencies.yaml, domain.yaml, domain-glossary.yaml - stack.yaml, tech-stack.yaml, workflows.yaml Added comprehensive .mindmodel subdirectories: - constraints/ (naming, db-schema, error-handling, types, etc.) - patterns/ (api, architecture, database, python, streamlit, etc.) - examples/ (code examples for each pattern) - anti-patterns/, architecture/, conventions/, dependencies/, domain/, stack/ Updated ARCHITECTURE.md to reflect current codebase: - Removed references to non-existent files - Added missing files (explorer.py, explorer_helpers.py, pipeline/) - Added directory structure documentation - Updated tech stack to include scipy, sklearn, umap Updated .gitignore: - Added patterns for generated analysis files - Added .worktrees/ pattern (was already in gitignore but dir was deleted) Removed empty .worktrees/ directory
Constraint Files Index
This directory contains all constraint files for the Stemwijzer codebase.
Quick Navigation
| Category | File | Purpose |
|---|---|---|
| Stack | ../stack/stack.yaml |
Tech stack overview |
| Architecture | ../architecture/architecture.yaml |
Data flow, page routing, component relationships |
| Conventions | ../conventions/conventions.yaml |
Naming, error handling, code organization |
| Domain | ../domain/domain-glossary.yaml |
Dutch political terms, algorithm concepts |
| Patterns | ../patterns/patterns.yaml |
10 code patterns (page wrapper, pipeline, etc.) |
| Anti-Patterns | ../anti-patterns/anti-patterns.yaml |
⚠️ 7 issues including CRITICAL BUG |
| Dependencies | ../dependencies/dependencies.yaml |
Library wiring, singletons, imports |
How to Use
- Before writing code: Check
patterns/patterns.yamlfor how similar features are implemented - When naming things: Follow
conventions/conventions.yaml(snake_case functions, PascalCase classes) - When handling errors: Avoid patterns in
anti-patterns/anti-patterns.yaml - When working with domain terms: Reference
domain/domain-glossary.yaml - When connecting components: See
dependencies/dependencies.yamlfor wiring
Key Conventions Summary
- Files: snake_case (
explorer_helpers.py) - Functions: snake_case (
compute_party_coords) - Classes: PascalCase (
MotionDatabase) - Constants: UPPER_SNAKE_CASE (
PARTY_COLOURS) - No bare
except:— always specify exception type - Pure functions in helpers — no IO, no Streamlit calls
- One singleton per module —
db,config,PARTY_COLOURS
⚠️ Critical Bug
Read ../anti-patterns/anti-patterns.yaml first. Section 1 documents a critical bug in
explorer_helpers.py:compute_party_coords where party names in svd_vectors entity_id are
not recognized because party_map only contains MP-name keys.
Files Generated
manifest.yaml— lists all constraint files with group mappingsstack/stack.yaml— tech stackarchitecture/architecture.yaml— data flow & componentsconventions/conventions.yaml— coding conventionsdomain/domain-glossary.yaml— domain terminologypatterns/patterns.yaml— 10 code patterns with examplesanti-patterns/anti-patterns.yaml— 7 anti-patterns including CRITICAL BUGdependencies/dependencies.yaml— library wiringREADME.md— this index