diff --git a/.audittraining/security-errors/bunsenite.adoc b/.audittraining/security-errors/bunsenite.adoc
index 8af379e1..9d176003 100644
--- a/.audittraining/security-errors/bunsenite.adoc
+++ b/.audittraining/security-errors/bunsenite.adoc
@@ -154,33 +154,6 @@ fuzz_target!(|data: &[u8]| {
'''''
-=== Prevention Rules (historical Logtalk — superseded)
-
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP001–AP002; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
-
-[source,logtalk]
-----
-% Config parsers need input limits
-parser_rule(input_limits, preventive,
- "Config parsers must have input size limits",
- [
- crate_type(parser),
- not(pattern("MAX.*SIZE|size.*limit"))
- ],
- warn_reviewer).
-
-% WASM crates need memory limits
-wasm_rule(memory_limits, preventive,
- "WASM crates must limit memory allocation",
- [
- feature("wasm"),
- not(pattern("memory.*limit|max.*alloc"))
- ],
- warn_reviewer).
-----
-
-'''''
-
=== Training Classification
* *Error Types:* DEPENDENCY_VULN, WORKFLOW_SECURITY, PROCESS_HYGIENE
diff --git a/.audittraining/security-errors/czech-file-knife.adoc b/.audittraining/security-errors/czech-file-knife.adoc
index 5c45405b..2c29bf22 100644
--- a/.audittraining/security-errors/czech-file-knife.adoc
+++ b/.audittraining/security-errors/czech-file-knife.adoc
@@ -153,32 +153,29 @@ WORKDIR /src/czech-file-knife
RUN cargo +nightly fuzz build
----
-'''''
-
=== Prevention Rules (historical Logtalk — superseded)
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP003–AP004; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
+NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP005–AP006; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
[source,logtalk]
----
-% Require cargo audit in Rust CI
-rust_rule(missing_audit, preventive,
- "Rust repos must run cargo audit in CI",
+% Require CI tests for all repos
+project_rule(missing_ci_tests, preventive,
+ "Repos must have automated test workflow",
[
- file_exists("Cargo.toml"),
- not(workflow_contains("cargo audit"))
+ not(file_exists(".github/workflows/*test*.yml")),
+ has_source_code
],
block_release).
-% Workspace-aware dependency check
-rust_rule(workspace_vuln, curative,
- "Check all workspace members for vulnerabilities",
+% Require SAST for multi-language repos
+project_rule(missing_sast, preventive,
+ "Multi-language repos must have SAST configured",
[
- file_exists("Cargo.toml"),
- contains("[workspace]"),
- any_member_has_vuln
+ language_count > 1,
+ not(file_exists(".github/workflows/codeql.yml"))
],
- alert_maintainer).
+ warn_maintainer).
----
'''''
diff --git a/.audittraining/security-errors/gitvisor.adoc b/.audittraining/security-errors/gitvisor.adoc
index db4daeb2..d2aad16f 100644
--- a/.audittraining/security-errors/gitvisor.adoc
+++ b/.audittraining/security-errors/gitvisor.adoc
@@ -177,37 +177,3 @@ For polyglot repos like gitvisor:
|===
'''''
-
-=== Prevention Rules (historical Logtalk — superseded)
-
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP005–AP006; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
-
-[source,logtalk]
-----
-% Require CI tests for all repos
-project_rule(missing_ci_tests, preventive,
- "Repos must have automated test workflow",
- [
- not(file_exists(".github/workflows/*test*.yml")),
- has_source_code
- ],
- block_release).
-
-% Require SAST for multi-language repos
-project_rule(missing_sast, preventive,
- "Multi-language repos must have SAST configured",
- [
- language_count > 1,
- not(file_exists(".github/workflows/codeql.yml"))
- ],
- warn_maintainer).
-----
-
-'''''
-
-=== Training Classification
-
-* *Error Types:* PROCESS_HYGIENE, MISSING_TESTS, MISSING_SAST
-* *Auto-Fixable:* YES (add workflow files)
-* *Prevention:* Template enforcement, repo standards
-* *Recurrence Risk:* MEDIUM (new repos may lack setup)
diff --git a/.audittraining/security-errors/polyglot-i18n.adoc b/.audittraining/security-errors/polyglot-i18n.adoc
index e4ad6516..4433756c 100644
--- a/.audittraining/security-errors/polyglot-i18n.adoc
+++ b/.audittraining/security-errors/polyglot-i18n.adoc
@@ -151,31 +151,6 @@ bestpractices.coreinfrastructure.org
'''''
-=== Prevention Rules (historical Logtalk — superseded)
-
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP007–AP008; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
-
-[source,logtalk]
-----
-% Block remote property injection
-security_rule(property_injection, preventive,
- "Reject dynamic property access without validation",
- [
- pattern("\\[\\s*\\w+Input\\s*\\]"),
- pattern("\\[\\s*req\\.(body|query|params)"),
- not(nearby_pattern("allowedProps|whitelist|ALLOWED"))
- ],
- block_commit).
-
-% Enforce unused variable cleanup
-code_quality_rule(unused_vars, curative,
- "Flag files with unused variables for cleanup",
- [pattern("is declared but its value is never read")],
- warn_and_log).
-----
-
-'''''
-
=== Training Classification
* *Error Types:* CODE_SECURITY, CODE_QUALITY, WORKFLOW_SECURITY
diff --git a/.audittraining/security-errors/proof-of-work.adoc b/.audittraining/security-errors/proof-of-work.adoc
index 17105922..dace5eb8 100644
--- a/.audittraining/security-errors/proof-of-work.adoc
+++ b/.audittraining/security-errors/proof-of-work.adoc
@@ -194,42 +194,6 @@ let key = keys.get(index).ok_or(CryptoError::InvalidIndex)?;
'''''
-=== Prevention Rules (historical Logtalk — superseded)
-
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP009–AP011; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
-
-[source,logtalk]
-----
-% Crypto repos require enhanced review
-crypto_rule(enhanced_review, preventive,
- "Crypto repos require 2+ reviewers",
- [
- repo_tag(cryptography),
- pr_reviews < 2
- ],
- block_merge).
-
-% Require fuzzing for crypto
-crypto_rule(require_fuzzing, preventive,
- "Crypto repos must have fuzz targets",
- [
- repo_tag(cryptography),
- not(dir_exists("fuzz/"))
- ],
- block_release).
-
-% No panicking in crypto code
-crypto_rule(no_panic, preventive,
- "Crypto code must not panic",
- [
- repo_tag(cryptography),
- pattern("panic!|unwrap\\(\\)|expect\\(")
- ],
- warn_reviewer).
-----
-
-'''''
-
=== Training Classification
* *Error Types:* DEPENDENCY_VULN, PROCESS_HYGIENE, MISSING_FUZZING
diff --git a/.audittraining/security-errors/supernorma.adoc b/.audittraining/security-errors/supernorma.adoc
index 49a7fbaa..66f9d394 100644
--- a/.audittraining/security-errors/supernorma.adoc
+++ b/.audittraining/security-errors/supernorma.adoc
@@ -104,33 +104,6 @@ runs:
'''''
-=== Prevention Rules (historical Logtalk — superseded)
-
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP012–AP013; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
-
-[source,logtalk]
-----
-% Meta rule: RSR tooling must be RSR-compliant
-meta_rule(rsr_self_compliance, preventive,
- "RSR tooling repos must pass all RSR checks",
- [
- repo_name(supernorma),
- has_rsr_violation
- ],
- block_merge_with_escalation).
-
-% Template repos need extra scrutiny
-template_rule(exemplary_standards, diagnostic,
- "Template/tooling repos should exceed normal standards",
- [
- repo_purpose(tooling),
- scorecard_score < 8
- ],
- alert_maintainer).
-----
-
-'''''
-
=== Recommended Improvements
==== 1. Self-Testing
diff --git a/.audittraining/security-errors/ubicity.adoc b/.audittraining/security-errors/ubicity.adoc
index d3a48dea..3dd7e7a4 100644
--- a/.audittraining/security-errors/ubicity.adoc
+++ b/.audittraining/security-errors/ubicity.adoc
@@ -131,33 +131,6 @@ end
'''''
-=== Prevention Rules (historical Logtalk — superseded)
-
-NOTE: Historical source of record only (2025-12-29), retained so the transcription can be audited. These are rules AP014–AP015; the canonical Elixir form is `Hypatia.Rules.AuditPrevention` plus the live checkers named in `docs/rules/logtalk-migration.adoc`. Do not treat the block below as an active rule source.
-
-[source,logtalk]
-----
-% Enforce permissions declaration
-workflow_rule(missing_permissions, preventive,
- "Reject workflows without permissions declaration",
- [
- file_type(".github/workflows/*.yml"),
- not(contains("permissions:"))
- ],
- block_merge).
-
-% Enforce SHA pinning
-workflow_rule(unpinned_action, preventive,
- "Reject workflows with unpinned actions",
- [
- pattern("uses:.*@v[0-9]"),
- not(pattern("#.*v[0-9]"))
- ],
- block_merge).
-----
-
-'''''
-
=== Security.md Template
[source,markdown]
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f7728fd6..d54cae39 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,8 +3,7 @@
# This workflow is managed by gh actions-lock.
# Main CI workflow for hypatia
# Tests Rust (adapters, cli, fixer, data) and the Elixir rules. The Haskell
-# (registry) jobs below are dormant-gated on the tree's absence; the Logtalk
-# rule engine was retired 2026-03-06 (absorbed into lib/rules/*.ex).
+# (registry) jobs below are dormant-gated on the tree's absence.
name: CI
@@ -356,6 +355,7 @@ jobs:
test/rules/rsr_conformance_test.exs \
test/rules/audit_prevention_test.exs \
test/security_errors_test.exs \
+ test/batch_security_scan_category_test.exs \
test/research_extensions_test.exs \
test/research_extensions_equivalence_test.exs \
test/workflow_test.exs \
@@ -412,12 +412,6 @@ jobs:
- name: Real noninteractive changed-job execution (1009)
run: mix test --no-start test/ci_changed_act_test.exs --only act_integration
- # ADR-001 retirement guard: Hypatia rules are pure Elixir
- # (lib/rules/*.ex). This fails if an active .lgt/.logtalk source
- # or a Logtalk output/loader setting re-enters the tree outside
- # the exact-path, shrink-only .logtalk-allowlist. Proven by
- # mutant (plant a .lgt + a report_format: logtalk setting -> red;
- # revert -> green). See docs/rules/logtalk-migration.adoc.
# The receipt contract (schema/receipt.ncl) is checked by Nickel. Without it the
# contract tests skip, so this lane must have it, and must fail if they skip.
# The release publishes no checksum: the hash below is the one measured for
@@ -455,9 +449,6 @@ jobs:
exit 1
fi
- - name: No active Logtalk (ADR-001 guard)
- run: bash scripts/check-no-active-logtalk.sh
-
# The consumers' invocation, verbatim: the oracle is called with an
# EXPLICIT --ssot. The default SSOT resolution is deliberately not
# exercised here — it depends on the layout of the checkout that hosts
diff --git a/.github/workflows/language-blockers.yml b/.github/workflows/language-blockers.yml
index 17da8a7e..a750a40a 100644
--- a/.github/workflows/language-blockers.yml
+++ b/.github/workflows/language-blockers.yml
@@ -65,6 +65,22 @@ jobs:
fi
echo "✅ No TypeScript/ReScript sources"
+ - name: Retired rule-language sources are banned
+ run: |
+ set -euo pipefail
+ # Hypatia's rules are Elixir (lib/rules, ADR-001). A tracked .lgt
+ # or .logtalk source, in any letter case, fails the run: the retired
+ # rule engine stays out.
+ hits=$(git ls-files ':(icase)*.lgt' ':(icase)*.logtalk' || true)
+ n=$(printf '%s' "$hits" | grep -c . || true)
+ echo "retired rule-language sources in tree: ${n}"
+ if [ "$n" -gt 0 ]; then
+ echo "::error::Retired rule-language sources are banned; rules are Elixir (lib/rules, ADR-001). Found:"
+ printf '%s\n' "$hits"
+ exit 1
+ fi
+ echo "✅ No retired rule-language sources"
+
- name: Banned runtimes are not provisioned in mise.toml
run: |
set -euo pipefail
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e9bf8293..56f4392d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -205,7 +205,7 @@ jobs:
component:
# Only the CLI image remains. The adapter/registry/engine images were
# retired: their Containerfiles were deleted (deploy/Containerfile.*),
- # the Haskell `registry/` and Logtalk `engine/` sources removed, and the
+ # the Haskell `registry/` and the old `engine/` sources removed, and the
# ghcr registry package archived (see note at end of file). The adapter
# still ships as the `forge-adapter` binary via build-rust; recover its
# image with `git show f2fe2df^:deploy/Containerfile.adapter` if wanted.
@@ -357,9 +357,9 @@ jobs:
# NOTE: The adapter/registry/engine container images were retired; this workflow
# now builds only the CLI image.
- # - registry (Haskell) + engine (SWI-Prolog/Logtalk): sources deleted (f2fe2df).
- # Logtalk was an early idea for the rule engine, superseded by the native
- # Elixir ruleset. The hypatia-registry package on ghcr.io is now archived.
+ # - registry (Haskell) + engine: sources deleted (f2fe2df); the rule engine
+ # is the native Elixir ruleset. The hypatia-registry package on ghcr.io is
+ # now archived.
# - adapter (Rust): still ships as the `forge-adapter` binary via build-rust;
# only its service image was dropped. Recover it if ever wanted again with
# `git show f2fe2df^:deploy/Containerfile.adapter`.
diff --git a/.github/workflows/verify-proofs.yml b/.github/workflows/verify-proofs.yml
index 029cf2c4..3cf2037e 100644
--- a/.github/workflows/verify-proofs.yml
+++ b/.github/workflows/verify-proofs.yml
@@ -348,16 +348,16 @@ jobs:
echo "$(dirname "$agda_bin")" >> "$GITHUB_PATH"
"$agda_bin" --version
- - name: Check LogtalkMigration.agda (strict profile)
+ - name: Check AlertTableCorrespondence.agda (strict profile)
working-directory: verification/proofs/agda
run: |
set -euo pipefail
agda --version
- sha256sum LogtalkMigration.agda
- if agda --safe --without-K --cubical-compatible LogtalkMigration.agda; then
- bash "$GITHUB_WORKSPACE/scripts/proof-ledger.sh" receipt agda pass verification/proofs/agda/LogtalkMigration.agda -- checker="Agda $AGDA_VERSION"
+ sha256sum AlertTableCorrespondence.agda
+ if agda --safe --without-K --cubical-compatible AlertTableCorrespondence.agda; then
+ bash "$GITHUB_WORKSPACE/scripts/proof-ledger.sh" receipt agda pass verification/proofs/agda/AlertTableCorrespondence.agda -- checker="Agda $AGDA_VERSION"
else
- bash "$GITHUB_WORKSPACE/scripts/proof-ledger.sh" receipt agda fail verification/proofs/agda/LogtalkMigration.agda
+ bash "$GITHUB_WORKSPACE/scripts/proof-ledger.sh" receipt agda fail verification/proofs/agda/AlertTableCorrespondence.agda
exit 1
fi
@@ -388,11 +388,11 @@ jobs:
{
echo "## Agda proof verification"
echo ""
- echo "- Invocation: \`agda --safe --without-K --cubical-compatible LogtalkMigration.agda\`"
+ echo "- Invocation: \`agda --safe --without-K --cubical-compatible AlertTableCorrespondence.agda\`"
if command -v agda >/dev/null 2>&1; then
echo "- Checker: \`$(agda --version | head -1)\`"
fi
- echo "- Source SHA-256: \`$(sha256sum verification/proofs/agda/LogtalkMigration.agda | cut -d' ' -f1)\`"
+ echo "- Source SHA-256: \`$(sha256sum verification/proofs/agda/AlertTableCorrespondence.agda | cut -d' ' -f1)\`"
} >> "$GITHUB_STEP_SUMMARY"
tlc:
diff --git a/.hypatia-ignore b/.hypatia-ignore
index 8b03daa1..8d4aaae6 100644
--- a/.hypatia-ignore
+++ b/.hypatia-ignore
@@ -124,14 +124,3 @@ cicd_rules/banned_language_file:resolve.py
# "docker" string and flagging the policy itself; this is recursive
# self-flagging.
# code_safety/ncl_docker_not_podman:.machine_readable/self-validating/hypatia-metadata.k9.ncl
-
-# ─── 2026-11-01 Logtalk migration coordination packets ─────────────────
-#
-# These two packets quote epistemic-types' OWN `src/EpistemicTypes/`
-# paths and Agda checker command verbatim, because the sibling issue is
-# precisely about that repository's descriptor. SD022 (stale `src/
/`
-# after a rename in THIS tree) cannot distinguish a quoted foreign tree
-# from local rename drift. Exact files only; remove each entry when its
-# packet is deleted after the sibling change lands.
-structural_drift/SD022:docs/rules/migration/epistemic-types-neurosym-deed-issue.md
-structural_drift/SD022:docs/rules/migration/standards-deed-mapping-issue.md
diff --git a/.logtalk-allowlist b/.logtalk-allowlist
deleted file mode 100644
index 7cb5a44c..00000000
--- a/.logtalk-allowlist
+++ /dev/null
@@ -1,39 +0,0 @@
-# SPDX-License-Identifier: MPL-2.0
-# Exact-path exemptions for scripts/check-no-active-logtalk.sh.
-#
-# Rules for this file (following the .hypatia-ignore precedent):
-# * exact repository-relative file paths only — no wildcards, no
-# directory blankets, no globs of any kind;
-# * every entry names a classification and a removal condition;
-# * shrink-only: adding an entry is a policy change requiring the
-# same review as adding a rule; removing one is always welcome;
-# * the guard fails if an entry points at a missing file or a file
-# that no longer contains any guarded form (stale exemption).
-#
-# Format: | |
-#
-# Historical audit-training originals (2025-12-29). The blocks are the
-# source of record against which AuditPrevention was transcribed; they
-# are headed "historical … superseded" in place. Remove an entry only
-# together with deleting/rewriting that file's Logtalk block.
-.audittraining/security-errors/bunsenite.adoc | historical source of record (AP001-AP002) | remove with the block
-.audittraining/security-errors/czech-file-knife.adoc | historical source of record (AP003-AP004) | remove with the block
-.audittraining/security-errors/gitvisor.adoc | historical source of record (AP005-AP006) | remove with the block
-.audittraining/security-errors/polyglot-i18n.adoc | historical source of record (AP007-AP008) | remove with the block
-.audittraining/security-errors/proof-of-work.adoc | historical source of record (AP009-AP011) | remove with the block
-.audittraining/security-errors/supernorma.adoc | historical source of record (AP012-AP013) | remove with the block
-.audittraining/security-errors/ubicity.adoc | historical source of record (AP014-AP015) | remove with the block
-# The migration ledger and sibling-coordination packets must quote the
-# retired forms to specify their replacements.
-docs/rules/logtalk-migration.adoc | migration ledger of record | permanent while it is the ledger; remove only if superseded and rewritten without quoted forms
-docs/rules/migration/echidna-security-learning-issue.md | sibling coordination packet | remove when the ECHIDNA change lands and the packet is deleted
-docs/rules/migration/epistemic-types-neurosym-deed-issue.md | sibling coordination packet | remove when the epistemic-types change lands and the packet is deleted
-docs/rules/migration/standards-deed-mapping-issue.md | sibling coordination packet | remove when the standards change lands and the packet is deleted
-# Vendored standards conformance fixtures: byte-faithful copies whose
-# retired report-format value is upstream-owned drift (see the
-# standards packet above). Never edit these to diverge from standards.
-test/fixtures/deed_egress/rsr-template-repo_chora.deed | vendored upstream fixture | remove when the standards fixture re-sync no longer carries the retired value
-test/fixtures/deed_egress/template-main/rsr-template-repo_chora.deed | vendored upstream fixture | remove when the standards fixture re-sync no longer carries the retired value
-test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed | vendored upstream fixture | remove when the standards fixture re-sync no longer carries the retired value
-# The guard itself contains the pattern definitions it enforces.
-scripts/check-no-active-logtalk.sh | enforcement definition | remove only with the guard itself
diff --git a/.machine_readable/INTENT.contractile b/.machine_readable/INTENT.contractile
index 5274ec3c..6910a797 100644
--- a/.machine_readable/INTENT.contractile
+++ b/.machine_readable/INTENT.contractile
@@ -34,7 +34,7 @@
"5 neural networks (Graph of Trust, MoE, LSM, ESN, RNN) in coordinator GenServer"
"VQL as the query interface to verisimdb-data — no raw SQL or direct file reads"
"JSONL dispatch manifests for fleet execution layer"
- "Pure-Elixir rule engine in lib/rules/*.ex for error catalog and pattern detection — no Logtalk/SWI-Prolog (ADR-001)"
+ "Pure-Elixir rule engine in lib/rules/*.ex for error catalog and pattern detection (ADR-001)"
"Idris2 ABI for Types, GraphQL, gRPC, REST with dependent type proofs"
"Zig FFI with 7 exported functions for C ABI bridge"
)
diff --git a/.machine_readable/MUST.contractile b/.machine_readable/MUST.contractile
index 25af6e21..f9865561 100644
--- a/.machine_readable/MUST.contractile
+++ b/.machine_readable/MUST.contractile
@@ -89,10 +89,10 @@
; architecture, because its enforcement path never existed:
;
; * "5 neural networks ... must not be reduced" -> there are 8.
- ; * "Logtalk rule engine ... must be preserved" -> DELETED. Logtalk was
- ; purged 2026-04-14 (ADR-001) and AGENTIC.a2ml explicitly FORBIDS it. A
- ; MUST demanding preservation of something another artefact forbids is
- ; worse than no invariant at all.
+ ; * an invariant preserving the pre-ADR-001 rule engine -> DELETED. That
+ ; engine was purged 2026-04-14 (ADR-001) and AGENTIC.a2ml explicitly
+ ; FORBADE it. A MUST demanding preservation of something another
+ ; artefact forbids is worse than no invariant at all.
; * "VQL" / "verisimdb-data" -> renamed VCL / verisim-data
; by ADR-002 on 2026-04-05.
; * "8 GenServers (... Fleet)" -> 24 supervised children and
diff --git a/EXPLAINME.adoc b/EXPLAINME.adoc
index d5e3209e..9fc63659 100644
--- a/EXPLAINME.adoc
+++ b/EXPLAINME.adoc
@@ -95,7 +95,7 @@ pseudo-counts, not Elixir floats.
____
*Machine-checked proofs* — Idris2 proofs of the ABI and the decision logic (confidence bounds,
safety-triangle routing, dispatch thresholds, quarantine, rollback, the Bayesian update and rate
- limiting), one Agda model of the Logtalk-to-Elixir migration, and a TLA+
+ limiting), one Agda model of the security-alert rule tables, and a TLA+
model of the Kin gate that is model-checked on a bounded instance. The proofs are about models of
the code, not the Elixir runtime itself. Proof ledger: 35 proven of 57; 0 proven-with-postulates,
13 tested-only, 2 argued, 7 open
@@ -295,5 +295,5 @@ Census, from `scripts/proof-ledger.sh check`:
35 proven of 57; 0 proven-with-postulates, 13 tested-only, 2 argued, 7 open.
----
-Of the three theory rows, `logtalk-migration` is `PWG-3`;
+Of the three theory rows, `alert-table-correspondence` is `PWG-3`;
`pagerank-convergence` and `esn-echo-state` are ungraded and `open`.
diff --git a/README.adoc b/README.adoc
index 16714ead..595ee217 100644
--- a/README.adoc
+++ b/README.adoc
@@ -27,7 +27,7 @@ It combines:
outcomes, which gates whether a fix is applied automatically, sent for review, or merely reported
* *Machine-checked proofs* — Idris2 proofs of the ABI and the decision logic (confidence bounds,
safety-triangle routing, dispatch thresholds, quarantine, rollback, the Bayesian update and rate
- limiting), one Agda model of the Logtalk-to-Elixir migration, and a TLA+
+ limiting), one Agda model of the security-alert rule tables, and a TLA+
model of the Kin gate that is model-checked on a bounded instance. The proofs are about models of
the code, not the Elixir runtime itself. Proof ledger: 35 proven of 57; 0 proven-with-postulates,
13 tested-only, 2 argued, 7 open (link:EXPLAINME.adoc#proof-ledger[details])
diff --git a/ROADMAP.adoc b/ROADMAP.adoc
index a9afe7ec..2015a79f 100644
--- a/ROADMAP.adoc
+++ b/ROADMAP.adoc
@@ -6,8 +6,7 @@
== Overview
-Hypatia is the neurosymbolic CI/CD intelligence layer for the hyperpolymath ecosystem. It coordinates the gitbot-fleet (rhodibot, echidnabot, sustainabot, glambot, seambot, finishbot) via a safety triangle pipeline, with 8 neural networks, VCL query layer, Bayesian confidence updating, and Elixir rules for pattern detection (absorbed from the Logtalk engine,
-retired 2026-03-06).
+Hypatia is the neurosymbolic CI/CD intelligence layer for the hyperpolymath ecosystem. It coordinates the gitbot-fleet (rhodibot, echidnabot, sustainabot, glambot, seambot, finishbot) via a safety triangle pipeline, with 8 neural networks, VCL query layer, Bayesian confidence updating, and Elixir rules for pattern detection.
== Current State (2026-03-29)
@@ -51,8 +50,7 @@ retired 2026-03-06).
| adapters, cli, data, fixer, integration crates
| Elixir rules (`lib/rules/`)
-| Error catalog, pattern detection, RSR compliance rules (absorbed from the
-Logtalk engine, retired 2026-03-06)
+| Error catalog, pattern detection, RSR compliance rules
| Data layer
| verisim-data (git-backed flat-file store), neural state persistence, JSONL outcomes
@@ -91,7 +89,7 @@ Elixir pipeline:
* [x] Outcome tracking with Bayesian confidence updating
* [x] Re-scan verification via panic-attacker
* [x] Dispatch manifest (JSONL bridge to bash execution)
-* [x] Logtalk rule engine (error catalog, pattern detection) — retired 2026-03-06, absorbed into the Elixir ruleset
+* [x] Rule engine (error catalog, pattern detection) in the Elixir ruleset
=== v2.0 — Neural Intelligence (COMPLETE)
@@ -222,7 +220,7 @@ Soundness gates plus closed-loop verification metric.
2. **verisim-api not deployed:** VeriSimDB Rust core not running — graph/vector/temporal via flat files only
3. **One-sided training data:** ~~99%+ "success"~~ Strategy A (synthetic regressions + rule-based RBF targets) on by default since 2026-04-22 (`lib/neural/rebalancer.ex`). Strategies B (adversarial perturbation) and C (real failure corpus from panic-attack history) remain unstarted.
4. **Fix script coverage:** ~~310/600 auto-execute entries with null fix_script~~ Resolved 2026-05-24 (PR #309 commit `d2bbf75`) — root cause was a matcher language-gate bug, not missing scripts. All 22 scorecard recipe fix scripts already existed on disk; they were unreachable because of an unrecognised `"any"` language sentinel and unreachable `"yaml"` recipes.
-5. **Containerfiles:** Haskell still uses non-Chainguard base images (Logtalk removed)
+5. **Containerfiles:** Haskell still uses non-Chainguard base images
6. **Ada TUI not integrated:** Compiles but not wired into Elixir supervision tree
7. **Neural state persistence:** ~~Coordinator has not persisted to disk yet~~ All eight networks now warm-restart-capable. RBF + MoE + trust_graph hydrated since commits `f5257ef` + `2d5cb2e`; GNN + VAE + Sequence since commit `cc50422` (M17). LSM + ESN remain summary-only by reservoir-state design — no plain serialisation pathway for those.
8. **`/api/*` loopback-only:** ~~Bearer-token auth tracked as Phase 4 deferred~~ Done 2026-05-24 commit `5fab9d4` (M15a): HYPATIA_API_BEARER_TOKEN env enables remote callers; loopback-only otherwise.
diff --git a/arcvix-neurosymbolic-ci-intelligence.tex b/arcvix-neurosymbolic-ci-intelligence.tex
index df46087f..f24b86ff 100644
--- a/arcvix-neurosymbolic-ci-intelligence.tex
+++ b/arcvix-neurosymbolic-ci-intelligence.tex
@@ -65,7 +65,7 @@
% ABSTRACT
% ============================================================
\begin{abstract}
-Modern software supply chains deploy numerous static and dynamic analysis tools---CodeQL, Semgrep, Snyk, Trivy, SonarQube---that collectively generate thousands of findings per organisation. Yet the critical gap is not \emph{detection} but \emph{decision}: given a finding, what should be done, by whom, with what confidence, and in what order? We present \textsc{Hypatia}, a neurosymbolic decision intelligence system that sits between scanners and fixers in CI/CD pipelines, orchestrating automated remediation across a fleet of specialised bots. \textsc{Hypatia} combines five lightweight neural networks---a trust-weighted PageRank graph, a sparse Mixture of Experts, two reservoir computing networks (Liquid State Machine and Echo State Network), and a Radial Basis Function novelty detector---with 20 declarative Logtalk/Prolog rules for known standards compliance. A Safety Triangle framework inspired by occupational hazard hierarchies routes every finding through Eliminate, Substitute, or Control tiers with confidence-gated dispatch. Over 16{,}671 recorded outcomes across 302 repositories, the system achieves a 99\% remediation success rate with Bayesian confidence updating, automatic bot quarantine on failure streaks, and batch rollback capability. We argue that this detection--decision decoupling represents a necessary paradigm shift for managing the combinatorial explosion of findings in modern DevSecOps environments.
+Modern software supply chains deploy numerous static and dynamic analysis tools---CodeQL, Semgrep, Snyk, Trivy, SonarQube---that collectively generate thousands of findings per organisation. Yet the critical gap is not \emph{detection} but \emph{decision}: given a finding, what should be done, by whom, with what confidence, and in what order? We present \textsc{Hypatia}, a neurosymbolic decision intelligence system that sits between scanners and fixers in CI/CD pipelines, orchestrating automated remediation across a fleet of specialised bots. \textsc{Hypatia} combines five lightweight neural networks---a trust-weighted PageRank graph, a sparse Mixture of Experts, two reservoir computing networks (Liquid State Machine and Echo State Network), and a Radial Basis Function novelty detector---with a declarative rule layer for known standards compliance (20 rules in the version evaluated here). A Safety Triangle framework inspired by occupational hazard hierarchies routes every finding through Eliminate, Substitute, or Control tiers with confidence-gated dispatch. Over 16{,}671 recorded outcomes across 302 repositories, the system achieves a 99\% remediation success rate with Bayesian confidence updating, automatic bot quarantine on failure streaks, and batch rollback capability. We argue that this detection--decision decoupling represents a necessary paradigm shift for managing the combinatorial explosion of findings in modern DevSecOps environments.
\medskip
\noindent\textbf{Keywords:} neurosymbolic AI, CI/CD, automated remediation, software engineering intelligence, safety triangle, DevSecOps, reservoir computing
@@ -216,7 +216,7 @@ \section{The Neurosymbolic Architecture}
\node[neuralbox, right=0.3cm of esn] (rbf) {Radial\\(RBF)};
% Symbolic layer
-\node[symbox, below right=1.0cm and 2.5cm of registry] (rules) {Logtalk/Prolog\\(20 rules)};
+\node[symbox, below right=1.0cm and 2.5cm of registry] (rules) {Symbolic rules\\(20, as evaluated)};
% Coordinator
\node[box, fill=purple!10, draw=purple!50!black, below=1.8cm of registry] (coord) {Neural Coordinator};
@@ -386,11 +386,11 @@ \subsubsection{Radial Basis Function Network (Novelty Detection)}
\subsection{The Symbolic Layer: Declarative Rules}
\label{subsec:symbolic}
-Twenty Logtalk/Prolog rules encode deterministic domain knowledge---the ``known-knowns'' that do not benefit from neural approximation. These rules cover:
+In the version evaluated here, twenty declarative rules encode deterministic domain knowledge---the ``known-knowns'' that do not benefit from neural approximation. The rule layer is now implemented as Elixir modules and has since grown: the generated catalogue (\texttt{docs/rules/catalogue.adoc}) lists 44 rule modules. The twenty evaluated rules cover:
\begin{table}[htbp]
\centering
-\caption{Symbolic rule categories in \textsc{Hypatia}. Each rule is an Elixir predicate function with deterministic output, avoiding neural computation overhead for well-understood checks.}
+\caption{Symbolic rule categories in the evaluated version of \textsc{Hypatia}. Each rule has deterministic output, avoiding neural computation overhead for well-understood checks.}
\label{tab:rules}
\begin{tabular}{@{}llc@{}}
\toprule
@@ -410,7 +410,7 @@ \subsection{The Symbolic Layer: Declarative Rules}
The symbolic layer processes findings \emph{before} the neural layer. Any finding that matches a symbolic rule receives a deterministic verdict---either a confirmed true positive with a known recipe, or a confirmed false positive to be suppressed. Only findings not resolved by the symbolic layer proceed to neural evaluation.
-This architecture has two advantages. First, it is fast: Logtalk rule evaluation is sub-millisecond, avoiding the overhead of neural inference for standard checks. Second, it is auditable: every symbolic decision can be traced to a specific rule with a human-readable justification, satisfying compliance requirements that opaque neural decisions cannot.
+This architecture has two advantages. First, it is fast: symbolic rule evaluation is sub-millisecond, avoiding the overhead of neural inference for standard checks. Second, it is auditable: every symbolic decision can be traced to a specific rule with a human-readable justification, satisfying compliance requirements that opaque neural decisions cannot.
\subsection{Neurosymbolic Fusion}
\label{subsec:fusion}
@@ -648,8 +648,7 @@ \subsection{Technology Stack}
\toprule
\textbf{Language} & \textbf{Component} & \textbf{Rationale} \\
\midrule
-Elixir/OTP & Core pipeline, neural nets, dispatch & Fault-tolerant concurrency, GenServers \\
-Logtalk/Prolog & Symbolic rule engine & Declarative logic programming \\
+Elixir/OTP & Core pipeline, symbolic rules, neural nets, dispatch & Fault-tolerant concurrency, GenServers \\
Rust & Adapters, CLI, data layer, fixer & Performance, memory safety \\
Idris2 & ABI definitions & Dependent types for interface proofs \\
Zig & FFI bridge & C ABI compatibility, zero overhead \\
@@ -929,7 +928,7 @@ \section{Conclusion}
% ============================================================
\section*{Acknowledgements}
-The author thanks the open-source communities behind Elixir/OTP, Rust, Idris2, Zig, and Logtalk, whose tools made this multi-paradigm architecture possible. The OpenSSF Scorecard project provided the compliance framework that motivated the symbolic rule layer. The paper's title echoes the occupational safety literature's emphasis on hazard hierarchies, acknowledging the intellectual debt to that tradition.
+The author thanks the open-source communities behind Elixir/OTP, Rust, Idris2, and Zig, whose tools made this multi-paradigm architecture possible. The OpenSSF Scorecard project provided the compliance framework that motivated the symbolic rule layer. The paper's title echoes the occupational safety literature's emphasis on hazard hierarchies, acknowledging the intellectual debt to that tradition.
% ============================================================
diff --git a/docs/DEBT-REGISTER.adoc b/docs/DEBT-REGISTER.adoc
index 505d1df8..0a04b7c4 100644
--- a/docs/DEBT-REGISTER.adoc
+++ b/docs/DEBT-REGISTER.adoc
@@ -444,28 +444,25 @@ producer.
==== D-2 · HIGH · Retired technology still documented as current · partly fixed in this pass
-41 surviving Logtalk/SWI-Prolog references in human docs for an engine
-purged 2026-04-14 — including an install runbook that says
-`+# Install SWI-Prolog and Logtalk+`. Also: a 135-line README section on
+Surviving references in human docs to the rule engine purged
+2026-04-14 (ADR-001), including an install runbook for its runtime.
+Also: a 135-line README section on
a Haskell registry that *does not exist*, Julia neural networks (*zero
`+.jl+` files*), and ArangoDB/Dragonfly architecture 37 lines after the
README says ArangoDB was ditched. trufflehog is still _executing_ in
`+security-policy.yml+` despite #675 retiring it.
-*Logtalk subset — closed 2026-11-01.* The remaining Logtalk *semantics*
-(ECHIDNA `security_learning.lgt`; Hypatia's embedded audit-training
-rules AP001–AP015) are transcribed to Elixir with a clause-by-clause
-ledger (`docs/rules/logtalk-migration.adoc`); the Logtalk generator is
-replaced by schema'd JSON; active-tense Logtalk documentation
-(developer guide, EXPLAINME, FAQ/glossary, diagrams, quickstarts, man
-page, security/testing/API docs, integration config, INTENT) is
-corrected to the canonical `lib/rules/*.ex` locations or explicitly
-classified historical; and `scripts/check-no-active-logtalk.sh` guards
-against new active `.lgt` files/settings. The two vendored DEED
-fixtures still carrying the retired Logtalk report-format value are upstream-owned
-(standards) and tracked in the migration packet, so they remain until
-standards re-sync. D-2 stays open for its non-Logtalk parts (Haskell
-registry prose, Julia claims, ArangoDB/Dragonfly, trufflehog).
+*Retired rule-engine subset — closed 2026-11-01, mentions removed
+2026-11-16.* The remaining rule semantics (ECHIDNA's security-learning
+rule table; Hypatia's audit-training rules AP001–AP015) are transcribed
+to Elixir, recorded clause by clause in
+`docs/rules/security-rule-provenance.adoc`; the old positional rule
+export is replaced by schema'd JSON; and the documentation names only
+the canonical `lib/rules/*.ex` locations. The vendored DEED fixtures
+that still carry the retired report-format value are upstream-owned
+(standards) and stay byte-faithful until standards re-syncs them. D-2
+stays open for its other parts (Haskell registry prose, Julia claims,
+ArangoDB/Dragonfly, trufflehog).
==== D-3 · HIGH · No rule catalogue exists · UNTRACKED
@@ -523,9 +520,9 @@ The test suite already asserts this as a known deviation
==== M-2 · HIGH · `+MUST.contractile+` declares invariants that would revert landed architecture · fixed in this pass
It required "`5 neural networks … must not be reduced`" (there are 8)
-and — most seriously — "`**Logtalk rule engine … must be preserved**`",
-directly contradicting ADR-001 which purged it and `+AGENTIC.a2ml+`
-which _forbids_ it. Its `+k9-validator+` enforcement path
+and — most seriously — that the pre-ADR-001 rule engine "`**must be
+preserved**`", directly contradicting ADR-001 which purged it and
+`+AGENTIC.a2ml+` which _forbade_ it. Its `+k9-validator+` enforcement path
(`+contractiles/self-validating/must-check.k9.ncl+`) *does not exist*,
which is why the drift went undetected. Only 4 of ~14 declared
invariants have contract tests.
@@ -542,7 +539,7 @@ corpus run both call`".
It is the file agents are instructed to read _first_. Claimed `+VQL+`
(renamed VCL 2026-04-05), `+verisimdb-data+` (renamed verisim-data),
-`+Logtalk rules+` (purged), `+5 neural networks+` (8), and `+lib/vql/+`
+the purged pre-ADR-001 rules, `+5 neural networks+` (8), and `+lib/vql/+`
(does not exist).
==== M-5 · MEDIUM · Six `+6a2+` files stale by 74-136 days, with internal contradictions · fixed in this pass
diff --git a/docs/api/cli-reference.adoc b/docs/api/cli-reference.adoc
index 2c639f4f..c6e6c176 100644
--- a/docs/api/cli-reference.adoc
+++ b/docs/api/cli-reference.adoc
@@ -582,7 +582,7 @@ hyper deposit [OPTIONS]
|Argument |Description
|`RULESET_FILE`
-|Path to the ruleset file (.lgt or .hs)
+|Path to the ruleset file (.json or .hs)
|===
==== Options
@@ -617,13 +617,13 @@ hyper deposit [OPTIONS]
[source,bash]
----
# Deposit a ruleset
-hyper deposit my-rules.lgt
+hyper deposit my-rules.json
# Validate only
-hyper deposit --validate-only my-rules.lgt
+hyper deposit --validate-only my-rules.json
# Deposit with tags
-hyper deposit --tag security,workflow my-rules.lgt
+hyper deposit --tag security,workflow my-rules.json
----
=== withdraw
@@ -667,6 +667,11 @@ hyper withdraw [OPTIONS]
|`-o`
|Output file path
|stdout
+
+|`--file-format `
+|
+|Format written to the output file: `json`, `yaml` or `toml`
+|`yaml`
|===
==== Examples
@@ -680,7 +685,7 @@ hyper withdraw security-rules
hyper withdraw --version 1.2.0 security-rules
# Save to file
-hyper withdraw -o rules.lgt security-rules
+hyper withdraw --file-format json -o rules.json security-rules
----
=== search
diff --git a/docs/architecture/NEURAL-ARCHITECTURE.adoc b/docs/architecture/NEURAL-ARCHITECTURE.adoc
index a7404242..7cd229d4 100644
--- a/docs/architecture/NEURAL-ARCHITECTURE.adoc
+++ b/docs/architecture/NEURAL-ARCHITECTURE.adoc
@@ -7,12 +7,6 @@ by a central *Neural.Coordinator* GenServer in a *hub-and-spoke*
topology. The coordinator aggregates predictions from all 8 networks and
provides a unified intelligence layer for the safety triangle pipeline.
-*Logtalk is NOT part of the neural architecture.* The Logtalk rule files
-(`+.lgt+`) were standalone symbolic reasoning rules (the engine was retired
-2026-03-06 and absorbed into `+lib/rules/*.ex+`) that were not
-loaded or executed by the Elixir application. They are a separate,
-disconnected layer.
-
'''''
=== Hub-and-Spoke Topology
@@ -223,9 +217,7 @@ every 5 minutes and feeds outcomes to the coordinator via
Training is seeded from gitbot-fleet’s `+fix-outcomes.jsonl+` (6,000+
records) and hypatia’s `+auto-fix-formulaic.sh+` scan results.
-*Note:* The Logtalk symbolic layer (`+.lgt+` files) was absorbed into
-Elixir modules in `+lib/rules/+` on 2026-03-06. The Logtalk files have
-been removed from the repository.
+*Note:* The symbolic rules are Elixir modules in `+lib/rules/+`.
'''''
@@ -340,7 +332,7 @@ control
|`+self_diagnostics.ex+` |Health monitoring, circuit breaker
|===
-==== Rules Engine (lib/rules/) — absorbed from Logtalk 2026-03-06
+==== Rules Engine (lib/rules/)
[width="100%",cols="48%,52%",options="header",]
|===
diff --git a/docs/architecture/system-integration.adoc b/docs/architecture/system-integration.adoc
index 3f767e92..787d0a24 100644
--- a/docs/architecture/system-integration.adoc
+++ b/docs/architecture/system-integration.adoc
@@ -6,7 +6,7 @@
....
┌─────────────────────────────────────────────────────────────────┐
-│ AUTONOMOUS LEARNING LOOP │
+│ LEARNING LOOP │
└─────────────────────────────────────────────────────────────────┘
│
▼
@@ -26,10 +26,9 @@
│ (hypatia-cli.sh scan .) │
│ │
│ Rules from: │
- │ • code-safety-lessons.lgt │
- │ • container-security-lessons.lgt │
- │ • security-lessons.lgt │
- │ • learned-rules.lgt (auto-generated) │
+ │ • lib/rules/code_safety.ex │
+ │ • lib/rules/security_errors.ex │
+ │ • lib/rules/cicd_rules.ex │
└──────────────┬───────────────────────────┘
│
▼
@@ -66,18 +65,18 @@
│ • Frequencies │ │ fixes based on │
│ • Fix outcomes │ │ known patterns │
│ │ │ │
- │ After 5 obs.: │ │ Records: │
- │ → Propose rule │ │ • Success rate │
+ │ On promote: │ │ Records: │
+ │ >= 5 fixes and │ │ • Success rate │
│ │ │ • Failure rate │
- │ After 10 obs + │ │ │
- │ 3 successes: │ │ ← Feeds back │
- │ → Auto-approve │ │ │
- │ → Add to │ │ │
- │ learned- │ │ │
- │ rules.lgt │ │ │
+ │ >= 75% success, │ │ │
+ │ FP <= 30%: │ │ ← Feeds back │
+ │ → promoted │ │ │
+ │ (manual call: │ │ │
+ │ promote_patterns│ │ │
+ │ ; no timer) │ │ │
└──────┬───────────┘ └─────┬────────────┘
│ │
- │ New rules │ Fix results
+ │ Promotions │ Fix results
│ │
└──────────┬─────────┘
│
@@ -85,10 +84,10 @@
┌──────────────────────────────────────────┐
│ 7. CONTINUOUS IMPROVEMENT │
│ │
- │ • New patterns → New rules │
+ │ • New categories → recipes at 0.50 │
│ • Successful fixes → Higher confidence │
│ • Failed fixes → Try alternative │
- │ • 10+ observations → Auto-add rule │
+ │ • promote_patterns → promote issue type │
└───────────────────────────────────────────┘
....
@@ -101,19 +100,14 @@ from fixes to rules ❌ *GitHub integration* - No CI/CD calling hypatia
=== What Was Built (2026-01-25)
-✅ *code-safety-lessons.lgt* - Rust / (legacy ReScript) / CORS / auth
-patterns [Logtalk engine retired 2026-04; see commit d27fe4b] ✅
-*engine/scanner.lgt* - Actual file reading/pattern matching [same
-retirement] ✅ *hypatia-cli.sh* - Command-line scanner (ripgrep-based)
-✅ *fleet-coordinator.sh* - Bot execution & coordination ✅
-*learning_engine.lgt* - Auto-generates rules from patterns [same
-retirement] ✅ *GitHub Actions template* - CI/CD integration
-
-____
-*2026-04 update:* The `+.lgt+` (Logtalk) components were retired; rule
-logic now lives entirely in Elixir under `+lib/rules/+`. The historical
-entries above are kept for provenance.
-____
+✅ *Code-safety rules* - Rust / (legacy ReScript) / CORS / auth
+patterns (now `+lib/rules/code_safety.ex+`) ✅ *hypatia-cli.sh* -
+Command-line scanner (ripgrep-based) ✅ *fleet-coordinator.sh* - Bot
+execution & coordination ✅ *Learning engine* - Records fix outcomes;
+`+promote_patterns+` marks qualifying issue types as promoted in the
+module's own state, which nothing outside it acts on yet (now
+`+lib/rules/learning.ex+`) ✅ *GitHub Actions
+template* - CI/CD integration
=== How To Use
@@ -187,32 +181,36 @@ cd gitbot-fleet
==== Threshold Phase
....
-Observations | Action
--------------|-----------------------------------
-1-4 | Just observe and count
-5 | Generate rule proposal → manual review
-10 + 3 fixes | Auto-approve → add to learned-rules.lgt
+At a promote_patterns call, for one issue type | Action
+-------------------------------------------------|---------------------
+fewer than 5 recorded fixes | not promoted
+success rate below 0.75 | not promoted
+false-positive records over 30% of fix count | not promoted
+5+ fixes, success >= 0.75, FP records <= 30% | promoted
....
-==== Auto-Generated Rule Example
-
-After seeing `+useUnsafePointer()+` 10 times, the learning pipeline in
-`+lib/rules/learning.ex+` auto-generates a rule module at confidence
-0.50 and promotes it via the Bayesian update loop once fixes succeed.
-The former Logtalk example here described the retired `+.lgt+` engine;
-the Elixir equivalent lives in `+lib/rules/code_safety.ex+`.
-
-____
-*Note:* this document still contains residual `+.lgt+` filenames and
-"`learned-rules.lgt`"-style references from the earlier Logtalk-era
-architecture; they are provenance only. The rules engine is 100% Elixir
-(`+lib/rules/*.ex+`); see `+docs/rules/logtalk-migration.adoc+` for the
-semantic transcription and JSON replacement contracts.
-____
+The false-positive share is the number of `+record_false_positive/2+`
+records for the type divided by its number of recorded fixes. A type that
+is already promoted stays promoted: a later call that fails a check does
+not demote it.
+
+==== Rule Promotion and New Recipes
+
+`+lib/rules/learning.ex+` promotes an issue type only when
+`+promote_patterns+` is called; nothing in `+lib/+` calls it on a
+timer. For an uncovered category, `+recipe_generator.ex+` writes a
+remediation recipe (`+recipe-.json+`) at confidence 0.50. It
+does not create a detector rule: nothing generates executable rules yet.
+The Bayesian loop in `+outcome_tracker.ex+`
+updates that confidence as fixes succeed or fail.
+The Elixir rule for this pattern family lives in
+`+lib/rules/code_safety.ex+`. The rules engine is 100% Elixir
+(`+lib/rules/*.ex+`); see `+docs/rules/security-rule-provenance.adoc+`
+for the transcribed rule tables and the learned-rules JSON contract.
=== Current Rules Coverage
-==== Code Safety (code-safety-lessons.lgt)
+==== Code Safety
* ✅ Rust `+unwrap()+` → panic DoS
* ✅ Rust `+unwrap_or(0)+` → privilege escalation
@@ -227,7 +225,7 @@ detection kept for migration audits)
* ✅ Path traversal patterns
* ✅ Command injection patterns
-==== Container Security (container-security-lessons.lgt)
+==== Container Security
* ✅ Environment variable injection
* ✅ Shell variable quoting
@@ -237,7 +235,7 @@ detection kept for migration audits)
* ✅ Permissive mode bypasses
* ✅ Runtime delegation security
-==== Workflow Security (security-lessons.lgt)
+==== Workflow Security
* ✅ Unpinned GitHub Actions
* ✅ Missing permissions declarations
@@ -296,9 +294,10 @@ Scan of svalinn (2026-01-25):
=== Architecture Benefits
[arabic]
-. *Autonomous* - Learns and improves without manual intervention
+. *Feedback-driven* - Fix outcomes update confidence; rule promotion
+runs when `+promote_patterns+` is called
. *Incremental* - Starts with basic rules, grows organically
-. *Evidence-based* - Rules generated from actual observations
+. *Evidence-based* - Recipe confidence comes from recorded fix outcomes
. *Self-correcting* - Failed fixes reduce pattern confidence
. *Explainable* - Every rule has observation count + context
. *Collaborative* - Bots share findings via gitbot-fleet
@@ -313,8 +312,9 @@ After: - ✅ GitHub Actions watch alarm (CI/CD) - ✅ hypatia-cli detects
smoke (scanner) - ✅ fleet-coordinator dispatches trucks (bot execution)
- ✅ robot-repo-automaton puts out fire (auto-fix) - ✅ learning_engine
improves detection (fewer false alarms) - ✅ System gets smarter with
-every fire (autonomous learning)
+every fire (fix outcomes feed confidence)
'''''
-*The system is now fully operational and autonomous.*
+*The pipeline is wired end to end. Rule promotion is not automatic: it
+runs when `+promote_patterns+` is called.*
diff --git a/docs/architecture/topology.adoc b/docs/architecture/topology.adoc
index 3477a8cf..4413871c 100644
--- a/docs/architecture/topology.adoc
+++ b/docs/architecture/topology.adoc
@@ -85,7 +85,7 @@ NEURAL SUBSYSTEM (hub-and-spoke)
Training Pipeline ██████████ 100% Reads verisim-data automatically
Persistence ██████████ 100% ArangoDB + flat file backup
-RULES ENGINE (Elixir — absorbed from Logtalk 2026-03-06)
+RULES ENGINE (Elixir)
security_errors.ex ██████████ 100% SHA pins, secrets, CWEs
cicd_rules.ex ██████████ 100% Commit blocking, waste detection
code_safety.ex ██████████ 100% Per-language dangerous patterns
@@ -125,7 +125,7 @@ CROSS-REPO INTEGRATION
.git-private-farm → hypatia ██░░░░░░░░ 20% repo-list done, HOOKSYNC_TOKEN missing
REMOVED (2026-03-06)
- Logtalk engine/ (28 .lgt files) — absorbed into lib/rules/*.ex
+ Old rule engine/ (28 files) — absorbed into lib/rules/*.ex
Ada TUI (102 files) — never compiled
Haskell registry (30 files) — superseded by Elixir pipeline
k8s/terraform/helm deploy (94) — over-engineered for local tool
diff --git a/docs/diagrams/data-flow.adoc b/docs/diagrams/data-flow.adoc
index 91917a32..36128953 100644
--- a/docs/diagrams/data-flow.adoc
+++ b/docs/diagrams/data-flow.adoc
@@ -127,7 +127,7 @@ sequenceDiagram
participant Verify
participant Storage
- User->>CLI: hyper deposit ruleset.lgt
+ User->>CLI: hyper deposit ruleset.json
CLI->>CLI: parse_ruleset()
CLI->>API: POST /rulesets
diff --git a/docs/diagrams/rule-execution.adoc b/docs/diagrams/rule-execution.adoc
index a34160cc..bffa7160 100644
--- a/docs/diagrams/rule-execution.adoc
+++ b/docs/diagrams/rule-execution.adoc
@@ -17,9 +17,9 @@ flowchart TB
end
subgraph "Rule Loading"
- Static[Static Rules
cicd_rules.lgt]
- Learned[Learned Patterns
learning.lgt]
- Distilled[Distilled Rules
rule_distiller.lgt]
+ Static[Static Rules
cicd_rules.ex]
+ Learned[Learned Patterns
learning.ex]
+ Distilled[Distilled Rules
learning.ex promotion]
end
subgraph "Evaluation"
diff --git a/docs/governance/CRG-AUDIT-2026-04-18.adoc b/docs/governance/CRG-AUDIT-2026-04-18.adoc
index 93ae9271..352ee2b0 100644
--- a/docs/governance/CRG-AUDIT-2026-04-18.adoc
+++ b/docs/governance/CRG-AUDIT-2026-04-18.adoc
@@ -153,9 +153,9 @@ hits, contractile trident complete, full mirror fan-out configured.
| 0
| Grep `{believe_me,assert_total,Admitted,sorry,unsafeCoerce,Obj.magic}` across `src/` → 1 match, which is the literal string "Zero believe_me" in `RuleEngine.idr:18` (a claim-of-absence comment, not a use).
-| Logtalk legacy files
+| Legacy rule-engine files (ADR-001)
| *0 in `lib/`* — grep finds zero hits
-| `engine/logtalk/*.lgt` removed 2026-04-11 (STATE.a2ml session log: "Deleted engine/logtalk/error_instances.lgt + loader.lgt"). The 2026-04-14 session log records the full purge: CI/CD jobs removed, Elixir promoted to primary, SWI-Prolog dropped from `stapeln.toml` and Containerfiles.
+| The old `engine/` rule sources were removed 2026-04-11 (STATE.a2ml session log). The 2026-04-14 session log records the full purge: CI/CD jobs removed, Elixir promoted to primary, SWI-Prolog dropped from `stapeln.toml` and Containerfiles.
| Lingering `.scm` files
| 5 total (2 in `docs/`, 2 in `.audittraining/`, 1 at root as `guix.scm`)
@@ -176,7 +176,7 @@ different things:
*CI is not green today.* The 2026-04-05 session explicitly records 124 failing
tests (corrupted recipe data) that *were not fixed in that session and have
not been recorded as fixed since*. Later sessions (2026-04-11, 2026-04-14)
-add PO001–PO006, ECHIDNA↔Hypatia coupling, and the Logtalk purge, but no
+add PO001–PO006, ECHIDNA↔Hypatia coupling, and the ADR-001 rule-engine purge, but no
session-history entry closes out the 124 failures. Under v2.0 C this is a
red-flag direct failure of the "CI green" requirement.
@@ -363,7 +363,7 @@ items.
| D
| *✓ strong pass*
-| 33 RSR workflows; clean Containerfile / Deno / Justfile / contractile-trident / well-known / LICENSE layout; 0 `Dockerfile`, 0 `package.json`, 0 `Makefile`; 1,128 LOC Idris2 ABI with `%default total` on every module; 0 `believe_me` / `assert_total` / `sorry` / `unsafeCoerce` / `Obj.magic` uses; Logtalk purge complete 2026-04-14 (0 `.lgt` files, 0 `logtalk` refs in `lib/`); full 5-mirror fan-out
+| 33 RSR workflows; clean Containerfile / Deno / Justfile / contractile-trident / well-known / LICENSE layout; 0 `Dockerfile`, 0 `package.json`, 0 `Makefile`; 1,128 LOC Idris2 ABI with `%default total` on every module; 0 `believe_me` / `assert_total` / `sorry` / `unsafeCoerce` / `Obj.magic` uses; ADR-001 rule-engine purge complete 2026-04-14 (0 legacy rule files, 0 legacy refs in `lib/`); full 5-mirror fan-out
| Four stale `.scm` files (`docs/CRYPTO-STANDARD.scm`, `docs/STANDARDIZATION-CHECKLIST.scm`, `.audittraining/ERROR-CATALOG.scm`, `.audittraining/SHA-PINS.scm`) owe A2ML migration — adjacent to the 2026-04-12 migration closure. STATE.a2ml omits `crg-grade` entirely — machine-readable governance defect.
| C
@@ -408,7 +408,7 @@ next-target = "C"
notes = """
CRG v2.0 STRICT audit 2026-04-18: 33 RSR workflows, 697 tests, 1,128 LOC
Idris2 ABI with 0 believe_me uses, clean container+deno+justfile posture,
-Logtalk purge complete. Blocker to C: 124 pre-existing test failures
+ADR-001 rule-engine purge complete. Blocker to C: 124 pre-existing test failures
recorded 2026-04-05 not yet closed (CI not green clause). Per-subtree
README coverage 1/22. External-target trail absent; language diversity
within estate is not v2.0 B evidence.
@@ -427,8 +427,8 @@ The D grade is earned on four positive signals:
the estate. Idris2 ABI has `%default total` on every module; grep confirms
zero uses of `believe_me`, `assert_total`, `sorry`, `unsafeCoerce`,
`Obj.magic`.
-3. Logtalk purge complete 2026-04-14 — `engine/` directory gone, 0 `.lgt`
- files, 0 `logtalk` refs in `lib/`, SWI-Prolog dropped from `stapeln.toml`.
+3. ADR-001 rule-engine purge complete 2026-04-14 — `engine/` directory gone,
+ 0 legacy rule files, 0 legacy refs in `lib/`, SWI-Prolog dropped from `stapeln.toml`.
Elixir rules are now the single source of truth, as intended.
4. Broad internal dogfood: `hypatia-scan.yml` is a consumed CI dependency
on ~30+ estate repos. 19 rule modules with 6,791 LOC of Elixir is a real
@@ -479,8 +479,8 @@ What blocks promotion to B (even after C is met):
- The ECHIDNA↔Hypatia coupling (2026-04-11 session: `proof_obligation.ex`
PO001–PO006, FleetDispatcher extension, LearningScheduler N5) is taken
as done; not re-audited.
-- The Logtalk purge (2026-04-14) is taken as done; grep confirms 0 `.lgt`
- files and 0 `logtalk` refs in `lib/`. The 2026-04-12 MEMORY.md note
+- The ADR-001 rule-engine purge (2026-04-14) is taken as done; grep confirms
+ 0 legacy rule files and 0 legacy refs in `lib/`. The 2026-04-12 MEMORY.md note
("Hypatia now consumes JSON AssailReport via Elixir rules") matches
what the code shows.
- The BJ2-style credential isolation and axiomatic-`believe_me` policies are
diff --git a/docs/guides/admin-guide.adoc b/docs/guides/admin-guide.adoc
index 4235895c..5bde36b4 100644
--- a/docs/guides/admin-guide.adoc
+++ b/docs/guides/admin-guide.adoc
@@ -40,7 +40,7 @@ hypatia consists of several interconnected components:
----
*Registry*:: Haskell service for ruleset storage, verification, and distribution
-*Engine*:: Elixir rules service for rule execution and inference (absorbed from the retired Logtalk/SWI-Prolog engine)
+*Engine*:: Elixir rules service for rule execution and inference
*Adapter*:: Rust service for forge API integration (GitHub, GitLab, etc.)
*ArangoDB*:: Graph database for relationship modeling
*Dragonfly*:: High-performance cache for compiled rules
@@ -114,7 +114,7 @@ GRAFANA_PASSWORD=admin-password-here
| Engine
| 8081
-| Rule engine (Elixir; Logtalk predecessor retired 2026-03-06)
+| Rule engine (Elixir)
| Adapter
| 8082
@@ -321,7 +321,7 @@ source ~/.cargo/env
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
# Install Erlang/Elixir (the rule engine). Use the versions pinned in
-# mise.toml / CI. SWI-Prolog/Logtalk are NOT dependencies.
+# mise.toml / CI.
# See https://elixir-lang.org/install.html
----
@@ -1002,14 +1002,6 @@ curl -u root:password http://localhost:8529/_api/query/slow
kubectl top pods -n hypatia
----
-. Review heap usage:
-+
-[source,bash]
-----
-kubectl exec -it deployment/hypatia-engine -- \
- swipl -g "statistics(heap, H), format('Heap: ~w~n', [H]), halt"
-----
-
== Reference
* <>
diff --git a/docs/guides/cicd-guidebook.adoc b/docs/guides/cicd-guidebook.adoc
index fdaf3cd2..885fd0ce 100644
--- a/docs/guides/cicd-guidebook.adoc
+++ b/docs/guides/cicd-guidebook.adoc
@@ -1026,7 +1026,7 @@ RUST_LOG=cicd_fixer::scanner=trace cicd-fixer scan /path/to/repo
=== Phase 1: Foundation (Complete)
-* [x] Logtalk rule engine (retired 2026-03-06, absorbed into the Elixir ruleset)
+* [x] Rule engine (error catalog, pattern detection) in the Elixir ruleset
* [x] ERROR-CATALOG.scm
* [x] SHA-PINS.scm
* [x] cicd-fixer CLI
diff --git a/docs/guides/developer-guide.adoc b/docs/guides/developer-guide.adoc
index ee3a58fb..8f041844 100644
--- a/docs/guides/developer-guide.adoc
+++ b/docs/guides/developer-guide.adoc
@@ -10,7 +10,7 @@
== Introduction
-This guide covers development of hypatia components, including writing rules in Elixir (the rule engine — absorbed from the Logtalk engine, retired 2026-03-06), developing forge adapters, and contributing to the project.
+This guide covers development of hypatia components, including writing rules in Elixir (the rule engine), developing forge adapters, and contributing to the project.
=== Development Environment Setup
@@ -61,7 +61,6 @@ cd ../adapters && cargo build
cd ../registry && cabal update && cabal build
# Rule engine is Elixir — fetch deps and run the test suite
-# (the Logtalk engine these docs predated was retired 2026-03-06)
# Start development environment
cd ../deploy
@@ -130,14 +129,9 @@ cabal test
== Writing Rules (Elixir)
Rules are pure-Elixir modules under `+lib/rules/*.ex+` in the
-`+Hypatia.Rules+` namespace. There is no Logtalk engine, loader, or
-output format (ADR-001, 2026-04-14). The clause-by-clause transcription
-of the retired Logtalk semantics — and the JSON contracts that replaced
-Logtalk facts — is `+docs/rules/logtalk-migration.adoc+`. Do not add
-`+.lgt+`/`+.logtalk+` files or Logtalk output settings:
-`+scripts/check-no-active-logtalk.sh+` rejects them, and
-`+Hypatia.Rules.SecurityErrors.language_replacement("logtalk")+`
-answers `+"elixir"+` for scanned repositories.
+`+Hypatia.Rules+` namespace (ADR-001, 2026-04-14). Rules transcribed
+from an external source of record, and the learned-rules JSON contract,
+are recorded in `+docs/rules/security-rule-provenance.adoc+`.
=== Shape of a rule module
@@ -795,6 +789,6 @@ cabal haddock --open
* <>
* <>
* https://elixir-lang.org/docs.html[Elixir Documentation]
-* <<../rules/logtalk-migration.adoc#,Logtalk → Elixir Migration Ledger>> (historical semantics and replacement contracts)
+* <<../rules/security-rule-provenance.adoc#,Security Rule Provenance>> (transcribed rule tables and the learned-rules JSON contract)
* https://www.haskell.org/documentation/[Haskell Documentation]
* https://doc.rust-lang.org/book/[The Rust Book]
diff --git a/docs/guides/glossary.adoc b/docs/guides/glossary.adoc
index 19c2a725..f3c74b98 100644
--- a/docs/guides/glossary.adoc
+++ b/docs/guides/glossary.adoc
@@ -214,13 +214,9 @@ A purely functional programming language used for the registry, ruleset DSL, and
Liquid Haskell::
A refinement type system for Haskell that enables formal verification of code properties. Used to verify ruleset correctness.
-[[logtalk]]
-Logtalk::
-An object-oriented logic programming language extending Prolog. *Historical:* Hypatia's original rule language, retired 2026-04-14 (ADR-001); its surviving semantics were transcribed to Elixir (`+docs/rules/logtalk-migration.adoc+`). Not used anywhere in the current system.
-
[[prolog]]
Prolog::
-A logic programming language that forms the foundation of Logtalk. Enables declarative rule definition and inference.
+A logic programming language. Enables declarative rule definition and inference.
[[quickcheck]]
QuickCheck::
diff --git a/docs/history/KNOWN-ISSUES.adoc b/docs/history/KNOWN-ISSUES.adoc
index b707ef6c..6d9d23ab 100644
--- a/docs/history/KNOWN-ISSUES.adoc
+++ b/docs/history/KNOWN-ISSUES.adoc
@@ -50,12 +50,6 @@ PA016, PA019 remain uncovered.
== Open Issues
[start=5]
-. **Logtalk: `deteriorating/1` predicate is a stub.** +
-The `deteriorating/1` predicate in the Logtalk knowledge base unconditionally
-calls `fail`. Pattern deterioration (declining confidence over time, increasing
-false positives) is therefore not detected. This predicate needs a real
-implementation that queries confidence history from the temporal data layer.
-
. **Containerfiles: Non-Chainguard base images.** +
The Engine Containerfile (SWI-Prolog) and Registry Containerfile (Haskell)
use non-Chainguard base images. These are documented exceptions because
diff --git a/docs/history/ROADMAP-v1.0.0.adoc b/docs/history/ROADMAP-v1.0.0.adoc
index 8ff4190d..778695a3 100644
--- a/docs/history/ROADMAP-v1.0.0.adoc
+++ b/docs/history/ROADMAP-v1.0.0.adoc
@@ -18,7 +18,7 @@ This document outlines the complete path from the current alpha state (*90% comp
|===
| Component | Completion | Status | Notes
-| **Rules Engine (Logtalk)**
+| **Rules Engine**
| 80%
| ✅ Complete
| Schema defined, bot protocol ready, 50+ rules
@@ -61,8 +61,8 @@ This document outlines the complete path from the current alpha state (*90% comp
=== Working Features Today
-* Logtalk rules engine with formal schema (`rule_schema.lgt`)
-* Bot integration protocol (`bot_integration.lgt`)
+* Rules engine with formal schema (`rule_schema`)
+* Bot integration protocol (`bot_integration`)
* ArangoDB graph model with 9 collections, 16 edges, 3 graphs
* 20+ AQL query templates
* Gitbot fleet shared context layer
@@ -89,7 +89,7 @@ This document outlines the complete path from the current alpha state (*90% comp
| 2 days
| Connect rules → graph
-| Logtalk engine writes findings to ArangoDB
+| Rules engine writes findings to ArangoDB
| 3 days
| Basic CLI
@@ -268,7 +268,7 @@ This document outlines the complete path from the current alpha state (*90% comp
| Task | Description | Effort
| Distillation pipeline
-| Pattern → Logtalk rule conversion
+| Pattern → rule conversion
| 4 days
| Confidence scoring
@@ -445,10 +445,9 @@ This document outlines the complete path from the current alpha state (*90% comp
│ └─────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────────────────────────────────────┐ │
-│ │ SYMBOLIC LAYER (Logtalk) │ │
+│ │ SYMBOLIC LAYER │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ rule_schema │ │ bot_integr │ │ cicd_rules │ │ distiller │ │ │
-│ │ │ .lgt │ │ .lgt │ │ .lgt │ │ .lgt │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │ │
@@ -586,7 +585,7 @@ This document outlines the complete path from the current alpha state (*90% comp
1. Deploy ArangoDB with graph model
2. Run initial bot fleet integration test
-3. Connect Logtalk engine to ArangoDB
+3. Connect the rules engine to ArangoDB
4. Create `hypatia scan` CLI
=== This Month
diff --git a/docs/integration/a2ml-k9.adoc b/docs/integration/a2ml-k9.adoc
index 51afe8f9..b21eb61d 100644
--- a/docs/integration/a2ml-k9.adoc
+++ b/docs/integration/a2ml-k9.adoc
@@ -1,6 +1,6 @@
== Hypatia a2ml & K9 Integration
-*Status:* HISTORICAL DESIGN RECORD — the Logtalk rule-generation workflow below is superseded (2026-11-01): production rules are Elixir modules in `+lib/rules/*.ex+` and learned-rule exports are JSON (`+schemas/learned-security-rules.schema.json+`). See `+docs/rules/logtalk-migration.adoc+`. *Original date:* 2026-02-06 *Version:* 1.0.0
+*Status:* HISTORICAL DESIGN RECORD — the rule-generation workflow below is superseded (2026-11-01): production rules are Elixir modules in `+lib/rules/*.ex+` and learned-rule exports are JSON (`+schemas/learned-security-rules.schema.json+`). See `+docs/rules/security-rule-provenance.adoc+`. *Original date:* 2026-02-06 *Version:* 1.0.0
=== Overview
@@ -158,7 +158,6 @@ crossed (5+ obs), propose an Elixir rule under `+lib/rules/*.ex+` via
the normal PR flow (observations are evidence, not approval) 5.
Validate with tests — and ECHIDNA where the pattern is in its scope 6.
Ship with the Hypatia release; there is no `+approved-rules/+` drop
-and no Logtalk artefact
*When modifying rules:* 1. Update both the Elixir rule and any mirrored bash pattern 2.
Re-validate with ECHIDNA 3. Document changes in deployment manifest
diff --git a/docs/operations/containerfiles-chainguard-gap.adoc b/docs/operations/containerfiles-chainguard-gap.adoc
index dda97c6c..fbc780d9 100644
--- a/docs/operations/containerfiles-chainguard-gap.adoc
+++ b/docs/operations/containerfiles-chainguard-gap.adoc
@@ -77,7 +77,7 @@ Three options, each with constraints:
Estimated cost: 1 person-day initial + half a day per quarter.
3. *Switch Haskell projects to a different runtime.*
- We've already retired Logtalk and several other languages. If
+ We've already retired several other languages. If
the Haskell footprint is small enough, a port-or-retire decision
might be cleaner than building a custom image. Out of scope for
a Containerfile audit — that's an architectural call.
diff --git a/docs/proofs/gap-analysis.adoc b/docs/proofs/gap-analysis.adoc
index 5e680a91..9b844a57 100644
--- a/docs/proofs/gap-analysis.adoc
+++ b/docs/proofs/gap-analysis.adoc
@@ -14,7 +14,7 @@ ledger:
* *Idris2:* `+idris2 --check+` on every file in
`+verification/proofs/idris2/+`, and builds of `+src/abi/hypatia-abi.ipkg+`
and `+verify/hypatia-verify.ipkg+`.
-* *Agda:* `+verification/proofs/agda/LogtalkMigration.agda+` under
+* *Agda:* `+verification/proofs/agda/AlertTableCorrespondence.agda+` under
`+--safe --without-K --cubical-compatible+`.
* *TLA+:* TLC on `+verification/proofs/tlaplus/KinGate.tla+`, a bounded model
check (`+tested-only+`, not a proof).
diff --git a/docs/quickstart/llm-warmup-dev.adoc b/docs/quickstart/llm-warmup-dev.adoc
index 8881ec1a..0179ff6a 100644
--- a/docs/quickstart/llm-warmup-dev.adoc
+++ b/docs/quickstart/llm-warmup-dev.adoc
@@ -3,7 +3,7 @@
=== Architecture
Hypatia is an Elixir OTP application with a Rust workspace, Idris2 ABI,
-Zig FFI, and a pure-Elixir rule engine in `lib/rules/*.ex` (no Logtalk: ADR-001).
+Zig FFI, and a pure-Elixir rule engine in `lib/rules/*.ex` (ADR-001).
==== Elixir Pipeline (lib/)
diff --git a/docs/rules/catalogue.adoc b/docs/rules/catalogue.adoc
index ae445ac5..f48965da 100644
--- a/docs/rules/catalogue.adoc
+++ b/docs/rules/catalogue.adoc
@@ -18,18 +18,18 @@ a blank ID column means the module emits atom-keyed findings rather than prefixe
|Module |Rule IDs |Purpose
|`+actions_lock+` |— |Strict local validation for machine-generated `gh actions-lock` v0.0.2/v0.0.3 files.
|`+admin_merge_eligibility+` |DBA002 |Recognises PR shapes that are safe to admin-merge in bulk when the
-|`+audit_prevention+` |AP001 AP002 AP003 AP004 AP005 AP006 AP007 AP008 AP009 AP010 AP011 AP012 AP013 AP014 AP015 |Audit-training prevention rules AP001–AP015, transcribed from Logtalk.
+|`+audit_prevention+` |AP001 AP002 AP003 AP004 AP005 AP006 AP007 AP008 AP009 AP010 AP011 AP012 AP013 AP014 AP015 |Audit-training prevention rules AP001–AP015.
|`+baseline_health+` |BH001 BH002 BH003 BH004 BH005 BH006 BH007 BH008 |Detects degraded `main`-branch baseline conditions that allow silent rot.
|`+branch_protection+` |BP001 BP002 BP003 BP004 BP005 BP006 BP007 BP008 BP009 |Branch-protection hygiene rules drawn from the CIS GitHub Benchmark,
|`+build_system_rules+` |— |Build-tool configuration anti-patterns that block estate CI but slip past
|`+ci_failure_triage+` |— |Symbolic triage of a failed CI run: which layer failed, what to do, and
-|`+cicd_rules+` |— |Primary Elixir CI/CD policy rules (migrated from legacy Logtalk engine).
-|`+code_safety+` |— |Primary Elixir rules for code safety (migrated from legacy Logtalk engine).
+|`+cicd_rules+` |— |Primary Elixir CI/CD policy rules.
+|`+code_safety+` |— |Primary Elixir rules for code safety.
|`+code_scanning_alerts+` |CSA001 CSA002 CSA003 CSA004 CSA005 CSA006 |GitHub Code Scanning alert querying (CodeQL + third-party SARIF).
|`+dependabot_alerts+` |DA001 DA002 DA003 DA004 |GitHub Dependabot alert querying and risk assessment.
|`+disambiguation_rules+` |DR001 |Cross-reference / language-disambiguation rules.
|`+dogfooding+` |HYP-DOG-001 HYP-DOG-003 HYP-DOG-004 HYP-DOG-005 HYP-DOG-006 HYP-DOG-007 HYP-DOG-008 HYP-DOG-009 HYP-DOG-010 |Dogfooding compliance rules -- HYP-DOG-001 through HYP-DOG-010.
-|`+forge_adapters+` |— |Primary Elixir forge adapter rules (migrated from legacy Logtalk engine).
+|`+forge_adapters+` |— |Primary Elixir forge adapter rules.
|`+git_state+` |GS001 GS002 GS003 GS004 GS005 GS006 GS007 GS008 |Git repository synchronisation state checks.
|`+green_web+` |— |Green Web Foundation certification checks for hyperpolymath repositories.
|`+honest_completion+` |— |Honest completion audit -- cross-references claimed completion percentages
@@ -48,10 +48,10 @@ a blank ID column means the module emits atom-keyed findings rather than prefixe
|`+rsr_conformance+` |— |The RSR v2.0 conformance **oracle** (increment 3 of the HYP-S family):
|`+rsr_criteria+` |— |Loads the **RSR v2.0 criteria SSOT** (`rsr-criteria-v2.a2ml` from
|`+rule_loader+` |— |Loads standards-authored rule definitions (`.a2ml` files) into structured
-|`+rules+` |ERR-LIC-001 |Facade module for all Hypatia rules, absorbed from the Logtalk engine.
+|`+rules+` |ERR-LIC-001 |Facade module for all Hypatia rules.
|`+scorecard_compliance+` |— |Enforces OpenSSF Scorecard best practices as automated Elixir rules.
|`+secret_scanning_alerts+` |SSA001 SSA002 SSA003 SSA004 |GitHub Secret Scanning alert querying.
-|`+security_errors+` |— |Primary Elixir security error database (migrated from legacy Logtalk engine).
+|`+security_errors+` |— |Primary Elixir security error database.
|`+sha_bump_propagation+` |— |Detection: an estate-wide reusable workflow has been bumped to a new SHA
|`+standards_repo+` |— |The names of the estate standards repository.
|`+strategy_drift+` |— |N4: Detects strategy-shift events and flags previously-failed attempts
diff --git a/docs/rules/logtalk-migration.adoc b/docs/rules/logtalk-migration.adoc
deleted file mode 100644
index a2add596..00000000
--- a/docs/rules/logtalk-migration.adoc
+++ /dev/null
@@ -1,709 +0,0 @@
-// SPDX-License-Identifier: CC-BY-SA-4.0
-= Logtalk → Elixir Rule Migration Ledger
-:toc: macro
-:toclevels: 3
-
-Status: *transcription complete; Hypatia CI receipts recorded at commit 4018290eaa3265b82209e2a45b6917a4bb0a0331; sibling landings pending*
-Date: 2026-11-01
-Applies to: Hypatia, ECHIDNA `rules/security_learning.lgt`, epistemic-types
-`NEUROSYM.a2ml`, and the Logtalk examples vendored from standards
-
-This is the canonical ledger for retiring Logtalk as an active rule and
-report format in the Hypatia estate. It records what the Logtalk sources
-meant, where each meaning now lives in Elixir, every deliberate
-divergence, the exact replacement contracts for consumers, and the proof
-status of the correspondence. Historical Logtalk text may remain where
-this ledger classifies it as a record; it must not be read as an active
-rule source or an available output format.
-
-[WARNING]
-====
-The authoring sandbox for this change had no `elixir`, `mix`, `Agda`,
-`idris2`, `lean`, or `coqc` binaries, and its egress rules blocked the
-official installers. Executable evidence therefore comes from Hypatia
-CI at commit 4018290eaa3265b82209e2a45b6917a4bb0a0331: CI run 41328303014 (Elixir Compile job 124912999773,
-warnings-as-errors + targeted ExUnit including the new rule suites +
-the no-Logtalk guard) and Verify Proofs run 41328302925 (Agda job
-124912804344; Idris2 job 124912804086; Lean, TLA+, proof-status and
-trusted-base jobs also green). Claims below cite those receipts; no
-local-sandbox compilation or proof run is claimed.
-====
-
-toc::[]
-
-== Decision: the canonical rule system
-
-Hypatia's active, canonical rule system is *pure Elixir*:
-
-* Rule modules: `lib/rules/*.ex` (41 modules at this change), fronted by
- `lib/rules/rules.ex`.
-* Generated inventory: `docs/rules/catalogue.adoc` and
- `docs/wiki-pages/Rule-Catalogue.md`, produced by
- `scripts/gen-rule-catalogue.sh` from the Elixir moduledocs. If the
- catalogue and the modules disagree, the modules win and the catalogue
- is regenerated.
-* Scan findings: JSON under `schema/findings.ncl` (the CLI also renders
- `text`, `github`, and `sarif`; there is no `logtalk` format).
-* Rulesets shared as data: `schemas/ruleset.schema.json`.
-* Learned security-rule exports:
- `schemas/learned-security-rules.schema.json` (new in this change; see
- <>).
-
-There is no `engine/` tree, no Logtalk loader, and no tracked `.lgt` or
-`.logtalk` source in this repository. This completes ADR-001
-(2026-04-14, "Hypatia is pure Elixir") at the level of rule semantics:
-ADR-001 removed the runtime; the two residual Logtalk rule sources
-(ECHIDNA's fact module and Hypatia's own audit-training blocks) are
-transcribed below.
-
-== How fidelity is recorded
-
-Each transcribed item carries one disposition:
-
-[cols="1,3",options="header"]
-|===
-|Disposition |Meaning
-
-|Exact
-|Same inputs, same outputs, including failure/absence behaviour over
-the stated domain.
-
-|Operationalised
-|The Logtalk condition named an uninterpreted predicate
-(`crate_type(parser)`, `nearby_pattern/1`, `pr_reviews < 2`, …). The
-Elixir check states the concrete evidence test used in its place; the
-interpretation is written down here and in the module, not hidden.
-
-|Extension
-|The Elixir surface is a superset (more alert types, a total function
-where Logtalk failed, an extra prevention mapping). Shared-domain
-behaviour is unchanged.
-
-|Superseded
-|The Logtalk value was wrong or unsafe under current estate policy and
-was replaced on purpose. The old value is quoted here so the change is
-auditable.
-
-|Dead code
-|The Logtalk clause could never execute as written, or described a
-runtime/dynamic-database mechanism replaced wholesale by an Elixir
-subsystem. No clause-by-clause equivalent is pretended.
-|===
-
-== Consumer inventory and exact replacements
-
-[cols="2,2,3",options="header"]
-|===
-|Consumer / stale claim |Was requesting |Replacement (this change)
-
-|`Mix.Tasks.Hypatia.BatchSecurityScan.generate_echidna_rules/1`
-|Generated `learned_security_rules.lgt` /
-`.audittraining/echidna-rules.lgt` containing
-`security_rule(Type, Category, AutoFix, Count)` facts
-|`generate_learned_rules/1` writes
-`~/repos/echidna/rules/learned_security_rules.json` (when that
-directory exists) or `.audittraining/echidna-rules.json`, conforming to
-`schemas/learned-security-rules.schema.json`. See <>.
-
-|ECHIDNA `security_learning::export_rules/1`,
-`cicd_integration::push_rules_to_cicd/0`
-|Wrote `security_rule(Type, Category, Severity, AutoFix)` facts to
-`~/repos/cicd-hyper-a/.audittraining/echidna-rules.lgt`
-|Same JSON contract. The `.lgt` file itself is transcribed into
-`Hypatia.Rules.SecurityErrors` (<>); ECHIDNA-side
-removal/archival is coordinated in
-`docs/rules/migration/echidna-security-learning-issue.md`.
-
-|ECHIDNA `docs/ECOSYSTEM-INTEGRATION.adoc`;
-`echidna-playground/.machine_readable/descriptiles/NEUROSYM.a2ml`
-|"Auto-generates Logtalk rules after 5+ observations"; a live
-(`scan-enabled = true`) descriptor with `report-format = "logtalk"`
-|Same coordination packet: docs reworded to Elixir rule
-modules / learned-rules JSON, and the descriptor value replaced with
-exactly `report-format = "json"` (full DEED conversion may follow the
-estate descriptile programme separately).
-
-|epistemic-types `.machine_readable/descriptiles/NEUROSYM.a2ml`
-(at `5422cd5`, still on `main`)
-|`report-format = "logtalk"` for a (disabled) Hypatia scan
-|Status drift, not a dependency: Hypatia has had no such output since
-ADR-001. The whole descriptor is re-expressed as a DEED
-(`docs/rules/migration/epistemic-types_chora.deed`) with
-`:report-format "json"`; landing instructions and issue text in
-`docs/rules/migration/epistemic-types-neurosym-deed-issue.md`.
-
-|`integration/robot-repo-automaton/config.yml`
-|`engine/loader.lgt`, `engine/rules/*.lgt`, distillation and export to
-`learned_rules.lgt`, `format: logtalk`, Logtalk in `allowed_languages`
-|Repointed to the Elixir application (`mix.exs`, `lib/rules/*.ex`,
-`schema/findings.ncl`, `report_format: json`), to
-`.audittraining/echidna-rules.json` + the learned-rules schema, and to
-`logtalk` under `banned_languages` with `elixir` allowed. (The file's
-long-dead Haskell-registry and ArangoDB sections are separate drift and
-are not silently rewritten here.)
-
-|`.machine_readable/INTENT.contractile`
-|Three active-tense Logtalk claims (pattern detection, "Logtalk rule
-engine" invariant, Logtalk rules under `data/`)
-|Corrected to the pure-Elixir engine in `lib/rules/*.ex`. Other stale
-contents of that file are untouched by this change.
-
-|`Hypatia.Rules.SecurityErrors` language policy; `hooks/lib/common.sh`
-|"logtalk" in the allowed-language set; hook library detected `.lgt`
-files but never banned them
-|Logtalk moves to banned with replacement `"elixir"`
-(`language_replacement("logtalk") == "elixir"`); `is_banned_language`
-now fires on `logtalk` and `get_language_alternative` answers
-"Elixir (lib/rules/*.ex)". Detection of `.lgt` is retained precisely so
-the ban can trigger. The standards language policies contain no
-Logtalk/Prolog allowlist entry, so this aligns Hypatia with the estate
-canon rather than inventing a new rule.
-
-|`verification/proofs/idris2/VerisimdbConnector.idr`
-|`LogtalkFact`, "transit to Logtalk facts", a fictitious
-`to_logtalk_facts` in a nonexistent `lib/verisimdb_connector.ex`
-|Renamed to `FindingFact` (the canonical JSON finding projection),
-pointed at the real `lib/verisim_connector.ex`, and recorded as a
-*superseded statement* in `verification/PROOF-STATUS.adoc` — see
-<>. The proof term is unchanged; its old target no longer
-exists, which is exactly why the supersession is explicit.
-
-|standards DEED mapping/template; Hypatia deed test fixtures
-|The standards `agentic-neurosym-playbook-to-repo-deed` mapping's own
-template still emits `:report-format "logtalk"`, and two fixtures
-vendored into `test/fixtures/deed_egress/` reproduce it
-|Upstream-owned drift. The fixtures stay byte-faithful to standards
-until standards lands the fix (deviating locally would falsify the
-reader's conformance fixtures); they are exact-path exemptions in the
-new guard, and the standards fix is coordinated in
-`docs/rules/migration/standards-deed-mapping-issue.md`.
-
-|Active-tense documentation (developer guide, EXPLAINME, FAQ/glossary,
-quickstarts, man page, API/security/testing docs, rules README, CLI and
-schema docs)
-|Described a live Logtalk engine under a nonexistent `engine/`
-|Corrected to the canonical Elixir locations above. Genuinely
-historical records — ADR-001, STATE/AGENTIC/MUST checkpoints,
-roadmaps, dated audits, provenance/history narratives, and the arXiv
-paper snapshot — are *not* rewritten; they are classified historical in
-the guard allowlist and in `docs/DEBT-REGISTER.adoc` (D-2 closure note).
-|===
-
-No other live consumer of Logtalk output was found: the Hypatia CLI
-accepts `json|text|github|sarif`; `Hypatia.CLI.Formatter`, panic-attack
-integration, VCL, and the neural/dispatch pipeline are all JSON-shaped.
-
-[[learned-rules-json]]
-== The learned-rules JSON contract
-
-There were *two* incompatible `security_rule/4` shapes, which is
-itself sufficient reason the positional format had to die:
-
-* Hypatia's generator: `security_rule(Type, Category, AutoFix, Count)`
-* ECHIDNA's exporter: `security_rule(Type, Category, Severity, AutoFix)`
-
-The replacement is one named-field JSON document,
-`schemas/learned-security-rules.schema.json` ($id
-`https://hyperpolymath.dev/schemas/hypatia/learned-security-rules`,
-format version `1.0.0`), produced by
-`Mix.Tasks.Hypatia.BatchSecurityScan`:
-
-[source,json]
-----
-{
- "schema": "https://hyperpolymath.dev/schemas/hypatia/learned-security-rules",
- "version": "1.0.0",
- "generated_at": "2026-11-01T00:00:00Z",
- "generator": "mix hypatia.batch_security_scan",
- "source_alert_count": 1234,
- "rules": [
- {
- "alert_type": "TokenPermissionsID",
- "category": "workflow_security",
- "severity": "high",
- "auto_fixable": true,
- "observations": 87,
- "fix": "Add granular workflow-level permissions ...",
- "prevention_workflow": "workflow-linter.yml"
- }
- ]
-}
-----
-
-Field provenance:
-
-[cols="1,2,2",options="header"]
-|===
-|JSON field |Retired Logtalk source |Canonical Elixir source
-
-|`alert_type` |Field 1 of both shapes |GitHub/Scorecard alert id
-|`category` |Field 2 of both shapes; `alert_category/2`
-|`SecurityErrors.alert_category/1` (snake-case string; task-local
-substring grouping only as fallback for ids outside the 18)
-|`severity` |ECHIDNA field 3; `classify_severity/2` (absent from
-Hypatia's generator) |`SecurityErrors.issue_severity/1`
-|`auto_fixable` |Hypatia field 3 / ECHIDNA field 4; `is_auto_fixable/1`
-|`SecurityErrors.auto_fixable?/1`
-|`observations` |Hypatia field 4 (absent from ECHIDNA's export)
-|Alert count in the producing scan. Evidence for belief formation
-only — never a soundness claim (`src/Hypatia/ABI/Verdict.idr`).
-|`fix` |`suggest_fix/2` |`SecurityErrors.fix_suggestion/1` (`null` when none)
-|`prevention_workflow` |`get_prevention_workflow/2`
-|`SecurityErrors.prevention_workflow/1` (`null` when none)
-|===
-
-All per-alert fields except `observations` are exactly
-`Hypatia.Rules.SecurityErrors.validate_alert/1` rendered as JSON.
-
-[[echidna-ledger]]
-== ECHIDNA `security_learning.lgt` — clause-by-clause ledger
-
-Source: `hyperpolymath/echidna:rules/security_learning.lgt` (only
-`.lgt` file in that repository; added 2025-12-29; no loader or other
-Logtalk consumer exists there). Target:
-`Hypatia.Rules.SecurityErrors`, except where stated.
-
-=== `alert_category/2` — 18 facts → `@alert_categories` — *Exact*
-
-New canonical home: `SecurityErrors.alert_categories/0` /
-`alert_category/1` (atoms, snake-case as in the Logtalk):
-
-* `workflow_security`: TokenPermissionsID, PinnedDependenciesID,
- missing-workflow-permissions
-* `code_security`: hard-coded-cryptographic-value,
- remote-property-injection, sql-injection
-* `code_quality`: unused-local-variable, syntax-error
-* `dependency_vuln`: VulnerabilitiesID, unmaintained
-* `process_hygiene`: SecurityPolicyID, MaintainedID, CodeReviewID,
- BranchProtectionID, CIIBestPracticesID
-* `missing_tests`: FuzzingID, SASTID, CITestsID
-
-Outside these 18, `alert_category/1` returns `nil`, mirroring the
-absence of a fact. (The batch-scan task keeps a separate kebab-case
-*display* grouping with substring fallback for unseen ids such as
-`unused-import`; it is not a second semantic source and is commented
-as such.)
-
-=== `classify_severity/2` → `issue_severity/1` — *Exact on the 18; one stated difference outside*
-
-* critical: hard-coded-cryptographic-value, sql-injection,
- VulnerabilitiesID
-* high: remote-property-injection, TokenPermissionsID,
- missing-workflow-permissions
-* medium: PinnedDependenciesID, SecurityPolicyID, BranchProtectionID,
- CodeReviewID, syntax-error
-* low (Logtalk catch-all `classify_severity(_, low)`): the remaining
- seven — unused-local-variable, unmaintained, MaintainedID,
- CIIBestPracticesID, FuzzingID, SASTID, CITestsID
-
-Before this change, SASTID, CITestsID, and unmaintained had no
-explicit Elixir entry and fell through to `issue_severity/1`'s `:info`
-default — a silent transcription bug against the Logtalk catch-all.
-They are now explicit `:low` entries. For ids *neither* system has
-seen, Elixir keeps its long-standing `:info` unknown-default rather
-than the Logtalk catch-all's `low`; that is the single deliberate
-difference, unreachable for any of the 18.
-
-=== `is_auto_fixable/1` — 6 facts → `@auto_fixable` — *Exact on the 18 (Elixir set is a superset overall)*
-
-TokenPermissionsID, PinnedDependenciesID, missing-workflow-permissions,
-SecurityPolicyID, BranchProtectionID, unused-local-variable. The
-Elixir set additionally contains later alert ids outside the Logtalk
-domain; on the 18 the two agree exactly.
-
-=== `suggest_fix/2` — 13 facts → `@fix_suggestions`
-
-* *Exact (10), byte-identical strings:* SecurityPolicyID,
- BranchProtectionID, CodeReviewID, CIIBestPracticesID, FuzzingID,
- VulnerabilitiesID, hard-coded-cryptographic-value,
- remote-property-injection, unused-local-variable, syntax-error.
-* *Generalised (1):* PinnedDependenciesID — Logtalk
- "Replace @v4 with @SHA # v4 format" → Elixir
- "Replace @vN with @SHA # vN format" (same instruction, version
- parameterised).
-* *Superseded (2):* TokenPermissionsID and missing-workflow-permissions
- — Logtalk prescribed `Add "permissions: read-all" at workflow level`.
- Current OSSF guidance (and Hypatia's own
- `scorecard_compliance/token_permissions` check) flags `read-all`
- itself as high severity, so the canonical text prescribes granular
- least-privilege permissions and explicitly warns against `read-all`.
- Transcribing the old string would have made Hypatia recommend what
- Hypatia flags.
-* *No fix in either system (5 of the 18):* sql-injection, unmaintained,
- MaintainedID, SASTID, CITestsID → `fix_suggestion/1` returns `nil`.
-
-=== `get_prevention_workflow/2` — 7 facts → `@prevention_workflows`
-
-Exact for six: TokenPermissionsID, PinnedDependenciesID,
-missing-workflow-permissions → `workflow-linter.yml`;
-hard-coded-cryptographic-value → `secret-scanner.yml`;
-VulnerabilitiesID → `cargo-audit.yml`; SecurityPolicyID →
-`scorecard-enforcer.yml`.
-
-* *Superseded (pre-existing, now ledgered):* BranchProtectionID —
- Logtalk `branch-protection-enforcer.yml` → Elixir
- `scorecard-enforcer.yml`. The Elixir value predates this change (it
- groups BranchProtection with the other Scorecard process checks) and
- every executable consumer has used it since; both workflow templates
- still exist under `.audittraining/prevention/`. Changing it back is
- a policy decision for a separate change, not a transcription fix.
-* *Extension:* CodeReviewID → `scorecard-enforcer.yml` exists in
- Elixir with no Logtalk counterpart.
-
-=== `cicd_integration::validate_alert/2` → `validate_alert/1` — *Total-function extension*
-
-Logtalk composed severity + fix + auto-fixability into
-`alert_validation(Type, Severity, Fix, AutoFix)` and *failed* for any
-alert without a `suggest_fix/2` clause. `SecurityErrors.validate_alert/1`
-returns those fields plus the separately-looked-up `category` and
-`prevention_workflow`, and is total: absent facts are `nil`/`false`
-rather than query failure. Consumers that relied on Logtalk failure
-as an "unknown alert" signal should test `category: nil` and
-`fix: nil` in the returned map (or the JSON `null`s).
-
-=== Learning machinery — *Dead code / wholesale replacement*
-
-`load_training_data/1`, `read_training_examples/1`,
-`process_training_term/1`, `learn_rules/0`, the `training_data/3` /
-`learned_rule/4` / `fix_pattern/3` dynamic database, and
-`sync_from_cicd/0` (hard-coded `~/repos/cicd-hyper-a` path, Prolog
-`read/1` over a Guile Scheme module) never formed a runnable pipeline
-and have no clause-level equivalents. Their *purpose* is served by:
-
-* `Hypatia.Rules.Learning` — outcome tracking, confidence, promotion
- (the live learning subsystem);
-* `Mix.Tasks.Hypatia.BatchSecurityScan` — fleet alert collection and
- the learned-rules JSON above;
-* `.audittraining/ERROR-CATALOG.scm` — retained as training-data
- record (Scheme, not Logtalk).
-
-One latent ambiguity is worth recording because the JSON contract
-dissolves it: `process_training_term/1` stored the catalog's second
-field as `Type`, while `learn_rules/0` read the same position as
-`Category`. Named JSON fields make that class of error impossible.
-
-=== Where `.audittraining/ERROR-CATALOG.scm` disagrees with the Logtalk
-
-The Logtalk header says its facts derive from `ERROR-CATALOG.scm`, but
-the two disagree, and this transcription follows the *Logtalk* (the
-values every executable consumer used), recording the Scheme variants
-as open policy questions rather than smuggling them in:
-
-* Categories: the catalog splits fuzzing/SAST/CI-tests into
- `missing-fuzzing` / `missing-sast` / `missing-tests`; Logtalk and
- Elixir use one `missing_tests` group.
-* Severities: catalog has VulnerabilitiesID high (Logtalk critical),
- unmaintained medium (Logtalk low), FuzzingID/SASTID/CITestsID medium
- (Logtalk low).
-* Auto-fixability: catalog marks CodeReviewID, FuzzingID, SASTID,
- CITestsID `#t`; Logtalk/Elixir say false.
-* The catalog's extra entries (workflow-linter self-detection,
- rust-toolchain input, duplicate workflows, …) were never in the
- Logtalk; most already live in Elixir's extended severity/fix tables.
-
-Adopting the catalog's finer split or medium grading would change
-live severities fleet-wide and needs its own decision.
-
-== Audit-training prevention rules AP001–AP015
-
-Source: the `Prevention Rules (Logtalk)` blocks (2025-12-29) in seven
-`.audittraining/security-errors/*.adoc` files — the last rule-bearing
-Logtalk text inside Hypatia itself. Those blocks are retained in
-place, now headed as historical, and are *not* executable sources.
-Canonical target: `Hypatia.Rules.AuditPrevention`, whose `rules/0`
-preserves every record verbatim as data (id, functor, name, effect,
-description, conditions, action, origin, canonical equivalent).
-
-Common operationalisations:
-
-* The records had effects and actions but no severities. Finding
- severity derives from the action (`block_merge_with_escalation` →
- `:critical`; other `block_*` → `:high`; `warn_*`/`alert_*` →
- `:medium`; `warn_and_log` → `:low`). Alert-id severities remain
- `SecurityErrors`' business.
-* Checks are pure functions over caller-supplied evidence (file lists,
- file contents, tag/review/score facts). `check_all/1` runs every
- implemented check whose evidence is present and is silent otherwise;
- it never duplicates a check whose canonical home is another module.
-
-[cols="1,2,3,3",options="header"]
-|===
-|ID |Logtalk rule |Canonical Elixir |Disposition / operationalisation
-
-|AP001 |`parser_rule(input_limits)` (bunsenite)
-|`AuditPrevention.check_parser_input_limits/1`
-|Implemented. `crate_type(parser)` is inferred from a Cargo description
-naming a parser; the negated size-limit pattern is searched over the
-supplied contents.
-
-|AP002 |`wasm_rule(memory_limits)` (bunsenite)
-|`AuditPrevention.check_wasm_memory_limits/1`
-|Implemented. `feature("wasm")` is inferred from Cargo wasm
-features/dependencies; memory-limit markers searched likewise.
-
-|AP003 |`rust_rule(missing_audit)` (czech-file-knife)
-|`AuditPrevention.check_missing_cargo_audit/2`
-|Implemented exactly over evidence: `Cargo.toml` present and no
-*workflow* content running `cargo audit` (a README mention is not CI).
-
-|AP004 |`rust_rule(workspace_vuln)` (czech-file-knife)
-|`AuditPrevention.check_workspace_vuln/2`
-|Implemented as the stated conjunction; `any_member_has_vuln` is
-caller-supplied vulnerability evidence (this check does not itself
-audit members — that is the scanner's/cargo-audit's job).
-
-|AP005 |`project_rule(missing_ci_tests)` (gitvisor)
-|`AuditPrevention.check_missing_ci_tests/1`
-|Implemented. The literal glob was `*test*.yml`; `.yaml` test
-workflows are accepted as the same semantic object (recorded here
-because the glob, read literally, would false-positive on them).
-`has_source_code` uses the module's source-extension list.
-
-|AP006 |`project_rule(missing_sast)` (gitvisor)
-|`AuditPrevention.check_missing_sast/2`
-|Implemented; `codeql.yaml` accepted alongside the literal
-`codeql.yml`, same reasoning as AP005. SecurityErrors' CodeQL language
-matrix validation is the related pre-existing surface.
-
-|AP007 |`security_rule(property_injection)` (polyglot-i18n)
-|`AuditPrevention.check_property_injection/1`
-|Implemented. Both Logtalk access patterns are used verbatim;
-`nearby_pattern(allowlist)` is operationalised as *same file*. CWE-915
-added to `SecurityErrors` for `remote-property-injection` /
-`remote_property_injection` (previously unmapped).
-
-|AP008 |`code_quality_rule(unused_vars)` (polyglot-i18n)
-|`SecurityErrors` metadata for `unused-local-variable`
-|Metadata only, deliberately: the Logtalk condition is a compiler
-diagnostic string ("is declared but its value is never read"), so the
-detector of record stays the language compiler/linter. Severity
-(`:low`), fix, category (`:code_quality`), and auto-fixability are
-canonical in `SecurityErrors`.
-
-|AP009 |`crypto_rule(enhanced_review)` (proof-of-work)
-|`AuditPrevention.check_crypto_enhanced_review/2`
-|Implemented. `pr_reviews < 2` is read as the *required approving
-review count* from branch protection; unknown (`nil`) never fires.
-
-|AP010 |`crypto_rule(require_fuzzing)` (proof-of-work)
-|`AuditPrevention.check_crypto_require_fuzzing/2`
-|Implemented: cryptography tag + no `fuzz/` path in the file list.
-
-|AP011 |`crypto_rule(no_panic)` (proof-of-work)
-|`CodeSafety.scan_content/2` (`:panic_macro`, `:unwrap_without_check`,
-`:expect_in_hot_path`)
-|Already canonical — and a superset: the Elixir patterns fire in every
-Rust repo, not only cryptography-tagged ones. Not duplicated.
-
-|AP012 |`meta_rule(rsr_self_compliance)` (supernorma)
-|`RsrConformance` + `Dogfooding`
-|Already canonical, generalised: the Logtalk hard-coded
-`repo_name(supernorma)` becomes "any RSR-tooling repo, including
-Hypatia itself" via the conformance oracle and dogfooding checks.
-
-|AP013 |`template_rule(exemplary_standards)` (supernorma)
-|`AuditPrevention.check_exemplary_standards/2`
-|Implemented exactly: tooling purpose + Scorecard score < 8;
-boundary value 8 passes, mirroring `<`.
-
-|AP014 |`workflow_rule(missing_permissions)` (ubicity)
-|`WorkflowAudit.check_permissions/1`,
-`WorkflowHardening.wh002_excessive_permissions/1`
-|Already canonical (and stricter: excessive grants are flagged, not
-only absence). Not duplicated; `check_all/1` excludes it.
-
-|AP015 |`workflow_rule(unpinned_action)` (ubicity)
-|`WorkflowHardening.wh004_unpinned_uses/1`,
-`WorkflowAudit.check_unpinned_actions/1`
-|Already canonical with one supersession: Logtalk excused a tag ref
-with a trailing `# vN` comment; the Elixir checks require the
-40-hex SHA form (comment or not). A comment beside a mutable tag is
-not a pin.
-|===
-
-== epistemic-types `NEUROSYM.a2ml` → DEED
-
-Artifact: `docs/rules/migration/epistemic-types_chora.deed`, to land
-at the epistemic-types repository root under that exact filename
-(DEED v1.2.1 dispatches the `repo-deed` head by the
-`_chora.deed` filename). If that repository has acquired a repo
-deed in the meantime, the single `(neurosym …)` clause merges into it
-instead — a repo has one deed, not two.
-
-Grammar authority: standards `1-formats/deed/spec/abnf/deed.abnf`
-(v1.2.1); mapping authority: standards
-`1-formats/deed/mappings/agentic-neurosym-playbook-to-repo-deed.adoc`
-family 4. The transcription:
-
-* `[metadata]` → `(neurosym :project :version :status :last-updated
- :author …)`, strings preserved.
-* `[hypatia-config]` → `(hypatia :scan-enabled #f :scan-depth
- standard :report-format "json" :scan-paths ("src/EpistemicTypes")
- :file-globs ("*.agda"))`. Per the mapping: `scan-enabled` is a DEED
- boolean (`#f`, never the word), `scan-depth` a symbol, paths/globs
- lists of strings, DOIs would be strings (none here).
-* `[neural-config] enabled=false` and `[ci] enabled=false` map
- directly to `(neural-config :enabled #f)` / `(ci :enabled #f)`.
-* The one intentional semantic change in the entire file:
- `report-format` `"logtalk"` → `"json"`.
-
-*Proposed mapping extension (needs a standards row):* family 4
-currently fails closed on a populated `[symbolic-rules]` table.
-epistemic-types has ten real rules, so the artifact transcribes them
-as `(symbolic-rules (notes :checker-of-record … :safe-flags …) (rule
-:name … :pattern … :severity … :note …) …)` — syntactically valid
-under the ABNF (clauses are generic), semantically a row standards
-should ratify; see the standards coordination issue. The same applies
-to the extra `[metadata]` fields carried as `:status` /
-`:last-updated` / `:author` strings. Pattern strings were converted
-escape-for-escape so their parsed values are identical to the A2ML
-(arbitrary-precision string escapes in DEED are only `\"`, `\\`, `\n`,
-`\t`). The A2ML's prose comments survive as DEED comments/notes where
-they carry meaning.
-
-Two deliberate non-changes: the repo's checker-of-record and
-`--safe --without-K` flags are transcribed as-is — bringing that
-repo's own proof profile to the estate's current strict invocation
-(which adds `--cubical-compatible`) is a sibling proof-policy
-reconciliation, not something to smuggle into a format migration;
-and Hypatia's *own* `NEUROSYM.a2ml` is not deed-translated here,
-because its populated neural configuration contains values DEED v1
-cannot yet express losslessly (the mapping's fail-closed gap). It
-already declares JSON.
-
-Before landing in epistemic-types: run the standards gate —
-`bun /path/to/standards/1-formats/deed/tools/deed_lint.js epistemic-types_chora.deed`
-(expected exit 0) — and keep the receipt with the sibling PR. In this
-change the artifact was validated against the ABNF subset it uses
-(header, balanced single root form, exactly one string
-`:schema-version`, boolean spelling, escape discipline, and
-field-by-field equality with the `5422cd5` source) — that is authoring
-evidence, not a standards-gate receipt.
-
-[[proofing]]
-== Proofing: policy, grades, and exact statuses
-
-Proofing follows metadatastician/standards `3-practice/PROOF-POLICY.adoc`:
-§5 for status tokens and §8 for Proof Witness Grades (owner ruling
-2026-11-04, which supersedes the ladder of the Mathesis architecture
-brief). `PWG-3` means the Agda proof is checked under the §2.1
-invocation; `PWG-2i` adds one counted Rocq or Lean recheck leg and
-`PWG-2ii` both; `PWG-1` adds a current per-commit receipt for every
-witness. Statuses and grades are recorded exactly, never as a percentage,
-and a checked model never silently becomes a runtime-refinement or
-reconciliation claim.
-
-Applied here:
-
-[cols="2,2,2",options="header"]
-|===
-|Claim |Artefact |Status at this change
-
-|Finite correspondence of the 18-alert category / severity /
-auto-fixability / fix-presence tables, prevention agreement on the
-six unchanged entries, and the two prevention non-equalities stated
-exactly
-|`verification/proofs/agda/LogtalkMigration.agda`
-(`categoriesAgree`, `severitiesAgree`, `autoFixableAgrees`,
-`fixPresenceAgrees`, `prevention*`, `catchAll*Low`)
-|*PROVEN, `PWG-3`.* Receipt recorded in
-`verification/PROOF-STATUS.adoc`: official pinned Agda 2.8.0.2 Linux
-release (builtins only, no stdlib), invocation `agda --safe
---without-K --cubical-compatible LogtalkMigration.agda`, success in
-Verify Proofs run 41328302925, job 124912804344, at commit 4018290eaa3265b82209e2a45b6917a4bb0a0331;
-source SHA-256
-bbd18e2747c84e2eda7ff5a778a2df7f8960a1ef47b1c253f316b9d97b9902a0.
-The `agda strict-profile check` job fails hard (never skips) on every
-relevant change. No `PWG-2i`, `PWG-2ii` or `PWG-1`, Rocq/Lean reconciliation, or Elixir
-runtime-refinement claim is made.
-
-|VeriSimDB connector field preservation
-|`VerisimdbConnector.idr` (`factPreservesData` over `FindingFact`)
-|Engineering (Idris2) evidence with a *superseded statement*: target
-changed from the retired Logtalk fact format to the canonical JSON
-finding record on 2026-11-01. Re-checked in Verify Proofs run
-41328302925 (idris2 --check job 124912804086) at commit 4018290eaa3265b82209e2a45b6917a4bb0a0331; the
-model alone does not prove the Elixir connector refines it.
-
-|Elixir runtime behaviour of the transcription
-|`test/security_errors_test.exs`,
-`test/rules/audit_prevention_test.exs`
-|TESTED in CI run 41328303014 (Elixir Compile job 124912999773:
-`mix compile --warnings-as-errors`, targeted ExUnit including these
-suites, and the no-Logtalk guard) at commit 4018290eaa3265b82209e2a45b6917a4bb0a0331. Tests are
-evidence about the Elixir code; they are not a substitute
-for the Agda statement above, nor vice versa.
-
-|AP001–AP015 check semantics beyond table correspondence
-|`AuditPrevention` + canonical checkers
-|No formal claim. The regex/evidence semantics are specified in code
-+ tests; formalising them is future theory work and would enter at
-Open/Claimed, not by inheriting the alert-table status.
-|===
-
-== Guard: keeping Logtalk out
-
-`scripts/check-no-active-logtalk.sh` (wired into CI) enforces, over
-tracked files:
-
-* no `*.lgt` / `*.logtalk` files outside the allowlist;
-* no active configuration requesting Logtalk — loader paths,
-`format: logtalk`, `report-format` set to `logtalk` in A2ML/DEED
-form, or generated `.lgt` outputs — outside the allowlist.
-
-Exemptions live in `.logtalk-allowlist` as *exact paths only*
-(following the `.hypatia-ignore` precedent: no wildcards, no directory
-blankets), each with a classification and removal condition. The list
-is shrink-only: adding an entry requires the same review as adding a
-rule, and the script fails if an allowlisted path no longer exists
-(the classic stale-exemption rot). Historical prose mentioning
-Logtalk is not banned — the guard targets executable/config forms,
-and this ledger, the migration packet, the proof model, and the
-seven audit-training originals are its initially allowlisted records.
-Estate rollout (other repos have their own trees) is proposed through
-the standards coordination issue rather than pretend-enforced from
-here.
-
-== Sibling coordination
-
-Prepared, ready-to-file packets (Hypatia cannot land changes in
-sibling repositories from this branch):
-
-* `docs/rules/migration/echidna-security-learning-issue.md` — remove
- `rules/security_learning.lgt` from ECHIDNA's active tree (preferred:
- delete, pointing at this ledger as the transcription of record;
- acceptable fallback: move under an explicit archive path), and fix
- any ECHIDNA docs still presenting Logtalk generation as live.
-* `docs/rules/migration/epistemic-types-neurosym-deed-issue.md` +
- `epistemic-types_chora.deed` — land the deed, run `deed_lint`,
- then delete `.machine_readable/descriptiles/NEUROSYM.a2ml`.
-* `docs/rules/migration/standards-deed-mapping-issue.md` — fix the
- `"logtalk"` literal in the standards DEED mapping/template (the
- upstream source of Hypatia's two vendored fixtures), ratify the
- populated-`[symbolic-rules]` mapping row proposed above, and
- consider the no-active-Logtalk guard for estate-wide adoption.
-
-== Acceptance summary
-
-* Canonical active rules: `lib/rules/*.ex`, documented here and in
- `lib/rules/README.adoc` / the generated catalogue. ✓
-* ECHIDNA Logtalk semantics faithfully in Elixir, divergences
- itemised (3 superseded/generalised fix strings, 1 prevention
- supersession + 1 extension, catch-all severity bug fixed,
- total-function `validate_alert`). ✓ (CI receipt recorded above)
-* Hypatia's embedded Logtalk rules AP001–AP015 transcribed to
- `AuditPrevention` or pointed at their pre-existing canonical
- checkers. ✓ (CI receipt recorded above)
-* Logtalk-generating code replaced by a schema'd JSON contract. ✓
-* Every consumer that requested Logtalk has an exact replacement
- above. ✓
-* epistemic-types descriptor re-expressed as an ABNF-conformant DEED
- with `report-format "json"`. ✓ (landing + lint receipt: sibling)
-* ECHIDNA `.lgt` removal/archival coordinated; standards drift
- coordinated. ✓ (landing: siblings)
-* Repository guard against new active `.lgt` files / Logtalk output
- settings, exact-path shrink-only allowlist, wired into CI. ✓
-* Proofing graded honestly: finite correspondence PROVEN at
- `PWG-3` on the recorded strict-profile Agda
- receipt; Idris statement supersession recorded and re-checked; no
- claim inflated beyond its evidence. ✓
diff --git a/docs/rules/migration/echidna-security-learning-issue.md b/docs/rules/migration/echidna-security-learning-issue.md
deleted file mode 100644
index 437a1f4c..00000000
--- a/docs/rules/migration/echidna-security-learning-issue.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-# Issue packet for hyperpolymath/echidna
-
-**Suggested title:** Retire `rules/security_learning.lgt` — semantics now canonical in Hypatia Elixir + JSON
-
-**Prepared from:** Hypatia branch `arena/82ed8898-hypatia`, `docs/rules/logtalk-migration.adoc` (2026-11-01)
-
----
-
-## Summary
-
-`rules/security_learning.lgt` is dead, active-looking Logtalk. As of this audit it is the only `.lgt` path in ECHIDNA's recursive tree, there is no Logtalk loader/settings file or other in-tree consumer for it, and ECHIDNA's documented stack is Rust/Julia/Idris2/Zig/Chapel. Its security-alert semantics have now been transcribed clause-by-clause into Hypatia's canonical Elixir rule system, so the file can be removed (or explicitly archived) without losing meaning.
-
-## Where the semantics went
-
-All in `hyperpolymath/hypatia`, module `Hypatia.Rules.SecurityErrors` (`lib/rules/security_errors.ex`):
-
-| Logtalk | Elixir |
-|---|---|
-| `alert_category/2` (18 facts) | `alert_categories/0`, `alert_category/1` |
-| `classify_severity/2` | `issue_severity/1` — including the `low` catch-all, now explicit for `SASTID`, `CITestsID`, `unmaintained` (previously drifting to `:info`) |
-| `is_auto_fixable/1` (6 facts) | `auto_fixable?/1` |
-| `suggest_fix/2` (13 facts) | `fix_suggestion/1` |
-| `get_prevention_workflow/2` | `prevention_workflow/1` |
-| `cicd_integration::validate_alert/2` | `validate_alert/1` (total-function extension: returns `nil` fields instead of failing; also folds in category + prevention) |
-| `export_rules/1` / `push_rules_to_cicd/0` (`security_rule/4` `.lgt`) | `Mix.Tasks.Hypatia.BatchSecurityScan` now emits `learned_security_rules.json` per `schemas/learned-security-rules.schema.json` |
-| dynamic learning predicates | superseded wholesale by `Hypatia.Rules.Learning`; no clause-level equivalent is claimed |
-
-Deliberate divergences, all ledgered in Hypatia `docs/rules/logtalk-migration.adoc`:
-
-- `TokenPermissionsID` / `missing-workflow-permissions` fix text no longer prescribes `permissions: read-all` (Hypatia flags `read-all` itself); granular least-privilege text is canonical.
-- `PinnedDependenciesID` fix generalised `@v4` → `@vN`.
-- `BranchProtectionID` prevention is `scorecard-enforcer.yml` (long-standing Elixir value), not the Logtalk `branch-protection-enforcer.yml`; `CodeReviewID` gained a prevention mapping with no Logtalk counterpart.
-- Wholly unknown alert ids get severity `:info` in Elixir rather than the Logtalk catch-all `low`; all 18 known ids agree exactly.
-
-Proof status, stated exactly: the finite table correspondence is modelled in Hypatia `verification/proofs/agda/LogtalkMigration.agda` and is **PROVEN, `PWG-3`** (metadatastician/standards `3-practice/PROOF-POLICY.adoc` §5 and §8) on a strict-profile receipt (Agda 2.8.0.2, `agda --safe --without-K --cubical-compatible`, Hypatia Verify Proofs run 41328302925 at commit 4018290eaa3265b82209e2a45b6917a4bb0a0331; full receipt in Hypatia `verification/PROOF-STATUS.adoc`). Elixir behaviour is pinned by ExUnit tests in the same PR's CI. The Agda model grades the finite table correspondence only — no runtime-refinement, `PWG-2i`, `PWG-2ii` or `PWG-1` claim is being sold here.
-
-## Requested changes in ECHIDNA
-
-1. **Delete `rules/security_learning.lgt`** (preferred). Git history plus the Hypatia ledger preserve it; no replacement `.lgt` should be created. If a local archival copy is required instead, move it to a non-executable archival name (e.g. `docs/archive/security_learning.logtalk.txt`) with a header stating it is superseded by Hypatia `lib/rules/security_errors.ex` and linking the ledger — do not leave an active-looking `.lgt` under `rules/`.
-2. **Fix `docs/ECOSYSTEM-INTEGRATION.adoc`**, which currently says the learning engine "Auto-generates Logtalk rules after 5+ observations". Replacement wording: learned patterns are proposed as Hypatia Elixir rule modules (`lib/rules/*.ex`) and/or emitted as learned-security-rules JSON; observation counts are belief-forming evidence, never a soundness claim.
-3. **Fix `echidna-playground/.machine_readable/descriptiles/NEUROSYM.a2ml`**: it has `scan-enabled = true` with `report-format = "logtalk"`. Exact replacement value: `report-format = "json"` (Hypatia findings, `schema/findings.ncl`). A full DEED conversion can ride the estate descriptile programme separately; the format value should not wait for it.
-4. Sweep the tree for any remaining `.lgt` paths, Logtalk loader/settings references, or `format.*logtalk` settings after the deletion.
-
-## Acceptance criteria
-
-- [ ] No `.lgt` / `.logtalk` file remains in an active path (`git ls-files '*.lgt' '*.logtalk'` empty, or only under an explicitly archival, non-executable name).
-- [ ] No document in ECHIDNA describes Logtalk rule generation/output as current behaviour.
-- [ ] `echidna-playground` NEUROSYM requests JSON.
-- [ ] ECHIDNA docs (or the archival stub) point at Hypatia `docs/rules/logtalk-migration.adoc` as the transcription of record.
-
-## Non-goals
-
-No change to ECHIDNA's prover architecture, rule-learning research direction, or non-Logtalk subsystems. This is solely retirement of a dead format and its stale documentation.
diff --git a/docs/rules/migration/epistemic-types-neurosym-deed-issue.md b/docs/rules/migration/epistemic-types-neurosym-deed-issue.md
deleted file mode 100644
index 66a648e0..00000000
--- a/docs/rules/migration/epistemic-types-neurosym-deed-issue.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-# Issue packet for hyperpolymath/epistemic-types
-
-**Suggested title:** Replace `NEUROSYM.a2ml` with a repo DEED — `report-format = "logtalk"` is retired
-
-**Prepared from:** Hypatia branch `arena/82ed8898-hypatia`; artifact `docs/rules/migration/epistemic-types_chora.deed`; ledger `docs/rules/logtalk-migration.adoc`
-**Source pinned:** `.machine_readable/descriptiles/NEUROSYM.a2ml` at `5422cd5` (identical on `main` at audit time)
-
----
-
-## Summary
-
-This repo's `NEUROSYM.a2ml` declares `report-format = "logtalk"` for Hypatia. That is status drift, not a working dependency: Hypatia's rule engine has been pure Elixir (`lib/rules/*.ex`) since its ADR-001 (2026-04-14), its report formats are `json|text|github|sarif`, and the scan here is disabled (`scan-enabled = false`) in any case.
-
-The estate direction is that this descriptor information lives in the repository's DEED, in the `(neurosym …)` clause defined by standards (`1-formats/deed/spec/abnf/deed.abnf` v1.2.1; mapping `1-formats/deed/mappings/agentic-neurosym-playbook-to-repo-deed.adoc`, family 4). A complete, ready-to-land transcription is attached from Hypatia: `epistemic-types_chora.deed`.
-
-## The change
-
-1. Add **`epistemic-types_chora.deed`** at the repository root, with exactly the content of Hypatia `docs/rules/migration/epistemic-types_chora.deed`.
- - Filename matters: DEED dispatches the `repo-deed` head by the `_chora.deed` name.
- - If this repo has acquired a repo deed since the audit, do **not** add a second one — merge the single `(neurosym …)` clause from the artifact into the existing deed instead.
-2. Delete **`.machine_readable/descriptiles/NEUROSYM.a2ml`** once the deed lints (step 3).
-3. Validate with the standards gate and keep the receipt in the landing PR:
-
- ```bash
- bun /path/to/standards/1-formats/deed/tools/deed_lint.js epistemic-types_chora.deed
- # expected: exit 0
- ```
-
-## Semantic diff (complete)
-
-Everything from the `5422cd5` descriptor is carried over:
-
-- `[metadata]` → `:project`, `:version`, `:status`, `:last-updated`, `:author` (strings verbatim).
-- `[hypatia-config]` → `(hypatia :scan-enabled #f :scan-depth standard :report-format "json" :scan-paths ("src/EpistemicTypes") :file-globs ("*.agda"))`. Note DEED booleans are `#t/#f` and `scan-depth` is a symbol, per the mapping.
-- All ten `[symbolic-rules]` entries → `(rule :name … :pattern … :severity … :note …)`, patterns converted escape-for-escape so the parsed strings are identical; `[symbolic-rules.notes]` → `(notes :checker-of-record … :safe-flags …)`.
-- `[neural-config] enabled=false`, `[ci] enabled=false` → `:enabled #f` clauses.
-- Meaningful A2ML comments are preserved as DEED comments.
-
-**The only intentional semantic change:** `:report-format "logtalk"` → `"json"`.
-
-Two non-changes, on purpose:
-
-- The checker-of-record (`agda --no-libraries -i src src/EpistemicTypes/All.agda`) and `--safe --without-K` flags are transcribed as-is. Whether this repo should also adopt the estate's current strict-profile addition `--cubical-compatible` is a *separate* proof-policy reconciliation — please don't bundle it silently into this format migration, and don't read this issue as a proof-grade claim about the Agda sources.
-- No scan behaviour changes: the scan remains disabled.
-
-## One standards dependency to be aware of
-
-Family 4 of the standards mapping currently *fails closed* on a populated `[symbolic-rules]` table (it has no ratified row yet — this repo is the motivating case, with ten real rules). The `(symbolic-rules (notes …) (rule …))` shape in the artifact is valid DEED syntax under the ABNF, and a companion standards issue (Hypatia `docs/rules/migration/standards-deed-mapping-issue.md`) proposes ratifying exactly this row. Landing here does not depend on that ratification for syntactic validity, but the shape should be treated as "proposed standard" until the row lands.
-
-## Acceptance criteria
-
-- [ ] `deed_lint.js` exits 0 on the landed deed; receipt recorded in the PR.
-- [ ] `grep -ri logtalk` over active (non-historical) files finds no report-format or rule-format claim.
-- [ ] `NEUROSYM.a2ml` deleted; nothing references the old path.
-- [ ] `just check` (Agda proof check) unaffected and still the soundness floor, as the original notes say.
diff --git a/docs/rules/migration/epistemic-types_chora.deed b/docs/rules/migration/epistemic-types_chora.deed
deleted file mode 100644
index c42b56fc..00000000
--- a/docs/rules/migration/epistemic-types_chora.deed
+++ /dev/null
@@ -1,92 +0,0 @@
-;; SPDX-License-Identifier: MPL-2.0
-; epistemic-types_chora.deed — proposed repo deed clause set for
-; hyperpolymath/epistemic-types, prepared in Hypatia as the exact
-; replacement for .machine_readable/descriptiles/NEUROSYM.a2ml at
-; epistemic-types@5422cd5. Land at the sibling repository root; if a
-; repo deed has been created there in the meantime, merge the single
-; (neurosym ...) clause into it instead of adding a second deed.
-; Sole intentional semantic change: :report-format "logtalk" ->
-; "json" (Hypatia has had no Logtalk output since ADR-001,
-; 2026-04-14; the value was status drift, not a dependency).
-; Grammar: metadatastician/standards 1-formats/deed/spec/abnf/deed.abnf
-; v1.2.1. Mapping: 1-formats/deed/mappings/
-; agentic-neurosym-playbook-to-repo-deed.adoc family 4, extended for
-; the populated [symbolic-rules] table (see Hypatia
-; docs/rules/logtalk-migration.adoc).
-(repo-deed
- :schema-version "1.0.0"
- :canonical-name "epistemic-types"
- (neurosym
- :project "epistemic-types"
- :version "0.1.0"
- :status "prototype"
- :last-updated "2026-06-15"
- :author "Jonathan D.A. Jewell (hyperpolymath) "
- (hypatia
- :scan-enabled #f
- :scan-depth standard
- :report-format "json"
- :scan-paths ("src/EpistemicTypes")
- :file-globs ("*.agda"))
- ; Custom symbolic rules for this repository. Agda has no
- ; believe_me/unsafeCoerce; the honest analogues to flag are escape
- ; hatches and library coupling that would weaken the constructive,
- ; --safe --without-K, no-postulate, no-stdlib discipline here.
- (symbolic-rules
- (notes
- :checker-of-record "agda --no-libraries -i src src/EpistemicTypes/All.agda"
- :safe-flags "--safe --without-K")
- (rule
- :name "no-postulate"
- :pattern "postulate"
- :severity "critical"
- :note "This repo postulates nothing. Any `postulate` is a silent axiom; laws must be fields or proofs.")
- (rule
- :name "no-terminating-pragma"
- :pattern "\\{-# TERMINATING #-\\}"
- :severity "critical"
- :note "Bypasses the termination checker; breaks the constructive honesty guarantee.")
- (rule
- :name "no-non-terminating-pragma"
- :pattern "\\{-# NON_TERMINATING #-\\}"
- :severity "critical"
- :note "Same escape hatch as TERMINATING; not used here and must not appear.")
- (rule
- :name "no-primTrustMe"
- :pattern "primTrustMe"
- :severity "critical"
- :note "Unsound equality witness; equivalent in spirit to believe_me. Must never appear.")
- (rule
- :name "no-trustMe"
- :pattern "trustMe"
- :severity "critical"
- :note "Library-level wrapper over primTrustMe; same prohibition.")
- (rule
- :name "no-no-positivity-check"
- :pattern "\\{-# NO_POSITIVITY_CHECK #-\\}"
- :severity "critical"
- :note "Disables the positivity checker; would admit non-strictly-positive (unsound) data.")
- (rule
- :name "no-no-termination-check"
- :pattern "\\{-# NO_TERMINATION_CHECK #-\\}"
- :severity "critical"
- :note "Legacy termination bypass; forbidden for the same reason as TERMINATING.")
- (rule
- :name "no-stdlib-import"
- :pattern "open import (Data|Relation|Function|Algebra|Category|Codata|Effect|Foreign|IO|Reflection|Tactic|Agda\\.Builtin\\.Reflection)\\b"
- :severity "high"
- :note "Repo builds with `agda --no-libraries`; only `Agda.Builtin.*` and `Agda.Primitive` are permitted. A standard-library import would not type-check under `just check` and breaks the self-contained guarantee.")
- (rule
- :name "no-unsafe-options"
- :pattern "\\{-# OPTIONS[^#]*--type-in-type"
- :severity "critical"
- :note "`--type-in-type` is inconsistent; the repo target is `--safe --without-K`.")
- (rule
- :name "echo-not-collapsed"
- :pattern "Echo .* = .* E "
- :severity "medium"
- :note "Heuristic: Echo C y (certified residue and separately measured bounds) and E kappa A (epistemic availability) are distinct modalities. Their composition is meaningful; their identification is a modelling error. Manual review on hit."))
- (neural-config
- :enabled #f)
- (ci
- :enabled #f)))
diff --git a/docs/rules/migration/standards-deed-mapping-issue.md b/docs/rules/migration/standards-deed-mapping-issue.md
deleted file mode 100644
index 5258d5f0..00000000
--- a/docs/rules/migration/standards-deed-mapping-issue.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-# Issue packet for metadatastician/standards
-
-**Suggested title:** DEED neurosym mapping: retire the `"logtalk"` report-format example and ratify populated `[symbolic-rules]`
-
-**Prepared from:** Hypatia branch `arena/82ed8898-hypatia`; motivating case `hyperpolymath/epistemic-types` (`NEUROSYM.a2ml` @ `5422cd5`); ledger Hypatia `docs/rules/logtalk-migration.adoc`
-
----
-
-## 1. The `"logtalk"` literal is a retired format presented as the example
-
-`1-formats/deed/mappings/agentic-neurosym-playbook-to-repo-deed.adoc` (family 4) maps:
-
-```
-[hypatia-config] report-format → (neurosym (hypatia :report-format "logtalk")) — verbatim STRING
-```
-
-and the template/valid fixtures under `1-formats/deed/tools/fixtures/` reproduce `:report-format "logtalk"`. Two of those fixtures are vendored byte-for-byte into Hypatia's DEED-reader conformance tests (`test/fixtures/deed_egress/`), so the drift now has downstream copies that cannot be corrected locally without falsifying fixture provenance.
-
-Facts:
-
-- Hypatia — the system the `report-format` names — retired Logtalk in ADR-001 (2026-04-14). Its report formats are `json | text | github | sarif`; `json` is canonical (findings: `schema/findings.ncl`). There is no Logtalk output to request.
-- Neither `0-canon/rsr/LANGUAGE-POLICY.adoc` nor `3-practice/LANGUAGE-POLICY.adoc` lists Logtalk (or Prolog) as approved.
-- At audit, at least two live descriptors carry the value as if current: `epistemic-types/.machine_readable/descriptiles/NEUROSYM.a2ml` and `echidna/echidna-playground/.machine_readable/descriptiles/NEUROSYM.a2ml` (the latter with `scan-enabled = true`).
-
-**Requested:**
-
-1. Change the mapping example to `:report-format "json"`, and add an explicit migration note: a source value of `"logtalk"` is a *retired format*, to be normalised to `"json"` during A2ML→DEED migration, **not** carried across verbatim. (This is the one place where "verbatim STRING" is the wrong rule: verbatim preservation of an unimplementable format is how the drift propagated.)
-2. Consider closing the value set in the row (as `scan-depth` already is): `json text github sarif`, string-valued, with `json` canonical.
-3. Regenerate/update the affected fixtures and template pair so vendored copies downstream (Hypatia's reader fixtures) can re-sync cleanly.
-4. In the same pass, fix any converter behaviour in `1-formats/deed/tools/a2ml_to_deed.py` / `migrate_a2ml_to_deed.sh` that would emit `"logtalk"` from a legacy descriptor without complaint.
-
-## 2. Ratify the populated `[symbolic-rules]` row (currently fail-closed)
-
-Family 4 says populated `[symbolic-rules]` / `[neural-config]` fail closed pending table rows. epistemic-types is a real, minimal motivating case: ten rules, a notes sub-table, `neural-config` present but disabled, plus `[metadata]` fields (`status`, `last-updated`, `author`) and a `[ci]` section the current rows don't cover.
-
-Hypatia's proposed transcription (full artifact: `docs/rules/migration/epistemic-types_chora.deed` in the Hypatia repo) uses only generic DEED clause syntax from `deed.abnf` v1.2.1:
-
-```scheme
-(repo-deed
- :schema-version "1.0.0"
- :canonical-name "epistemic-types"
- (neurosym
- :project "epistemic-types"
- :version "0.1.0"
- :status "prototype"
- :last-updated "2026-06-15"
- :author "Jonathan D.A. Jewell (hyperpolymath) "
- (hypatia
- :scan-enabled #f
- :scan-depth standard
- :report-format "json"
- :scan-paths ("src/EpistemicTypes")
- :file-globs ("*.agda"))
- (symbolic-rules
- (notes
- :checker-of-record "agda --no-libraries -i src src/EpistemicTypes/All.agda"
- :safe-flags "--safe --without-K")
- (rule :name "no-postulate" :pattern "postulate"
- :severity "critical" :note "…")
- …)
- (neural-config :enabled #f)
- (ci :enabled #f)))
-```
-
-**Requested:** add family-4 rows for
-
-- `[symbolic-rules] rules[]` → `(symbolic-rules (rule :name S :pattern S :severity S :note S)…)`;
-- `[symbolic-rules.notes]` → `(symbolic-rules (notes :checker-of-record S :safe-flags S))` (or a ruling on where notes belong);
-- `[metadata] status/author` and `[ci] enabled` (currently only `version`/`last-updated` have rows);
-- and state explicitly which A2ML values, if any, still fail closed after these rows (e.g. populated `[neural-config]` floats — Hypatia's own `NEUROSYM.a2ml` remains unconvertible for that reason and is intentionally left for that ruling).
-
-## 3. Optional estate guard
-
-Hypatia now carries `scripts/check-no-active-logtalk.sh` + an exact-path, shrink-only `.logtalk-allowlist` (no tracked `*.lgt/*.logtalk`; no active config requesting Logtalk loaders/formats). If standards wants this estate-wide, Hypatia's implementation is offered as the seed for a template/CI-snippet ruling rather than each repo inventing its own patterns.
-
-## Acceptance criteria
-
-- [ ] No standards mapping, template, or *valid* fixture presents `"logtalk"` as a current Hypatia report format.
-- [ ] The A2ML→DEED tooling normalises or rejects a legacy `"logtalk"` value loudly (never emits it silently).
-- [ ] Family-4 rows exist for populated `[symbolic-rules]`, its notes, `[ci]`, and the extra `[metadata]` fields — or an explicit ruling records a different canonical shape, in which case Hypatia's epistemic-types artifact will be regenerated to match.
-- [ ] Downstream vendored fixtures (Hypatia `test/fixtures/deed_egress/`) can be re-synced from the corrected standards fixtures.
diff --git a/docs/rules/security-rule-provenance.adoc b/docs/rules/security-rule-provenance.adoc
new file mode 100644
index 00000000..006c2546
--- /dev/null
+++ b/docs/rules/security-rule-provenance.adoc
@@ -0,0 +1,369 @@
+// SPDX-License-Identifier: CC-BY-SA-4.0
+= Security Rule Provenance
+:toc: macro
+:toclevels: 2
+
+This page records where two rule sets in `lib/rules/` came from, how each
+source rule maps onto Elixir, and every deliberate divergence:
+
+* the security-alert tables of `Hypatia.Rules.SecurityErrors`, transcribed
+ from ECHIDNA's security-learning rule table (the *source of record*);
+* the audit-training prevention rules AP001–AP015 of
+ `Hypatia.Rules.AuditPrevention`, first written as prevention-rule records
+ in the `.audittraining/security-errors/*.adoc` incident reports
+ (2025-12-29).
+
+It also defines the learned-rules JSON contract that
+`mix hypatia.batch_security_scan` writes. The Elixir modules are canonical;
+if this page and the code disagree, the code wins and this page is
+corrected.
+
+toc::[]
+
+== How fidelity is recorded
+
+Each transcribed item carries one disposition:
+
+[cols="1,3",options="header"]
+|===
+|Disposition |Meaning
+
+|Exact
+|Same inputs, same outputs, including failure/absence behaviour over
+the stated domain.
+
+|Operationalised
+|The source condition named an uninterpreted predicate
+(`crate_type(parser)`, `nearby_pattern/1`, `pr_reviews < 2`, …). The
+Elixir check states the concrete evidence test used in its place; the
+interpretation is written down here and in the module, not hidden.
+
+|Extension
+|The Elixir surface is a superset (more alert types, a total function
+where the source query failed, an extra prevention mapping).
+Shared-domain behaviour is unchanged.
+
+|Superseded
+|The source value was wrong or unsafe under current estate policy and
+was replaced on purpose. The old value is quoted here so the change is
+auditable.
+
+|Replaced
+|The source described a runtime mechanism that an Elixir subsystem
+replaces wholesale. No clause-by-clause equivalent is pretended.
+|===
+
+[[learned-rules-json]]
+== The learned-rules JSON contract
+
+`Mix.Tasks.Hypatia.BatchSecurityScan` writes one named-field JSON document,
+`schemas/learned-security-rules.schema.json` ($id
+`https://hyperpolymath.dev/schemas/hypatia/learned-security-rules`, format
+version `1.0.0`), to `~/repos/echidna/rules/learned_security_rules.json`
+when that directory exists, or to `.audittraining/echidna-rules.json`:
+
+[source,json]
+----
+{
+ "schema": "https://hyperpolymath.dev/schemas/hypatia/learned-security-rules",
+ "version": "1.0.0",
+ "generated_at": "2026-11-01T00:00:00Z",
+ "generator": "mix hypatia.batch_security_scan",
+ "source_alert_count": 1234,
+ "rules": [
+ {
+ "alert_type": "TokenPermissionsID",
+ "category": "workflow_security",
+ "severity": "high",
+ "auto_fixable": true,
+ "observations": 87,
+ "fix": "Add granular workflow-level permissions ...",
+ "prevention_workflow": "workflow-linter.yml"
+ }
+ ]
+}
+----
+
+Field provenance:
+
+[cols="1,2,2",options="header"]
+|===
+|JSON field |Source-of-record predicate |Canonical Elixir source
+
+|`alert_type` |the alert id |GitHub/Scorecard alert id
+|`category` |`alert_category/2`
+|`SecurityErrors.alert_category/1` (snake-case string; task-local
+substring grouping only as fallback for ids outside the 18)
+|`severity` |`classify_severity/2` |`SecurityErrors.issue_severity/1`
+|`auto_fixable` |`is_auto_fixable/1` |`SecurityErrors.auto_fixable?/1`
+|`observations` |— |Alert count in the producing scan. Evidence for
+belief formation only — never a soundness claim
+(`src/Hypatia/ABI/Verdict.idr`).
+|`fix` |`suggest_fix/2` |`SecurityErrors.fix_suggestion/1` (`null` when none)
+|`prevention_workflow` |`get_prevention_workflow/2`
+|`SecurityErrors.prevention_workflow/1` (`null` when none)
+|===
+
+All per-alert fields except `observations` are
+`Hypatia.Rules.SecurityErrors.validate_alert/1` rendered as JSON, with
+one exception: where `validate_alert/1` gives no category (an id outside
+the 18), `category` is the task-local grouping above, not `null`. Named
+fields also remove an ambiguity in the source's training loader, which
+stored a catalog field as `Type` in one predicate and read the same
+position as `Category` in another.
+
+[[security-errors]]
+== `SecurityErrors`: the security-alert tables
+
+Source of record: ECHIDNA's security-learning rule table (added
+2025-12-29). Target: `Hypatia.Rules.SecurityErrors`, except where
+stated. The finite correspondence of the 18 alert types is checked in
+`verification/proofs/agda/AlertTableCorrespondence.agda` (see
+`verification/PROOF-STATUS.adoc`, section 8); runtime behaviour is
+pinned by `test/security_errors_test.exs`.
+
+=== `alert_category/2` — 18 facts → `@alert_categories` — *Exact*
+
+Canonical home: `SecurityErrors.alert_categories/0` / `alert_category/1`
+(snake-case atoms, as in the source):
+
+* `workflow_security`: TokenPermissionsID, PinnedDependenciesID,
+ missing-workflow-permissions
+* `code_security`: hard-coded-cryptographic-value,
+ remote-property-injection, sql-injection
+* `code_quality`: unused-local-variable, syntax-error
+* `dependency_vuln`: VulnerabilitiesID, unmaintained
+* `process_hygiene`: SecurityPolicyID, MaintainedID, CodeReviewID,
+ BranchProtectionID, CIIBestPracticesID
+* `missing_tests`: FuzzingID, SASTID, CITestsID
+
+Outside these 18, `alert_category/1` returns `nil`, mirroring the absence
+of a fact. (The batch-scan task keeps a separate kebab-case *display*
+grouping with substring fallback for unseen ids such as `unused-import`;
+it is not a second semantic source and is commented as such.)
+
+=== `classify_severity/2` → `issue_severity/1` — *Exact on the 18; one stated difference outside*
+
+* critical: hard-coded-cryptographic-value, sql-injection,
+ VulnerabilitiesID
+* high: remote-property-injection, TokenPermissionsID,
+ missing-workflow-permissions
+* medium: PinnedDependenciesID, SecurityPolicyID, BranchProtectionID,
+ CodeReviewID, syntax-error
+* low (the source catch-all `classify_severity(_, low)`): the remaining
+ seven — unused-local-variable, unmaintained, MaintainedID,
+ CIIBestPracticesID, FuzzingID, SASTID, CITestsID
+
+SASTID, CITestsID and unmaintained are explicit `:low` entries, so they do
+not fall through to `issue_severity/1`'s `:info` default. For ids
+*neither* table has seen, Elixir keeps its long-standing `:info`
+unknown-default rather than the source catch-all's `low`; that is the
+single deliberate difference, unreachable for any of the 18.
+
+=== `is_auto_fixable/1` — 6 facts → `@auto_fixable` — *Exact on the 18*
+
+TokenPermissionsID, PinnedDependenciesID, missing-workflow-permissions,
+SecurityPolicyID, BranchProtectionID, unused-local-variable. The Elixir
+set also holds later alert ids outside the source domain; on the 18 the
+two agree exactly.
+
+=== `suggest_fix/2` — 13 facts → `@fix_suggestions`
+
+* *Exact (10), byte-identical strings:* SecurityPolicyID,
+ BranchProtectionID, CodeReviewID, CIIBestPracticesID, FuzzingID,
+ VulnerabilitiesID, hard-coded-cryptographic-value,
+ remote-property-injection, unused-local-variable, syntax-error.
+* *Generalised (1):* PinnedDependenciesID — source
+ "Replace @v4 with @SHA # v4 format" → Elixir
+ "Replace @vN with @SHA # vN format" (same instruction, version
+ parameterised).
+* *Superseded (2):* TokenPermissionsID and missing-workflow-permissions —
+ the source prescribed `Add "permissions: read-all" at workflow level`.
+ Current OSSF guidance (and Hypatia's own
+ `scorecard_compliance/token_permissions` check) flags `read-all` itself
+ as high severity, so the canonical text prescribes granular
+ least-privilege permissions and warns against `read-all`.
+* *No fix in either table (5 of the 18):* sql-injection, unmaintained,
+ MaintainedID, SASTID, CITestsID → `fix_suggestion/1` returns `nil`.
+
+=== `get_prevention_workflow/2` — 7 facts → `@prevention_workflows`
+
+Exact for six: TokenPermissionsID, PinnedDependenciesID,
+missing-workflow-permissions → `workflow-linter.yml`;
+hard-coded-cryptographic-value → `secret-scanner.yml`;
+VulnerabilitiesID → `cargo-audit.yml`; SecurityPolicyID →
+`scorecard-enforcer.yml`.
+
+* *Superseded:* BranchProtectionID — source
+ `branch-protection-enforcer.yml` → Elixir `scorecard-enforcer.yml`. The
+ Elixir value groups BranchProtection with the other Scorecard process
+ checks and every executable consumer has used it; both workflow
+ templates still exist under `.audittraining/prevention/`. Changing it
+ back is a policy decision for a separate change.
+* *Extension:* CodeReviewID → `scorecard-enforcer.yml` exists in Elixir
+ with no source counterpart.
+
+=== `validate_alert/2` → `validate_alert/1` — *Total-function extension*
+
+The source composed severity, fix and auto-fixability into
+`alert_validation(Type, Severity, Fix, AutoFix)` and *failed* for any
+alert without a `suggest_fix/2` clause. `SecurityErrors.validate_alert/1`
+returns those fields plus `category` and `prevention_workflow`, and is
+total: absent facts are `nil`/`false` rather than query failure. A
+consumer that needs an "unknown alert" signal tests `category: nil` and
+`fix: nil` in the returned map. In the learned-rules JSON export,
+`category` is never `null` (an unknown alert gets the task-local
+grouping, at worst `"unknown"`), so the export alone does not mark an
+alert as unknown: `fix: null` covers every unknown alert but also the
+known types without a fix. Call `validate_alert/1` for the exact signal.
+
+=== Learning machinery — *Replaced*
+
+The source's training-data loader, its dynamic learned-rule database and
+its CI/CD sync never formed a runnable pipeline and have no clause-level
+equivalents. Their purpose is served by:
+
+* `Hypatia.Rules.Learning` — outcome tracking, confidence, promotion;
+* `Mix.Tasks.Hypatia.BatchSecurityScan` — fleet alert collection and the
+ learned-rules JSON above;
+* `.audittraining/ERROR-CATALOG.scm` — retained as a training-data record.
+
+=== Where `.audittraining/ERROR-CATALOG.scm` disagrees with the source
+
+The source table says its facts derive from `ERROR-CATALOG.scm`, but the
+two disagree. `SecurityErrors` follows the source table (the values every
+executable consumer used) and records the catalog variants as open policy
+questions:
+
+* Categories: the catalog splits fuzzing/SAST/CI-tests into
+ `missing-fuzzing` / `missing-sast` / `missing-tests`; the source and
+ Elixir use one `missing_tests` group.
+* Severities: the catalog has VulnerabilitiesID high (source critical),
+ unmaintained medium (source low), FuzzingID/SASTID/CITestsID medium
+ (source low).
+* Auto-fixability: the catalog marks CodeReviewID, FuzzingID, SASTID and
+ CITestsID `#t`; the source and Elixir say false.
+* The catalog's extra entries (workflow-linter self-detection,
+ rust-toolchain input, duplicate workflows, …) were never in the source;
+ most already live in Elixir's extended severity/fix tables.
+
+Adopting the catalog's finer split or medium grading would change live
+severities fleet-wide and needs its own decision.
+
+[[audit-prevention]]
+== `AuditPrevention`: rules AP001–AP015
+
+`Hypatia.Rules.AuditPrevention.rules/0` keeps every source record
+verbatim as data (id, `source_functor`, `source_name`, effect,
+description, conditions, action, `origin` report, canonical equivalent);
+the module is the rules' only home.
+
+Common operationalisations:
+
+* The records had effects and actions but no severities. Finding
+ severity derives from the action (`block_merge_with_escalation` →
+ `:critical`; other `block_*` → `:high`; `warn_*`/`alert_*` →
+ `:medium`; `warn_and_log` → `:low`). Alert-id severities remain
+ `SecurityErrors`' business.
+* Checks are pure functions over caller-supplied evidence (file lists,
+ file contents, tag/review/score facts). `check_all/1` runs every
+ implemented check whose evidence is present and is silent otherwise;
+ it never duplicates a check whose canonical home is another module.
+
+[cols="1,2,3,3",options="header"]
+|===
+|ID |Source rule |Canonical Elixir |Disposition / operationalisation
+
+|AP001 |`parser_rule(input_limits)` (bunsenite)
+|`AuditPrevention.check_parser_input_limits/1`
+|Implemented. `crate_type(parser)` is inferred from a Cargo description
+naming a parser; the negated size-limit pattern is searched over the
+supplied contents.
+
+|AP002 |`wasm_rule(memory_limits)` (bunsenite)
+|`AuditPrevention.check_wasm_memory_limits/1`
+|Implemented. `feature("wasm")` is inferred from Cargo wasm
+features/dependencies; memory-limit markers searched likewise.
+
+|AP003 |`rust_rule(missing_audit)` (czech-file-knife)
+|`AuditPrevention.check_missing_cargo_audit/2`
+|Implemented exactly over evidence: `Cargo.toml` present and no
+*workflow* content running `cargo audit` (a README mention is not CI).
+
+|AP004 |`rust_rule(workspace_vuln)` (czech-file-knife)
+|`AuditPrevention.check_workspace_vuln/2`
+|Implemented as the stated conjunction; `any_member_has_vuln` is
+caller-supplied vulnerability evidence (this check does not itself
+audit members — that is the scanner's/cargo-audit's job).
+
+|AP005 |`project_rule(missing_ci_tests)` (gitvisor)
+|`AuditPrevention.check_missing_ci_tests/1`
+|Implemented. The literal glob was `*test*.yml`; `.yaml` test workflows
+are accepted as the same semantic object (the glob, read literally,
+would false-positive on them). `has_source_code` uses the module's
+source-extension list.
+
+|AP006 |`project_rule(missing_sast)` (gitvisor)
+|`AuditPrevention.check_missing_sast/2`
+|Implemented; `codeql.yaml` accepted alongside the literal `codeql.yml`,
+same reasoning as AP005. SecurityErrors' CodeQL language matrix
+validation is the related pre-existing surface.
+
+|AP007 |`security_rule(property_injection)` (polyglot-i18n)
+|`AuditPrevention.check_property_injection/1`
+|Implemented. Both source access patterns are used verbatim;
+`nearby_pattern(allowlist)` is operationalised as *same file*. CWE-915
+is mapped in `SecurityErrors` for `remote-property-injection` /
+`remote_property_injection`.
+
+|AP008 |`code_quality_rule(unused_vars)` (polyglot-i18n)
+|`SecurityErrors` metadata for `unused-local-variable`
+|Metadata only, deliberately: the source condition is a compiler
+diagnostic string ("is declared but its value is never read"), so the
+detector of record stays the language compiler/linter. Severity
+(`:low`), fix, category (`:code_quality`) and auto-fixability are
+canonical in `SecurityErrors`.
+
+|AP009 |`crypto_rule(enhanced_review)` (proof-of-work)
+|`AuditPrevention.check_crypto_enhanced_review/2`
+|Implemented. `pr_reviews < 2` is read as the *required approving review
+count* from branch protection; unknown (`nil`) never fires.
+
+|AP010 |`crypto_rule(require_fuzzing)` (proof-of-work)
+|`AuditPrevention.check_crypto_require_fuzzing/2`
+|Implemented: cryptography tag + no `fuzz/` path in the file list.
+
+|AP011 |`crypto_rule(no_panic)` (proof-of-work)
+|`CodeSafety.scan_content/2` (`:panic_macro`, `:unwrap_without_check`,
+`:expect_in_hot_path`)
+|Already canonical — and a superset: the Elixir patterns fire in every
+Rust repo, not only cryptography-tagged ones. Not duplicated.
+
+|AP012 |`meta_rule(rsr_self_compliance)` (supernorma)
+|`RsrConformance` + `Dogfooding`
+|Already canonical, generalised: the hard-coded `repo_name(supernorma)`
+becomes "any RSR-tooling repo, including Hypatia itself" via the
+conformance oracle and dogfooding checks.
+
+|AP013 |`template_rule(exemplary_standards)` (supernorma)
+|`AuditPrevention.check_exemplary_standards/2`
+|Implemented exactly: tooling purpose + Scorecard score < 8; boundary
+value 8 passes, mirroring `<`.
+
+|AP014 |`workflow_rule(missing_permissions)` (ubicity)
+|`WorkflowAudit.check_permissions/1`,
+`WorkflowHardening.wh002_excessive_permissions/1`
+|Already canonical (and stricter: excessive grants are flagged, not only
+absence). Not duplicated; `check_all/1` excludes it.
+
+|AP015 |`workflow_rule(unpinned_action)` (ubicity)
+|`WorkflowHardening.wh004_unpinned_uses/1`,
+`WorkflowAudit.check_unpinned_actions/1`
+|Already canonical with one supersession: the source excused a tag ref
+with a trailing `# vN` comment; the Elixir checks require the 40-hex SHA
+form (comment or not). A comment beside a mutable tag is not a pin.
+|===
+
+AP001–AP015 check semantics beyond the table correspondence carry no
+formal claim: the regex/evidence semantics are specified in code and in
+`test/rules/audit_prevention_test.exs`.
diff --git a/docs/wiki-pages/Architecture.md b/docs/wiki-pages/Architecture.md
index 3ca7424b..a359ef4b 100644
--- a/docs/wiki-pages/Architecture.md
+++ b/docs/wiki-pages/Architecture.md
@@ -131,4 +131,4 @@ Foreign callers reach Hypatia through:
- **ArangoDB → verisim-data**. The graph DB was ditched per the #273 architecture audit; storage is now the git-backed flat-file store.
- **5 networks → 8 networks**. GNN, VAE, and Sequence model joined the blackboard.
- **Hub-and-spoke → blackboard**. Fixed weights replaced with trace-derived confidence.
-- **Logtalk → Elixir rules**. The Logtalk rule engine was retired.
+- **Elixir rules**. The rule engine is pure Elixir (`lib/rules/`, ADR-001).
diff --git a/docs/wiki-pages/Rule-Catalogue.md b/docs/wiki-pages/Rule-Catalogue.md
index ebae6b9c..687381d5 100644
--- a/docs/wiki-pages/Rule-Catalogue.md
+++ b/docs/wiki-pages/Rule-Catalogue.md
@@ -9,23 +9,25 @@ Every rule module Hypatia ships. **Generated** from `lib/rules/*.ex` — regener
|---|---|---|
| `actions_lock` | — | Strict local validation for machine-generated `gh actions-lock` v0.0.2/v0.0.3 files. |
| `admin_merge_eligibility` | DBA002 | Recognises PR shapes that are safe to admin-merge in bulk when the |
-| `audit_prevention` | AP001 AP002 AP003 AP004 AP005 AP006 AP007 AP008 AP009 AP010 AP011 AP012 AP013 AP014 AP015 | Audit-training prevention rules AP001–AP015, transcribed from Logtalk. |
+| `audit_prevention` | AP001 AP002 AP003 AP004 AP005 AP006 AP007 AP008 AP009 AP010 AP011 AP012 AP013 AP014 AP015 | Audit-training prevention rules AP001–AP015. |
| `baseline_health` | BH001 BH002 BH003 BH004 BH005 BH006 BH007 BH008 | Detects degraded `main`-branch baseline conditions that allow silent rot. |
| `branch_protection` | BP001 BP002 BP003 BP004 BP005 BP006 BP007 BP008 BP009 | Branch-protection hygiene rules drawn from the CIS GitHub Benchmark, |
| `build_system_rules` | — | Build-tool configuration anti-patterns that block estate CI but slip past |
-| `cicd_rules` | — | Primary Elixir CI/CD policy rules (migrated from legacy Logtalk engine). |
-| `code_safety` | — | Primary Elixir rules for code safety (migrated from legacy Logtalk engine). |
+| `ci_failure_triage` | — | Symbolic triage of a failed CI run: which layer failed, what to do, and |
+| `cicd_rules` | — | Primary Elixir CI/CD policy rules. |
+| `code_safety` | — | Primary Elixir rules for code safety. |
| `code_scanning_alerts` | CSA001 CSA002 CSA003 CSA004 CSA005 CSA006 | GitHub Code Scanning alert querying (CodeQL + third-party SARIF). |
| `dependabot_alerts` | DA001 DA002 DA003 DA004 | GitHub Dependabot alert querying and risk assessment. |
| `disambiguation_rules` | DR001 | Cross-reference / language-disambiguation rules. |
| `dogfooding` | HYP-DOG-001 HYP-DOG-003 HYP-DOG-004 HYP-DOG-005 HYP-DOG-006 HYP-DOG-007 HYP-DOG-008 HYP-DOG-009 HYP-DOG-010 | Dogfooding compliance rules -- HYP-DOG-001 through HYP-DOG-010. |
-| `forge_adapters` | — | Primary Elixir forge adapter rules (migrated from legacy Logtalk engine). |
+| `forge_adapters` | — | Primary Elixir forge adapter rules. |
| `git_state` | GS001 GS002 GS003 GS004 GS005 GS006 GS007 GS008 | Git repository synchronisation state checks. |
| `green_web` | — | Green Web Foundation certification checks for hyperpolymath repositories. |
| `honest_completion` | — | Honest completion audit -- cross-references claimed completion percentages |
| `implementation_inside_canon` | — | Executable evaluator for the standards-authored HYP-S009 rule. |
-| `learning` | — | Learning engine rules absorbed from the retired Logtalk learning and |
-| `migration_rules` | — | Primary Elixir ReScript migration rules (migrated from legacy Logtalk engine). |
+| `js_call_scan` | — | A small JavaScript-aware reader for one question: does a call to a |
+| `learning` | — | Learning engine rules. |
+| `migration_rules` | — | Primary Elixir ReScript migration rules. |
| `moved_repositories` | — | Versioned records of confirmed repository moves relevant to reusable workflows. |
| `pin_integrity` | — | Pin-level integrity rules for workflow and lockfile content. |
| `pin_sites` | — | Structural `uses:` pin sites on one line of workflow YAML. |
@@ -37,16 +39,17 @@ Every rule module Hypatia ships. **Generated** from `lib/rules/*.ex` — regener
| `rsr_conformance` | — | The RSR v2.0 conformance **oracle** (increment 3 of the HYP-S family): |
| `rsr_criteria` | — | Loads the **RSR v2.0 criteria SSOT** (`rsr-criteria-v2.a2ml` from |
| `rule_loader` | — | Loads standards-authored rule definitions (`.a2ml` files) into structured |
-| `rules` | ERR-LIC-001 | Facade module for all Hypatia rules, absorbed from the Logtalk engine. |
+| `rules` | ERR-LIC-001 | Facade module for all Hypatia rules. |
| `scorecard_compliance` | — | Enforces OpenSSF Scorecard best practices as automated Elixir rules. |
| `secret_scanning_alerts` | SSA001 SSA002 SSA003 SSA004 | GitHub Secret Scanning alert querying. |
-| `security_errors` | — | Primary Elixir security error database (migrated from legacy Logtalk engine). |
+| `security_errors` | — | Primary Elixir security error database. |
| `sha_bump_propagation` | — | Detection: an estate-wide reusable workflow has been bumped to a new SHA |
| `standards_repo` | — | The names of the estate standards repository. |
| `strategy_drift` | — | N4: Detects strategy-shift events and flags previously-failed attempts |
| `structural_drift` | SD001 SD002 SD003 SD004 SD005 SD006 SD007 SD008 SD009 SD010 SD011 SD013 SD014 SD021 SD022 SD023 SD024 | Structural drift detection rules. |
+| `structured_format` | — | SF001: advisory detection of an Elixir regex that reconstructs workflow |
| `supply_chain` | SC001 SC002 SC003 SC004 SC005 SC006 SC007 SC008 SC009 SC010 SC011 SC012 SC013 | Supply-chain integrity rules drawn from OSSF Scorecard, SLSA, OWASP |
-| `workflow_audit` | ERR-WF-013 ERR-WF-014 WF-025 WF013 WF014 WF015 WF016 WF017 WF018 WF019 WF020 WF021 WF022 WF023 WF024 WF025 WF026 WF027 WF028 | CI/CD workflow audit rules. |
+| `workflow_audit` | ERR-WF-013 ERR-WF-014 WF-025 WF013 WF014 WF015 WF016 WF017 WF018 WF019 WF020 WF021 WF022 WF023 WF024 WF025 WF026 WF027 WF028 WF029 WF030 WF031 WF032 WF033 | CI/CD workflow audit rules. |
| `workflow_hardening` | WH001 WH002 WH003 WH004 WH005 WH006 WH007 WH008 WH009 WH010 WH011 WH012 WH013 WH014 | Static detection of dangerous GitHub Actions workflow patterns. |
## ID families
@@ -54,7 +57,7 @@ Every rule module Hypatia ships. **Generated** from `lib/rules/*.ex` — regener
| Prefix | Family |
|---|---|
| `AM` | Admin-merge eligibility |
-| `AP` | Audit-prevention rules transcribed from the historical Logtalk blocks |
+| `AP` | Audit-prevention rules from the audit-training incident reports |
| `BH` | Baseline health (silent `main` rot) |
| `BP` | Branch protection (CIS / Scorecard / NIST SSDF) |
| `CSA` | Code-scanning alerts (CodeQL + third-party SARIF) |
diff --git a/hooks/lib/common.sh b/hooks/lib/common.sh
index 90b2133f..59ef4512 100755
--- a/hooks/lib/common.sh
+++ b/hooks/lib/common.sh
@@ -160,8 +160,6 @@ detect_languages() {
echo "$_files" | grep -qE '\.json$' && _langs="$_langs json"
echo "$_files" | grep -qE '\.scm$' && _langs="$_langs scheme"
echo "$_files" | grep -qE '\.ncl$' && _langs="$_langs nickel"
- # .lgt is still *detected* so the RSR ban below can fire on it;
- # detection is not approval (Logtalk retired estate-wide, ADR-001).
echo "$_files" | grep -qE '\.(lgt|logtalk)$' && _langs="$_langs logtalk"
echo "$_files" | grep -qE '\.adoc$' && _langs="$_langs asciidoc"
echo "$_files" | grep -qE '\.md$' && _langs="$_langs markdown"
@@ -187,7 +185,7 @@ get_language_alternative() {
go) echo "Rust" ;;
python) echo "Elixir or Rust" ;;
java|kotlin) echo "Rust" ;;
- logtalk) echo "Elixir (lib/rules/*.ex)" ;;
+ logtalk) echo "Elixir" ;;
*) echo "allowed languages" ;;
esac
}
diff --git a/hypatia_chora.deed b/hypatia_chora.deed
index 3e6588a0..c2a4c955 100644
--- a/hypatia_chora.deed
+++ b/hypatia_chora.deed
@@ -75,7 +75,7 @@
(meta
:last-updated "2026-08-07"
:scoping-first #t
- (adr :id "ADR-001" :title "Replace Logtalk rule engine with pure Elixir rules" :status accepted :date "2026-04-14")
+ (adr :id "ADR-001" :title "Rules are pure Elixir (lib/rules)" :status accepted :date "2026-04-14")
(adr :id "ADR-002" :title "Rename VQL→VCL and verisimdb→verisim throughout" :status accepted :date "2026-04-05")
(adr :id "ADR-003" :title "Route ProofObligations through FleetDispatcher to echidnabot" :status accepted :date "2026-04-11")
(adr :id "ADR-004" :title "Synthetic rebalancer (Strategy A) as default; B+C deferred to M9" :status accepted :date "2026-04-22")
diff --git a/integration/robot-repo-automaton/config.yml b/integration/robot-repo-automaton/config.yml
index 51276d5d..16c30f97 100644
--- a/integration/robot-repo-automaton/config.yml
+++ b/integration/robot-repo-automaton/config.yml
@@ -10,9 +10,7 @@ integration:
# Connection to hypatia engine
engine:
# Canonical Elixir rule engine (ADR-001, 2026-04-14). Rules are
- # compiled Elixir modules in lib/rules/*.ex — there is no loader
- # file and no Logtalk/Prolog runtime. Migration ledger:
- # docs/rules/logtalk-migration.adoc.
+ # compiled Elixir modules in lib/rules/*.ex; there is no loader file.
elixir:
application: hypatia
mix_project: mix.exs
@@ -125,7 +123,7 @@ learning:
min_occurrences: 3
output_path: .audittraining/echidna-rules.json
- # Export formats (replaces the retired Logtalk security_rule/4 file)
+ # Export formats
exports:
- format: json
path: .audittraining/echidna-rules.json
@@ -187,7 +185,7 @@ rsr_policy:
- java
- kotlin
- swift
- - logtalk # retired 2026-04-14 (ADR-001); rules are Elixir
+ - logtalk
# Allowed languages
allowed_languages:
diff --git a/lib/mix/tasks/hypatia.batch_security_scan.ex b/lib/mix/tasks/hypatia.batch_security_scan.ex
index ea66da19..90ddfa52 100644
--- a/lib/mix/tasks/hypatia.batch_security_scan.ex
+++ b/lib/mix/tasks/hypatia.batch_security_scan.ex
@@ -16,9 +16,8 @@ defmodule Mix.Tasks.Hypatia.BatchSecurityScan do
* `~/repos/echidna/rules/learned_security_rules.json` (if that dir
exists) or `.audittraining/echidna-rules.json` — learned security
rules for echidnabot in the JSON format defined by
- `schemas/learned-security-rules.schema.json`. This replaces the
- retired Logtalk `security_rule/4` export; see
- `docs/rules/logtalk-migration.adoc` for the exact field mapping.
+ `schemas/learned-security-rules.schema.json`; see
+ `docs/rules/security-rule-provenance.adoc` for the field mapping.
"""
use Mix.Task
@@ -32,8 +31,8 @@ defmodule Mix.Tasks.Hypatia.BatchSecurityScan do
# Display grouping for the generated markdown (kebab-case headings).
# The canonical alert-type semantics live in
# `Hypatia.Rules.SecurityErrors.alert_categories/0` (exact match,
- # snake-case atoms, transcribed from ECHIDNA's retired
- # `security_learning.lgt`); this local table is kept only because its
+ # snake-case atoms, transcribed from the ECHIDNA security-learning
+ # rule table); this local table is kept only because its
# substring matching also buckets alert ids the canonical table has
# never seen (for example `unused-import`). The JSON learned-rules
# export below reads the canonical table via `validate_alert/1`.
@@ -253,12 +252,9 @@ defmodule Mix.Tasks.Hypatia.BatchSecurityScan do
Mix.shell().info("Generated: #{filepath}")
end
- # Learned-rules export. This replaces two retired, mutually
- # incompatible Logtalk `security_rule/4` shapes — Hypatia's generated
- # `security_rule(Type, Category, AutoFix, Count)` and ECHIDNA's
- # exported `security_rule(Type, Category, Severity, AutoFix)` — with
- # one named-field JSON object carrying the union of their data plus
- # the fix/prevention lookups:
+ # Learned-rules export: one named-field JSON object per alert type,
+ # carrying the observation count plus the canonical category,
+ # severity, auto-fixability and fix/prevention lookups:
#
# {"alert_type", "category", "severity", "auto_fixable",
# "observations", "fix", "prevention_workflow"}
@@ -311,13 +307,18 @@ defmodule Mix.Tasks.Hypatia.BatchSecurityScan do
Mix.shell().info("Generated learned security rules: #{filepath}")
end
- defp category_string(category, _rule_id) when is_atom(category) do
- Atom.to_string(category)
- end
-
- defp category_string(nil, rule_id) do
+ # The category written for one alert type. `nil` (an id outside the 18
+ # canonical types) falls back to this task's substring grouping. The nil
+ # clause must come first: nil is an atom, so the general clause would
+ # otherwise export the string "nil".
+ @doc false
+ def category_string(nil, rule_id) do
rule_id
|> categorize_alert()
|> String.replace("-", "_")
end
+
+ def category_string(category, _rule_id) when is_atom(category) do
+ Atom.to_string(category)
+ end
end
diff --git a/lib/rules/README.adoc b/lib/rules/README.adoc
index 1514855b..ae22102b 100644
--- a/lib/rules/README.adoc
+++ b/lib/rules/README.adoc
@@ -2,10 +2,9 @@
= lib/rules/ — the canonical Hypatia rule system
This directory is Hypatia's active, canonical rule system: pure-Elixir
-modules compiled into the `hypatia` Mix application. There is no
-`engine/` tree, no Logtalk loader, and no Logtalk output format (ADR-001,
-2026-04-14; semantic migration completed 2026-11-01 — see
-`docs/rules/logtalk-migration.adoc`).
+modules compiled into the `hypatia` Mix application (ADR-001,
+2026-04-14). Rules transcribed from an external source of record are
+recorded in `docs/rules/security-rule-provenance.adoc`.
The inventory is intentionally *not* hand-listed here; it drifts. The
generated catalogue is the reference, and the modules themselves win in
@@ -22,8 +21,7 @@ any disagreement:
* `Hypatia.Rules.RuleLoader` + `Hypatia.Rules.RsrCriteria`
— standards-authored rule data (`.a2ml`) loaded as data, never as code.
* `Hypatia.Rules.Learning` — outcome tracking, confidence, and pattern
- promotion (the live learning subsystem that replaced the old dynamic
- Logtalk learning predicates).
+ promotion (the live learning subsystem).
== Canonical semantic homes most often needed
@@ -34,14 +32,15 @@ any disagreement:
|`security_errors.ex`
|Shared security knowledge: error categories, the canonical alert
category/severity/fix/prevention tables and `validate_alert/1`
-(transcribed from ECHIDNA's retired `security_learning.lgt`), SHA pins
+(transcribed from ECHIDNA's security-learning rule table), SHA pins
and pin exemptions, secret patterns, CodeQL language support, CWE
-mappings, and the RSR language policy (Logtalk banned → Elixir).
+mappings, and the RSR language policy (banned languages and their
+replacements).
|`audit_prevention.ex`
-|Audit-training prevention rules AP001–AP015, transcribed from the
-historical Logtalk blocks in `.audittraining/security-errors/*.adoc`:
-verbatim rule records (`rules/0`) plus the evidence-shaped checks that
+|Audit-training prevention rules AP001–AP015, first written in the
+`.audittraining/security-errors/*.adoc` incident reports: verbatim rule
+records (`rules/0`) plus the evidence-shaped checks that
had no other home. Rules whose checks already existed point at them
instead of duplicating them.
@@ -56,12 +55,7 @@ home of AP012).
== Output contracts
-Rules produce findings consumed as JSON (`schema/findings.ncl`), never
-as Logtalk facts. Rulesets exchanged as data follow
+Rules produce findings consumed as JSON (`schema/findings.ncl`). Rulesets exchanged as data follow
`schemas/ruleset.schema.json`; learned security-rule exports follow
`schemas/learned-security-rules.schema.json`
(`Mix.Tasks.Hypatia.BatchSecurityScan`).
-
-New `.lgt`/`.logtalk` sources and Logtalk output settings are blocked
-by `scripts/check-no-active-logtalk.sh` (exact-path exemptions, with
-removal conditions, in `.logtalk-allowlist`).
diff --git a/lib/rules/audit_prevention.ex b/lib/rules/audit_prevention.ex
index d043b40b..78da7afd 100644
--- a/lib/rules/audit_prevention.ex
+++ b/lib/rules/audit_prevention.ex
@@ -3,14 +3,15 @@
defmodule Hypatia.Rules.AuditPrevention do
@moduledoc """
- Audit-training prevention rules AP001–AP015, transcribed from Logtalk.
+ Audit-training prevention rules AP001–AP015.
- These fifteen rules were the last rule-bearing Logtalk text in this
- repository: the `Prevention Rules (Logtalk)` blocks embedded in
- `.audittraining/security-errors/*.adoc` (2025-12-29). They are recorded
- here verbatim as data (`rules/0` — functor, name, effect, description,
- conditions, action, origin file) so the transcription can be diffed
- against the originals preserved in `docs/rules/logtalk-migration.adoc`.
+ These fifteen rules were first written as prevention-rule records in
+ the `.audittraining/security-errors/*.adoc` incident reports
+ (2025-12-29); each record's `origin` names its report. This module is
+ now their only home: `rules/0` keeps each record verbatim as data
+ (source functor and name, effect, description, conditions, action,
+ origin file), and `docs/rules/security-rule-provenance.adoc` records
+ how each one was operationalised.
Every rule names its canonical Elixir equivalent. Where the estate
already had a live checker (workflow permissions, unpinned actions,
@@ -23,7 +24,7 @@ defmodule Hypatia.Rules.AuditPrevention do
Two operationalisations are recorded here rather than hidden:
- * The Logtalk records carry an effect and an action but no severity.
+ * The source records carry an effect and an action but no severity.
Findings therefore derive severity from the action
(`block_merge_with_escalation` is `:critical`; other `block_*`
actions are `:high`; `warn_*`/`alert_*` are `:medium`;
@@ -38,8 +39,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP001",
rule: "parser_input_limits",
- logtalk_functor: "parser_rule",
- logtalk_name: "input_limits",
+ source_functor: "parser_rule",
+ source_name: "input_limits",
effect: :preventive,
description: "Config parsers must have input size limits",
conditions: [
@@ -53,8 +54,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP002",
rule: "wasm_memory_limits",
- logtalk_functor: "wasm_rule",
- logtalk_name: "memory_limits",
+ source_functor: "wasm_rule",
+ source_name: "memory_limits",
effect: :preventive,
description: "WASM crates must limit memory allocation",
conditions: [
@@ -68,8 +69,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP003",
rule: "rust_missing_audit",
- logtalk_functor: "rust_rule",
- logtalk_name: "missing_audit",
+ source_functor: "rust_rule",
+ source_name: "missing_audit",
effect: :preventive,
description: "Rust repos must run cargo audit in CI",
conditions: [
@@ -83,8 +84,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP004",
rule: "rust_workspace_vuln",
- logtalk_functor: "rust_rule",
- logtalk_name: "workspace_vuln",
+ source_functor: "rust_rule",
+ source_name: "workspace_vuln",
effect: :curative,
description: "Check all workspace members for vulnerabilities",
conditions: [
@@ -99,8 +100,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP005",
rule: "project_missing_ci_tests",
- logtalk_functor: "project_rule",
- logtalk_name: "missing_ci_tests",
+ source_functor: "project_rule",
+ source_name: "missing_ci_tests",
effect: :preventive,
description: "Repos must have automated test workflow",
conditions: [
@@ -114,8 +115,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP006",
rule: "project_missing_sast",
- logtalk_functor: "project_rule",
- logtalk_name: "missing_sast",
+ source_functor: "project_rule",
+ source_name: "missing_sast",
effect: :preventive,
description: "Multi-language repos must have SAST configured",
conditions: [
@@ -129,8 +130,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP007",
rule: "security_property_injection",
- logtalk_functor: "security_rule",
- logtalk_name: "property_injection",
+ source_functor: "security_rule",
+ source_name: "property_injection",
effect: :preventive,
description: "Reject dynamic property access without validation",
conditions: [
@@ -145,8 +146,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP008",
rule: "code_quality_unused_vars",
- logtalk_functor: "code_quality_rule",
- logtalk_name: "unused_vars",
+ source_functor: "code_quality_rule",
+ source_name: "unused_vars",
effect: :curative,
description: "Flag files with unused variables for cleanup",
conditions: [
@@ -160,8 +161,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP009",
rule: "crypto_enhanced_review",
- logtalk_functor: "crypto_rule",
- logtalk_name: "enhanced_review",
+ source_functor: "crypto_rule",
+ source_name: "enhanced_review",
effect: :preventive,
description: "Crypto repos require 2+ reviewers",
conditions: [
@@ -175,8 +176,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP010",
rule: "crypto_require_fuzzing",
- logtalk_functor: "crypto_rule",
- logtalk_name: "require_fuzzing",
+ source_functor: "crypto_rule",
+ source_name: "require_fuzzing",
effect: :preventive,
description: "Crypto repos must have fuzz targets",
conditions: [
@@ -190,8 +191,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP011",
rule: "crypto_no_panic",
- logtalk_functor: "crypto_rule",
- logtalk_name: "no_panic",
+ source_functor: "crypto_rule",
+ source_name: "no_panic",
effect: :preventive,
description: "Crypto code must not panic",
conditions: [
@@ -206,8 +207,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP012",
rule: "meta_rsr_self_compliance",
- logtalk_functor: "meta_rule",
- logtalk_name: "rsr_self_compliance",
+ source_functor: "meta_rule",
+ source_name: "rsr_self_compliance",
effect: :preventive,
description: "RSR tooling repos must pass all RSR checks",
conditions: [
@@ -222,8 +223,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP013",
rule: "template_exemplary_standards",
- logtalk_functor: "template_rule",
- logtalk_name: "exemplary_standards",
+ source_functor: "template_rule",
+ source_name: "exemplary_standards",
effect: :diagnostic,
description: "Template/tooling repos should exceed normal standards",
conditions: [
@@ -237,8 +238,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP014",
rule: "workflow_missing_permissions",
- logtalk_functor: "workflow_rule",
- logtalk_name: "missing_permissions",
+ source_functor: "workflow_rule",
+ source_name: "missing_permissions",
effect: :preventive,
description: "Reject workflows without permissions declaration",
conditions: [
@@ -253,8 +254,8 @@ defmodule Hypatia.Rules.AuditPrevention do
%{
id: "AP015",
rule: "workflow_unpinned_action",
- logtalk_functor: "workflow_rule",
- logtalk_name: "unpinned_action",
+ source_functor: "workflow_rule",
+ source_name: "unpinned_action",
effect: :preventive,
description: "Reject workflows with unpinned actions",
conditions: [
@@ -264,7 +265,7 @@ defmodule Hypatia.Rules.AuditPrevention do
action: "block_merge",
origin: ".audittraining/security-errors/ubicity.adoc",
canonical:
- "Hypatia.Rules.WorkflowHardening.wh004_unpinned_uses/1 and Hypatia.Rules.WorkflowAudit.check_unpinned_actions/1 (the Logtalk second condition is superseded: a trailing \"# vN\" comment beside a tag ref is not a pin; the Elixir checks require the 40-hex SHA form)"
+ "Hypatia.Rules.WorkflowHardening.wh004_unpinned_uses/1 and Hypatia.Rules.WorkflowAudit.check_unpinned_actions/1 (the source rule's second condition is superseded: a trailing \"# vN\" comment beside a tag ref is not a pin; the Elixir checks require the 40-hex SHA form)"
}
]
@@ -300,7 +301,7 @@ defmodule Hypatia.Rules.AuditPrevention do
`crate_type(parser)` is operationalised as a `Cargo.toml` that
describes the crate with parse/parser/parsing; the negative condition
- keeps the Logtalk pattern verbatim (`MAX.*SIZE|size.*limit`,
+ keeps the source pattern verbatim (`MAX.*SIZE|size.*limit`,
case-insensitive) over every supplied file content.
"""
def check_parser_input_limits(contents) when is_map(contents) do
@@ -325,7 +326,7 @@ defmodule Hypatia.Rules.AuditPrevention do
`feature("wasm")` is operationalised as a `wasm` entry in the
`[features]` table, a `wasm-bindgen` dependency, or a `wasm32`
target mention in `Cargo.toml`; the negative condition keeps the
- Logtalk pattern verbatim (`memory.*limit|max.*alloc`).
+ source pattern verbatim (`memory.*limit|max.*alloc`).
"""
def check_wasm_memory_limits(contents) when is_map(contents) do
cargo = Map.get(contents, "Cargo.toml", "")
@@ -390,9 +391,9 @@ defmodule Hypatia.Rules.AuditPrevention do
end
@doc """
- AP005 — source code with no test workflow. The Logtalk glob
+ AP005 — source code with no test workflow. The source glob
(`.github/workflows/*test*.yml`) is transcribed semantically: the
- `.yaml` spelling counts too. The ledger records the literal glob.
+ `.yaml` spelling counts too. `rules/0` keeps the literal glob.
"""
def check_missing_ci_tests(files) when is_list(files) do
test_workflow? =
@@ -410,7 +411,7 @@ defmodule Hypatia.Rules.AuditPrevention do
end
@doc """
- AP006 — a multi-language repo with no CodeQL workflow. The Logtalk
+ AP006 — a multi-language repo with no CodeQL workflow. The source
file test is transcribed semantically: `codeql.yaml` counts too.
"""
def check_missing_sast(files, language_count) when is_list(files) do
@@ -428,7 +429,7 @@ defmodule Hypatia.Rules.AuditPrevention do
@doc """
AP007 — dynamic property access from request input with no allowlist
- nearby (same file). Both Logtalk access patterns must match and the
+ nearby (same file). Both source access patterns must match and the
allowlist pattern (`allowedProps|whitelist|ALLOWED`) must not.
"""
def check_property_injection(content) when is_binary(content) do
diff --git a/lib/rules/cicd_rules.ex b/lib/rules/cicd_rules.ex
index 3c626182..8c784d3b 100644
--- a/lib/rules/cicd_rules.ex
+++ b/lib/rules/cicd_rules.ex
@@ -2,7 +2,7 @@
defmodule Hypatia.Rules.CicdRules do
@moduledoc """
- Primary Elixir CI/CD policy rules (migrated from legacy Logtalk engine).
+ Primary Elixir CI/CD policy rules.
Defines repository must-have rules, commit blocking conditions,
auto-fix capabilities, CI/CD waste detection, and license validation.
diff --git a/lib/rules/code_safety.ex b/lib/rules/code_safety.ex
index acb81835..4492d032 100644
--- a/lib/rules/code_safety.ex
+++ b/lib/rules/code_safety.ex
@@ -2,7 +2,7 @@
defmodule Hypatia.Rules.CodeSafety do
@moduledoc """
- Primary Elixir rules for code safety (migrated from legacy Logtalk engine).
+ Primary Elixir rules for code safety.
Detects dangerous patterns in Rust, ReScript, BEAM, and container code.
"""
diff --git a/lib/rules/forge_adapters.ex b/lib/rules/forge_adapters.ex
index 1d00dc0c..a3e1e4a2 100644
--- a/lib/rules/forge_adapters.ex
+++ b/lib/rules/forge_adapters.ex
@@ -2,7 +2,7 @@
defmodule Hypatia.Rules.ForgeAdapters do
@moduledoc """
- Primary Elixir forge adapter rules (migrated from legacy Logtalk engine).
+ Primary Elixir forge adapter rules.
Provides validated operations against multiple forges (GitHub, GitLab, Bitbucket).
Enforces input validation to prevent shell injection.
"""
diff --git a/lib/rules/learning.ex b/lib/rules/learning.ex
index bff5ee4a..9c45eb3c 100644
--- a/lib/rules/learning.ex
+++ b/lib/rules/learning.ex
@@ -2,8 +2,7 @@
defmodule Hypatia.Rules.Learning do
@moduledoc """
- Learning engine rules absorbed from the retired Logtalk learning and
- rule-distiller modules (see docs/rules/logtalk-migration.adoc).
+ Learning engine rules.
Tracks fix outcomes, adjusts confidence, promotes patterns to rules,
and manages cross-repo learning.
diff --git a/lib/rules/migration_rules.ex b/lib/rules/migration_rules.ex
index b0f5de37..0bc78270 100644
--- a/lib/rules/migration_rules.ex
+++ b/lib/rules/migration_rules.ex
@@ -2,7 +2,7 @@
defmodule Hypatia.Rules.MigrationRules do
@moduledoc """
- Primary Elixir ReScript migration rules (migrated from legacy Logtalk engine).
+ Primary Elixir ReScript migration rules.
Tracks deprecated API usage, migration readiness, and merge conflict resolution.
"""
diff --git a/lib/rules/rules.ex b/lib/rules/rules.ex
index 13eb8344..c9a8c48c 100644
--- a/lib/rules/rules.ex
+++ b/lib/rules/rules.ex
@@ -2,22 +2,20 @@
defmodule Hypatia.Rules do
@moduledoc """
- Facade module for all Hypatia rules, absorbed from the Logtalk engine.
+ Facade module for all Hypatia rules.
- This replaces the need for Logtalk rule evaluation by providing
- all policy rules, security checks, and learning operations directly
- in Elixir. The canonical active rule system is this directory
- (`lib/rules/*.ex`); there is no `engine/` tree and no Logtalk output
- format. The original Logtalk declarations are preserved —
- clause-by-clause, with every divergence — in
- `docs/rules/logtalk-migration.adoc`.
+ Provides all policy rules, security checks, and learning operations
+ directly in Elixir. The canonical active rule system is this directory
+ (`lib/rules/*.ex`). Where a rule was transcribed from an external
+ source of record, the source and every divergence are recorded in
+ `docs/rules/security-rule-provenance.adoc`.
## Submodules
- `SecurityErrors` -- Error categories, SHA pins, secret detection, CodeQL, CWE mappings, alert validation
- `CicdRules` -- Repo requirements, commit blocking, waste detection, license validation
- `CodeSafety` -- Language-specific dangerous pattern detection
- - `AuditPrevention` -- AP001–AP015 audit-training prevention rules transcribed from Logtalk
+ - `AuditPrevention` -- AP001–AP015 audit-training prevention rules
- `MigrationRules` -- ReScript v12→v13 migration, merge conflict resolution
- `Learning` -- Fix outcome tracking, confidence, pattern promotion (GenServer)
- `ForgeAdapters` -- Multi-forge operations with input validation
diff --git a/lib/rules/security_errors.ex b/lib/rules/security_errors.ex
index 83b86ef8..24e3b252 100644
--- a/lib/rules/security_errors.ex
+++ b/lib/rules/security_errors.ex
@@ -2,7 +2,7 @@
defmodule Hypatia.Rules.SecurityErrors do
@moduledoc """
- Primary Elixir security error database (migrated from legacy Logtalk engine).
+ Primary Elixir security error database.
Defines error categories, severity levels, prevention mechanisms,
SHA pin database, CodeQL language support, and secret detection patterns.
@@ -88,7 +88,7 @@ defmodule Hypatia.Rules.SecurityErrors do
# Issue Severity Classification
# ---------------------------------------------------------------------------
#
- # Provenance: transcribed from ECHIDNA `rules/security_learning.lgt`
+ # Provenance: transcribed from the ECHIDNA security-learning rule table's
# `classify_severity/2` (explicit critical/high/medium membership lists
# plus a `low` catch-all), itself derived from
# `.audittraining/ERROR-CATALOG.scm`. The catch-all members are spelled
@@ -97,9 +97,9 @@ defmodule Hypatia.Rules.SecurityErrors do
# unused-local-variable) so they do not fall through to this module's
# `:info` unknown-id default; ERROR-CATALOG.scm grades
# fuzzing/sast/ci-tests `medium` instead — that upstream disagreement
- # is recorded in docs/rules/logtalk-migration.adoc and deliberately
- # not resolved here, because every executable consumer since the
- # Logtalk module has used the `low` grading.
+ # is recorded in docs/rules/security-rule-provenance.adoc and
+ # deliberately not resolved here, because every executable consumer
+ # of the source table has used the `low` grading.
@issue_severity %{
"hard-coded-cryptographic-value" => :critical,
@@ -301,7 +301,7 @@ defmodule Hypatia.Rules.SecurityErrors do
#
# Canonical alert-type -> category mapping and the composed
# `validate_alert/1` query. Faithfully transcribed 2026-11-01 from
- # ECHIDNA `rules/security_learning.lgt`:
+ # the ECHIDNA security-learning rule table (the source of record):
#
# * `alert_category/2` (18 facts) -> @alert_categories
# * `classify_severity/2` -> `issue_severity/1` (above)
@@ -310,30 +310,32 @@ defmodule Hypatia.Rules.SecurityErrors do
# * `get_prevention_workflow/2` -> @prevention_workflows (above)
# * `cicd_integration::validate_alert/2` -> `validate_alert/1` (below)
#
- # The Logtalk module derived its facts from
+ # The source table derived its facts from
# `.audittraining/ERROR-CATALOG.scm`; where the two disagree this
# module keeps the values every executable consumer has used since
- # (the Logtalk facts / earlier Elixir transcription) and records the
- # disagreement in the migration ledger rather than changing live
- # behaviour as a side effect of transcription:
+ # (the source facts / earlier Elixir transcription) and records the
+ # disagreement in docs/rules/security-rule-provenance.adoc rather than
+ # changing live behaviour as a side effect of transcription:
#
# * ERROR-CATALOG.scm splits the `:missing_tests` group into
# missing-fuzzing / missing-sast / missing-tests; the six-group
- # form below is canonical because the Logtalk module and
+ # form below is canonical because the source table and
# `Mix.Tasks.Hypatia.BatchSecurityScan` -- the two executable
# consumers -- both used it.
# * `BranchProtectionID` prevention was `branch-protection-enforcer.yml`
- # in Logtalk; the Elixir mapping has used `scorecard-enforcer.yml`
+ # in the source table; the Elixir mapping has used `scorecard-enforcer.yml`
# (jointly with SecurityPolicyID/CodeReviewID) since the first
# transcription and stays canonical. Both workflow templates
# still exist under `.audittraining/prevention/`.
# * `TokenPermissionsID` / `missing-workflow-permissions` fix text
- # prescribed `permissions: read-all` in Logtalk. That advice is
+ # prescribed `permissions: read-all` in the source table. That advice is
# superseded ON PURPOSE: current OSSF guidance flags `read-all`
# itself, so the granular-permissions text in @fix_suggestions
# is canonical (see scorecard_compliance/token_permissions).
#
- # Full clause-by-clause ledger: docs/rules/logtalk-migration.adoc.
+ # Full clause-by-clause record: docs/rules/security-rule-provenance.adoc.
+ # The table correspondence is checked in
+ # verification/proofs/agda/AlertTableCorrespondence.agda.
@alert_categories %{
"TokenPermissionsID" => :workflow_security,
@@ -359,7 +361,7 @@ defmodule Hypatia.Rules.SecurityErrors do
@doc """
All canonical alert-type -> category mappings (the transcribed
ECHIDNA `alert_category/2` facts). Categories are atoms in the
- snake-case spelling the Logtalk module used; ERROR-CATALOG.scm's
+ snake-case spelling the source table used; ERROR-CATALOG.scm's
kebab-case type names map to them by hyphen -> underscore.
"""
def alert_categories, do: @alert_categories
@@ -376,9 +378,9 @@ defmodule Hypatia.Rules.SecurityErrors do
Faithful transcription of ECHIDNA `cicd_integration::validate_alert/2`,
which composed `classify_severity/2`, `suggest_fix/2` and
`is_auto_fixable/1` into `alert_validation(Type, Severity, Fix,
- AutoFix)`. The category and prevention-workflow lookups the Logtalk
+ AutoFix)`. The category and prevention-workflow lookups the source
caller performed separately are folded in, so this one map is the
- complete replacement surface for `security_learning.lgt` consumers:
+ complete replacement surface for consumers of the source table:
%{
alert_type: "TokenPermissionsID",
@@ -389,14 +391,14 @@ defmodule Hypatia.Rules.SecurityErrors do
prevention_workflow: "workflow-linter.yml"
}
- This is deliberately a total-function extension of the Logtalk query:
- Logtalk `validate_alert/2` fails outright for an alert type with no
+ This is deliberately a total-function extension of the source query:
+ the source `validate_alert/2` fails outright for an alert type with no
`suggest_fix/2` clause, whereas this returns the map with `fix: nil`
(and `category`/`prevention_workflow` `nil`, `auto_fixable` `false`
when those facts are absent too). One further documented difference:
- the Logtalk severity catch-all returned `low` for wholly unknown
+ the source severity catch-all returned `low` for wholly unknown
types, where `issue_severity/1`'s long-standing unknown-id default
- is `:info`. Every alert type the Logtalk module knew is now an
+ is `:info`. Every alert type the source table knew is now an
explicit entry above, so the difference is reachable only for ids
neither system has seen.
"""
@@ -670,14 +672,6 @@ defmodule Hypatia.Rules.SecurityErrors do
# estate policy refresh — migration target is AffineScript directly,
# not through ReScript). affinescript ADDED. typescript replacement
# corrected from "rescript" → "affinescript".
- #
- # Policy refresh 2026-11-01: logtalk REMOVED from allowed and added
- # to banned (replacement: elixir). Logtalk appears nowhere in the
- # estate LANGUAGE-POLICY allowlist; Hypatia's rule engine has been
- # pure Elixir since ADR-001 (2026-04-14), and the estate carries no
- # active `.lgt` sources. New Logtalk in a scanned repo is drift to
- # migrate to `lib/rules/*.ex`-style Elixir, not an approved choice.
- # See docs/rules/logtalk-migration.adoc.
@allowed_languages MapSet.new([
"affinescript",
"affine",
diff --git a/poc-scanner.sh b/poc-scanner.sh
index 94e7d26f..c4028727 100755
--- a/poc-scanner.sh
+++ b/poc-scanner.sh
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0
# Proof-of-concept scanner implementing hypatia rules in bash+ripgrep
# Demonstrates the patterns work standalone (predates the Elixir ruleset
-# that absorbed the Logtalk engine, retired 2026-03-06)
+# in lib/rules/)
set -euo pipefail
@@ -11,7 +11,7 @@ ISSUE_COUNT=0
echo "=== Hypatia POC Scanner ==="
echo "Target: $TARGET_REPO"
-echo "Scanning for security patterns from code-safety-lessons.lgt"
+echo "Scanning for security patterns from lib/rules/code_safety.ex"
echo ""
# Color codes
@@ -242,9 +242,9 @@ else
echo -e "${RED}✗ Security issues require attention${NC}"
echo ""
echo "These patterns map to hypatia rules:"
- echo " - code-safety-lessons.lgt: has_unsafe_crash, has_unsafe_panic"
- echo " - code-safety-lessons.lgt: has_cors_misconfiguration"
- echo " - code-safety-lessons.lgt: has_auth_bypass, has_privilege_escalation"
+ echo " - unsafe crash / panic patterns (lib/rules/code_safety.ex)"
+ echo " - CORS misconfiguration (lib/rules/code_safety.ex)"
+ echo " - auth bypass / privilege escalation (lib/rules/code_safety.ex)"
echo ""
echo "Run the hypatia CLI for detailed analysis and fix suggestions."
exit 1
diff --git a/schemas/learned-security-rules.schema.json b/schemas/learned-security-rules.schema.json
index dc8fbd4b..ba0c5079 100644
--- a/schemas/learned-security-rules.schema.json
+++ b/schemas/learned-security-rules.schema.json
@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://hyperpolymath.dev/schemas/hypatia/learned-security-rules",
"title": "Hypatia Learned Security Rules",
- "description": "Named-field JSON replacement for two retired, mutually incompatible Logtalk security_rule/4 exports: Hypatia's generated (Type, Category, AutoFix, Count) and ECHIDNA's (Type, Category, Severity, AutoFix). Produced by `mix hypatia.batch_security_scan`; semantics are Hypatia.Rules.SecurityErrors.validate_alert/1 plus the observation count. See docs/rules/logtalk-migration.adoc for the field-by-field mapping.",
+ "description": "Named-field JSON export of learned security rules, one entry per alert type. Produced by `mix hypatia.batch_security_scan`; semantics are Hypatia.Rules.SecurityErrors.validate_alert/1 plus the observation count. See docs/rules/security-rule-provenance.adoc for the field-by-field mapping.",
"type": "object",
"additionalProperties": false,
"required": ["schema", "version", "generated_at", "generator", "source_alert_count", "rules"],
@@ -46,34 +46,34 @@
"alert_type": {
"type": "string",
"minLength": 1,
- "description": "GitHub code-scanning / Scorecard alert id (first positional field in both retired Logtalk exports)"
+ "description": "GitHub code-scanning / Scorecard alert id"
},
"category": {
"type": "string",
"enum": ["workflow_security", "code_security", "code_quality", "dependency_vuln", "process_hygiene", "missing_tests", "unknown"],
- "description": "Canonical alert category (second positional field in both retired exports; snake-case as in the retired ECHIDNA module). ERROR-CATALOG.scm kebab-case names map by hyphen to underscore."
+ "description": "Canonical alert category (snake-case as in the ECHIDNA security-learning source of record). ERROR-CATALOG.scm kebab-case names map by hyphen to underscore."
},
"severity": {
"type": "string",
"enum": ["critical", "high", "medium", "low", "info"],
- "description": "Classified severity (ECHIDNA export field 3 / Logtalk classify_severity/2; absent from Hypatia's old generator. Canonical source SecurityErrors.issue_severity/1)"
+ "description": "Classified severity (source classify_severity/2; canonical source SecurityErrors.issue_severity/1)"
},
"auto_fixable": {
"type": "boolean",
- "description": "Whether an automated fix exists (Hypatia generator field 3, ECHIDNA export field 4; Logtalk is_auto_fixable/1)"
+ "description": "Whether an automated fix exists (source is_auto_fixable/1; canonical source SecurityErrors.auto_fixable?/1)"
},
"observations": {
"type": "integer",
"minimum": 1,
- "description": "Alerts of this type seen in the source scan (Hypatia generator field 4; absent from ECHIDNA's export). An observation count is belief-formation evidence, never a soundness claim: see schema/findings.ncl and src/Hypatia/ABI/Verdict.idr."
+ "description": "Alerts of this type seen in the source scan. An observation count is belief-formation evidence, never a soundness claim: see schema/findings.ncl and src/Hypatia/ABI/Verdict.idr."
},
"fix": {
"type": ["string", "null"],
- "description": "Suggested fix text (Logtalk suggest_fix/2), or null when none is recorded"
+ "description": "Suggested fix text (source suggest_fix/2; canonical source SecurityErrors.fix_suggestion/1), or null when none is recorded"
},
"prevention_workflow": {
"type": ["string", "null"],
- "description": "Prevention workflow template name (Logtalk get_prevention_workflow/2), or null when none is recorded"
+ "description": "Prevention workflow template name (source get_prevention_workflow/2; canonical source SecurityErrors.prevention_workflow/1), or null when none is recorded"
}
}
}
diff --git a/scripts/check-no-active-logtalk.sh b/scripts/check-no-active-logtalk.sh
deleted file mode 100755
index bcd7ff2d..00000000
--- a/scripts/check-no-active-logtalk.sh
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: MPL-2.0
-# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)
-#
-# check-no-active-logtalk.sh — keep Logtalk retired (ADR-001, 2026-04-14).
-#
-# Hypatia's canonical rule system is pure Elixir (lib/rules/*.ex); there
-# is no Logtalk loader, rule format, or report format. This guard fails
-# if an *active* Logtalk form re-enters the tracked tree:
-#
-# 1. a *.lgt / *.logtalk source file;
-# 2. an embedded Logtalk source block or object directive, a
-# logtalk_load/tester/doclet invocation;
-# 3. a configuration setting requesting Logtalk (report-format /
-# format / --format, A2ML or DEED spelling, loader/output paths
-# ending in .lgt);
-# 4. in executable/config files, a non-comment .lgt reference or a
-# generated security_rule(...) fact.
-#
-# Historical *prose* about Logtalk is not banned; the ledger, dated
-# audits, and provenance notes are records, not settings. Files that
-# must quote an active-looking form to document its retirement are
-# exempted by exact path in .logtalk-allowlist (shrink-only, each with
-# a classification and removal condition). Comment-only lines are not
-# settings and are ignored.
-#
-# Usage: scripts/check-no-active-logtalk.sh [--all]
-# default: tracked files (git ls-files)
-# --all: also untracked, non-ignored files (local pre-commit use)
-# Exit: 0 clean; 1 = active Logtalk form or stale/malformed allowlist;
-# 2 = usage / IO error.
-
-set -uo pipefail
-
-ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || {
- echo "::error::check-no-active-logtalk: not inside a git repository" >&2
- exit 2
-}
-cd "$ROOT" || exit 2
-
-ALLOWLIST=".logtalk-allowlist"
-SELF="scripts/check-no-active-logtalk.sh"
-
-mode="tracked"
-case "${1:-}" in
- "") ;;
- --all) mode="all" ;;
- *) echo "usage: $0 [--all]" >&2; exit 2 ;;
-esac
-if (( $# > 1 )); then
- echo "usage: $0 [--all]" >&2
- exit 2
-fi
-
-[[ -f $ALLOWLIST ]] || {
- echo "::error::check-no-active-logtalk: $ALLOWLIST not found" >&2
- exit 2
-}
-
-# ---------------------------------------------------------------------------
-# Guarded forms.
-# ---------------------------------------------------------------------------
-active_re='\[source,logtalk\]|:-[[:space:]]*(object|end_object|protocol|category)[[:space:]]*\(|logtalk_load[[:space:]]*\(|logtalk_(tester|doclet)|report-format[[:space:]]*=[[:space:]]*["'"'"']?logtalk|:report-format[[:space:]]+"logtalk"|(report[-_]?format|format)[[:space:]]*:[[:space:]]*["'"'"']?logtalk|--format([[:space:]]+|=)logtalk|^[[:space:]]*(loader|output_path|output|path|file|rules?)[[:space:]]*[:=].*\.lgt'
-codegen_re='\.lgt(["'"'"'[:space:],)\]]|$)|security_rule[[:space:]]*\('
-
-is_comment_line() {
- local input_line="$1" trimmed
- trimmed="$(printf '%s' "$input_line" | sed 's/^[[:space:]]*//')"
- case "$trimmed" in
- '#'*) return 0 ;;
- ';'*) return 0 ;;
- '//'*) return 0 ;;
- '--'*) return 0 ;;
- '%'*) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-is_codegen_file() {
- local candidate_path="$1"
- case "$candidate_path" in
- *.ex|*.exs|*.sh|*.bash|*.yml|*.yaml|*.toml|*.json|*.ncl|*.a2ml|\
- *.deed|*.contractile|*.rs|*.py|*.js|*.ts|*.jl|*.hs|*.erl|*.gleam|\
- *.zig|*.idr|*.agda) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-# has_candidate : raw (comment-inclusive) presence of a guarded
-# form — used only to detect allowlist entries that have gone stale.
-has_candidate() {
- local candidate_file="$1"
- grep -IqiE -- "$active_re" "$candidate_file" 2>/dev/null && return 0
- if is_codegen_file "$candidate_file"; then
- grep -IqiE -- "$codegen_re" "$candidate_file" 2>/dev/null && return 0
- fi
- return 1
-}
-
-# ---------------------------------------------------------------------------
-# Parse + validate the allowlist.
-# ---------------------------------------------------------------------------
-declare -A allowed=()
-failures=0
-ln=0
-while IFS= read -r line || [[ -n $line ]]; do
- ln=$((ln + 1))
- case "$line" in
- ''|'#'*) continue ;;
- *) ;;
- esac
- IFS='|' read -r path class removal extra <<<"$line"
- path="$(printf '%s' "$path" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
- class="$(printf '%s' "${class:-}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
- removal="$(printf '%s' "${removal:-}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
- if [[ -n ${extra:-} || -z $path || -z $class || -z $removal ]]; then
- echo "::error::$ALLOWLIST:$ln: expected ' | | '"
- failures=$((failures + 1)); continue
- fi
- case "$path" in
- *'*'*|*'?'*|*'['*|*']'*|'/'*|*'..'*|*'/')
- echo "::error::$ALLOWLIST:$ln: '$path' is not an exact repository-relative file path (no wildcards, no directories)"
- failures=$((failures + 1)); continue ;;
- *) ;;
- esac
- if [[ -n ${allowed[$path]:-} ]]; then
- echo "::error::$ALLOWLIST:$ln: duplicate entry for '$path'"
- failures=$((failures + 1)); continue
- fi
- allowed["$path"]=1
- if [[ ! -f $path ]]; then
- echo "::error::$ALLOWLIST:$ln: allowlisted path no longer exists: $path (shrink the list)"
- failures=$((failures + 1)); continue
- fi
- case "$path" in
- *.lgt|*.logtalk) ;;
- *)
- if ! has_candidate "$path"; then
- echo "::error::$ALLOWLIST:$ln: stale exemption — $path no longer contains a guarded form (shrink the list)"
- failures=$((failures + 1))
- fi ;;
- esac
-done <"$ALLOWLIST"
-
-# ---------------------------------------------------------------------------
-# Scan.
-# ---------------------------------------------------------------------------
-if [[ $mode == "all" ]]; then
- mapfile -d '' files < <(git ls-files --cached --others --exclude-standard -z)
-else
- mapfile -d '' files < <(git ls-files -z)
-fi
-
-checked=0
-for f in "${files[@]}"; do
- [[ -n $f ]] || continue
- [[ -f $f ]] || continue
- checked=$((checked + 1))
-
- lower="$(printf '%s' "$f" | tr '[:upper:]' '[:lower:]')"
- case "$lower" in
- *.lgt|*.logtalk)
- if [[ -z ${allowed[$f]:-} ]]; then
- echo "::error::$f: active Logtalk source file (Hypatia rules are Elixir in lib/rules/*.ex; see docs/rules/logtalk-migration.adoc)"
- failures=$((failures + 1))
- fi
- continue ;;
- *) ;;
- esac
-
- [[ $f == "$ALLOWLIST" ]] && continue
- [[ -n ${allowed[$f]:-} ]] && continue
-
- patterns="$active_re"
- if is_codegen_file "$f"; then
- patterns="$active_re|$codegen_re"
- fi
-
- while IFS= read -r hit; do
- [[ -n $hit ]] || continue
- lineno="${hit%%:*}"
- text="${hit#*:}"
- is_comment_line "$text" && continue
- echo "::error::$f:$lineno: active Logtalk form (retired; canonical replacement is Elixir + JSON — see docs/rules/logtalk-migration.adoc)"
- failures=$((failures + 1))
- done < <(grep -InE -- "$patterns" "$f" 2>/dev/null || true)
-done
-
-echo "check-no-active-logtalk: files checked ${checked}, allowlisted ${#allowed[@]}, violations ${failures}"
-if (( failures > 0 )); then
- echo "check-no-active-logtalk: FAIL"
- exit 1
-fi
-echo "check-no-active-logtalk: OK — no active Logtalk forms outside the exact-path allowlist"
-exit 0
diff --git a/test/batch_security_scan_category_test.exs b/test/batch_security_scan_category_test.exs
new file mode 100644
index 00000000..41d73a2e
--- /dev/null
+++ b/test/batch_security_scan_category_test.exs
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: MPL-2.0
+# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
+
+defmodule Mix.Tasks.Hypatia.BatchSecurityScanCategoryTest do
+ use ExUnit.Case, async: true
+
+ alias Hypatia.Rules.SecurityErrors
+ alias Mix.Tasks.Hypatia.BatchSecurityScan
+
+ defp exported(rule_id) do
+ BatchSecurityScan.category_string(SecurityErrors.validate_alert(rule_id).category, rule_id)
+ end
+
+ test "a canonical alert type exports its SecurityErrors category" do
+ assert exported("TokenPermissionsID") == "workflow_security"
+ end
+
+ test "an alert type outside the canonical table falls back to the task grouping, never \"nil\"" do
+ assert SecurityErrors.validate_alert("unused-import").category == nil
+ assert exported("unused-import") == "code_quality"
+ end
+
+ test "an alert type no grouping knows exports \"unknown\"" do
+ assert exported("no-such-alert") == "unknown"
+ end
+end
diff --git a/test/fixtures/deed/standards/UPSTREAM.adoc b/test/fixtures/deed/standards/UPSTREAM.adoc
index ce84a790..9c33cb16 100644
--- a/test/fixtures/deed/standards/UPSTREAM.adoc
+++ b/test/fixtures/deed/standards/UPSTREAM.adoc
@@ -3,7 +3,7 @@
Copied verbatim, SPDX headers intact, from `metadatastician/standards`
`1-formats/deed/tools/fixtures/` at commit
-`b2aaeb0c142de45ca1ed6e7b29f548c979737f54` (main, 2026-11-14), where
+`830b0d3758370b7496b83f61e6ec90d9e31080ec` (main, 2026-11-16), where
`deed.abnf` is v2.0.0:
[cols="1,3"]
diff --git a/test/fixtures/deed/standards/heads/invalid/_praxis.deed b/test/fixtures/deed/standards/heads/invalid/_praxis.deed
new file mode 100644
index 00000000..ff17a1f1
--- /dev/null
+++ b/test/fixtures/deed/standards/heads/invalid/_praxis.deed
@@ -0,0 +1,3 @@
+;; SPDX-License-Identifier: MPL-2.0
+; deed.abnf stem fixture: empty stem: praxis-file needs 1*stem before _praxis.deed
+(praxis-deed :schema-version "1.0.0")
diff --git a/test/fixtures/deed/standards/heads/invalid/a+b_praxis.deed b/test/fixtures/deed/standards/heads/invalid/a+b_praxis.deed
new file mode 100644
index 00000000..ba9390a9
--- /dev/null
+++ b/test/fixtures/deed/standards/heads/invalid/a+b_praxis.deed
@@ -0,0 +1,3 @@
+;; SPDX-License-Identifier: MPL-2.0
+; deed.abnf stem fixture: "+" is not a stem character
+(praxis-deed :schema-version "1.0.0")
diff --git a/test/fixtures/deed/standards/heads/valid/my.tool-v2_praxis.deed b/test/fixtures/deed/standards/heads/valid/my.tool-v2_praxis.deed
new file mode 100644
index 00000000..a712b81f
--- /dev/null
+++ b/test/fixtures/deed/standards/heads/valid/my.tool-v2_praxis.deed
@@ -0,0 +1,3 @@
+;; SPDX-License-Identifier: MPL-2.0
+; deed.abnf stem fixture: a praxis stem may hold letters, digits, "-", "." and "_"
+(praxis-deed :schema-version "1.0.0")
diff --git a/test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed b/test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed
index f7431073..06223878 100644
--- a/test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed
+++ b/test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed
@@ -107,7 +107,7 @@
:version "0.1.0" :last-updated "2026-04-11"
(hypatia :scan-enabled #t
:scan-depth standard
- :report-format "logtalk"))
+ :report-format "json"))
(playbook
:version "0.1.0" :last-updated "2026-04-11"
diff --git a/test/fixtures/deed_egress/README.adoc b/test/fixtures/deed_egress/README.adoc
index dd17565c..25d262dd 100644
--- a/test/fixtures/deed_egress/README.adoc
+++ b/test/fixtures/deed_egress/README.adoc
@@ -3,8 +3,8 @@
Copied verbatim from `metadatastician/standards`: `valid/` and `invalid/` from
`1-formats/deed/tools/fixtures/egress/` (ADR-009), and `rsr-template-repo_chora.deed`
-from `fixtures/valid/` there, last re-copied at standards `b2aaeb0`
-(2026-11-14). `test/deed_test.exs`
+from `fixtures/valid/` there, last re-copied at standards `830b0d3`
+(2026-11-16). `test/deed_test.exs`
asserts that `Hypatia.Deed` accepts and rejects exactly what the standards
checker `deed_lint.js --egress` does. Re-copy them when that directory changes;
do not edit them here.
diff --git a/test/fixtures/deed_egress/rsr-template-repo_chora.deed b/test/fixtures/deed_egress/rsr-template-repo_chora.deed
index f7431073..06223878 100644
--- a/test/fixtures/deed_egress/rsr-template-repo_chora.deed
+++ b/test/fixtures/deed_egress/rsr-template-repo_chora.deed
@@ -107,7 +107,7 @@
:version "0.1.0" :last-updated "2026-04-11"
(hypatia :scan-enabled #t
:scan-depth standard
- :report-format "logtalk"))
+ :report-format "json"))
(playbook
:version "0.1.0" :last-updated "2026-04-11"
diff --git a/test/security_errors_test.exs b/test/security_errors_test.exs
index d829ef5d..219a37a0 100644
--- a/test/security_errors_test.exs
+++ b/test/security_errors_test.exs
@@ -137,7 +137,7 @@ defmodule Hypatia.Rules.SecurityErrorsTest do
assert SecurityErrors.alert_category("unused-import") == nil
end
- test "Logtalk severity catch-all members are explicit :low, not :info" do
+ test "source-table severity catch-all members are explicit :low, not :info" do
for alert_type <- ["SASTID", "CITestsID", "unmaintained", "FuzzingID"] do
assert SecurityErrors.issue_severity(alert_type) == :low
end
diff --git a/tests/proof-ledger-test.sh b/tests/proof-ledger-test.sh
index 09d9ddc2..ebb2deb1 100755
--- a/tests/proof-ledger-test.sh
+++ b/tests/proof-ledger-test.sh
@@ -64,10 +64,10 @@ expect "tested-only without bounds is refused" 1 env PROOF_LEDGER="$work/unbound
mutate open-graded '.pwg = "3"' pagerank-convergence
expect_msg "a PWG on an open theory row is refused" 1 "PWG-3 needs an Agda proof that is proven" env PROOF_LEDGER="$work/open-graded.jsonl" bash "$script" check
-mutate grade-without-leg '.pwg = "2i"' logtalk-migration
+mutate grade-without-leg '.pwg = "2i"' alert-table-correspondence
expect "PWG-2i with no counted recheck leg is refused" 1 env PROOF_LEDGER="$work/grade-without-leg.jsonl" bash "$script" check
-mutate weak-agda '.checker = "Agda 2.8.0.2, --safe"' logtalk-migration
+mutate weak-agda '.checker = "Agda 2.8.0.2, --safe"' alert-table-correspondence
expect "a PWG without the PROOF-POLICY 2.1 invocation is refused" 1 env PROOF_LEDGER="$work/weak-agda.jsonl" bash "$script" check
mutate engineering-grade '.pwg = "3"' abi-ffi
@@ -127,7 +127,7 @@ expect "derive: TLC bounds the run does not reproduce are refused" 1 bash "$scri
mutate under '.status = "open" | .lane = "idris2"' elixir-rules-support
expect "derive: an open row whose file checks is a stale underclaim" 1 env PROOF_LEDGER="$work/under.jsonl" bash "$script" derive "$lanes" "$all_pass"
-mutate pwg-up '.pwg = "2i" | .legs = []' logtalk-migration
+mutate pwg-up '.pwg = "2i" | .legs = []' alert-table-correspondence
expect "derive: a grade above PWG-3 with no counted leg is an overclaim" 1 env PROOF_LEDGER="$work/pwg-up.jsonl" bash "$script" derive "$lanes" "$all_pass"
expect "derive: no receipts file is a failure, never a pass" 1 bash "$script" derive "$lanes" "$work/no-such-receipts.jsonl"
@@ -157,25 +157,25 @@ expect_msg "a proven row with an empty checker is refused" 1 "are not empty" env
mutate control-char '.obligation += "\n|open"' abi-types
expect_msg "a control character in a field is refused" 1 "control character" env PROOF_LEDGER="$work/control-char.jsonl" bash "$script" check
-mutate number-leg '.legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven","receipt":1}]' logtalk-migration
+mutate number-leg '.legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven","receipt":1}]' alert-table-correspondence
expect_msg "a number anywhere in a row is refused (jq -cS is JCS only without numbers)" 1 "holds no numbers" env PROOF_LEDGER="$work/number-leg.jsonl" bash "$script" check
-mutate asserted-leg '.pwg = "1" | .legs = [{"counts":true}]' logtalk-migration
+mutate asserted-leg '.pwg = "1" | .legs = [{"counts":true}]' alert-table-correspondence
expect_msg "a leg that only asserts it counts is refused" 1 "unknown leg field(s) counts" env PROOF_LEDGER="$work/asserted-leg.jsonl" bash "$script" check
-mutate pending-leg '.pwg = "2i" | .legs = [{"axioms":[],"correspondence":"pending","prover":"rocq","route":"transported","status":"proven"}]' logtalk-migration
+mutate pending-leg '.pwg = "2i" | .legs = [{"axioms":[],"correspondence":"pending","prover":"rocq","route":"transported","status":"proven"}]' alert-table-correspondence
expect_msg "a leg whose statement is not reconciled does not count" 1 "the legs support PWG-3" env PROOF_LEDGER="$work/pending-leg.jsonl" bash "$script" check
-mutate counted-leg '.pwg = "2i" | .legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven"}]' logtalk-migration
+mutate counted-leg '.pwg = "2i" | .legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven"}]' alert-table-correspondence
expect "a reconciled, proven Rocq leg supports PWG-2i" 0 env PROOF_LEDGER="$work/counted-leg.jsonl" bash "$script" check
-mutate understated '.legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven"},{"axioms":[],"correspondence":"reconciled","prover":"lean","route":"re-proved","status":"proven"}]' logtalk-migration
+mutate understated '.legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven"},{"axioms":[],"correspondence":"reconciled","prover":"lean","route":"re-proved","status":"proven"}]' alert-table-correspondence
expect_msg "a grade below what the legs support is refused too (computed, not asserted)" 1 "the legs support PWG-2ii" env PROOF_LEDGER="$work/understated.jsonl" bash "$script" check
-mutate pwg-one '.pwg = "1" | .legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven"},{"axioms":[],"correspondence":"reconciled","prover":"lean","route":"re-proved","status":"proven"}]' logtalk-migration
+mutate pwg-one '.pwg = "1" | .legs = [{"axioms":[],"correspondence":"reconciled","prover":"rocq","route":"re-proved","status":"proven"},{"axioms":[],"correspondence":"reconciled","prover":"lean","route":"re-proved","status":"proven"}]' alert-table-correspondence
expect_msg "PWG-1 is refused while the ledger records no per-commit receipts" 1 "PWG-1 needs a current per-commit receipt" env PROOF_LEDGER="$work/pwg-one.jsonl" bash "$script" check
-mutate diverse-claim '.foundation_diverse = true' logtalk-migration
+mutate diverse-claim '.foundation_diverse = true' alert-table-correspondence
expect_msg "+foundation-diverse without a counted other-foundation leg is refused" 1 "foundation_diverse is true exactly when" env PROOF_LEDGER="$work/diverse-claim.jsonl" bash "$script" check
expect_msg "a missing PROOF-POLICY pin is refused (section 7)" 1 "pin is missing or malformed" env PROOF_POLICY_PIN="" bash "$script" check
diff --git a/verification/PROOF-STATUS.adoc b/verification/PROOF-STATUS.adoc
index e51b5902..8a922998 100644
--- a/verification/PROOF-STATUS.adoc
+++ b/verification/PROOF-STATUS.adoc
@@ -42,7 +42,7 @@ neurosymbolic CI/CD platform.
them their own rows.
NOTE: This repo verifies Idris2 and TLA+ artefacts in CI, and carries one
-narrowly scoped Agda artefact (`+LogtalkMigration.agda+`) gated by the same
+narrowly scoped Agda artefact (`+AlertTableCorrespondence.agda+`) gated by the same
workflow. It does not yet run an Agda + Rocq + Lean reconciliation pipeline.
The engineering proofs that were in Lean (rate limiting, Bayesian update, VCL
parser, PageRank and ESN preconditions) moved to Idris2 on 2026-11-09
@@ -288,17 +288,17 @@ Checked against PROOF-POLICY as pinned by `+metadatastician/standards 3-practice
|`+verification/proofs/tlaplus/KinGate.tla+`: `+KinGateSafe+`, `+MutualExclusionByType+`, `+MutualExclusionBotView+`, `+ViewCoherentWithLocks+`, `+NoOrphanView+`, `+GrantsAreWellBracketed+`, `+EveryRequestProcessed+`
|One bounded instance; the Elixir kin gate is not shown to follow the spec. Bounds: 3 bots x 2 repos, MaxRequests = 4: 444715 distinct states, depth 13, no error
-|The 18 transcribed alert types agree between security_learning.lgt and Hypatia.Rules.SecurityErrors on category, severity, auto-fixability and fix presence; prevention agrees except the two ledgered non-equalities
+|The 18 transcribed alert types agree between the source of record (the ECHIDNA security-learning rule table) and Hypatia.Rules.SecurityErrors on category, severity, auto-fixability and fix presence; prevention agrees for tokenPermissions, pinnedDependencies, missingWorkflowPerms, hardCodedCrypto, vulnerabilities and securityPolicy, and the source and target values are recorded for branchProtection and codeReview
|proven, PWG-3
|Agda 2.8.0.2, builtins only, --safe --without-K --cubical-compatible
-|`+verification/proofs/agda/LogtalkMigration.agda+`: `+categoriesAgree+`, `+severitiesAgree+`, `+autoFixableAgrees+`, `+fixPresenceAgrees+`, `+preventionAgreesToken+`, `+preventionAgreesPinned+`, `+preventionAgreesMissing+`, `+preventionAgreesHardCoded+`, `+preventionAgreesVulnerabilities+`, `+preventionAgreesSecurityPolicy+`, `+preventionBranchSource+`, `+preventionBranchTarget+`, `+preventionCodeReviewSource+`, `+preventionCodeReviewTarget+`
+|`+verification/proofs/agda/AlertTableCorrespondence.agda+`: `+categoriesAgree+`, `+severitiesAgree+`, `+autoFixableAgrees+`, `+fixPresenceAgrees+`, `+preventionAgreesToken+`, `+preventionAgreesPinned+`, `+preventionAgreesMissing+`, `+preventionAgreesHardCoded+`, `+preventionAgreesVulnerabilities+`, `+preventionAgreesSecurityPolicy+`, `+preventionBranchSource+`, `+preventionBranchTarget+`, `+preventionCodeReviewSource+`, `+preventionCodeReviewTarget+`
|The finite table as transcribed; fix strings and Elixir runtime behaviour are outside the model. No Rocq or Lean leg yet
|Hypatia.Rules.SecurityErrors at runtime follows the table the Agda model states
|tested-only
|ExUnit (mix test)
|`+test/security_errors_test.exs+`: `+SecurityErrors+`
-|Example-based; the transcription into the Agda table is not itself checked. Bounds: ExUnit cases over the migrated alert types
+|Example-based; the transcription into the Agda table is not itself checked. Bounds: ExUnit cases over the transcribed alert types
|ActionsLock.parse/1 reproduces every expected.tsv row of the shared closure corpus, and the Idris2 model transcribes every fixture and states every row
|tested-only
@@ -787,8 +787,8 @@ internal types
* *P4.3* Severity Parsing: total mapping for all valid severity levels
* *P4.4* Data Preservation: projection to the canonical finding record
(`+FindingFact+`, via `+toFact+`) preserves repo, file, category, and
-severity (`+factPreservesData+`). Superseded 2026-11-01 from the retired
-Logtalk-fact target; the proof term is unchanged, the statement's target
+severity (`+factPreservesData+`). Superseded 2026-11-01 from an earlier
+positional-fact target; the proof term is unchanged, the statement's target
is the JSON finding record, and no runtime-refinement claim is made.
==== 5. Quarantine Logic (`+Quarantine.idr+`)
@@ -851,14 +851,24 @@ Status for all of P7: `proven` (Idris2 0.7.0, `%default total`). Moved
from Lean on 2026-11-09; the Lean proofs rested on the kernel axioms
`propext` and `Quot.sound`, which Idris2 does not have.
-==== 8. Logtalk Migration Correspondence (`+LogtalkMigration.agda+`)
-
-Status for all of P8: `proven`, *PWG-3* (AGDA-VERIFIED), on the
-strict-profile receipt: Agda 2.8.0.2, builtins only, Verify Proofs run
-41328302925, job 124912804344, commit 4018290eaa3265b82209e2a45b6917a4bb0a0331,
-source SHA-256 bbd18e2747c84e2eda7ff5a778a2df7f8960a1ef47b1c253f316b9d97b9902a0.
-This grades the finite model only. PWG-3 is not a discharge: the Rocq and
-Lean legs are still owed (PROOF-POLICY §8.4).
+==== 8. Alert-table correspondence (`+AlertTableCorrespondence.agda+`)
+
+The model states that the 18 security-alert types agree between the source
+of record (ECHIDNA's security-learning rule table) and
+`+Hypatia.Rules.SecurityErrors+` on category, severity, auto-fixability and
+fix presence. Prevention agreement covers the six alerts named in P8.5;
+P8.6 records the source and target values for two other alerts.
+Status for all of P8: `proven`, *PWG-3*
+(AGDA-VERIFIED), held to the strict-profile receipt that the `agda
+strict-profile check` job writes on each Verify Proofs run (Agda 2.8.0.2,
+builtins only); the job's `derive` step fails the run when this row has no
+passing receipt. The file was renamed and its comments and source-side
+identifiers reworded on 2026-11-16 (the theorems and tables are unchanged);
+its source SHA-256 is now
+ac4eefef156eb8850c112badded34bd177eb05eb52574e73c43231321cb419c8, which
+the next Verify Proofs run is the first to check in CI. This grades the
+finite model only. PWG-3 is not a discharge: the Rocq and Lean legs are
+still owed (PROOF-POLICY §8.4).
* *P8.1* Category correspondence: `+categoriesAgree+`
* *P8.2* Severity correspondence, including the former catch-all:
@@ -866,12 +876,15 @@ Lean legs are still owed (PROOF-POLICY §8.4).
`+catchAllUnmaintainedLow+`
* *P8.3* Auto-fixability correspondence: `+autoFixableAgrees+`
* *P8.4* Fix-presence (domain) correspondence: `+fixPresenceAgrees+`
-* *P8.5* Prevention agreement where the target did not deliberately
- change it: `+preventionAgreesToken+`, `+preventionAgreesPinned+`,
+* *P8.5* Prevention agreement for `+tokenPermissions+`,
+ `+pinnedDependencies+`, `+missingWorkflowPerms+`, `+hardCodedCrypto+`,
+ `+vulnerabilities+` and `+securityPolicy+`: `+preventionAgreesToken+`,
+ `+preventionAgreesPinned+`,
`+preventionAgreesMissing+`, `+preventionAgreesHardCoded+`,
`+preventionAgreesVulnerabilities+`,
`+preventionAgreesSecurityPolicy+`
-* *P8.6* The ledgered prevention non-equalities, exactly:
+* *P8.6* The recorded prevention differences for `+branchProtection+`
+ and `+codeReview+`, exactly:
`+preventionBranchSource+`, `+preventionBranchTarget+`,
`+preventionCodeReviewSource+`, `+preventionCodeReviewTarget+`
@@ -920,8 +933,8 @@ Elixir module and `+git revert+` are outside it
|VeriSimDB connector |`+VerisimdbConnector.idr+` |Full (model; statement
superseded 2026-11-01)
-|Logtalk → Elixir alert-table correspondence
-|`+LogtalkMigration.agda+` |Finite model only — `+PWG-3+` /
+|Security-alert table correspondence
+|`+AlertTableCorrespondence.agda+` |Finite model only — `+PWG-3+` /
AGDA-VERIFIED (receipt above); fix text and runtime refinement excluded
|actions.lock closure |`+ActionsLockClosure.idr+` |Model only: decision
@@ -977,6 +990,6 @@ enough that a runtime assertion does the job. It now lives in
audits the logs for any violation. Removing Agda also removes a theorem
prover from the toolchain: at retirement Hypatia used Idris2
(compile-time types), Lean 4 (universal invariants), and TLA+
-(model-checked concurrency). The 2026-11-01 migration correspondence
+(model-checked concurrency). The 2026-11-01 alert-table correspondence
reintroduces exactly one narrowly scoped Agda artefact
-(`+LogtalkMigration.agda+`); it does not revive this retired proof.
+(`+AlertTableCorrespondence.agda+`); it does not revive this retired proof.
diff --git a/verification/README.adoc b/verification/README.adoc
index fcaec960..1bb52d06 100644
--- a/verification/README.adoc
+++ b/verification/README.adoc
@@ -8,8 +8,8 @@ Idris2, Lean 4, TLA+ and Agda proof sources for Hypatia's type-level guarantees.
* `proofs/idris2/` — Idris2 proof files (`.idr`) asserting invariants over the
normative ABI in `src/Hypatia/ABI/`
* `proofs/lean4/`, `proofs/tlaplus/` — Lean 4 and TLA+ proofs
-* `proofs/agda/` — Agda correspondence model for the Logtalk → Elixir
- rule migration (`LogtalkMigration.agda`; `PWG-3` receipt in
+* `proofs/agda/` — Agda correspondence model for the security-alert
+ rule tables (`AlertTableCorrespondence.agda`; `PWG-3` receipt in
`PROOF-STATUS.adoc`), and the models of the E0 qualification gate
(`E0Model.agda`, `E0Import.agda`, `E0Agreement.agda`, `E0ImportInstance.agda`,
and the generated `E0ModelTables.agda`)
@@ -32,7 +32,7 @@ K). A missing `agda` binary is an open proof obligation, never a skip:
[source,bash]
----
cd verification/proofs/agda
-agda --safe --without-K --cubical-compatible LogtalkMigration.agda
+agda --safe --without-K --cubical-compatible AlertTableCorrespondence.agda
----
The E0 models are checked the same way, each file in turn (they also carry
diff --git a/verification/proof-ledger.jsonl b/verification/proof-ledger.jsonl
index 688ae375..a376781d 100644
--- a/verification/proof-ledger.jsonl
+++ b/verification/proof-ledger.jsonl
@@ -35,8 +35,8 @@
{"axioms":[],"bounds":"","checker":"Idris2 0.7.0, idris2 --check (--total)","file":"verification/proofs/idris2/PageRankInvariants.idr","id":"pagerank-preconditions","kind":"engineering","lane":"idris2","names":["edgeWeightNonneg","outWeightSumNonneg","inWeightSumNonneg","pagerankPreconditionsSound"],"obligation":"PageRank inputs are well formed: edge weights and in/out weight sums are non-negative","status":"proven","trust_boundary":"Preconditions only; convergence is row pagerank-convergence. Moved from Lean 2026-11-09 (PROOF-POLICY section 3)"}
{"axioms":[],"bounds":"","checker":"Idris2 0.7.0, idris2 --check (--total)","file":"verification/proofs/idris2/ESNSpectralScaling.idr","id":"esn-preconditions","kind":"engineering","lane":"idris2","names":["denomPosWhenFloorPos","denomGeMaxAbs","denomGeFloor","esnScalingPreconditionsSound"],"obligation":"ESN spectral scaling is well defined: the floor-clamped denominator is positive and bounds both inputs","status":"proven","trust_boundary":"Preconditions only; the echo-state property is row esn-echo-state. Moved from Lean 2026-11-09 (PROOF-POLICY section 3)"}
{"axioms":[],"bounds":"3 bots x 2 repos, MaxRequests = 4: 444715 distinct states, depth 13, no error","checker":"TLC 2.19 (rev 5a47802), -workers auto -config KinGate.cfg","file":"verification/proofs/tlaplus/KinGate.tla","id":"kin-gate","kind":"engineering","lane":"tlc","names":["KinGateSafe","MutualExclusionByType","MutualExclusionBotView","ViewCoherentWithLocks","NoOrphanView","GrantsAreWellBracketed","EveryRequestProcessed"],"obligation":"Kin-gate atomicity: mutual exclusion by type and in the bot view, view coherent with locks, no orphan view, well-bracketed grants, and every request processed (H8)","status":"tested-only","trust_boundary":"One bounded instance; the Elixir kin gate is not shown to follow the spec"}
-{"axioms":[],"bounds":"","checker":"Agda 2.8.0.2, builtins only, --safe --without-K --cubical-compatible","file":"verification/proofs/agda/LogtalkMigration.agda","foundation_diverse":false,"id":"logtalk-migration","kind":"theory","lane":"agda","legs":[],"names":["categoriesAgree","severitiesAgree","autoFixableAgrees","fixPresenceAgrees","preventionAgreesToken","preventionAgreesPinned","preventionAgreesMissing","preventionAgreesHardCoded","preventionAgreesVulnerabilities","preventionAgreesSecurityPolicy","preventionBranchSource","preventionBranchTarget","preventionCodeReviewSource","preventionCodeReviewTarget"],"obligation":"The 18 transcribed alert types agree between security_learning.lgt and Hypatia.Rules.SecurityErrors on category, severity, auto-fixability and fix presence; prevention agrees except the two ledgered non-equalities","pwg":"3","status":"proven","trust_boundary":"The finite table as transcribed; fix strings and Elixir runtime behaviour are outside the model. No Rocq or Lean leg yet"}
-{"axioms":[],"bounds":"ExUnit cases over the migrated alert types","checker":"ExUnit (mix test)","file":"test/security_errors_test.exs","id":"logtalk-runtime","kind":"engineering","lane":"exunit","names":["SecurityErrors"],"obligation":"Hypatia.Rules.SecurityErrors at runtime follows the table the Agda model states","status":"tested-only","trust_boundary":"Example-based; the transcription into the Agda table is not itself checked"}
+{"axioms":[],"bounds":"","checker":"Agda 2.8.0.2, builtins only, --safe --without-K --cubical-compatible","file":"verification/proofs/agda/AlertTableCorrespondence.agda","foundation_diverse":false,"id":"alert-table-correspondence","kind":"theory","lane":"agda","legs":[],"names":["categoriesAgree","severitiesAgree","autoFixableAgrees","fixPresenceAgrees","preventionAgreesToken","preventionAgreesPinned","preventionAgreesMissing","preventionAgreesHardCoded","preventionAgreesVulnerabilities","preventionAgreesSecurityPolicy","preventionBranchSource","preventionBranchTarget","preventionCodeReviewSource","preventionCodeReviewTarget"],"obligation":"The 18 transcribed alert types agree between the source of record (the ECHIDNA security-learning rule table) and Hypatia.Rules.SecurityErrors on category, severity, auto-fixability and fix presence; prevention agrees for tokenPermissions, pinnedDependencies, missingWorkflowPerms, hardCodedCrypto, vulnerabilities and securityPolicy, and the source and target values are recorded for branchProtection and codeReview","pwg":"3","status":"proven","trust_boundary":"The finite table as transcribed; fix strings and Elixir runtime behaviour are outside the model. No Rocq or Lean leg yet"}
+{"axioms":[],"bounds":"ExUnit cases over the transcribed alert types","checker":"ExUnit (mix test)","file":"test/security_errors_test.exs","id":"alert-table-correspondence-runtime","kind":"engineering","lane":"exunit","names":["SecurityErrors"],"obligation":"Hypatia.Rules.SecurityErrors at runtime follows the table the Agda model states","status":"tested-only","trust_boundary":"Example-based; the transcription into the Agda table is not itself checked"}
{"axioms":[],"bounds":"5 corpus locks, 6 refs, lockfile versions v0.0.2 and v0.0.3","checker":"ExUnit (mix test)","file":"test/rules/actions_lock_closure_corpus_test.exs","id":"actions-lock-closure-corpus","kind":"engineering","lane":"exunit","names":["ActionsLockClosureCorpusTest"],"obligation":"ActionsLock.parse/1 reproduces every expected.tsv row of the shared closure corpus, and the Idris2 model transcribes every fixture and states every row","status":"tested-only","trust_boundary":"The corpus only; standards close-lock-test.sh replays the same byte-identical corpus against close-lock.sh"}
{"axioms":[],"bounds":"","checker":"-","file":"-","foundation_diverse":false,"id":"pagerank-convergence","kind":"theory","lane":"none","legs":[],"names":[],"obligation":"Damped PageRank iteration converges to a unique stationary vector","pwg":"ungraded","status":"open","trust_boundary":"Not stated in any prover. Agda statement first (PROOF-POLICY section 2), over constructive reals, then Rocq and Lean legs; no Mathlib"}
{"axioms":[],"bounds":"","checker":"-","file":"-","foundation_diverse":false,"id":"esn-echo-state","kind":"theory","lane":"none","legs":[],"names":[],"obligation":"With leak rate 0 < a <= 1 and the reservoir scaled to infinity-norm at most 0.95, two state trajectories under the same input converge geometrically (echo-state property), and [-1,1]^n is invariant","pwg":"ungraded","status":"open","trust_boundary":"Not stated in any prover. Agda statement first (PROOF-POLICY section 2), over constructive reals, then Rocq and Lean legs; no Mathlib. The runtime scales by the induced infinity-norm, not the spectral radius"}
diff --git a/verification/proofs/agda/LogtalkMigration.agda b/verification/proofs/agda/AlertTableCorrespondence.agda
similarity index 66%
rename from verification/proofs/agda/LogtalkMigration.agda
rename to verification/proofs/agda/AlertTableCorrespondence.agda
index a0549419..85db63bb 100644
--- a/verification/proofs/agda/LogtalkMigration.agda
+++ b/verification/proofs/agda/AlertTableCorrespondence.agda
@@ -2,17 +2,17 @@
-- SPDX-License-Identifier: MPL-2.0
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
--
--- Finite correspondence model for the Logtalk -> Elixir security-rule
--- migration (ECHIDNA rules/security_learning.lgt ->
--- Hypatia.Rules.SecurityErrors).
+-- Finite correspondence model between the source of record for the
+-- security-alert rules (ECHIDNA's security-learning rule table) and the
+-- Elixir target Hypatia.Rules.SecurityErrors.
--
-- Scope, deliberately narrow (estate PROOF-POLICY: a checked model is not
-- a runtime-refinement proof):
--
--- * The source functions transcribe the 18 alert_category/2 facts, the
--- classify_severity/2 clauses (including the final low catch-all),
--- the six is_auto_fixable/1 facts, the domain of suggest_fix/2, and
--- get_prevention_workflow/2 from security_learning.lgt.
+-- * The source functions transcribe the source of record: the 18
+-- alert_category/2 facts, the classify_severity/2 clauses (including
+-- the final low catch-all), the six is_auto_fixable/1 facts, the
+-- domain of suggest_fix/2, and get_prevention_workflow/2.
-- * The target functions transcribe the corresponding Elixir tables in
-- lib/rules/security_errors.ex over the same 18 alert types.
-- * The theorems check exhaustive agreement for category, severity,
@@ -21,9 +21,9 @@
-- the CodeReviewID extension are stated as separate lemmas rather
-- than hidden inside a false universal equality.
-- * Fix *text* is not modelled here: 10 of 13 strings are verbatim and
--- the other three are ledgered supersessions/generalisation in
--- docs/rules/logtalk-migration.adoc. Elixir runtime behaviour is
--- pinned by ExUnit tests, not by this file.
+-- the other three are recorded supersessions/generalisation in
+-- docs/rules/security-rule-provenance.adoc. Elixir runtime behaviour
+-- is pinned by ExUnit tests, not by this file.
--
-- Status and grade (standards PROOF-POLICY §5 and §8): the target is
-- `PROVEN`, `PWG-3`, which holds only while the strict command in
@@ -34,7 +34,7 @@
-- claim is made.
-- No postulates, no unsafe options, no standard-library dependency.
-module LogtalkMigration where
+module AlertTableCorrespondence where
open import Agda.Builtin.Bool
open import Agda.Builtin.Equality
@@ -89,112 +89,112 @@ data Maybe (A : Set) : Set where
just : A -> Maybe A
------------------------------------------------------------------------
--- Source: ECHIDNA security_learning.lgt
+-- Source of record: ECHIDNA security-learning rule table
------------------------------------------------------------------------
-logtalkCategory : Alert -> Category
-logtalkCategory tokenPermissions = workflowSecurity
-logtalkCategory pinnedDependencies = workflowSecurity
-logtalkCategory missingWorkflowPerms = workflowSecurity
-logtalkCategory hardCodedCrypto = codeSecurity
-logtalkCategory remotePropertyInjection = codeSecurity
-logtalkCategory sqlInjection = codeSecurity
-logtalkCategory unusedLocalVariable = codeQuality
-logtalkCategory syntaxError = codeQuality
-logtalkCategory vulnerabilities = dependencyVuln
-logtalkCategory unmaintained = dependencyVuln
-logtalkCategory securityPolicy = processHygiene
-logtalkCategory maintained = processHygiene
-logtalkCategory codeReview = processHygiene
-logtalkCategory branchProtection = processHygiene
-logtalkCategory ciiBestPractices = processHygiene
-logtalkCategory fuzzing = missingTests
-logtalkCategory sast = missingTests
-logtalkCategory ciTests = missingTests
-
--- The final Logtalk clause is classify_severity(_, low), so every alert
+sourceCategory : Alert -> Category
+sourceCategory tokenPermissions = workflowSecurity
+sourceCategory pinnedDependencies = workflowSecurity
+sourceCategory missingWorkflowPerms = workflowSecurity
+sourceCategory hardCodedCrypto = codeSecurity
+sourceCategory remotePropertyInjection = codeSecurity
+sourceCategory sqlInjection = codeSecurity
+sourceCategory unusedLocalVariable = codeQuality
+sourceCategory syntaxError = codeQuality
+sourceCategory vulnerabilities = dependencyVuln
+sourceCategory unmaintained = dependencyVuln
+sourceCategory securityPolicy = processHygiene
+sourceCategory maintained = processHygiene
+sourceCategory codeReview = processHygiene
+sourceCategory branchProtection = processHygiene
+sourceCategory ciiBestPractices = processHygiene
+sourceCategory fuzzing = missingTests
+sourceCategory sast = missingTests
+sourceCategory ciTests = missingTests
+
+-- The final source clause is classify_severity(_, low), so every alert
-- outside the critical/high/medium member lists is low here.
-logtalkSeverity : Alert -> Severity
-logtalkSeverity tokenPermissions = high
-logtalkSeverity pinnedDependencies = medium
-logtalkSeverity missingWorkflowPerms = high
-logtalkSeverity hardCodedCrypto = critical
-logtalkSeverity remotePropertyInjection = high
-logtalkSeverity sqlInjection = critical
-logtalkSeverity unusedLocalVariable = low
-logtalkSeverity syntaxError = medium
-logtalkSeverity vulnerabilities = critical
-logtalkSeverity unmaintained = low
-logtalkSeverity securityPolicy = medium
-logtalkSeverity maintained = low
-logtalkSeverity codeReview = medium
-logtalkSeverity branchProtection = medium
-logtalkSeverity ciiBestPractices = low
-logtalkSeverity fuzzing = low
-logtalkSeverity sast = low
-logtalkSeverity ciTests = low
-
-logtalkAutoFixable : Alert -> Bool
-logtalkAutoFixable tokenPermissions = true
-logtalkAutoFixable pinnedDependencies = true
-logtalkAutoFixable missingWorkflowPerms = true
-logtalkAutoFixable hardCodedCrypto = false
-logtalkAutoFixable remotePropertyInjection = false
-logtalkAutoFixable sqlInjection = false
-logtalkAutoFixable unusedLocalVariable = true
-logtalkAutoFixable syntaxError = false
-logtalkAutoFixable vulnerabilities = false
-logtalkAutoFixable unmaintained = false
-logtalkAutoFixable securityPolicy = true
-logtalkAutoFixable maintained = false
-logtalkAutoFixable codeReview = false
-logtalkAutoFixable branchProtection = true
-logtalkAutoFixable ciiBestPractices = false
-logtalkAutoFixable fuzzing = false
-logtalkAutoFixable sast = false
-logtalkAutoFixable ciTests = false
+sourceSeverity : Alert -> Severity
+sourceSeverity tokenPermissions = high
+sourceSeverity pinnedDependencies = medium
+sourceSeverity missingWorkflowPerms = high
+sourceSeverity hardCodedCrypto = critical
+sourceSeverity remotePropertyInjection = high
+sourceSeverity sqlInjection = critical
+sourceSeverity unusedLocalVariable = low
+sourceSeverity syntaxError = medium
+sourceSeverity vulnerabilities = critical
+sourceSeverity unmaintained = low
+sourceSeverity securityPolicy = medium
+sourceSeverity maintained = low
+sourceSeverity codeReview = medium
+sourceSeverity branchProtection = medium
+sourceSeverity ciiBestPractices = low
+sourceSeverity fuzzing = low
+sourceSeverity sast = low
+sourceSeverity ciTests = low
+
+sourceAutoFixable : Alert -> Bool
+sourceAutoFixable tokenPermissions = true
+sourceAutoFixable pinnedDependencies = true
+sourceAutoFixable missingWorkflowPerms = true
+sourceAutoFixable hardCodedCrypto = false
+sourceAutoFixable remotePropertyInjection = false
+sourceAutoFixable sqlInjection = false
+sourceAutoFixable unusedLocalVariable = true
+sourceAutoFixable syntaxError = false
+sourceAutoFixable vulnerabilities = false
+sourceAutoFixable unmaintained = false
+sourceAutoFixable securityPolicy = true
+sourceAutoFixable maintained = false
+sourceAutoFixable codeReview = false
+sourceAutoFixable branchProtection = true
+sourceAutoFixable ciiBestPractices = false
+sourceAutoFixable fuzzing = false
+sourceAutoFixable sast = false
+sourceAutoFixable ciTests = false
-- Domain of suggest_fix/2 only (13 facts); the strings themselves are
--- handled by the migration ledger and Elixir tests.
-logtalkHasFix : Alert -> Bool
-logtalkHasFix tokenPermissions = true
-logtalkHasFix pinnedDependencies = true
-logtalkHasFix missingWorkflowPerms = true
-logtalkHasFix hardCodedCrypto = true
-logtalkHasFix remotePropertyInjection = true
-logtalkHasFix sqlInjection = false
-logtalkHasFix unusedLocalVariable = true
-logtalkHasFix syntaxError = true
-logtalkHasFix vulnerabilities = true
-logtalkHasFix unmaintained = false
-logtalkHasFix securityPolicy = true
-logtalkHasFix maintained = false
-logtalkHasFix codeReview = true
-logtalkHasFix branchProtection = true
-logtalkHasFix ciiBestPractices = true
-logtalkHasFix fuzzing = true
-logtalkHasFix sast = false
-logtalkHasFix ciTests = false
-
-logtalkPrevention : Alert -> Maybe Workflow
-logtalkPrevention tokenPermissions = just workflowLinter
-logtalkPrevention pinnedDependencies = just workflowLinter
-logtalkPrevention missingWorkflowPerms = just workflowLinter
-logtalkPrevention hardCodedCrypto = just secretScanner
-logtalkPrevention remotePropertyInjection = nothing
-logtalkPrevention sqlInjection = nothing
-logtalkPrevention unusedLocalVariable = nothing
-logtalkPrevention syntaxError = nothing
-logtalkPrevention vulnerabilities = just cargoAudit
-logtalkPrevention unmaintained = nothing
-logtalkPrevention securityPolicy = just scorecardEnforcer
-logtalkPrevention maintained = nothing
-logtalkPrevention codeReview = nothing
-logtalkPrevention branchProtection = just branchProtectionEnforcer
-logtalkPrevention ciiBestPractices = nothing
-logtalkPrevention fuzzing = nothing
-logtalkPrevention sast = nothing
-logtalkPrevention ciTests = nothing
+-- handled by the provenance record and Elixir tests.
+sourceHasFix : Alert -> Bool
+sourceHasFix tokenPermissions = true
+sourceHasFix pinnedDependencies = true
+sourceHasFix missingWorkflowPerms = true
+sourceHasFix hardCodedCrypto = true
+sourceHasFix remotePropertyInjection = true
+sourceHasFix sqlInjection = false
+sourceHasFix unusedLocalVariable = true
+sourceHasFix syntaxError = true
+sourceHasFix vulnerabilities = true
+sourceHasFix unmaintained = false
+sourceHasFix securityPolicy = true
+sourceHasFix maintained = false
+sourceHasFix codeReview = true
+sourceHasFix branchProtection = true
+sourceHasFix ciiBestPractices = true
+sourceHasFix fuzzing = true
+sourceHasFix sast = false
+sourceHasFix ciTests = false
+
+sourcePrevention : Alert -> Maybe Workflow
+sourcePrevention tokenPermissions = just workflowLinter
+sourcePrevention pinnedDependencies = just workflowLinter
+sourcePrevention missingWorkflowPerms = just workflowLinter
+sourcePrevention hardCodedCrypto = just secretScanner
+sourcePrevention remotePropertyInjection = nothing
+sourcePrevention sqlInjection = nothing
+sourcePrevention unusedLocalVariable = nothing
+sourcePrevention syntaxError = nothing
+sourcePrevention vulnerabilities = just cargoAudit
+sourcePrevention unmaintained = nothing
+sourcePrevention securityPolicy = just scorecardEnforcer
+sourcePrevention maintained = nothing
+sourcePrevention codeReview = nothing
+sourcePrevention branchProtection = just branchProtectionEnforcer
+sourcePrevention ciiBestPractices = nothing
+sourcePrevention fuzzing = nothing
+sourcePrevention sast = nothing
+sourcePrevention ciTests = nothing
------------------------------------------------------------------------
-- Target: Hypatia.Rules.SecurityErrors (same 18 alert types)
@@ -304,7 +304,7 @@ elixirPrevention ciTests = nothing
-- Correspondence theorems (exhaustive over the finite Alert type)
------------------------------------------------------------------------
-categoriesAgree : (a : Alert) -> logtalkCategory a ≡ elixirCategory a
+categoriesAgree : (a : Alert) -> sourceCategory a ≡ elixirCategory a
categoriesAgree tokenPermissions = refl
categoriesAgree pinnedDependencies = refl
categoriesAgree missingWorkflowPerms = refl
@@ -324,7 +324,7 @@ categoriesAgree fuzzing = refl
categoriesAgree sast = refl
categoriesAgree ciTests = refl
-severitiesAgree : (a : Alert) -> logtalkSeverity a ≡ elixirSeverity a
+severitiesAgree : (a : Alert) -> sourceSeverity a ≡ elixirSeverity a
severitiesAgree tokenPermissions = refl
severitiesAgree pinnedDependencies = refl
severitiesAgree missingWorkflowPerms = refl
@@ -344,7 +344,7 @@ severitiesAgree fuzzing = refl
severitiesAgree sast = refl
severitiesAgree ciTests = refl
-autoFixableAgrees : (a : Alert) -> logtalkAutoFixable a ≡ elixirAutoFixable a
+autoFixableAgrees : (a : Alert) -> sourceAutoFixable a ≡ elixirAutoFixable a
autoFixableAgrees tokenPermissions = refl
autoFixableAgrees pinnedDependencies = refl
autoFixableAgrees missingWorkflowPerms = refl
@@ -364,7 +364,7 @@ autoFixableAgrees fuzzing = refl
autoFixableAgrees sast = refl
autoFixableAgrees ciTests = refl
-fixPresenceAgrees : (a : Alert) -> logtalkHasFix a ≡ elixirHasFix a
+fixPresenceAgrees : (a : Alert) -> sourceHasFix a ≡ elixirHasFix a
fixPresenceAgrees tokenPermissions = refl
fixPresenceAgrees pinnedDependencies = refl
fixPresenceAgrees missingWorkflowPerms = refl
@@ -386,32 +386,32 @@ fixPresenceAgrees ciTests = refl
-- Prevention: agreement on the six unchanged shared entries.
preventionAgreesToken :
- logtalkPrevention tokenPermissions ≡ elixirPrevention tokenPermissions
+ sourcePrevention tokenPermissions ≡ elixirPrevention tokenPermissions
preventionAgreesToken = refl
preventionAgreesPinned :
- logtalkPrevention pinnedDependencies ≡ elixirPrevention pinnedDependencies
+ sourcePrevention pinnedDependencies ≡ elixirPrevention pinnedDependencies
preventionAgreesPinned = refl
preventionAgreesMissing :
- logtalkPrevention missingWorkflowPerms ≡ elixirPrevention missingWorkflowPerms
+ sourcePrevention missingWorkflowPerms ≡ elixirPrevention missingWorkflowPerms
preventionAgreesMissing = refl
preventionAgreesHardCoded :
- logtalkPrevention hardCodedCrypto ≡ elixirPrevention hardCodedCrypto
+ sourcePrevention hardCodedCrypto ≡ elixirPrevention hardCodedCrypto
preventionAgreesHardCoded = refl
preventionAgreesVulnerabilities :
- logtalkPrevention vulnerabilities ≡ elixirPrevention vulnerabilities
+ sourcePrevention vulnerabilities ≡ elixirPrevention vulnerabilities
preventionAgreesVulnerabilities = refl
preventionAgreesSecurityPolicy :
- logtalkPrevention securityPolicy ≡ elixirPrevention securityPolicy
+ sourcePrevention securityPolicy ≡ elixirPrevention securityPolicy
preventionAgreesSecurityPolicy = refl
--- Prevention: the two ledgered non-equalities, stated exactly.
+-- Prevention: the two recorded non-equalities, stated exactly.
preventionBranchSource :
- logtalkPrevention branchProtection ≡ just branchProtectionEnforcer
+ sourcePrevention branchProtection ≡ just branchProtectionEnforcer
preventionBranchSource = refl
preventionBranchTarget :
@@ -419,14 +419,14 @@ preventionBranchTarget :
preventionBranchTarget = refl
preventionCodeReviewSource :
- logtalkPrevention codeReview ≡ nothing
+ sourcePrevention codeReview ≡ nothing
preventionCodeReviewSource = refl
preventionCodeReviewTarget :
elixirPrevention codeReview ≡ just scorecardEnforcer
preventionCodeReviewTarget = refl
--- The three alerts that reached low only through the Logtalk catch-all
+-- The three alerts that reached low only through the source catch-all
-- are explicit low entries in Elixir. (Also covered by
-- severitiesAgree; named here because this was the one place where a
-- fact-by-fact transcription would have changed behaviour to :info.)
diff --git a/verification/proofs/idris2/VerisimdbConnector.idr b/verification/proofs/idris2/VerisimdbConnector.idr
index a9c08fa0..c1b4f03f 100644
--- a/verification/proofs/idris2/VerisimdbConnector.idr
+++ b/verification/proofs/idris2/VerisimdbConnector.idr
@@ -10,11 +10,11 @@
-- projected to the canonical JSON finding record (schema/findings.ncl)
--
-- Corresponds to: lib/verisim_connector.ex (cleaned-finding projection model).
--- Statement superseded 2026-11-01: the 2026-04-04 target was the retired
--- Logtalk fact format. The equality proof below is unchanged; its target is
--- now the JSON finding record. This model does not by itself prove runtime
--- refinement of the Elixir connector (estate PROOF-POLICY); see
--- docs/rules/logtalk-migration.adoc and verification/PROOF-STATUS.adoc.
+-- Statement superseded 2026-11-01: the 2026-04-04 target was a retired
+-- positional fact format. The equality proof below is unchanged; its target
+-- is now the JSON finding record. This model does not by itself prove
+-- runtime refinement of the Elixir connector (estate PROOF-POLICY); see
+-- verification/PROOF-STATUS.adoc.
module VerisimdbConnector
@@ -153,7 +153,6 @@ cleanFindingSoundness (MkRawFinding (Just _) (Just _) (Just _) (Just sevS) (Just
||| The repo/file/category/severity projection of a finding: the fields a
||| canonical JSON finding (schema/findings.ncl) carries for every result.
-||| (Named LogtalkFact until the 2026-11-01 supersession in the header.)
public export
record FindingFact where
constructor MkFact