1.1 Rename task_* to quest_* with legacy-dev migration path (D-007) #45

Member

Implements IMPLEMENTATION-ORDER.md §1.1 (decision D-007, pre-release rename in place).

Changes

  • schema.py: quest_definitions/quest_instances DDL; constants renamed to SCHEMA_V1_QUEST_DEFINITIONS_DDL / SCHEMA_V1_QUEST_INSTANCES_DDL; docstrings follow the table names.
  • dao_rules.py / dao_instances.py: all SQL renamed; TaskDefinitionsDao → QuestDefinitionsDao, TaskInstancesDao → QuestInstancesDao, records renamed; error messages say quest.
  • migrations.py: migration 2 added — async-callable step detecting legacy task_* tables (dev databases stamped version 1 by the pre-rename runner) and ALTER TABLE RENAMing them inside the migration transaction; SQLite rewrites FK clauses on rename. Latest schema version is now 2.
  • tests: full rename; migration tests updated for version 2 (fresh-file, no-op, setup wiring); four new legacy-rename tests (rows preserved, FK follows rename, idempotent across restarts, fresh DBs never hold task_* names); completion_events append-only leak guard still clean.

Verification

uv run pytest: 777 passed.

Closes task dfd0b9a9 (feature 14, task 1.1).

Implements IMPLEMENTATION-ORDER.md §1.1 (decision D-007, pre-release rename in place). ## Changes - **schema.py**: quest_definitions/quest_instances DDL; constants renamed to SCHEMA_V1_QUEST_DEFINITIONS_DDL / SCHEMA_V1_QUEST_INSTANCES_DDL; docstrings follow the table names. - **dao_rules.py / dao_instances.py**: all SQL renamed; TaskDefinitionsDao → QuestDefinitionsDao, TaskInstancesDao → QuestInstancesDao, records renamed; error messages say quest. - **migrations.py**: migration 2 added — async-callable step detecting legacy task_* tables (dev databases stamped version 1 by the pre-rename runner) and ALTER TABLE RENAMing them inside the migration transaction; SQLite rewrites FK clauses on rename. Latest schema version is now 2. - **tests**: full rename; migration tests updated for version 2 (fresh-file, no-op, setup wiring); four new legacy-rename tests (rows preserved, FK follows rename, idempotent across restarts, fresh DBs never hold task_* names); completion_events append-only leak guard still clean. ## Verification uv run pytest: 777 passed. Closes task dfd0b9a9 (feature 14, task 1.1).
dev_agent added 1 commit 2026-09-15 09:36:20 -04:00
Per design/IMPLEMENTATION-ORDER.md 1.1 and decision D-007: the domain
model takes the quest vocabulary pre-release. SCHEMA_V1 now creates
quest_definitions/quest_instances directly; DAO classes, records and
error messages follow (QuestDefinitionsDao, QuestInstancesDao). The
migration runner gains migration 2, an async-callable step that detects
surviving task_* tables on dev machines and ALTER TABLE RENAMES them
inside the migration transaction, with FK clauses rewritten by SQLite.
Migration 1's content rewrite is legal because nothing was ever
shipped; dev databases stamped version 1 ride migration 2 up to 2.
overseer force-pushed task/dfd0b9a9-quest-rename from 25f0a43e16 to c988f6508b 2026-09-15 10:00:12 -04:00 Compare
dev_agent merged commit b955ab487b into feature/c16267ae-75be-4a4e-b14f-e41c06c8ab11-design-model-changes 2026-09-15 10:35:00 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#45