Skip to content

Merge Orchestration runtime · operational glue: Dispatcher.decide_all + write_manifest#491

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/peaceful-pascal-IRlgq
Jun 14, 2026
Merged

Merge Orchestration runtime · operational glue: Dispatcher.decide_all + write_manifest#491
hyperpolymath merged 1 commit into
mainfrom
claude/peaceful-pascal-IRlgq

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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 to lib/merge_orchestration/dispatcher.ex:

  • decide_all/1 — batch-decide over many PR contexts → %{decisions, entries, leases, stats}, where stats tallies by strategy (auto_execute / review / report_only). Pure (data in, data out).
  • write_manifest/2 — the thin operational glue: decides over the contexts and writes merge-decisions.jsonl (one entry per line) into the verisim dispatch dir — the same tier × strategy vocabulary the dispatch-runner and the .git-private-farm actuator already consume.

Encoder is injected, so the logic tests stay dependency-free

encode = Keyword.get_lazy(opts, :encode, fn -> &Jason.encode!/1 end)

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:

22 tests, 0 failures

Two new tests in test/merge_orchestration/dispatcher_test.exs:

  • decide_all batches three contexts (arm/clamp/veto) and asserts stats == %{total: 3, auto_execute: 1, review: 1, report_only: 1}.
  • write_manifest writes one JSONL line per decision into a System.tmp_dir! path using a stub encoder, then reads it back and asserts the line count + content.

Scope / safety

  • Not auto-armed — core-tier code, so it routes to your review per the pool rule we're dogfooding (docs/design PRs arm; lib/ does not).
  • Object-level, additive only: two new public functions + one private nothing; no change to dispatch/1, to_manifest_entry/1, or lease_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-farm actuator (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_directive pool, and feed those into decide_all. That's the next increment — held for your steer.


Generated by Claude Code

…+ 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
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 42 issues detected

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 42
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

@hyperpolymath hyperpolymath merged commit 9c36bc2 into main Jun 14, 2026
38 checks passed
@hyperpolymath hyperpolymath deleted the claude/peaceful-pascal-IRlgq branch June 14, 2026 04:15
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.

2 participants