Merge Orchestration runtime · operational glue: Dispatcher.decide_all + write_manifest#491
Merged
Merged
Conversation
…+ write_manifest Makes the runtime operational on the output side: - Dispatcher.decide_all/1: batch-decide over PR contexts -> decisions/entries/leases + stats (pure). - Dispatcher.write_manifest/2: emit the merge-decision JSONL that the dispatch-runner + the .git-private-farm actuator consume. The JSON encoder is injectable (opts[:encode]) so the logic is locally testable without deps; production uses Jason. - 2 new ExUnit cases. Full merge_orchestration suite: 22 tests, 0 failures (local elixir 1.14). Remaining for full operation is the INPUT side -- fetch open PRs + build contexts from bot attestations / bot_directive pools (the sensory layer) -- plus real central Kin.Gate lease storage. https://claude.ai/code/session_011GXPoh6pB6rm3jfeLHWMtc
🔍 Hypatia Security ScanFindings: 42 issues detected
View findings[
{
"reason": "Repository has 5 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "src/ui/gossamer/README.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "scripts/ci-tools/Cargo.toml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "scripts/bench-tools/Cargo.toml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "ffi/zig/README.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "docs/reports/audit/audit-2026-04-15-post.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "docs/integration/github-registry.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "docs/integration/github-registry.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "docs/integration/a2ml-k9.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 11 day(s) old",
"type": "CSA001",
"file": "docs/architecture/system-integration.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operational glue — the runtime now emits a manifest
This closes the gap between the pure
Dispatcher.dispatch/1(decision →{decision, manifest_entry, lease}) and the file the downstream consumers actually read. Two additions tolib/merge_orchestration/dispatcher.ex:decide_all/1— batch-decide over many PR contexts →%{decisions, entries, leases, stats}, wherestatstallies by strategy (auto_execute/review/report_only). Pure (data in, data out).write_manifest/2— the thin operational glue: decides over the contexts and writesmerge-decisions.jsonl(one entry per line) into the verisim dispatch dir — the sametier×strategyvocabulary thedispatch-runnerand the.git-private-farmactuator already consume.Encoder is injected, so the logic tests stay dependency-free
Production resolves
Jason(a real hypatia dep); the tests pass a stub encoder, so the manifest-writing logic is exercised without dragging the JSON dep into the unit suite.Testing (actual, not looks-right)
Ran the full merge-orchestration suite locally under Elixir 1.14:
Two new tests in
test/merge_orchestration/dispatcher_test.exs:decide_allbatches three contexts (arm/clamp/veto) and assertsstats == %{total: 3, auto_execute: 1, review: 1, report_only: 1}.write_manifestwrites one JSONL line per decision into aSystem.tmp_dir!path using a stub encoder, then reads it back and asserts the line count + content.Scope / safety
lib/does not).dispatch/1,to_manifest_entry/1, orlease_for/2.Where this leaves the runtime
Sense → deliberate → actuate is now wired end-to-end on the deliberate→actuate seam: Strategist (decide) → Kin.Council (consensus) → Dispatcher (
dispatch+decide_all+write_manifest) → JSONL → dispatch-runner /.git-private-farmactuator (independent re-verification).The remaining piece for full operation is the INPUT/sensory layer: fetch open PRs, build a context per PR from the bots' signed attestations + the repo's
bot_directivepool, and feed those intodecide_all. That's the next increment — held for your steer.Generated by Claude Code