Merge Orchestration · live operational Loop (sense → deliberate → gate → manifest)#495
Merged
Merged
Conversation
…nally bites
One entry point threading the merged modules over the shared store:
observations -> Sensor.sense -> (KinCompetence) -> Strategist/KinCouncil
-> KinGate -> merge-decisions.jsonl
This is the first place KinGate actually constrains Dispatcher output. A
decision stays auto_execute only if it CLAIMS the repo; two mutual-exclusion
layers:
* in-cycle -- at most one armed PR per repo per run (a 2nd same-repo arm is
deferred to report_only via a MapSet), so the actuator never gets two
auto_execute entries for a repo whose base is about to move;
* cross-agent / cross-cycle -- KinGate acquires the persistent per-repo lease;
another holder (another agent, or a still-live previous cycle) -> deferred.
* meta claims refused at the gate (LE2) -- defence in depth behind the
Strategist's meta=>flag guard.
Token-free: the loop only READS the store (observations the farm producer
deposited, signed attestations, pool policies) and WRITES the manifest + lease
records. The actuator is a separate process that reads the manifest and merges.
plan/6 is pure given an injected acquire fn (gate logic tests with no
filesystem); run/1 is the thin I/O shell; JSON codec injectable (Jason in prod).
58 ExUnit (was 54): +4 Loop -- in-cycle dedup, cross-agent lease conflict (both
via the real FileStore gate), mixed-cycle stats, full store->manifest round-trip;
+1 Jason-guarded. 0 failures, local elixir 1.14, mix-format-clean, scanner-clean.
🔍 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.
The live operational loop — where the gate finally bites
The runtime spine + the three operationalisation pieces are all merged, but they were unconnected modules.
Hypatia.MergeOrchestration.Loopis the single entry point that threads them into one real run over the shared store:Why this is more than a sequencer
This is the first place
KinGateactually constrainsDispatcheroutput. A decision staysauto_executeonly if it can claim the repo. Two layers of mutual exclusion:report_only(tracked with aMapSetthrough the fold), so the actuator never receives twoauto_executeentries for a repo whose base is about to move. (The persistent lease alone wouldn't catch this — both arms come from the same holder, soKinGatewould renew, not conflict.)KinGateacquires the persistent per-repo lease; if another holder (another agent, or a still-live previous cycle) holds it, the arm is deferred.meta ⇒ flag.A deferred arm is rewritten to
report_onlywith a[gate:…]rationale, so the actuator's independent re-verification sees a non-executable entry.Token-free by construction
The loop only reads the store (observations the farm producer deposited, signed attestations, pool policies) and writes the manifest + lease records. The actuator (
.git-private-farm, the PAT holder) is a separate process that reads the manifest and merges — the loop never calls it.Store layout under
opts[:store]:observations/·pools/·attestations/·leases/·merge-decisions.jsonl.Design / testability
plan/6is pure given an injectedacquirefn — the gate logic tests with no filesystem.run/1is the thin I/O shell; JSON codec injectable (Jason in prod),:trusttakes a GoT snapshot (empty ⇒ uniform council),:nowoverridable.Testing (actual, not looks-right)
58 ExUnit, 0 failures (was 54) under Elixir 1.14, mix-format-clean, scanner-clean:
The +4 Loop tests exercise the gate for real (over the actual
FileStore):auto_execute, secondreport_only(same-repo-this-cycle);report_only(lease-held:robot-repo-automaton);%{total: 4, armed: 2, deferred: 0, review: 1, flagged: 1}, gating only the arms;run/1over a real store of observation/pool/attestation files → reads, gates, writes the manifest, persists the lease.run/1(real JSON codec) that runs in CI.Scope / safety
lib/, your review.Where this leaves it
The pipeline now runs end to end in one call —
Loop.run(store: …)does sense → deliberate → gate → manifest. The only thing left is a scheduled trigger (a Mix task or a tick on an existing GenServer) that callsLoop.run/1on a cron with a live GoT trust snapshot (KinCompetence.trust_from_got/2) — pure wiring to an existing scheduler, no new brain logic — plus the owner follow-ons (a5standardsadoption; P3 handshake + mass_squash in the actuator; the farm Actions-billing fix).Generated by Claude Code