diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index d6992004..bbafaccf 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -82,9 +82,10 @@ clauses (grammar: standards `1-formats/deed/spec/abnf/deed.abnf`; lint with - `hypatia_rules_praxis.deed` - the A5 rule registry, generated by `scripts/gen-rules-praxis.sh` - `docs/history/A2ML-REMOVED.adoc` - each removed `.a2ml` file, its git blob id, and where its content went +- `audits/assail-classifications_praxis.deed` - panic-attack's user-classification registry + (audited findings it flips to suppressed), read deed-first by panic-attack -Two `.a2ml` files remain, each for a reader outside this repo (see the ledger): -`audits/assail-classifications.a2ml` (panic-attack reads only that name) and +One `.a2ml` file remains, for a reader outside this repo (see the ledger): `test/fixtures/a2ml/rsr-criteria-v2.a2ml` (a copy of the standards RSR criteria, still A2ML). The rules that *detect* `.a2ml` in scanned repos, and the shared readers that fall back to it (`RsrConformance`, `RsrCriteria`, `RuleLoader`), are deliberate. diff --git a/.github/workflows/dogfood-gate.yml b/.github/workflows/dogfood-gate.yml index 9539469e..a242e22e 100644 --- a/.github/workflows/dogfood-gate.yml +++ b/.github/workflows/dogfood-gate.yml @@ -35,11 +35,7 @@ jobs: - name: Check for A2ML and DEED files id: detect run: | - # audits/assail-classifications.a2ml is panic-attack's user-classification - # registry — an S-expression dialect by that tool's spec (see panic-attack - # CLAUDE.md), not the TOML-like manifest A2ML this gate validates. Exclude - # it rather than feeding it to a validator for a different dialect. - COUNT=$(find . -type f \( -name '*.a2ml' -o -name '*.deed' \) -not -path './.git/*' -not -name 'assail-classifications.a2ml' -printf '.' | wc -c) + COUNT=$(find . -type f \( -name '*.a2ml' -o -name '*.deed' \) -not -path './.git/*' -printf '.' | wc -c) echo "count=$COUNT" >> "$GITHUB_OUTPUT" if [ "$COUNT" -eq 0 ]; then echo "::warning::No .a2ml/.deed manifest files found. Every RSR repo should have a repo deed (_chora.deed); legacy 0-AI-MANIFEST.a2ml accepted mid-migration — standards #837" @@ -52,9 +48,7 @@ jobs: path: '.' strict: 'false' # Re-state the action's default carve-outs (a custom value REPLACES - # the default list), plus panic-attack's user-classification - # registry: that file is an S-expression dialect by panic-attack's - # spec, not the TOML-like manifest A2ML this action validates. + # the default list). paths-ignore: | vendor/ vendored/ @@ -63,7 +57,6 @@ jobs: integration/fixtures/ test/fixtures/ tests/fixtures/ - assail-classifications.a2ml - name: Write summary run: | diff --git a/audits/assail-classifications.a2ml b/audits/assail-classifications.a2ml deleted file mode 100644 index eba4c4e6..00000000 --- a/audits/assail-classifications.a2ml +++ /dev/null @@ -1,102 +0,0 @@ -;; SPDX-License-Identifier: MPL-2.0 -;; Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -;; assail-classifications.a2ml — audited panic-attack findings for hypatia. -;; -;; Read by panic-attack >= 2.5.5 (load_user_classifications): findings -;; matching (file, category) are flipped to suppressed = true AFTER the -;; structural kanren suppression pass. Entries here are AUDITED-SOUND -;; residuals, not exemptions of convenience — every entry must cite its -;; rationale, and the registry lives apart from the source so a code -;; edit cannot self-suppress (see panic-attack CLAUDE.md, User- -;; Classification Registry). -;; -;; Audit trail: 2026-06-11 estate-loop session — fresh panic-attack -;; 2.5.5 scan of hypatia; every entry below was inspected at source. - -(assail-classifications - ;; ── Soundness-gate negative fixtures ───────────────────────────── - ;; test/soundness/fixtures/code_safety/ exists to PROVE the scanner - ;; catches these constructs; the findings are the fixtures working - ;; as designed. Mirrors lib/hypatia/scanner_suppression.ex, which - ;; already exempts these paths for hypatia's own scanner. - (classification - (file "test/soundness/fixtures/code_safety/transmute.rs") - (category "UnsafeCode") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects mem::transmute")) - (classification - (file "test/soundness/fixtures/code_safety/admitted.v") - (category "ProofDrift") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects Admitted")) - (classification - (file "test/soundness/fixtures/code_safety/believe_me.idr") - (category "ProofDrift") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects believe_me")) - (classification - (file "test/soundness/fixtures/code_safety/sorry.lean") - (category "ProofDrift") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects sorry")) - (classification - (file "test/soundness/fixtures/code_safety/obj_magic_ocaml.ml") - (category "UnsafeTypeCoercion") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects Obj.magic")) - (classification - (file "test/soundness/fixtures/code_safety/unsafe_coerce.hs") - (category "UnsafeTypeCoercion") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects unsafeCoerce")) - (classification - (file "test/soundness/fixtures/code_safety/elixir_code_eval.ex") - (category "DynamicCodeExecution") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects Code.eval_string")) - (classification - (file "test/soundness/fixtures/code_safety/zig_ptr_cast.zig") - (category "UnsafeCode") - (audit "test/soundness — deliberate negative fixture") - (rationale "fixture asserting the scanner detects Zig pointer casts")) - - ;; ── Remediation scripts: pattern strings, not vulnerabilities ──── - (classification - (file "scripts/fix-scripts/fix-deno-permissions.sh") - (category "ExcessivePermissions") - (audit "remediation tool — replaces `deno -A` with scoped permission flags; scripts/fix-scripts/ is already exempt in scanner_suppression.ex") - (rationale "contains -A as the SEARCH pattern it removes from other repos")) - - ;; ── FFI boundary unsafe: documented, load-bearing ──────────────── - (classification - (file "clients/rust/hypatia-client/src/ffi.rs") - (category "UnsafeCode") - (audit "in-file # Safety section (ffi.rs:7-30) enumerates the invariant for every unsafe block; carries hypatia allow pragmas") - (rationale "libloading C-ABI boundary calls against libhypatia_ffi.so; each block's invariant documented at source")) - - ;; ── Test harnesses ─────────────────────────────────────────────── - (classification - (file "tests/e2e.sh") - (category "CommandInjection") - (audit "tests/e2e.sh:88-93 — heredoc writes a deliberately insecure fixture") - (rationale "the eval is fixture CONTENT generated for the scanner-detection test, not executed by the harness")) - (classification - (file "integration/run-tests.sh") - (category "HardcodedSecret") - (audit "integration/run-tests.sh:268 — ARANGODB_PASSWORD=testpassword") - (rationale "throwaway credential for the ephemeral integration-test database container")) - - ;; ── Env-var binding misread as a secret ────────────────────────── - (classification - (file "hooks/lib/cache.sh") - (category "HardcodedSecret") - (audit "hooks/lib/cache.sh:17-22 — CICD_CACHE_PASSWORD=\"${CICD_CACHE_PASSWORD:-}\"") - (rationale "empty-default env-var binding, documented in-file; no literal secret present")) - - ;; ── Rule definitions detecting themselves ──────────────────────── - (classification - (file "lib/hypatia/scanner_suppression.ex") - (category "HardcodedSecret") - (audit "scanner suppression rule definitions contain secret-shaped pattern strings") - (rationale "detector/suppression pattern table, not credentials — same class as the scripts/fix-* carve-out in scanner_suppression.ex")) -) diff --git a/audits/assail-classifications_praxis.deed b/audits/assail-classifications_praxis.deed new file mode 100644 index 00000000..02854916 --- /dev/null +++ b/audits/assail-classifications_praxis.deed @@ -0,0 +1,112 @@ +;; SPDX-License-Identifier: MPL-2.0 +;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +;; +;; assail-classifications_praxis.deed — audited panic-attack findings for +;; hypatia. Translated entry for entry from audits/assail-classifications.a2ml +;; (removed; see docs/history/A2ML-REMOVED.adoc): (file "…") is :file, +;; (category "…") is the symbol :category, (audit "…") is :audit and +;; (rationale "…") is :rationale. Nothing was added or dropped. +;; +;; Read by panic-attack's deed-first registry reader (load_user_classifications, +;; src/assail/classifications.rs): findings matching (:file, :category) are +;; flipped to suppressed = true AFTER the structural kanren suppression pass. +;; A malformed file fails the scan; it is never read as an empty registry. +;; Entries here are AUDITED-SOUND residuals, not exemptions of convenience: +;; every entry must cite its rationale, and the registry lives apart from the +;; source so a code edit cannot self-suppress (see panic-attack CLAUDE.md, +;; User-Classification Registry). +;; +;; Audit trail: 2026-06-11 estate-loop session — fresh panic-attack +;; 2.5.5 scan of hypatia; every entry below was inspected at source. +(praxis-deed + :schema-version "1.0.0" + :canonical-name "hypatia-assail-classifications" + :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" + :profile assail-classifications + + ;; ── Soundness-gate negative fixtures ───────────────────────────── + ;; test/soundness/fixtures/code_safety/ exists to PROVE the scanner + ;; catches these constructs; the findings are the fixtures working + ;; as designed. Mirrors lib/hypatia/scanner_suppression.ex, which + ;; already exempts these paths for hypatia's own scanner. + (classification + :file "test/soundness/fixtures/code_safety/transmute.rs" + :category UnsafeCode + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects mem::transmute") + (classification + :file "test/soundness/fixtures/code_safety/admitted.v" + :category ProofDrift + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects Admitted") + (classification + :file "test/soundness/fixtures/code_safety/believe_me.idr" + :category ProofDrift + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects believe_me") + (classification + :file "test/soundness/fixtures/code_safety/sorry.lean" + :category ProofDrift + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects sorry") + (classification + :file "test/soundness/fixtures/code_safety/obj_magic_ocaml.ml" + :category UnsafeTypeCoercion + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects Obj.magic") + (classification + :file "test/soundness/fixtures/code_safety/unsafe_coerce.hs" + :category UnsafeTypeCoercion + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects unsafeCoerce") + (classification + :file "test/soundness/fixtures/code_safety/elixir_code_eval.ex" + :category DynamicCodeExecution + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects Code.eval_string") + (classification + :file "test/soundness/fixtures/code_safety/zig_ptr_cast.zig" + :category UnsafeCode + :audit "test/soundness — deliberate negative fixture" + :rationale "fixture asserting the scanner detects Zig pointer casts") + + ;; ── Remediation scripts: pattern strings, not vulnerabilities ──── + (classification + :file "scripts/fix-scripts/fix-deno-permissions.sh" + :category ExcessivePermissions + :audit "remediation tool — replaces `deno -A` with scoped permission flags; scripts/fix-scripts/ is already exempt in scanner_suppression.ex" + :rationale "contains -A as the SEARCH pattern it removes from other repos") + + ;; ── FFI boundary unsafe: documented, load-bearing ──────────────── + (classification + :file "clients/rust/hypatia-client/src/ffi.rs" + :category UnsafeCode + :audit "in-file # Safety section (ffi.rs:7-30) enumerates the invariant for every unsafe block; carries hypatia allow pragmas" + :rationale "libloading C-ABI boundary calls against libhypatia_ffi.so; each block's invariant documented at source") + + ;; ── Test harnesses ─────────────────────────────────────────────── + (classification + :file "tests/e2e.sh" + :category CommandInjection + :audit "tests/e2e.sh:88-93 — heredoc writes a deliberately insecure fixture" + :rationale "the eval is fixture CONTENT generated for the scanner-detection test, not executed by the harness") + (classification + :file "integration/run-tests.sh" + :category HardcodedSecret + :audit "integration/run-tests.sh:268 — ARANGODB_PASSWORD=testpassword" + :rationale "throwaway credential for the ephemeral integration-test database container") + + ;; ── Env-var binding misread as a secret ────────────────────────── + (classification + :file "hooks/lib/cache.sh" + :category HardcodedSecret + :audit "hooks/lib/cache.sh:17-22 — CICD_CACHE_PASSWORD=\"${CICD_CACHE_PASSWORD:-}\"" + :rationale "empty-default env-var binding, documented in-file; no literal secret present") + + ;; ── Rule definitions detecting themselves ──────────────────────── + (classification + :file "lib/hypatia/scanner_suppression.ex" + :category HardcodedSecret + :audit "scanner suppression rule definitions contain secret-shaped pattern strings" + :rationale "detector/suppression pattern table, not credentials — same class as the scripts/fix-* carve-out in scanner_suppression.ex") +) diff --git a/docs/history/A2ML-REMOVED.adoc b/docs/history/A2ML-REMOVED.adoc index 9f80fad6..196782ea 100644 --- a/docs/history/A2ML-REMOVED.adoc +++ b/docs/history/A2ML-REMOVED.adoc @@ -223,24 +223,24 @@ Size is in bytes. The sha256 is of the file as it was tracked. | RuleLoader fixture (HYP-S007). | Inlined into `test/rules/rule_loader_test.exs`. +| `audits/assail-classifications.a2ml` +| 5623 +| `7d9c7b14419f6a597a9be87e5828ee7aff53648d5edc1175204494205d1bcb24` +| `eba4c4e6c4ed29dbbc7e1c9ca733f91e54e114f7` +| panic-attack's user-classification registry: 14 audited findings (file, category, audit, rationale) that panic-attack flips to suppressed. Removed later than the rest (it was retained until panic-attack had a deed reader); last held at `7d1059aa`. +| `audits/assail-classifications_praxis.deed`, entry for entry, all 14 kept: `(file …)`, `(audit …)` and `(rationale …)` became the `:file`, `:audit` and `:rationale` fields and `(category "…")` the symbol `:category`. No mapping spec covers it; its reader is panic-attack's deed-first `load_user_classifications`, which reads this name before the legacy A2ML ones. + |=== == Retained, with the reason -Two `.a2ml` files stay, each because a live reader outside this repository's -control still needs exactly that input. Neither has a deed form to move to. +One `.a2ml` file stays, because a live reader outside this repository's +control still needs exactly that input, and it has no deed form to move to. [cols="3,5",options="header"] |=== | Path | Why it stays -| `audits/assail-classifications.a2ml` -| panic-attack (>= 2.5.5, `load_user_classifications` in its assail module, -in the panic-attack repository) reads only `audits/assail-classifications.a2ml` or -`.panic-attack-classifications.a2ml`. No mapping spec covers it and -panic-attack has no deed reader, so deleting it would unsuppress the audited -findings it records. It goes when panic-attack reads a deed form first. - | `test/fixtures/a2ml/rsr-criteria-v2.a2ml` | A dogfood copy of the RSR v2.0 criteria, whose canon (`0-canon/rsr/rsr-criteria-v2.a2ml` in standards) is still A2ML: A7 section diff --git a/test/dogfood_manifest_detection_test.rb b/test/dogfood_manifest_detection_test.rb index 23eefc44..37e7b3d3 100644 --- a/test/dogfood_manifest_detection_test.rb +++ b/test/dogfood_manifest_detection_test.rb @@ -11,7 +11,8 @@ [['manifest.deed'], 1], [['manifest.a2ml'], 1], [["line\nbreak.deed", 'legacy.a2ml'], 2], - [['.git/ignored.deed', 'audits/assail-classifications.a2ml'], 0] + [['.git/ignored.deed'], 0], + [['audits/assail-classifications_praxis.deed'], 1] ].each do |files, expected| Dir.mktmpdir('dogfood-detect-') do |dir| files.each do |file| @@ -25,4 +26,4 @@ abort "wrong candidate count for #{files.inspect}" unless File.read(output) == "count=#{expected}\n" end end -puts 'PASS: empty, DEED-only, A2ML-only, mixed, newline filenames, and excluded manifests' +puts 'PASS: empty, DEED-only, A2ML-only, mixed, newline filenames, .git excluded, classification deed counted'