Skip to content

feat(control): assemble durable boot context#183

Merged
hadamrd merged 2 commits into
trunkfrom
loop/165-feat-control-assemble-bootcontext-from-d
Jun 2, 2026
Merged

feat(control): assemble durable boot context#183
hadamrd merged 2 commits into
trunkfrom
loop/165-feat-control-assemble-bootcontext-from-d

Conversation

@hadamrd
Copy link
Copy Markdown
Owner

@hadamrd hadamrd commented Jun 2, 2026

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.

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 hadamrd added the critic:blocking Critic found blocking issues label Jun 2, 2026
Copy link
Copy Markdown
Owner Author

@hadamrd hadamrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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:
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Owner Author

@hadamrd hadamrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manifesto violations:

  • [sev2] testing.md#TE-002def 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.

@hadamrd
Copy link
Copy Markdown
Owner Author

hadamrd commented Jun 2, 2026

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.

@hadamrd hadamrd removed the critic:blocking Critic found blocking issues label Jun 2, 2026
@hadamrd hadamrd merged commit 10a089f into trunk Jun 2, 2026
2 checks passed
@hadamrd hadamrd deleted the loop/165-feat-control-assemble-bootcontext-from-d branch June 2, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(control): assemble BootContext from durable stores

1 participant