Vapora/scripts/check-gate.nu
Jesús Pérez 75e5ebd9a2
Some checks failed
Documentation Lint & Validation / Markdown Linting (push) Has been cancelled
Documentation Lint & Validation / Validate mdBook Configuration (push) Has been cancelled
Documentation Lint & Validation / Content & Structure Validation (push) Has been cancelled
mdBook Build & Deploy / Build mdBook (push) Has been cancelled
Nickel Type Check / Nickel Type Checking (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled
Documentation Lint & Validation / Lint & Validation Summary (push) Has been cancelled
mdBook Build & Deploy / Documentation Quality Check (push) Has been cancelled
mdBook Build & Deploy / Deploy to GitHub Pages (push) Has been cancelled
mdBook Build & Deploy / Notification (push) Has been cancelled
chore: ontology sync + 4 NCL ADRs + landing page update
on+re:
  - core.ncl: 5 new Practice nodes (notification-channels,
    vapora-capabilities, agent-hot-reload-stable-identity,
    merkle-audit-trail, notification-channels) + 5 new edges;
    knowledge-graph-execution-history updated with HNSW+BM25+RRF
  - state.ncl: production-readiness blocker/catalyst updated (hot-reload
    complete, BudgetManager/LLMRouter still require restart);
    ontoref-integration catalyst updated (vapora-ontology/reflection
    crates, api-catalog.json, nickel contracts)

  ADRs (NCL):
  - adr-013: KG hybrid search — HNSW+BM25+RRF, rejected in-process scan
  - adr-014: capability packages — AgentDefinition→vapora-shared,
    DashMap shard-before-await constraint
  - adr-015: Merkle audit trail — SHA-256 hash chain, rejected HMAC
  - adr-016: agent hot-reload — stable_id=role, learning_profiles survive
    drain, BudgetManager excluded from reload scope

  landing page:
  - 2 new feature boxes: VCS-Agnostic Worktree (jj/git), Ontology Protocol
  - KG box: 20→28 tests, HNSW+BM25+RRF description
  - Agents box: 71→82 tests, hot-reload + stable_id
  - tech stack: Rust 21→23 crates, added jj, Radicle, ontoref badges
  - status badge: 620→691 tests
2026-04-07 21:06:48 +01:00

56 lines
1.9 KiB
Text

#!/usr/bin/env nu
# scripts/check-gate.nu
# Query the vapora gate ontology for a given signal.
# Exits 0 if at least one active membrana accepts the signal, 1 otherwise.
#
# Usage:
# nu scripts/check-gate.nu --ontology .ontology --signal DepthDemonstrated
# nu scripts/check-gate.nu --ontology .ontology --signal PreguntaQueRompeElMarco --verbose
def main [
--ontology: path = ".ontology", # Path to the project .ontology directory
--signal: string = "", # Signal to check (TipoSenal variant name)
--verbose, # Print full membrana details
] {
if ($signal | is-empty) {
error make { msg: "required flag --signal is missing" }
}
let gate_file = $ontology | path join "gate.ncl"
if not ($gate_file | path exists) {
error make { msg: $"gate.ncl not found at '($gate_file)'" }
}
let result = do { ^nickel export --format json $gate_file } | complete
if $result.exit_code != 0 {
error make { msg: $"nickel export failed: ($result.stderr | str trim)" }
}
let config = $result.stdout | from json
let membranas = $config.membranas
let accepting = $membranas | where { |m|
$m.activa and ($m.acepta | any { |s| $s == $signal })
}
if $verbose {
print $"Signal: ($signal)"
print $"Active membranas checked: ($membranas | where activa | length)"
if not ($accepting | is-empty) {
print "Accepting membranas:"
$accepting | each { |m|
print $" ✓ ($m.id) [permeabilidad=($m.permeabilidad)] — ($m.descripcion)"
} | ignore
} else {
print "No active membrana accepts this signal."
}
}
if ($accepting | is-empty) {
print $"gate: BLOCKED — no active membrana accepts signal '($signal)'"
exit 1
}
print $"gate: PASS — ($accepting | length) membrana(s) accept signal '($signal)'"
}