Skip to content

Merge Orchestration · k9 lease validator (LeaseValidator + mix hypatia.validate_leases)#499

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

Merge Orchestration · k9 lease validator (LeaseValidator + mix hypatia.validate_leases)#499
hyperpolymath merged 1 commit into
mainfrom
claude/peaceful-pascal-IRlgq

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

k9 lease validator — audit the persisted lease store

The a5 follow-on you asked for. KinGate.decide_acquire prevents 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} — a held lease with no expires_at (LE1)
    • {:le2_meta_unauthorized, id} — a held meta-territory lease without owner_authorized (LE2)
    • {:stale, id} — a held lease past its TTL (should have released/expired)
    • {: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 (decoder injectable).
  • mix hypatia.validate_leases [--store PATH] — the runnable gate; exits non-zero on any violation. This is exactly what the a5 standards INTENT probe 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:

71 tests, 0 failures

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_store reading a real lease dir (injected codec).

Scope / safety

  • Not auto-armed — core-tier lib/ + a Mix task, your review.
  • Additive: one module + the task + its test. Complements KinGate (mint-time) with store-time auditing.

Where this leaves the four items

LEDGER is at v0.9.0 with the full state.


Generated by Claude Code

…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.
@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 e05a43d into main Jun 14, 2026
36 checks passed
@hyperpolymath hyperpolymath deleted the claude/peaceful-pascal-IRlgq branch June 14, 2026 14:39
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