ambientops #127: expose SPARK theatre, fix non-compiling backend_interface, honest verified stance#49
Conversation
🔍 Hypatia Security ScanFindings: 97 issues detected
View findings[
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/ncl/lib/schema.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "getExn on external data -- use pattern matching (1 occurrences, CWE-754)",
"type": "getexn_on_external",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/src/nicaug/NicaugCLI.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "getExn on external data -- use pattern matching (1 occurrences, CWE-754)",
"type": "getexn_on_external",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/src/nicaug/PlatformOrchestrator.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "getExn on external data -- use pattern matching (7 occurrences, CWE-754)",
"type": "getexn_on_external",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/src/Discovery.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/ambientops/ambientops/panoptes/src/ollama.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap_or(0) with dangerous default (2 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/ambientops/ambientops/panoptes/src/web/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/ambientops/ambientops/personal-sysadmin/src/correlation.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
…oundary + sound contracts Foundation-first verification (gnatprove + gnat) found backend_interface.ads was SPARK theatre that NEVER COMPILED: - Transaction_Item.Package used an Ada reserved word as a field name (no compiler accepts it) -> renamed Pkg (zero references anywhere). - Install/Remove/Upgrade/Upgrade_System/Autoremove are *functions* with an in-out controlling parameter -> illegal SPARK (RM 4.5.2), yet the unit was pragma SPARK_Mode (On). gnatprove could never analyse it. Changes (genuine, no theatre, no fake green): - backend_interface.ads: real bug fix (Package->Pkg, now compiles, gnat exit 0); honest pragma SPARK_Mode (Off) with documented rationale; added sound Ada 2022 Pre'Class/Post'Class on the SPARK-legal query ops (Get_Name/Search/Get_Package_Info) + Pre on Register_Backend (runtime -gnata enforced; also the spec for the OWED SPARK refactor). - plugin_registry.ads: strengthened with non-empty-ID preconditions on Unregister/Get_Plugin/Get_Plugin_Metadata/Enable/Disable/ Is_Plugin_Enabled (was: only Register_Plugin had a Pre). OWED (tracked standards#127, must NOT be faked): state-mutating function->procedure redesign across backend_interface + backend_guix + backend_nix to make the modification path legal SPARK; only then can backend_interface/plugin_registry be gnatprove-discharged. Refs hyperpolymath/standards#124 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adversarial re-verification (gnat/gnatprove + 2-agent static SPARK-RM
swarm, dynamically spot-confirmed on origin/main) found PR#48's 'Strong'
SPARK coverage matrix comprehensively FALSE:
- snapshot_manager.adb:4 pragma SPARK_Mode(Off) — entire rollback body
unanalysed; never compiled (call@:93 of fn declared@:145, no fwd decl);
headline Post rests on reversibility_types.adb:31
System_State_Matches_Snapshot = hardcoded 'return True'.
- safety_boundary.adb:6 SPARK_Mode(Off); safety_boundary.ads:78+ Safe_*
are functions with in Out param (illegal SPARK), no escape; no
privilege/scope/bound model exists (only Is_Valid(Token)).
- safety_invariant.ads legal SPARK but tautologies over ghost state the
real (SPARK_Mode Off) path never updates.
Original 2026-05-18 audit ('SPARK theatre') was right; #48 was wrong.
RUST-SPARK-STANCE.adoc: false coverage matrix flagged SUPERSEDED;
added verified-correction section with file:line evidence, what this PR
genuinely delivers, and the precisely-scoped OWED programme.
Refs hyperpolymath/standards#124
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
238f194 to
561c344
Compare
🔍 Hypatia Security ScanFindings: 97 issues detected
View findings[
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/ncl/lib/schema.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "getExn on external data -- use pattern matching (1 occurrences, CWE-754)",
"type": "getexn_on_external",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/src/nicaug/NicaugCLI.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "getExn on external data -- use pattern matching (1 occurrences, CWE-754)",
"type": "getexn_on_external",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/src/nicaug/PlatformOrchestrator.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "getExn on external data -- use pattern matching (7 occurrences, CWE-754)",
"type": "getexn_on_external",
"file": "/home/runner/work/ambientops/ambientops/_pathroot/src/Discovery.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/ambientops/ambientops/panoptes/src/ollama.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap_or(0) with dangerous default (2 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/ambientops/ambientops/panoptes/src/web/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/ambientops/ambientops/personal-sysadmin/src/correlation.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
|
Rebased onto main (resolved the The 3 red checks (A2ML identity, K9 magic-number, ReScript anti-pattern) are pre-existing baseline rot on |
Refs hyperpolymath/standards#124 (estate proof-debt epic, sub-issue #127).
TL;DR — foundation-first verification overturned PR#48
PR#48 (merged, prior session) added
RUST-SPARK-STANCE.adocclaiming the audit's "SPARK theatre" finding was inaccurate and the safety-critical specs were "Strong". Adversarial re-verification (gnat/gnatprove + a 2-agent static SPARK-RM swarm, then dynamically spot-confirmed onorigin/main) found PR#48's coverage matrix is comprehensively FALSE. The original 2026-05-18 audit was right: the entiretotal-update/ada/dnfinitionSPARK story is theatre — and it never even compiled.Verified evidence (file:line, on origin/main)
backend_interface.ads:Transaction_Item.Packageused an Ada reserved word as a field name → no compiler accepts it (never compiled).Install/Remove/Upgrade/Upgrade_System/Autoremoveare functions within outparams = illegal SPARK (RM 4.5.2) underSPARK_Mode (On).snapshot_manager.adb:4→pragma SPARK_Mode (Off)(entire rollback body unanalysed) and never compiled (:93callsCreate_Btrfs_Snapshotdeclared:145, no forward decl). HeadlineRollback_To_SnapshotPostdepends onreversibility_types.adb:26-32System_State_Matches_Snapshot=pragma Unreferenced (ID); return True;(hardcoded vacuous oracle) + fail-permissive disjunction.safety_boundary.adb:6→pragma SPARK_Mode (Off);safety_boundary.ads:78+Safe_*are functions within Outparams (illegal SPARK). No privilege/scope/bound model exists at all.safety_invariant.ads: legal SPARK but tautologies over ghost state the real (SPARK_Mode Off) enforcement path never updates.What this PR genuinely delivers (no theatre, no fake green)
backend_interface.adsPackage→Pkg(zero references anywhere) — the unit now compiles (gnatexit 0).backend_interface.ads→pragma SPARK_Mode (Off)with documented rationale (it is genuinely non-SPARK by design).Pre'Class/Post'Classon the SPARK-legal query ops (Get_Name/Search/Get_Package_Info),PreonRegister_Backend, and six non-empty-IDPres onplugin_registry.ads— runtime-enforced (-gnata) and the spec for the OWED refactor.verified-correctionsection with the evidence above + precisely-scoped OWED programme.Honest scope — NOT closeable here
The real fix is a large genuine programme (tracked #127, must not be faked): state-mutating
function→procedureredesign across the interface + every backend +safety_boundary; bring the safety bodies intoSPARK_Mode (On); fix the elaboration error; replace the hardcoded-Trueghost oracle with a real state model. Only then can the safety-critical contracts begnatprove-discharged. This PR makes the truth visible and the foundation honest; it does not claim verification that does not exist.🤖 Generated with Claude Code