Files
motief/.mindmodel/constraints
sgeboers f376300804 refactor: delete stale files and consolidate .mindmodel structure
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
2026-04-04 18:46:53 +02:00
..

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

  1. Before writing code: Check patterns/patterns.yaml for how similar features are implemented
  2. When naming things: Follow conventions/conventions.yaml (snake_case functions, PascalCase classes)
  3. When handling errors: Avoid patterns in anti-patterns/anti-patterns.yaml
  4. When working with domain terms: Reference domain/domain-glossary.yaml
  5. When connecting components: See dependencies/dependencies.yaml for 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 moduledb, 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 mappings
  • stack/stack.yaml — tech stack
  • architecture/architecture.yaml — data flow & components
  • conventions/conventions.yaml — coding conventions
  • domain/domain-glossary.yaml — domain terminology
  • patterns/patterns.yaml — 10 code patterns with examples
  • anti-patterns/anti-patterns.yaml — 7 anti-patterns including CRITICAL BUG
  • dependencies/dependencies.yaml — library wiring
  • README.md — this index