Skip to content

feat(control): assemble BootContext from durable stores #165

@hadamrd

Description

@hadamrd

Parent: #163

Goal

Assemble a boot-loadable BootContext from durable stores: frontier cursor, memory IDs, in-flight task saga IDs, and latest event sequence.

This is the reset recovery contract. A maestro starting after context loss should not guess what matters; it should load a compact strategic context from explicit durable projections.

Scope

Expected owned surface:

  • src/forge_loop/control/boot.py
  • src/forge_loop/frontier/
  • src/forge_loop/eventlog/
  • src/forge_loop/memory/
  • src/forge_loop/tasks/
  • focused tests under tests/test_boot_context.py or equivalent.

Prefer small adapter protocols/fakes over a broad runner integration. The goal is boot assembly, not dispatch.

Required Behavior

  • BootContext includes:
    • frontier cursor summary;
    • active memory IDs;
    • rejected-path memory IDs if the memory store exposes them;
    • in-flight task IDs/saga IDs;
    • latest event sequence;
    • projection cursor positions or lag when available.
  • Boot assembly can run after reopening all durable stores.
  • Missing optional stores fail diagnosably or return empty sections; missing required frontier state should be explicit.
  • BootContext.summary() remains compact enough to be placed near the edge of an LLM context.

Acceptance Tests

  • Seed a frontier cursor, event log, memory records, and task saga records.
  • Reopen the stores and assemble a BootContext.
  • Assert the summary contains the current problem, next expansion, active memory IDs, in-flight task IDs, and latest event sequence.
  • Add a missing-frontier test that errors clearly.
  • Add a no-active-tasks test proving empty task state is not confused with failure.

Non-goals

  • Do not start workers from boot assembly.
  • Do not call model providers.
  • Do not add a dashboard.
  • Do not make the runner depend on this until the contract is tested.

Verification

Run at minimum:

  • env -u VIRTUAL_ENV uv run --extra dev pytest tests/test_frontier_store.py tests/test_eventlog_sqlite.py -q
  • New boot-context tests.
  • env -u VIRTUAL_ENV uv run --extra dev ruff check <changed files>
  • env -u VIRTUAL_ENV uv run --extra dev ruff format --check <changed files>

Customer Story

A forge-loop operator running autonomous work across multiple sessions benefits because maestro startup can reconstruct what matters without relying on model context.

Source

Expanded during Forge self-dogfood sprint planning on 2026-06-02.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions