feat(control): assemble durable boot context#183
Conversation
Fixes #165 by loading maestro reset context from explicit durable stores instead of relying on transcript state. The boot contract now includes frontier, memory IDs, rejected-path memory IDs, in-flight task/saga IDs, event sequence, and projection lag after stores are reopened.
hadamrd
left a comment
There was a problem hiding this comment.
[sev2/tests] SqliteTaskSagaStore.get() adds a public missing-row branch that returns None, but the new tests only call get() for an existing task. TE-002 requires a sad-path test for each new public function; add a focused test such as assert SqliteTaskSagaStore(db).get("missing-task") is None after reopening the store, and mirror it for the fake if the fake is intended to share the contract.
| ) | ||
| return saga | ||
|
|
||
| def get(self, task_id: str) -> TaskSaga | None: |
There was a problem hiding this comment.
[sev2/tests] SqliteTaskSagaStore.get() adds a public missing-row branch that returns None, but the new tests only call get() for an existing task. TE-002 requires a sad-path test for each new public function; add a focused test such as assert SqliteTaskSagaStore(db).get("missing-task") is None after reopening the store, and mirror it for the fake if the fake is intended to share the contract.
hadamrd
left a comment
There was a problem hiding this comment.
Manifesto violations:
- [sev2] testing.md#TE-002 —
def get(self, task_id: str) -> TaskSaga | None: row = self._connection.execute( """ SELE→ Add an adversarial test for the new public get() missing-task path, asserting it returns None after opening/reopening an empty or unrelated task saga store.
|
Review fix applied in daa8c98: added TE-002 sad-path coverage for SqliteTaskSagaStore.get("task-missing") returning None after reopen, mirrored against FakeTaskSagaStore. Verified locally: targeted pytest 18 passed; ruff check passed; ruff format --check passed; mypy passed; pyright 0 errors. Direct critic rerun found no concrete blocking defect; GitHub replay is green. |
Fixes #165\n\n## Acceptance criteria\n- Assembles BootContext from reopened durable frontier, event log, memory, and task saga stores.\n- Includes frontier summary, active memory IDs, rejected-path memory IDs, in-flight task IDs and saga IDs, latest event sequence, and projection cursor lag.\n- Raises a clear BootContextError for missing required frontier state.\n- Treats missing optional memory/task stores and no active tasks as empty state, not failure.\n\n## Tests\n- env -u VIRTUAL_ENV uv run --extra dev pytest tests/test_frontier_store.py tests/test_eventlog_sqlite.py tests/test_boot_context.py tests/test_task_saga_store.py tests/test_cli_status_control_plane.py -q\n- env -u VIRTUAL_ENV uv run --extra dev ruff check src/forge_loop/control/boot.py src/forge_loop/eventlog/store.py src/forge_loop/eventlog/sqlite.py src/forge_loop/tasks/store.py src/forge_loop/tasks/init.py src/forge_loop/_testing/task_saga_store.py tests/test_boot_context.py tests/test_task_saga_store.py\n- env -u VIRTUAL_ENV uv run --extra dev ruff format --check src/forge_loop/control/boot.py src/forge_loop/eventlog/store.py src/forge_loop/eventlog/sqlite.py src/forge_loop/tasks/store.py src/forge_loop/tasks/init.py src/forge_loop/_testing/task_saga_store.py tests/test_boot_context.py tests/test_task_saga_store.py\n- env -u VIRTUAL_ENV uv run --extra dev mypy src/forge_loop/control/boot.py src/forge_loop/eventlog/store.py src/forge_loop/eventlog/sqlite.py src/forge_loop/tasks/store.py src/forge_loop/tasks/init.py src/forge_loop/_testing/task_saga_store.py tests/test_boot_context.py tests/test_task_saga_store.py\n- env -u VIRTUAL_ENV uv run --extra dev pyright src/forge_loop/control/boot.py src/forge_loop/eventlog/store.py src/forge_loop/eventlog/sqlite.py src/forge_loop/tasks/store.py src/forge_loop/tasks/init.py src/forge_loop/_testing/task_saga_store.py tests/test_boot_context.py tests/test_task_saga_store.py\n\nLumen discovery skipped because mcp__lumen__semantic_search was unavailable.