diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-09 08:20:52 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-09 08:20:52 -0500 |
| commit | dd20248176086e0e918e8d982a1e38599ed45a87 (patch) | |
| tree | 14a15eb002c3d0aac5931ad4a8191189b7e41bc4 /AGENTS.md | |
| parent | 6dbb77b5e7525d0b38434267ca97fdbe16b8ef84 (diff) | |
Document TASK_TEST_MODE for safe testing in AGENTS.md
Add critical documentation about using test database to protect
production task data during development and testing.
Key points: - Set TASK_TEST_MODE=1 to use .tasks/tasks-test.jsonl -
Test suite automatically uses test mode - Never run destructive tests
on production database
This prevents accidental data loss like we experienced earlier when
test runs overwrote the production tasks.jsonl file.
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -255,11 +255,32 @@ States: ``` .tasks/ -├── tasks.jsonl # Git-tracked, source of truth +├── tasks.jsonl # Git-tracked, production database +├── tasks-test.jsonl # Test database (not tracked, auto-created) ``` Each line in `tasks.jsonl` is a JSON object representing a task. +## Testing and Development + +**IMPORTANT**: When writing or testing code that modifies tasks, use the test database: + +```bash +# Set test mode to protect production database +export TASK_TEST_MODE=1 + +# Now all task operations use .tasks/tasks-test.jsonl +task create "Test task" --type=task +task list + +# Unset when done +unset TASK_TEST_MODE +``` + +**The test suite automatically uses test mode** - you don't need to set it manually when running `task test` or `bild --test Omni/Task.hs`. + +**Never run destructive tests against the production database** (`.tasks/tasks.jsonl`) as this will delete real task data. + ## Example Session ```bash |
