Skip to content

feat(runtime): brain-split configuration and fold-cursor migration - #2183

Open
ohdearquant wants to merge 3 commits into
fix/schema-terminal-version-agnosticfrom
feat/brain-split-config
Open

feat(runtime): brain-split configuration and fold-cursor migration#2183
ohdearquant wants to merge 3 commits into
fix/schema-terminal-version-agnosticfrom
feat/brain-split-config

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

First slice of the brain feedback-fold decoupling (ADR-171 phase 1). This lands the inert machinery only — nothing reads the new configuration yet, and no dispatch behavior changes.

  • V22 migration brain_fold_cursor: one durable checkpoint row per tailed event source, advanced by compare-and-set inside the same transaction as the fold it covers, so each feedback event folds exactly once across any number of worker processes.
  • RuntimeConfig.brain_split: Option<BrainSplitConfig> (new brain_split module): None — the value every construction site in this PR uses — keeps today's behavior, the feedback fold running synchronously inside verb dispatch. Some is wired up by the follow-up PR that adds the fold worker.
  • Mechanical field additions at every RuntimeConfig struct-literal construction site across the workspace.

Stacked on #2177, which makes the schema-terminal predicates version-agnostic so a V22 can land at all; this PR is the first consumer of that fix.

Testing

  • cargo fmt --check --all, cargo clippy --workspace --all-targets --all-features clean.
  • Full suites green for khive-db, khive-runtime, khive-mcp, kkernel, and the five touched pack crates — kkernel's migration assertions now exercise the chain at V22.

@ohdearquant
ohdearquant marked this pull request as ready for review August 24, 2026 20:42

@ohdearquant ohdearquant left a comment

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.

Automated review. Posted by this repository's automated pull-request review pipeline; this is not a human read and does not gate the merge by itself.

Verdict on head 36c0ec8: REQUEST-CHANGES, 3 blocking findings. Finding details are delivered to the review's recipients rather than posted here. Do not merge this head while blocking findings are outstanding; a pipeline comment on a newer head supersedes this one.

…s, fingerprint separation

Three fixes reconciling the B1 slice to merged ADR-171:

- V22 cursor gains `last_event_id`: the (rowid, event id) witness pair
  from ADR-171's replay protocol. An implicit rowid is renumbered by
  VACUUM, so a bare rowid cursor could silently skip or re-fold after
  routine maintenance; the witness lets a worker validate the position,
  rebase by id on mismatch, and rewind-never-skip when the witnessed row
  was purged.
- brain_split docs no longer promise behavior this tree does not have:
  the field is a forward-deployed seam, nothing populates it, and the
  fold worker that consumes it is the next change in the series.
- compute_config_id folds the brain-split mode when configured, so split
  and legacy fold semantics can never share a warm daemon; the component
  is skipped when None (mirroring the topology component), preserving
  byte-identity for every existing daemon. Test proves Some != None and
  that None contributes no component; a no-op mutant reddens it.

@ohdearquant ohdearquant left a comment

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.

Automated review. Posted by this repository's automated pull-request review pipeline; this is not a human read and does not gate the merge by itself.

Verdict on head d01c40a: REQUEST-CHANGES, 1 blocking finding. Finding details are delivered to the review's recipients rather than posted here. Do not merge this head while blocking findings are outstanding; a pipeline comment on a newer head supersedes this one.

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