Merge Orchestration · k9 lease validator (LeaseValidator + mix hypatia.validate_leases)#499
Merged
Merged
Conversation
…lease store
The a5 "k9 lease validator" follow-on. KinGate.decide_acquire prevents bad
ACQUIRES at mint time; this validates the PERSISTED store after the fact,
catching drift a live gate can't see across files.
* Hypatia.MergeOrchestration.LeaseValidator.validate/2 (pure) over a list of
a5 lease records returns violations:
- {:le1_no_ttl, id} held lease with no expires_at (LE1)
- {:le2_meta_unauthorized, id} held meta lease w/o owner_authorized (LE2)
- {:stale, id} held lease past its TTL (coordination drift)
- {:overlap, repo, [id]} >=2 live held leases on one repo (the
one-bot-per-repo rule broken in the store)
* validate_store/2 reads the lease dir via KinGate.FileStore (decode injectable).
* mix hypatia.validate_leases [--store PATH] -- the runnable CI gate; exits
non-zero on any violation. This is what the a5 standards INTENT probe points at.
71 ExUnit (was 64): +7 LeaseValidator (clean / LE1 / LE2 + authorized-clean /
stale / overlap / different-repo+released-no-overlap / validate_store-over-dir).
0 failures, local elixir 1.14, mix-format-clean, scanner-clean. LEDGER v0.9.0
also records the manifest-shape adapter (farm #80, merged) resolving that seam.
🔍 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.
k9 lease validator — audit the persisted lease store
The a5 follow-on you asked for.
KinGate.decide_acquireprevents bad acquires at mint time; this validates the persisted lease store after the fact, catching coordination drift a live gate can't see across files.LeaseValidator.validate/2(pure) over a list of a5 lease records → violations:{:le1_no_ttl, id}— aheldlease with noexpires_at(LE1){:le2_meta_unauthorized, id}— aheldmeta-territory lease withoutowner_authorized(LE2){:stale, id}— aheldlease past its TTL (should have released/expired){:overlap, repo, [id]}— ≥2 liveheldleases on one repo (the "one bot per repo" rule broken in the store)validate_store/2— reads the lease dir viaKinGate.FileStore(decoder injectable).mix hypatia.validate_leases [--store PATH]— the runnable gate; exits non-zero on any violation. This is exactly what the a5 standardsINTENTprobe I drafted points at (.machine_readable/contractiles/trust/lease-validator.ncl).Testing (actual, not looks-right)
71 ExUnit, 0 failures (was 64), mix-format-clean, scanner-clean:
The +7 LeaseValidator tests: clean store, LE1 (no TTL), LE2 (meta unauthorized) + authorized-is-clean, stale (past TTL), overlap (two live held on one repo), different-repos/released-don't-overlap, and
validate_storereading a real lease dir (injected codec).Scope / safety
lib/+ a Mix task, your review.KinGate(mint-time) with store-time auditing.Where this leaves the four items
bag-of-actionsbeing added to scope.standards); theINTENTprobe references this validator, so once you approve, the two click together.LEDGER is at
v0.9.0with the full state.Generated by Claude Code