- Set created_at timestamp at service layer using time.time()
- Add PermissionError when non-creator tries to edit/delete
- Add ValueError when tracking non-existent bounty
- Rename create_bounty to add_bounty (matches spec)
- Add clear_link and clear_due parameters for partial updates
- Track timestamps for tracked bounties too
Tests with SimpleRoomStorage and SimpleTrackingStorage (without ensure_*)
show that add_bounty() and track_bounty() work fine without explicit
ensure methods - they create rooms/tracking internally.
This simplifies the Protocol to only essential methods.
- Removed PersonalStorage (redundant - RoomStorage handles both via room_id)
- Added ensure_room() and ensure_tracking() methods for explicit creation
- Added @runtime_checkable to Protocols for isinstance checks
- Added tests/test_ports.py with 11 unit tests for storage protocols
- Bounty.created_by_user_id is now non-optional (always required)
- Removed is_group from RoomData (negative room_id is self-documenting)
- Added room_id to TrackedBounty to track which room bounty was tracked from
- Added clarifying docstrings explaining TrackingData vs TrackedBounty
- Updated tests to match new model structure
- Remove GroupBounty/PersonalBounty subclasses, use Bounty with optional created_by_user_id
- Combine UserData/GroupData into RoomData with room_id and is_group fields
- Add group_id field to TrackingData (supports negative Telegram group IDs)
- Add test_bounty_comparison_not_equal for verifying different bounties are not equal
- Update core/__init__.py exports
- Storage: Change from per-user to per-group JSON files
- Data location: ~/.jigaido/ instead of apps/telegram-bot/data/
- Group bounties: data/{group_id}/group.json
- User tracking: data/{group_id}/{user_id}.json
- Personal bounties: data/{user_id}/user.json
- Update commands.py for new storage model
- Update bot.py to remove admin handlers
- Update tests to reflect created_by_user_id field
- Update SPEC.md with new design
Addresses user feedback from issue #2
Changed from per-user flat files to group/DM directory structure:
- data/{group_id}/group.json — group bounties
- data/{group_id}/{user_id}.json — user tracking in group
- data/{user_id}/user.json — user personal bounties (DM)
- Groups isolated, no cross-group access
- Tracking is per-group-per-user
- Add storage.py with load_user(), save_user(), next_bounty_id()
- Rewrite commands.py to use JSON storage (simplified)
- Remove db.py, schema.sql, cron.py, test_db.py
- Update SPEC.md to reflect new architecture
- Admin model removed (anyone can add, creator only can edit/delete)
- No reminders in v1
db.py:
- Add conn.isolation_level = None to get_conn() — fixes row_factory +
autocommit conflict. row_factory disables implicit transactions,
so we need explicit autocommit mode.
- Remove all conn.commit() calls (unnecessary with autocommit)
pyproject.toml:
- Move pytest + pytest-asyncio to main dependencies (uv run pytest
uses ephemeral env with main deps only)
tests/test_db.py:
- Fix test_upsert_user_updates_username to not chain upsert_user()
calls in assert expressions (test isolation issue)
JIGAIDO is now a platform with apps/ as the container.
All telegram-bot files moved to apps/telegram-bot/:
- bot.py, commands.py, cron.py, db.py, schema.sql
- requirements.txt, .env.example, README.md
- Root now holds SPEC.md, README.md, CONTRIBUTING.md only.
Structure:
jigaido/
├── apps/
│ └── telegram-bot/
└── SPEC.md, README.md, CONTRIBUTING.md