Skip to content

feat: add controller preview foundation#136

Merged
rlippmann merged 3 commits into
mainfrom
codex/controller-preview
May 23, 2026
Merged

feat: add controller preview foundation#136
rlippmann merged 3 commits into
mainfrom
codex/controller-preview

Conversation

@rlippmann
Copy link
Copy Markdown
Owner

@rlippmann rlippmann commented May 23, 2026

What changed

  • Added a new stateless controller module above the engine:
    • step(engine, user_input) -> StepResult
    • preview(engine, user_input) -> PreviewResult
    • state_diff(before, after) -> StructuralDiff
  • Implemented checkpoint-based preview orchestration only:
    1. export checkpoint
    2. run engine.step(...)
    3. capture decision/state/diff
    4. restore checkpoint in finally
    5. fail preview if restore fails
  • Added controller result/diff typed contracts and exported controller APIs/types from package root.
  • Added focused controller tests covering:
    • contract shape stability (output_version, mode, required keys)
    • non-mutation guarantees
    • clarify/pending behavior
    • idempotent/no-op behavior
    • restore-failure behavior
    • pending confirmation user-flow narrative (yes/no preview then real confirmation)
  • Added small Python-local controller fixtures under tests/fixtures/controller/ for preview behavior checks.

Part of #84

Why

  • Establish the 0.7 controller/preview foundation while preserving engine authority and structural contracts.
  • Provide deterministic, inspectable dry-run behavior without adding a second semantic layer.
  • Keep host-facing orchestration logic minimal and stateless.

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann rlippmann merged commit a6c8d17 into main May 23, 2026
12 checks passed
@rlippmann rlippmann deleted the codex/controller-preview branch May 23, 2026 02:21
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.

1 participant