Skip to content

feat: add evolution controller and append-only ledger - #38

Open
divo12 wants to merge 11 commits into
stack/v2-03-gate-v2from
stack/v2-04-controller
Open

feat: add evolution controller and append-only ledger#38
divo12 wants to merge 11 commits into
stack/v2-03-gate-v2from
stack/v2-04-controller

Conversation

@divo12

@divo12 divo12 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • add typed, fsynced append-only evolution ledger with sequence-keyset paging, verified owner lock, corruption fail-closed replay, and idempotent event identities
  • add resumable EvolutionController status/advance state machine coordinating hypothesis, candidate, evaluated receipt, gate decision, stops, and pre-PR5 AwaitingPublication barrier
  • expose evolution_status and advance_evolution MCP tools and route the generated program through controller calls

Data flow and trust boundary

MCP -> EvolutionController -> typed policy/hypothesis/candidate/gate receipts -> FileEvolutionLedger in Git common control dir. No trace payloads or provider responses are persisted locally.

Verification

  • PR3 resynced at c5e6a34
  • 365 passed, 2 skipped; 94.74% coverage
  • ruff, strict mypy, Radon, four skill validators, and plugin validation passed locally

Scope

Targets only stack/v2-03-gate-v2. No merge, deployment, System Book, harness/runtime/E2B/canary/live-adapter work, or uv.lock changes.


Summary by cubic

Adds a typed, fsynced append-only evolution ledger and resumable EvolutionController that replaces direct hypothesis recording and candidate execution with one-step evolution actions. The generated program now checks evolution_status, advances once per call, and stops before publication; trace payloads and provider responses remain unpersisted locally.

New Features

  • Stores typed events in Git’s common control directory with keyset paging, verified owner locking, fail-closed replay, and idempotent identities.
  • Binds receipts and gate decisions to accepted content identities so review decisions remain valid across rebases.
  • Exposes evolution_status and advance_evolution through MCP and falls back to the persisted baseline commit when the active baseline is unavailable.

Written for commit 8fde9ef. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 14 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread src/ofw/evolution/ledger.py
Comment thread src/ofw/evolution/ledger.py
Comment thread src/ofw/evolution/controller.py
Comment thread src/ofw/evolution/controller.py
Comment thread src/ofw/preparation/policy.py
Comment thread plugins/openflywheel/program_templates/base.md Outdated
Comment thread src/ofw/evolution/controller.py
Comment thread src/ofw/preparation/templates/base.md Outdated
Comment thread plugins/openflywheel/program_templates/base.md Outdated
Comment thread plugins/openflywheel/program_templates/base.md

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/ofw/evolution/ledger.py
Comment thread src/ofw/evolution/controller.py
Comment thread src/ofw/evolution/controller.py

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 10 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/ofw/evolution/controller.py
Comment thread src/ofw/preparation/templates/base.md
Comment thread plugins/openflywheel/program_templates/base.md
@divo12
divo12 force-pushed the stack/v2-03-gate-v2 branch from c5e6a34 to bd36934 Compare September 3, 2026 12:29
@divo12
divo12 force-pushed the stack/v2-04-controller branch from 8cc0e1e to c719e05 Compare September 3, 2026 12:39
@divo12

divo12 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

Restack transparency note:

During the requested rebase onto stack/v2-03-gate-v2, the first guarded --force-with-lease attempt was intentionally rejected: it expected remote head 8cc0e1e4dd0d9cc06aee13e8de3b8d7c6c493255, but the remote branch had advanced to c719e050fbe4ca1be6c646eba437a11825c70f1d. After refreshing the remote state, the rebase was published with a guarded lease from exact old head c719e050fbe4ca1be6c646eba437a11825c70f1d to exact new head cd5e2316fa2fcedae6f76afa7b286768d63dd945. No unrelated remote work was overwritten; the lease protected against that case. No further force-pushes will be performed.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/ofw/evolution/controller.py
Comment thread src/ofw/evolution/controller.py

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/ofw/evolution/controller.py Outdated
@divo12
divo12 force-pushed the stack/v2-03-gate-v2 branch from bd36934 to 4ba81a4 Compare September 4, 2026 05:34
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