From 81eee5400c785f5e633f8983610e57c43295d3ed Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 19:52:21 +0000 Subject: [PATCH 1/2] deed(identity): carry the registered v8 ids, not #u5 literals :repo-uuid and :beholding-chora were #u5 literals, which owner ruling Q2 (CHORA-SPEC 7.1) refuses in identity fields; deed_lint and the standards check-uuid-v8.sh --strict both fail on them. The ids are copied, not minted: chora-registry records panic-attacker (this repo's birth name, listed in (lineage :previous-names)) as #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b", minted in gv-clade-index before V9 (U1: a rename never remints), and the estate chora is #uuid"0889b37b-defb-831f-973c-e119500db00e" (CHORA-SPEC, the standards manifest). The no-self-suppression obligation now names the deed registry that #295 made primary. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC --- panic-attack_chora.deed | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/panic-attack_chora.deed b/panic-attack_chora.deed index 9c407ed1..18d9ebb6 100644 --- a/panic-attack_chora.deed +++ b/panic-attack_chora.deed @@ -11,8 +11,12 @@ (repo-deed :schema-version "1.0.0" :canonical-name "panic-attack" - :repo-uuid #u5"hyperpolymath/panic-attack" - :beholding-chora #u5"estate/chora" + ; The v8 id chora-registry holds for this repo under its birth name, + ; panic-attacker (minted in gv-clade-index, pre-V9). Renaming never remints + ; it (U1); it is carried opaque (U4, Q2). The estate chora id is the one every + ; repo deed names, e.g. hypatia_chora.deed. + :repo-uuid #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b" + :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" (status :phase active :note "static analysis, stress testing and logic-based bug signature detection") @@ -29,4 +33,4 @@ :note "T0 syntax heuristics are labelled T0. A finding is never dressed up as a parser or dataflow proof; see docs/RECON-AND-EVIDENCE.adoc") (obligation :name "no-self-suppression" - :note "suppressions live in a separate registry file (audits/assail-classifications.a2ml) so one hand cannot both add a defect and hide it")) + :note "suppressions live in a separate registry file (audits/assail-classifications_praxis.deed) so one hand cannot both add a defect and hide it")) From 088dfbbc343709e8119df5ef23d389b798c4d8d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 20:18:00 +0000 Subject: [PATCH 2/2] chore(a2ml): move panic-attack off A2ML: translate per the mapping specs, move the readers, delete 25 of 26 files The owner approved on 2026-11-14 moving panic-attack off A2ML the way hypatia#1113 did. Each .a2ml file is translated where a standards mapping spec covers it, its readers are moved, and it is deleted. docs/history/A2ML-REMOVED.adoc records every removed file (size, sha256, blob id, what it held, where it went, what was dropped and why). Translated: - CLADE.a2ml -> (identity) (clade) (forges) (lineage) in panic-attack_chora.deed; its [status] -> (status) in .machine_readable/descriptiles/STATE.deed (clade-to-repo-deed.adoc as updated by standards#1579, A7 J15). The chora's own (status) clause is replaced by that one. (lineage :type) said `hub`; CLADE and chora-registry both say `standalone`, which it now says. - META, ECOSYSTEM, AGENTIC, NEUROSYM, PLAYBOOK -> (meta) (ecosystem) (agentic) (neurosym) (playbook), table rows only. - ANCHOR (two copies) -> (ecosystem (related :relationship parent :uuid)) for boj-server and ambientops (A7 6.4, J26). No (anchor) clause: the source has no authority, and a translator never invents one. - STATE.a2ml -> nothing (state-v1-decision option B); journal archived by reference. - 0-AI-MANIFEST.a2ml -> pointer-only 0-AI-MANIFEST.deed (A7 Q15). Deleted with no mapping spec: agent_instructions (and its README), campaigns/2026-05-26, contractiles INDEX/Bust/Dust/Trust and the root contractiles/ generator sources, integrations. Retained: .machine_readable/contractiles/adjust/Adjustfile.a2ml, because `just adjust-check` reads its thresholds and no spec covers a contractile. Readers: - src/a2ml: the AI manifest is read deed first (0-AI-MANIFEST.deed via src/deed.rs), legacy .a2ml only as a fallback. A deed manifest carries no report settings. `manifest` and `diagnostics` use the same order. - src/diagnostics: panicbot directives are the repo deed's (bot-directives (bot :name panicbot)) clause, not the stale .scm path. - docs/campaigns/2026-05-26/file-ffi-pr-v2.sh, a dated campaign record that writes an .a2ml registry, is marked historical and exits at once. - .claude/CLAUDE.md, CONTRIBUTING, QUICKSTART-DEV, MUST.contractile, contractile.just, bust.ncl and a scan-and-report comment point at the deeds. No licence or SPDX change except the SPDX on the three new files. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC --- .claude/CLAUDE.md | 29 +- .github/CONTRIBUTING.md | 7 +- .github/workflows/scan-and-report.yml | 2 +- .machine_readable/6a2/AGENTIC.a2ml | 188 --------- .machine_readable/6a2/ANCHOR.a2ml | 22 - .machine_readable/6a2/ECOSYSTEM.a2ml | 49 --- .machine_readable/6a2/META.a2ml | 84 ---- .machine_readable/6a2/NEUROSYM.a2ml | 214 ---------- .machine_readable/6a2/PLAYBOOK.a2ml | 118 ------ .machine_readable/6a2/STATE.a2ml | 116 ------ .machine_readable/CLADE.a2ml | 50 --- .machine_readable/MUST.contractile | 2 +- .../agent_instructions/README.adoc | 42 -- .../agent_instructions/coverage.a2ml | 61 --- .../agent_instructions/debt.a2ml | 49 --- .../agent_instructions/methodology.a2ml | 107 ----- .machine_readable/anchors/ANCHOR.a2ml | 20 - .machine_readable/campaigns/2026-05-26.a2ml | 382 ------------------ .machine_readable/contractiles/INDEX.a2ml | 93 ----- .../contractiles/bust/Bustfile.a2ml | 28 -- .machine_readable/contractiles/bust/bust.ncl | 6 +- .../contractiles/dust/Dustfile.a2ml | 22 - .../contractiles/trust/Trustfile.a2ml | 22 - .machine_readable/descriptiles/STATE.deed | 37 ++ .../integrations/feedback-o-tron.a2ml | 13 - .machine_readable/integrations/proven.a2ml | 18 - .machine_readable/integrations/verisimdb.a2ml | 15 - .machine_readable/integrations/vexometer.a2ml | 18 - 0-AI-MANIFEST.a2ml | 137 ------- 0-AI-MANIFEST.deed | 21 + CHANGELOG.adoc | 21 + QUICKSTART-DEV.adoc | 9 +- contractile.just | 7 + contractiles/intend/Intentfile.a2ml | 22 - contractiles/must/Mustfile.a2ml | 42 -- contractiles/trust/Trustfile.a2ml | 25 -- docs/campaigns/2026-05-26/README.adoc | 9 +- docs/campaigns/2026-05-26/file-ffi-pr-v2.sh | 13 + docs/history/A2ML-REMOVED.adoc | 239 +++++++++++ panic-attack_chora.deed | 130 +++++- src/a2ml/mod.rs | 246 ++++++++++- src/diagnostics.rs | 84 +++- src/main.rs | 14 +- 43 files changed, 808 insertions(+), 2025 deletions(-) delete mode 100644 .machine_readable/6a2/AGENTIC.a2ml delete mode 100644 .machine_readable/6a2/ANCHOR.a2ml delete mode 100644 .machine_readable/6a2/ECOSYSTEM.a2ml delete mode 100644 .machine_readable/6a2/META.a2ml delete mode 100644 .machine_readable/6a2/NEUROSYM.a2ml delete mode 100644 .machine_readable/6a2/PLAYBOOK.a2ml delete mode 100644 .machine_readable/6a2/STATE.a2ml delete mode 100644 .machine_readable/CLADE.a2ml delete mode 100644 .machine_readable/agent_instructions/README.adoc delete mode 100644 .machine_readable/agent_instructions/coverage.a2ml delete mode 100644 .machine_readable/agent_instructions/debt.a2ml delete mode 100644 .machine_readable/agent_instructions/methodology.a2ml delete mode 100644 .machine_readable/anchors/ANCHOR.a2ml delete mode 100644 .machine_readable/campaigns/2026-05-26.a2ml delete mode 100644 .machine_readable/contractiles/INDEX.a2ml delete mode 100644 .machine_readable/contractiles/bust/Bustfile.a2ml delete mode 100644 .machine_readable/contractiles/dust/Dustfile.a2ml delete mode 100644 .machine_readable/contractiles/trust/Trustfile.a2ml create mode 100644 .machine_readable/descriptiles/STATE.deed delete mode 100644 .machine_readable/integrations/feedback-o-tron.a2ml delete mode 100644 .machine_readable/integrations/proven.a2ml delete mode 100644 .machine_readable/integrations/verisimdb.a2ml delete mode 100644 .machine_readable/integrations/vexometer.a2ml delete mode 100644 0-AI-MANIFEST.a2ml create mode 100644 0-AI-MANIFEST.deed delete mode 100644 contractiles/intend/Intentfile.a2ml delete mode 100644 contractiles/must/Mustfile.a2ml delete mode 100644 contractiles/trust/Trustfile.a2ml create mode 100644 docs/history/A2ML-REMOVED.adoc diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index e0cb0e07..1287b053 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -67,8 +67,8 @@ src/ │ ├── reachability.rs # Import scanning for phantom dependency detection │ ├── classify.rs # Three-way classification: Mitigable/Unmitigable/Informational │ └── registry.rs # Mitigation lifecycle registry (JSON persistence) -├── a2ml/ # AI manifest protocol (TOML-like format support, 0-AI-MANIFEST.a2ml priority lookup) -├── deed.rs # Minimal DEED reader (standards deed.abnf v2.0.0); used by the classification registry +├── a2ml/ # AI manifest reader (0-AI-MANIFEST.deed first; legacy .a2ml read-only fallback) + Nickel export + report-bundle codec +├── deed.rs # Minimal DEED reader (standards deed.abnf v2.0.0); used by the classification registry, the AI manifest and diagnostics ├── panll/ # PanLL event-chain export ├── storage/ # Filesystem + VerisimDB persistence ├── i18n/ # Multi-language support (ISO 639-1, 10 languages) @@ -259,7 +259,7 @@ from its former A2ML registry). ## Integration Points -- **panicbot**: gitbot-fleet verifier bot — invokes `panic-attack assail --output-format json`, translates WeakPoints to Findings (PA001-PA025). Directives at `.machine_readable/bot_directives/panicbot.scm` +- **panicbot**: gitbot-fleet verifier bot — invokes `panic-attack assail --output-format json`, translates WeakPoints to Findings (PA001-PA025). Directives, when a repo has any, are the `(bot-directives (bot :name panicbot …))` clause of its `_chora.deed` (standards `agentic-neurosym-playbook-to-repo-deed.adoc` §6); with none, panicbot runs the full suite - **verisimdb**: Store scan results as hexads (document + semantic modalities). File I/O works, API planned - **hypatia**: Neurosymbolic rule engine processes findings. Env var watcher in diagnostics - **panll**: Event-chain export for three-panel visualisation. Working via `panll` subcommand. Two dedicated panels: panic-attack (single-repo) and Mass Panic (assemblyline batch GUI) @@ -285,3 +285,26 @@ Run with `just readiness` or `just readiness-summary`. - Use anyhow::Result for error handling - Serde derive on public types for JSON serialization - Zero compiler warnings policy (release + test builds) + +## Machine-Readable Metadata (deed forms; A2ML retired 2026-11-14) + +A2ML is retired. Never create, restore or extend a `.a2ml` file here, and do +not recommend one to a scanned repository. The repo's metadata is in deeds +(grammar: standards `1-formats/deed/spec/abnf/deed.abnf`; check with +`bun /1-formats/deed/tools/deed_lint.js FILE`): + +- `panic-attack_chora.deed` — identity, clade, forges, lineage, maturity, and + the `(meta)`, `(ecosystem)`, `(agentic)`, `(neurosym)` and `(playbook)` + clauses translated from the retired descriptiles. +- `.machine_readable/descriptiles/STATE.deed` — lifecycle `(status)` + (`deed_lint.js --state`). +- `0-AI-MANIFEST.deed` — pointer-only front door (A7 Q15). +- `audits/assail-classifications_praxis.deed` — the classification registry + form (see above); this repo carries none. + +`docs/history/A2ML-REMOVED.adoc` records every removed `.a2ml` file and where +its content went. One remains, with its reason there: +`.machine_readable/contractiles/adjust/Adjustfile.a2ml`, which `just +adjust-check` still reads until its edict form exists. Readers in `src/` keep +an A2ML fallback only where other repositories still carry the legacy file +(the classification registry and the AI manifest); they never write one. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e5f0baaf..4e8e3869 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -210,7 +210,7 @@ Example: │ ├── abduct/ # Isolation + time-skew │ ├── adjudicate/ # Campaign verdict aggregation │ ├── axial/ # Reaction observation - │ ├── a2ml/ # AI manifest protocol + │ ├── a2ml/ # AI manifest reader (deed first) + report bundles │ ├── panll/ # PanLL event-chain export │ ├── storage/ # Filesystem + VerisimDB persistence │ ├── i18n/ # Multi-language support (ISO 639-1, 10 languages) @@ -229,7 +229,10 @@ This project follows RSR (Reproducible Software Repositories) standards: 1. **SCM files in .machine_readable/ only** - Never put STATE.scm, ECOSYSTEM.scm, or META.scm in the repository root -2. **AI manifest required** - AI.a2ml must be present and up-to-date +2. **Repo deed and AI manifest required** - `panic-attack_chora.deed` + and the pointer-only `0-AI-MANIFEST.deed` must be present and + up-to-date. A2ML is retired: never add a `.a2ml` file + (`docs/history/A2ML-REMOVED.adoc`) 3. **License consistency** - All files must use MPL-2.0 (SPDX header) diff --git a/.github/workflows/scan-and-report.yml b/.github/workflows/scan-and-report.yml index 1c8e0be6..c9ecd05f 100644 --- a/.github/workflows/scan-and-report.yml +++ b/.github/workflows/scan-and-report.yml @@ -137,7 +137,7 @@ jobs: esac # Count only findings the scanner did NOT suppress. `suppressed` is - # set by the user-classification registry (audits/*.a2ml) and by + # set by the user-classification registry (audits/*_praxis.deed) and by # test-context detection, and is omitted rather than set false, so # test for `!= true`. OFFENDING=$(jq --argjson t "$THRESHOLD" ' diff --git a/.machine_readable/6a2/AGENTIC.a2ml b/.machine_readable/6a2/AGENTIC.a2ml deleted file mode 100644 index 92561916..00000000 --- a/.machine_readable/6a2/AGENTIC.a2ml +++ /dev/null @@ -1,188 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# AGENTIC.a2ml — AI agent operational gating and scan dispatch -# Defines safety constraints, entropy budgets, and explicit-intent gating for AI agents -# working in panic-attack (static-analysis scanner with 49 language analyzers, -# 25 weak-point categories, and three deployment modes). - -[metadata] -version = "0.1.0" -last-updated = "2026-06-04" -spec-version = "AGENTIC-FORMAT v0.1.0" -authority = "Jonathan D.A. Jewell (hyperpolymath)" -conformance = "AGENTIC-FORMAT-SPEC-compliant" - -# === AGENT ROLES === -# The concrete AI agents that interact with panic-attack and how. - -[agent-roles.panicbot] -kind = "gitbot-fleet verifier bot" -invokes = "panic-attack assail --output-format json" -consumes = "JSON AssailReport" -emits = "Findings PA001–PA025 (WeakPoints translated to fleet Findings)" -directives = ".machine_readable/bot_directives/panicbot.scm" -translator = "gitbot-fleet/bots/panicbot/src/translator.rs" -filters = "Drops items with WeakPoint.suppressed = true (kanren + v2.5.5 context suppression)" -notes = "Read-only consumer of scan output; never edits the repo under scan. Surfaces test_context + suppression-reason in fleet-side reports." - -[agent-roles.hypatia] -kind = "neurosymbolic rule engine" -consumes = "JSON AssailReport via Elixir rules" -processes = "Findings as neurosymbolic facts; env-var watcher in src/diagnostics.rs" -planned = "Ingestion of test_context / ffi_kind / jit_context metadata; ContextSuppressed bucket distinct from RuleSuppressed" -notes = "Downstream rule processor; does not mutate panic-attack state." - -[agent-roles.echidnabot] -kind = "proof-verification bot (planned)" -purpose = "Proof verification of scan claims" -status = "planned" -reciprocal = "panic-attack scans echidna's Rust + Idris2 ABI for banned patterns (echidna NEUROSYM.a2ml proof-obligations.abi-integrity)" - -# === GATING POLICIES === -# Per-operation-class rules: when may an action proceed? - -[gating-policies] -file-read = { mode = "auto", entropy-cost = 1, description = "Reading source files for analysis" } -file-write = { mode = "auto", entropy-cost = 10, description = "Creating/modifying source files in the panic-attack repo" } -scan-execute = { mode = "auto", entropy-cost = 15, description = "Running assail/assault on a target (read-only over the target tree)" } -batch-scan = { mode = "auto", entropy-cost = 40, description = "assemblyline batch scan across a repo directory (rayon + BLAKE3)" } -network-external = { mode = "require-confirmation", entropy-cost = 50, description = "OSV API queries (Patch Bridge, http feature) or GitHub issue creation (notify)" } -state-mutation = { mode = "require-confirmation", entropy-cost = 30, description = "Writing the mitigation registry, verisimdb hexads, or suppression classifications" } -suppression-edit = { mode = "require-confirmation", entropy-cost = 35, description = "Editing audits/assail-classifications.a2ml (flips findings to suppressed)" } -credentials-read = { mode = "require-confirmation", entropy-cost = 75, description = "Accessing an Ed25519 signing key for attestation sealing" } -credentials-write = { mode = "require-explicit-intent", entropy-cost = 100, description = "Storing or transmitting credentials" } - -# === ENTROPY BUDGETS === -# Session-scoped risk tracking: accumulated cost per operation type, four threshold levels. - -[entropy-budgets.operations] -session-max = 500 -threshold-low = 100 -threshold-medium = 200 -threshold-high = 350 -threshold-critical = 500 - -scan-run = 15 # Cost to run a single assail scan -batch-scan-run = 40 # Cost to run an assemblyline batch scan -osv-api-call = 50 # Cost to query the OSV CVE feed -github-issue-create = 50 # Cost for the notify pipeline to open a GitHub issue -file-write-source = 10 # Cost per source file modification -file-write-critical = 75 # Cost per critical file (assail/analyzer.rs, kanren/*, types.rs) -suppression-registry-edit = 35 # Cost to add/modify a suppression classification -verisim-push = 30 # Cost to push a hexad to verisimdb -attestation-seal = 60 # Cost to Ed25519-seal an attestation chain -emergency-override = 200 # Cost to override a gating decision - -[entropy-budgets.thresholds] -low = "Routine operations (read, scan, small writes, single-target assail)" -medium = "Elevated risk (batch scan, source writes, suppression-registry edits)" -high = "Sensitive operations (external API, GitHub issue creation, attestation sealing)" -critical = "Reserved for emergency overrides only" - -# === RISK THRESHOLDS === - -[risk-thresholds.low] -entropy-range = [0, 100] -operations = ["file-read", "scan-execute", "scan-run"] -user-confirmation-required = false -audit-log-level = "info" -override-allowed = true - -[risk-thresholds.medium] -entropy-range = [101, 200] -operations = ["file-write", "batch-scan", "suppression-edit"] -user-confirmation-required = false -audit-log-level = "warning" -override-allowed = true -override-requires = "explicit-present-intent" - -[risk-thresholds.high] -entropy-range = [201, 350] -operations = ["network-external", "github-issue-create", "credentials-read", "attestation-seal"] -user-confirmation-required = true -audit-log-level = "critical" -override-allowed = true -override-requires = ["explicit-present-intent", "META-permit"] - -[risk-thresholds.critical] -entropy-range = [351, 500] -operations = ["credentials-write", "emergency-override"] -user-confirmation-required = true -audit-log-level = "critical" -override-allowed = false -never-override-actions = ["credential-exfiltration", "finding-falsification", "self-suppression", "attestation-forgery"] - -# === OVERRIDE PATHS === - -[override-paths.bypass-1] -condition = "User types: 'yes, I intend to '" -scope = "Any low/medium/high entropy operation" -requires = ["explicit-present-intent-in-current-turn", "META-permit"] -audit = "Must record user's exact intent phrase + timestamp" -never-applies-to = ["credential-exfiltration", "finding-falsification", "self-suppression"] - -[override-paths.bypass-2] -condition = "PLAYBOOK.a2ml explicitly schedules with user's prior written intent" -scope = "Pre-authorized scheduled operations (e.g. nightly Mass-panic batch scan)" -requires = ["META-permit", "PLAYBOOK entry with timestamp"] -audit = "Reference PLAYBOOK by section + date; log override use" -never-applies-to = ["credential-exfiltration", "finding-falsification", "self-suppression"] - -[override-paths.never-override] -actions = [ - "credential-exfiltration (storing secrets in clear text, sending creds to untrusted service)", - "finding-falsification (suppressing a real WeakPoint without a reviewable companion classification, or silencing analyzer errors)", - "self-suppression (editing source under scan to hide a finding instead of recording an audited classification in the separate registry)", - "attestation-forgery (sealing an attestation chain that does not bind the actual scan inputs)", - "corpus-skip-abuse (relocating real source under external_corpora/ / third_party/ / corpus/ to dodge scanning)" -] -reason = "These actions irreversibly compromise panic-attack's diagnostic trust model. No override path exists." - -# === DECISION RECORDING === - -[decision-recording] -enabled = true -backend = "attestation evidence chain (src/attestation/) + optional verisimdb hexads" -columns = [ - "timestamp (ISO 8601)", - "action_type (scan-execute, file-write, osv-api-call, suppression-edit, etc.)", - "target (path scanned or file written)", - "gate_result (allowed | denied)", - "entropy_cost (numeric)", - "entropy_after (session running total)", - "risk_threshold_applied (low | medium | high | critical)", - "user_intent_type (explicit-present | inferred-from-memory | none)", - "override_used (true | false)", - "audit_note (freetext; mandatory for denied/overridden actions)" -] -retention = "Bound to the attestation envelope; persisted to verisimdb where Mass-panic is active" - -# === AGENT PERMISSIONS & CONSTRAINTS === - -[agent-permissions] -can-edit-source = true -can-edit-tests = true -can-edit-docs = true -can-edit-config = true -can-create-files = true -can-run-scans = true -can-edit-suppression-registry = "with-confirmation" -can-push-verisimdb = "with-confirmation" - -[agent-constraints] -never-use = [ - "hardcoded secrets or credentials", - "AGPL license (use MPL-2.0)", - "state files in repository root (use .machine_readable/ only)", - "self-suppressing source edits (record audits in the separate classification registry instead)", - "compiler warnings in release or test builds (zero-warning policy)", - ".unwrap() in test harness code (return Result and use ?; production .unwrap() held ≤50)" -] -always-do = [ - "Check entropy budget before high-cost operations (network, GitHub issues, sealing)", - "Keep suppressions in audits/assail-classifications.a2ml — a reviewable companion change, never a single-side source edit", - "Run cargo test (--features http for bridge) before commit", - "Dogfood: scan panic-attack's own source after analyzer changes", - "Honour SPDX MPL-2.0 headers on every new file" -] diff --git a/.machine_readable/6a2/ANCHOR.a2ml b/.machine_readable/6a2/ANCHOR.a2ml deleted file mode 100644 index 20e8a0f7..00000000 --- a/.machine_readable/6a2/ANCHOR.a2ml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# ⚓ ANCHOR: panic-attack -# Canonical authority and project recalibration trigger for panic-attack. -# Template from: https://github.com/hyperpolymath/standards -identity: "org.hyperpolymath.panic-attack.anchor" - -id: "org.hyperpolymath.panic-attack" -version: "1.0.0" -clade: "diagnostic" -status: "active" - -# SSG Configuration (Unified boj-server build) -ssg: - engine: "casket" - output_dir: "public" - boj_trigger: true - cartridge: "ssg-mcp" - -# Relationships -parents: - - "org.hyperpolymath.boj-server" - - "org.hyperpolymath.ambientops" diff --git a/.machine_readable/6a2/ECOSYSTEM.a2ml b/.machine_readable/6a2/ECOSYSTEM.a2ml deleted file mode 100644 index 4b3ac328..00000000 --- a/.machine_readable/6a2/ECOSYSTEM.a2ml +++ /dev/null @@ -1,49 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# ECOSYSTEM.a2ml — Ecosystem position -# Converted from ECOSYSTEM.scm on 2026-03-15 - -[metadata] -version = "0.2.0" -last-updated = "2026-06-04" -project = "panic-attack" -ecosystem = "hyperpolymath" - -[project] -name = "Panic Attack" -full-name = "Panic Attack — static analysis and bug-signature detection tool" -purpose = """Static analysis and bug-signature detection. Scans source code for weak -points (unwrap/expect, unsafe blocks, panic sites, error-handling gaps, command -injection, unsafe deserialization, FFI boundaries, atom exhaustion, proof drift, -crypto misuse, supply-chain gaps, and more) across 49 language analyzers, emitting -25 weak-point categories (PA001–PA025). A miniKanren logic engine adds taint -analysis and cross-language vulnerability-chain reasoning.""" -role = "diagnostic-tool" - -[position] -tier = "diagnostic" -type = "component" -hospital-model-role = """Diagnostic tool for software health within the AmbientOps -hospital model. Loosely affiliated; sits alongside the Operating Room as a -software-health diagnostic, while hardware-crash-team is the hardware-health -sibling. Independent top-level repo that feeds findings into the hospital's -Records system via verisimdb.""" - -[related-projects] -projects = [ - { name = "verisimdb", relationship = "active-integration", notes = "Scan results persisted as hexads (document + semantic modalities). File I/O works; HTTP push via Chapel verisim-push subcommand under the http feature; full REST API integration planned." }, - { name = "hypatia", relationship = "active-consumer", notes = "Neurosymbolic rule engine consumes JSON AssailReport (Elixir rules) and processes findings. Env-var watcher in diagnostics.rs. Planned: ingestion of test_context/ffi_kind/jit_context metadata." }, - { name = "panll", relationship = "active-integration", notes = "Event-chain export for three-panel visualisation via the panll subcommand. Two dedicated panels: panic-attack (single-repo) and Mass Panic (assemblyline batch GUI)." }, - { name = "assemblyline", relationship = "core-subsystem", notes = "Batch scanning of repo directories with rayon parallelism and BLAKE3 fingerprinting; the engine of Mass-panic mode. Feeds the notify pipeline." }, - { name = "gitbot-fleet (panicbot)", relationship = "active-consumer", notes = "panicbot is the gitbot-fleet verifier bot. Invokes panic-attack assail --output-format json, translates WeakPoints to Findings PA001–PA025. Directives at .machine_readable/bot_directives/panicbot.scm; translator at gitbot-fleet/bots/panicbot/src/translator.rs." }, - { name = "echidna / echidnabot", relationship = "planned-integration", notes = "echidnabot will perform proof verification of scan claims (planned). echidna's own NEUROSYM.a2ml references panic-attack as its code-only banned-pattern scanner; the two are reciprocal — panic-attack scans echidna's Rust + Idris2 ABI." }, - { name = "hardware-crash-team", relationship = "sibling", notes = "Sibling diagnostic tool in the hospital model: hardware diagnostics vs panic-attack's software analysis." }, - { name = "ambientops", relationship = "parent-context", notes = "The hospital-model umbrella. See ambientops/.claude/CLAUDE.md for the overview. panic-attack is loosely affiliated, not a hard dependency." }, -] - -[integration-surface] -output-formats = ["text", "json"] -panicbot-invocation = "panic-attack assail --output-format json" -finding-codes = "PA001–PA025" -verisim-push = "panic-attack verisim-push --url --retry --fallback-dir (http feature)" -panll-export = "panic-attack panll" -attestation = "Optional Ed25519-signed intent→evidence→seal chain wrapped in an A2ML envelope" diff --git a/.machine_readable/6a2/META.a2ml b/.machine_readable/6a2/META.a2ml deleted file mode 100644 index 2373d544..00000000 --- a/.machine_readable/6a2/META.a2ml +++ /dev/null @@ -1,84 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# META.a2ml — Project meta-information -# Converted from META.scm on 2026-03-15 - -[metadata] -project = "panic-attack" -author = "Jonathan D.A. Jewell " -license = "MPL-2.0" -standard = "RSR 2026" -version = "2.5.5" -last-updated = "2026-06-04" -status = "active" - -[project-context] -name = "panic-attack" -full-name = "Panic Attack — static analysis and bug-signature detection tool" -completion-percentage = 99 -phase = "v2.5.5 — 25 detection categories + context-aware FP suppression + Chapel→VeriSimDB HTTP push" -notes = """ -Static analysis engine that scans source across 49 language analyzers for -25 weak-point categories (PA001–PA025). Renamed 2026-02-08: binary -panic-attacker→panic-attack, subcommand xray→assail, module src/xray→src/assail, -type XRayReport→AssailReport. Three self-contained deployment modes: -Standalone, Panicbot, Mass-panic. See .claude/CLAUDE.md for the full surface. -""" - -[dependencies] -primary = ["Rust"] -secondary = ["Chapel", "Idris2"] -build-features = ["http"] -notes = "Single-binary core has zero runtime deps (Standalone mode). The http feature enables Patch Bridge (OSV API). Chapel is planned for distributed Mass-panic orchestration. Idris2 ABI proofs (PatternCompleteness.idr, Stripping.idr) back the detection surface." - -# ───────────────────────────────────────────────────────────────────────────── -# Architecture decisions -# ───────────────────────────────────────────────────────────────────────────── - -[architecture.per-file-language-detection] -decision = "Each file is analyzed with its own language-specific pattern set, not a single project-wide language guess" -rationale = "Polyglot repositories are the norm; a Rust crate with embedded Zig FFI and shell build scripts needs each file matched to the right detector" -consequence = "49 language analyzers in src/assail/analyzer.rs; corpus directories (external_corpora/, third_party/, corpus/) are skipped to avoid scanning vendored code" - -[architecture.minikanren-logic-engine] -decision = "A miniKanren-inspired relational logic engine (src/kanren/) layers over the syntactic analyzers" -rationale = "Taint flows, cross-language vulnerability chains, and false-positive suppression are relational reasoning problems, not regex problems" -consequence = "TaintAnalyzer (source→sink), CrossLangAnalyzer (FFI/NIF/Port/subprocess boundaries), SearchStrategy (risk-weighted prioritisation), forward chaining + backward queries over a FactDB" - -[architecture.non-gameable-suppression] -decision = "Audited findings are flipped to suppressed=true only via a project-local registry file held SEPARATELY from the source under scan" -rationale = "If a source edit could self-suppress, adding a new unsafe block would be invisible; keeping the registry in a companion file makes every suppression a reviewable change" -consequence = "audits/assail-classifications.a2ml (preferred) or .panic-attack-classifications.a2ml (fallback); applied by analyze()/analyze_verbose() after the kanren structural pass. Reference: hyperpolymath/007" - -[architecture.context-aware-fp-suppression] -decision = "v2.5.5 adds content-aware classifiers (test_context, comment_marker, ffi_kind, jit_context) that run after the kanren rules" -rationale = "A PanicPath in a test, an unsafe block behind an audited FFI build script, or a transmute inside a JIT compiler are legitimate residuals that should not be reported as defects" -consequence = "apply_v255_context_suppression() flips test-only/doc PanicPath and BuildSystem/TestMock UnsafeFFI; inline `// panic-attack: accepted` markers honoured string-literal-aware" - -[architecture.three-phase-attestation] -decision = "Scan runs can be wrapped in a cryptographic attestation chain: intent → evidence → seal" -rationale = "Pipeline consumers need to bind a report to the exact inputs and commitments that produced it, optionally Ed25519-signed" -consequence = "src/attestation/ (intent.rs, evidence.rs rolling hash, seal.rs, chain.rs, envelope.rs A2ML wrapper)" - -[architecture.deployment-modes] -decision = "Three self-contained deployment modes share one binary; none requires the others" -rationale = "The same engine must run air-gapped on a USB stick, inside CI as a verifier bot, and at org scale across a repo directory" -consequence = "Standalone (zero-dep single binary), Panicbot (JSON for gitbot-fleet), Mass-panic (assemblyline rayon batch + BLAKE3 incremental + verisimdb hexads)" - -# ───────────────────────────────────────────────────────────────────────────── -# Development practices -# ───────────────────────────────────────────────────────────────────────────── - -[practices] -error-handling = "anyhow::Result throughout; production .unwrap() held to ≤50 and static-regex OnceLock closures use .expect()" -serialization = "serde derive on all public types for machine-readable JSON output" -warnings-policy = "Zero compiler warnings in release and test builds" -spdx = "MPL-2.0 SPDX header on every file" -panic-free-tests = "All 11 test files return Result and use ? (Clade A panic-free); 3 canonical patterns contributed to panic-free-tests-and-benches v1.2.0" -dogfooding = "Self-scan E2E test scans panic-attack's own source as a representative target" - -[readiness-tests] -location = "tests/readiness.rs" -grade-d = "Alpha — component runs without crashing on valid input" -grade-c = "Beta — component produces correct output on representative input" -grade-b = "RC — component handles edge cases and multiple input types" -runner = "just readiness / just readiness-summary" diff --git a/.machine_readable/6a2/NEUROSYM.a2ml b/.machine_readable/6a2/NEUROSYM.a2ml deleted file mode 100644 index 4d5bf16a..00000000 --- a/.machine_readable/6a2/NEUROSYM.a2ml +++ /dev/null @@ -1,214 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# NEUROSYM.a2ml — Neurosymbolic semantics for static-analysis operations -# Formal definitions of operation semantics, proof obligations, and composition rules -# for the panic-attack miniKanren logic engine layered over 49 language analyzers. - -[metadata] -version = "0.1.0" -last-updated = "2026-06-04" -spec-version = "NEUROSYM-FORMAT v0.1.0" -authority = "Jonathan D.A. Jewell (hyperpolymath)" -conformance = "NEUROSYM-FORMAT-SPEC-compliant" - -# === ARCHITECTURE === -# Symbolic reasoning layer over the syntactic analyzers. - -[architecture] -neural-substrate = "Not a learned model — the 49 per-file language analyzers (src/assail/analyzer.rs + patterns.rs) provide the syntactic 'recognition' layer that surfaces candidate WeakPoints" -symbolic-engine = "miniKanren-inspired relational logic engine (src/kanren/, v2.0.0) reasons over candidates: Term, Substitution, unification, FactDB, forward chaining" -downstream-reasoner = "Hypatia neurosymbolic rule engine consumes the JSON AssailReport and applies Elixir rules" -principle = "Recognition (analyzers) is heuristic and may over-report; relational reasoning (kanren) refines, links, and suppresses; the registry records honest residuals" - -# === OPERATION DEFINITIONS === -# For every core operation: forward semantics, inverse, claim-type, entropy-contribution, pre/postconditions. - -[operation-definitions.analyze] -forward-semantics = "Run per-file language detection; apply that language's attack patterns; emit candidate WeakPoints (PA001–PA025) into an AssailReport" -inverse = "Discard the report; re-scan from clean source (always possible — analysis is pure over file contents)" -claim-type = "candidate (raw analyzer hits before kanren refinement and suppression)" -entropy-contribution = 15 -preconditions = [ - "target path readable", - "file language detectable (Latin-1 fallback for non-UTF-8)", - "path not under external_corpora/ / third_party/ / corpus/ (skipped)" -] -postconditions = [ - "AssailReport populated with WeakPoints carrying category, file, line, severity", - "each WeakPoint.suppressed = false (pending suppression passes)" -] - -[operation-definitions.taint-analysis] -forward-semantics = "TaintAnalyzer tracks data flow from sources (user input, network, deserialization) to sinks (eval, shell commands, SQL queries) via relational source→sink resolution" -inverse = "Drop derived taint facts; the underlying candidate WeakPoints remain" -claim-type = "derived (a taint chain is inferred, not directly observed)" -entropy-contribution = 25 -preconditions = [ - "FactDB seeded with source and sink facts from the analyzers", - "unification available over Term" -] -postconditions = [ - "source→sink chains materialised as new facts", - "CommandInjection / UnsafeDeserialization candidates corroborated or refuted" -] - -[operation-definitions.crosslang-reasoning] -forward-semantics = "CrossLangAnalyzer detects vulnerability chains crossing FFI / NIF / Port / subprocess boundaries between language families" -inverse = "Drop cross-language edges; per-language facts persist" -claim-type = "derived (boundary-crossing chain inferred from both sides)" -entropy-contribution = 30 -preconditions = [ - "facts present on both sides of a boundary (e.g. Rust unsafe extern + C callee)", - "boundary kind recognised (FFI/NIF/Port/subprocess)" -] -postconditions = [ - "UnsafeFFI chains linked across files/languages", - "crosslang flag available to the query DSL" -] - -[operation-definitions.forward-chaining] -forward-semantics = "Apply detection rules to existing facts to derive new vulnerability facts until fixpoint" -inverse = "Retract derived facts; base facts unchanged" -claim-type = "derived (rule consequence)" -entropy-contribution = 20 -preconditions = ["FactDB non-empty", "rule set loaded (src/signatures/rules.rs)"] -postconditions = ["closure of derivable facts computed", "bug signatures (use-after-free, deadlock, etc.) surfaced"] - -[operation-definitions.backward-query] -forward-semantics = "Given a target vulnerability type, find which files could cause it (relational backward search)" -inverse = "None needed — query is read-only over the FactDB" -claim-type = "derived (existential witness search)" -entropy-contribution = 10 -preconditions = ["FactDB populated", "goal vulnerability type well-formed"] -postconditions = ["witness file set returned (possibly empty)"] - -[operation-definitions.apply-suppression] -forward-semantics = "Run the kanren structural-suppression pass over candidate WeakPoints; flip structurally-explained findings to suppressed = true" -inverse = "Re-run analyze from source to recover the unsuppressed candidate set" -claim-type = "refined (structural suppression is sound w.r.t. the rule set, not absolute ground truth)" -entropy-contribution = 15 -preconditions = ["AssailReport populated by analyze", "suppression rules available"] -postconditions = [ - "structurally-explained candidates marked suppressed", - "apply_user_classifications runs next (registry overlay)", - "apply_v255_context_suppression runs after (test_context / comment_marker / ffi_kind / jit_context)" -] - -[operation-definitions.user-classification-overlay] -forward-semantics = "Load audits/assail-classifications.a2ml (or .panic-attack-classifications.a2ml fallback); flip matching audited findings to suppressed = true" -inverse = "Remove the registry overlay; suppression reverts to the kanren structural result" -claim-type = "audited (a human audit is recorded in a file SEPARATE from the source under scan)" -entropy-contribution = 5 -preconditions = [ - "registry file present and parseable (A2ML S-expression)", - "each classification names file + category + audit reference + rationale" -] -postconditions = [ - "audited residuals suppressed with a reviewable provenance", - "self-suppression impossible: a new unsafe block cannot hide itself without a companion registry edit" -] - -# === COMPOSITION RULES === - -[composition-rules.scan-pipeline] -pattern = "analyze ; apply_suppression ; apply_user_classifications ; apply_v255_context_suppression" -entropy-behavior = "sum (each pass contributes independently)" -claim-propagation = "monotone-refining (each pass can only suppress, never invent, a finding)" -example = "analyze() / analyze_verbose() full pipeline" -semantics = "Candidate set is produced once, then narrowed by successive sound suppression passes" - -[composition-rules.relational-derivation] -pattern = "taint-analysis || crosslang-reasoning || forward-chaining (over a shared FactDB)" -entropy-behavior = "sum (independent derivations accumulate facts)" -claim-propagation = "additive (derived facts corroborate candidates; none are removed)" -example = "kanren engine deriving CommandInjection + UnsafeFFI + bug signatures" -semantics = "All derivations read the same FactDB; results union into the report" - -[composition-rules.suppression-precedence] -pattern = "IF user-classification matches THEN audited-suppressed ELSE IF structural/context rule fires THEN rule-suppressed ELSE reported" -entropy-behavior = "no-cost (precedence is metadata, not execution)" -claim-propagation = "special (suppression status follows the highest-provenance match)" -example = "Registry audit beats structural suppression beats raw candidate" -semantics = "Audited classifications are the strongest suppression evidence because they are reviewable companion changes" - -# === PROOF OBLIGATIONS === - -[proof-obligations.suppression-non-gameable] -name = "A finding may only be suppressed via a change reviewable independently of the source under scan" -claim-type = "audited" -verification-method = "User-classification registry lives in audits/assail-classifications.a2ml, a separate file from the scanned source" -discharge-requirements = [ - "registry edit is a distinct, reviewable change from the source edit", - "each suppression names an audit reference (e.g. audits/audit-ffi-unsafe.md §1) + rationale" -] -failure-action = "report-finding (no valid companion classification ⇒ the WeakPoint is surfaced)" - -[proof-obligations.pattern-completeness] -name = "Every supported language × category pair has a defined, total detection arm" -claim-type = "verified" -verification-method = "Idris2 ABI proof src/abi/PatternCompleteness.idr (49 languages, 25 categories, all proven total)" -discharge-requirements = ["each (language, category) handled", "no partial match arms"] -failure-action = "abort-build (ABI type-check fails; idris2 totality not satisfied)" - -[proof-obligations.strip-idempotence] -name = "Comment-stripping used in detection is idempotent (strip(strip x) = strip x)" -claim-type = "verified (partial — Layer 1.0)" -verification-method = "Idris2 ABI proof src/abi/Stripping.idr (IsStrippedBody shape lemma + base cases Qed-closed)" -discharge-requirements = ["stripBodyProducesStrippedShape proven", "line-comment base cases closed"] -failure-action = "flag-open-obligation (slash-slash inductive closure remains open; tracked in PROOF-PROGRAMME row 1)" - -[proof-obligations.corpus-exclusion] -name = "Vendored corpus directories are never scanned as first-party code" -claim-type = "verified" -verification-method = "Directory skip in analyzer for external_corpora/ / third_party/ / corpus/" -discharge-requirements = ["path prefix match short-circuits analysis before pattern application"] -failure-action = "abort-operation (a corpus-skip-abuse relocation would otherwise hide real source — see AGENTIC never-override)" - -# === TYPE SYSTEM === - -[type-system.base-types] -WeakPoint = "{ category: Category, file: String, line: Int, severity: Severity, suppressed: Bool, test_context: TestContext option, ffi_kind: FfiKind option, jit_context: JitContext option }" -Category = "PA001..PA025 (UnsafeCode, PanicPath, CommandInjection, UnsafeDeserialization, AtomExhaustion, UnsafeFFI, PathTraversal, HardcodedSecret, ProofDrift, CryptoMisuse, SupplyChain, InputBoundary, MutationGap, ...)" -AssailReport = "{ target: String, weak_points: WeakPoint list, summary: Counts }" -Term = "{ ast: LogicTerm, var-bindings: Substitution }" -Fact = "{ predicate: String, args: Term list }" -TaintChain = "{ source: Site, sink: Site, path: Site list }" -UserClassification = "{ file: String, category: Category, audit: String, rationale: String }" -TestContext = "{ Rust | Python | Go | JsTs | Julia | Zig | Elixir | Docs }" -FfiKind = "{ BuildSystem | RuntimeAbi | TestMock | Unknown }" -JitContext = "{ Cranelift | Llvm | Wasm | Javascript | None }" - -[type-system.operation-signatures] -analyze = "Path → AssailReport (always succeeds; emits candidate set)" -taint-analysis = "FactDB → TaintChain list (always succeeds; possibly empty)" -crosslang-reasoning = "FactDB → CrossLangChain list (always succeeds; possibly empty)" -backward-query = "Category × FactDB → File set (always succeeds; existential search)" -apply-suppression = "AssailReport → AssailReport (idempotent; monotone-refining)" -apply-user-classifications = "AssailReport × RegistryFile → AssailReport (idempotent overlay)" - -[type-system.operations-that-never-fail] -operations = [ - "analyze (Latin-1 fallback handles non-UTF-8; unreadable files reported, not fatal)", - "backward-query (empty witness set is a valid answer)", - "apply-suppression (no-op if no rule fires)" -] - -# === SEARCH STRATEGY === -# Risk-weighted file prioritisation (src/kanren/strategy.rs). - -[search-strategy] -auto-selection = "SearchStrategy auto-selects per project characteristics" -strategies = ["RiskWeighted", "BoundaryFirst", "LanguageFamily", "BreadthFirst", "DepthFirst"] -boundary-first-when = "FFI/NIF/Port boundaries dominate the project" -risk-weighted-when = "general-purpose default; prioritises files by accumulated risk facts" - -# === HYPATIA INTEGRATION === - -[hypatia-config] -scan-enabled = true -report-format = "JSON (AssailReport)" -consumer = "Hypatia neurosymbolic rule engine (Elixir rules)" -finding-codes = "PA001–PA025" -env-watcher = "src/diagnostics.rs (self-check for Hypatia / gitbot-fleet)" -planned = "Ingestion of test_context / ffi_kind / jit_context; ContextSuppressed bucket distinct from RuleSuppressed" diff --git a/.machine_readable/6a2/PLAYBOOK.a2ml b/.machine_readable/6a2/PLAYBOOK.a2ml deleted file mode 100644 index 0cbb30ac..00000000 --- a/.machine_readable/6a2/PLAYBOOK.a2ml +++ /dev/null @@ -1,118 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# PLAYBOOK.a2ml — Operational playbook -# Runbooks, build/test/scan procedures, deployment modes. - -[metadata] -version = "1.0.0" -last-updated = "2026-06-04" - -[build] -with-patch-bridge = "cargo build --release --features http" -without-patch-bridge = "cargo build --release" -notes = "The http feature enables Patch Bridge (OSV API queries) and the verisim-push subcommand; it needs network at runtime, not build time. Standalone mode uses the no-feature build." - -[test] -all = "cargo test --features http" -core = "cargo test" -readiness = "just readiness" -readiness-summary = "just readiness-summary" -notes = "Zero compiler warnings in release + test builds. Test harness is panic-free (Clade A): all test files return Result and use ?." - -[install] -command = "cp target/release/panic-attack ~/.asdf/installs/rust/nightly/bin/" - -[scan] -single-target = "panic-attack assail /path/to/repo" -single-target-json = "panic-attack assail /path/to/repo --output report.json" -single-target-verbose = "panic-attack assail /path/to/repo --verbose" -json-stream = "panic-attack assail --output-format json # panicbot invocation" -stress-test = "panic-attack assault /path/to/target # 6-axis stress testing" -batch = "assemblyline batch scan across a repo directory (Mass-panic; rayon + BLAKE3 incremental)" -delta = "panic-attack diff # only report changes since last scan" -query = "panic-attack query # heads: category, rule-id, severity, repo, file, pr-state, since, crosslang, diff, and, or, not" -panll-export = "panic-attack panll # event-chain export for three-panel visualisation" - -[patch-bridge] -triage = "panic-attack bridge triage /path/to/project" -triage-json = "panic-attack bridge triage /path/to/project --output report.json" -triage-register = "panic-attack bridge triage /path/to/project --register" -triage-offline = "panic-attack bridge triage /path/to/project --offline" -status = "panic-attack bridge status /path/to/project" -requires = "--features http at build time" -flow = "Parse Cargo.lock → query OSV API → reachability scan (.rs imports) → classify (Mitigable/Unmitigable/Informational) → JSON report" - -[verisim-push] -command = "panic-attack verisim-push --url --retry --fallback-dir" -requires = "http Cargo feature" -semantics = "local-writes-authoritative + push-additive; local hexad written first, push is additive" - -# ───────────────────────────────────────────────────────────────────────────── -# Deployment modes — three self-contained modes; none requires the others -# ───────────────────────────────────────────────────────────────────────────── - -[deployment-modes.standalone] -context = "USB / laptop / air-gapped" -binary = "Single binary, zero runtime deps" -usage = "assail / assault individual targets" -build = "cargo build --release" - -[deployment-modes.panicbot] -context = "gitbot-fleet / CI" -behaviour = "Automated JSON scanning; PA001–PA025 codes; bot directives" -invocation = "panic-attack assail --output-format json" -directives = ".machine_readable/bot_directives/panicbot.scm" -translator = "gitbot-fleet/bots/panicbot/src/translator.rs" -suppression = "panicbot drops WeakPoints with suppressed = true" - -[deployment-modes.mass-panic] -context = "assemblyline + verisimdb + Chapel" -behaviour = "Org-scale batch scanning with incremental BLAKE3 fingerprinting, hexad persistence, delta reporting, notifications" -parallelism = "rayon (per-repo); Chapel coforall planned for distributed multi-machine (v3.0.0)" -persistence = "verisimdb hexads (document + semantic modalities); per-finding hexads gated by PANIC_ATTACK_STORE_FINDING_HEXADS=1" -notify = "assemblyline → markdown summaries → GitHub issues (src/notify.rs)" - -# ───────────────────────────────────────────────────────────────────────────── -# Runbooks -# ───────────────────────────────────────────────────────────────────────────── - -[incident-response] -steps = [ - "Check .machine_readable/6a2/STATE.a2ml for current status", - "Review recent commits and CI results (chapel-ci.yml aggregator gate)", - "Re-run cargo test --features http to confirm the regression", - "Dogfood: run panic-attack assail on panic-attack's own source", - "If a false positive: record an audited classification in audits/assail-classifications.a2ml (never edit the source under scan to hide it)" -] - -[release-process] -steps = [ - "Update version in STATE.a2ml and META.a2ml", - "Run cargo test --features http (all suites) and confirm zero warnings", - "Run just readiness-summary", - "Tag the release with git tag vX.X.X", - "Push the tag to origin" -] - -[rollback-process] -steps = [ - "Identify the last stable tag", - "Revert to the stable tag with git revert", - "Re-run cargo test --features http to confirm green" -] - -[suppression-runbook] -when = "A reported WeakPoint is a legitimate, audited residual (e.g. genuine FFI unsafe)" -steps = [ - "Write the audit (e.g. audits/audit-ffi-unsafe.md §1) explaining why the residual is sound", - "Add a classification entry to audits/assail-classifications.a2ml naming file + category + audit reference + rationale", - "Re-run the scan; apply_user_classifications flips the finding to suppressed = true", - "Commit the registry edit as a reviewable companion change — never a single-side source edit" -] -reference = "hyperpolymath/007 audits/assail-classifications.a2ml" - -[monitoring] -self-check = "src/diagnostics.rs — self-check for Hypatia / gitbot-fleet (env-var watcher)" -warnings-policy = "Zero compiler warnings in release + test builds" -ci = ".github/workflows/chapel-ci.yml (MassPanic wiring + cross-rust contract checks + always-on aggregator gate)" diff --git a/.machine_readable/6a2/STATE.a2ml b/.machine_readable/6a2/STATE.a2ml deleted file mode 100644 index de374a07..00000000 --- a/.machine_readable/6a2/STATE.a2ml +++ /dev/null @@ -1,116 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# STATE.a2ml — Project state checkpoint -# Converted from STATE.scm on 2026-03-15 - -[metadata] -project = "panic-attack" -version = "2.5.5" -last-updated = "2026-06-24" -status = "active" - -[project-context] -name = "panic-attack" -completion-percentage = 99 -phase = "CRG C (Beta) — v2.5.5 complete: 25 detection categories + shell completions + delta reporting + context-aware FP suppression (test_context/comment_marker/ffi_kind/jit_context) + Chapel→VeriSimDB HTTP push + PROOF-PROGRAMME Layer 1.0 partial" - -[testing-completion-2026-04-04] -description = "CRG C blitz completed: unit + smoke + build + P2P + E2E + reflexive + contract + aspect + benchmarks" -unit-tests = "116 passing (inline #[test] across 62 modules)" -p2p-tests = "14 passing (property-based invariant tests in tests/property_tests.rs)" -e2e-tests = "12 passing (full-pipeline tests in tests/e2e_tests.rs, including self-scan dogfooding)" -aspect-tests = "18 passing (error handling, performance scaling, security evasion in tests/aspect_tests.rs)" -integration-tests = "3 passing (tests/integration.rs)" -benchmarks = "7 criterion benchmarks (benches/scan_bench.rs with baselines)" -total-tests = "282+ tests, all passing" -compiler-warnings = "0 in release builds" - -[fixes-2026-03-23] -a2ml-parser = "Now handles TOML-like format in addition to S-expression format" -manifest-lookup = "Tries 0-AI-MANIFEST.a2ml first, then falls back to AI.a2ml" -language-detection = "Skips external_corpora/, third_party/, and corpus/ directories during scanning" - -[session-2026-04-12] -logtalk-removed = "Logtalk export removed; Hypatia now consumes JSON AssailReport via Elixir rules" -fp-suppression = "WeakPoint.suppressed field wired; apply_suppression() runs kanren engine on every scan; panicbot filters suppressed items" -languages = "49 languages (added Isabelle/HOL .thy and Coq/Rocq .v with dedicated analyzers)" -categories = "23 weak point categories as of 2026-04-12 (ProofDrift PA021, CryptoMisuse PA022, SupplyChain PA023); InputBoundary PA024 + MutationGap PA025 added same session → 25 total" -proof-drift = "ProofDrift: sorry/oops/Admitted/trustMe/believe_me/assert_total/%partial across Isabelle/Coq/Lean/Agda/Idris2; Julia mirror patterns" -crypto-misuse = "CryptoMisuse: MD5/SHA-1 in security context (Rust/Python/JS/Go/Elixir); timing-unsafe == on secret variables" -supply-chain = "SupplyChain: Cargo.toml git-deps without rev=, absent Cargo.lock, Julia Manifest.toml without hashes, flake.nix without narHash, unpinned deno.json" -panicbot-wired = "PA021/PA022/PA023 wired in gitbot-fleet/bots/panicbot/src/translator.rs" -idris2-abi = "PatternCompleteness.idr updated: 49 languages, 25 categories, all proven total" - -[session-2026-04-12b] -input-boundary = "InputBoundary PA024: CBOR/MessagePack (serde_cbor/ciborium/rmp_serde) in Rust, JSON.parse without try-catch in JS, JSON3.read/JSON.parse in Julia" -mutation-gap = "MutationGap PA025: Cargo.toml with test infra but no cargo-mutants config (Rust, project-level), @testset all-type-only assertions (Julia), ExUnit without ExUnitProperties/StreamData (Elixir)" -panicbot-wired = "PA024/PA025 wired in gitbot-fleet/bots/panicbot/src/translator.rs" -categories = "25 weak point categories total (v2.5.0 complete)" -v25-complete = "All 5 v2.5.0 detection categories done: crypto_misuse, proof_drift, supply_chain, input_boundary, mutation" - -[shipped-v250] -shell-completions = "bash, zsh, fish, nushell, powershell — clap_complete + clap_complete_nushell, generated files in completions/" -delta-reporting = "diff subcommand — only reports changes since last scan, src/report/diff.rs" - -[session-close-2026-04-12] -action = "Verified shell completions + delta reporting both shipped; advanced STATE to v2.5.0; removed stale next-priority entries" -commit = "4624e53" -blocker = "none" - -[session-2026-04-25] -description = "Full test suite converted to panic-free Clade A; production .unwrap() reduced to ≤50" -test-files-converted = "11 of 11 test files now return Result and use ? throughout (zero .unwrap() in harness code)" -files = "assemblyline_tests, analyzer_tests, pattern_tests, panll_tests, report_tests, sarif_tests, types_tests, property_tests, readiness, e2e_tests, unbounded_corpus" -production-unwrap-fixes = "Static-regex OnceLock closures → .expect(); fixed_versions.first() panic risk in bridge/classify.rs" -clade-registry = "3 canonical pattern files contributed to panic-free-tests-and-benches v1.2.0 (25 total patterns)" -commits = "39b4353 (3 remaining test files); 9fe8507, 2053fd9 (prior test files); 5ea9b74 (production fixes)" -tests-passing = "200 pass / 0 fail / 3 ignored across all test binaries" - -[session-2026-06-01] -description = "Baseline-red corrective maintenance + rsr-template gap fills + dependency bumps" -prs-merged = "#93 (rust-minor dependabot: log 0.4.29→0.4.30 + eframe), #94 (3 baseline-red fixes), #96 (rsr-template scaffolding gaps), #97 (rust-ci-reusable SHA bump past standards#334)" -baseline-red-resolved = "Dogfood Gate A2ML (file relocated to .machine_readable/campaigns/ + validator SHA bumped to 6bff6ec); Governance Trusted-base (analyzer.rs whole-file exemption — file IS the scanner); Secret Scanner rust-secrets (concat! split of password keyword)" -upstream-fixes-landed = "standards#334 (rust-ci-reusable.yml bare-if wrap), standards#336 (elixir-ci-reusable.yml same pattern), a2ml-validate-action#26 (s-expression form support, SHA 6bff6ec)" -estate-sweep-spawned = "a2ml-validate-action SHA bump fanout across 215 estate repos (excluding panic-attack, no forks); throttled 7min/PR; logs at /tmp/a2ml-sha-sweep/progress.tsv" -commits = "b323f6f (baseline-red fixes), 5e02b82 (a2ml relocation), 11e54a9 (action SHA bump on #94)" -blocker = "none" - -[session-2026-06-02-pm] -description = "v2.5.5 context-awareness cohort + v3.0.0 Chapel→VeriSimDB HTTP push + PROOF-PROGRAMME" -prs-merged = "#102 (test_context foundation), #104 (PROOF-PROGRAMME 3-layer), #105 (comment_marker inline suppression), #106 (ffi_kind subtyping), #107 (jit_context classifier), #108 (Chapel verisim-push), #110 (Phase 2 analyzer wire-up), #111 (Layer 1.0 strip-idempotence partial)" -v255-test-context = "Cross-language test-path classification (Rust/Python/Go/JS-TS/Julia/Zig/Elixir/docs); WeakPoint.test_context: Option field through 137 sites; content-promotion via ExUnit/unittest/pytest/@testset markers" -v255-comment-marker = "// panic-attack: accepted [- reason] inline marker; mid-line // for C-family, start-of-line for # / -- / ; / % / /// / //!; string-literal aware; shebang excluded; same-or-preceding-line scope" -v255-ffi-kind = "PA013 subtyped: BuildSystem (build.zig/build.rs audit-accepted) / RuntimeAbi (bindings/ ffi/ sys/ cdef.zig audit-significant) / TestMock (tests/mocks tests/stubs audit-accepted) / Unknown; is_audited_boundary() parses audits/audit-ffi-unsafe.md sections" -v255-jit-context = "Cranelift / Llvm / Wasm / Javascript / None classifier; classify_rust(content) heuristic; transmute_targets_fn_ptr tolerant of unsafe { ... } wrappers" -v255-phase-2-wire-up = "apply_v255_context_suppression() runs after kanren rules: marker-flip suppressed=true, PanicPath-in-TestOnly/Doc auto-suppress, UnsafeFFI-in-BuildSystem/TestMock auto-suppress; per-file content cache" -v300-chapel-verisim-push = "panic-attack verisim-push --url --retry --fallback-dir subcommand under http Cargo feature; Chapel takeSnapshot 6-arg overload spawns subprocess after local hexad write; local-writes-authoritative + push-additive semantics" -proof-programme = "PROOF-PROGRAMME.md (3-layer Surface/Engine/Persistence, 9-phase ~16-week sequence); src/abi/Stripping.idr (Layer 1.0 partial: IsStrippedBody shape lemma + stripBodyProducesStrippedShape + base cases of stripLineCommentsIdempotent Qed-closed; open: slash-slash inductive closure)" -proven-cross-fit = "SafePath + SafeUrl identified as port-to-Rust candidates (perf-neutral, semantic-equivalent); SafeJson / SafeRegex / SafeDateTime / SafeCommand / SafeEnv / SafeUUID marked skip (already total / semantic mismatch); 7 gaps for first-principles proofs (miniKanren engine, hexad model, A2ML chain, bridge reachability, sweep tracker, adjudicate/axial, FFI ABI)" -test-count = "897 passing (cargo test --release; 4 ignored; 901 runnable per --list)" -truthfulness-fix = "tests/ WeakPoint constructions sed-updated for test_context field (was silently broken on main post-#102)" -blocker = "none" - -[session-2026-06-24] -description = "assail detector precision fixes (false-positive reduction) — PR #134" -unchecked-alloc = "UncheckedAllocation (C) now NULL-check aware: per-line scan, skips malloc whose result is guarded (if (p==NULL)/if(!p)/nullptr) within a 7-line window, attaches line number (enables inline // panic-attack: accepted markers). Genuinely-unchecked malloc still fires. New helper c_alloc_result_is_null_checked() in analyzer.rs." -dyn-code-exec = "DynamicCodeExecution (JS/Python) word-boundary aware: \\beval\\s*\\( (and \\b(?:eval|exec)\\s*\\( for Python) so FFI symbols like proven_calculator_eval( are not flagged; genuine eval( still fires." -command-injection = "CommandInjection (Shell) no longer matches --eval/-eval CLI flag: eval builtin matched only in statement position via (?m)(?:^|[\\s;&|(])eval[ \\t]." -conservative = "All three are precision-only (no new false negatives): a site is treated benign only on a clear signal. 4 new tests in tests/analyzer_tests.rs; full analyzer suite 17/17 green; zero warnings." -verified = "End-to-end re-scan: proven 1->0 active Critical/High (stubs.c clears, the genuine fix now registers); paint-type 36->35 (gossamer --eval benchmark FP clears; vendored unsafe FFI + irreducible believe_me axiom correctly remain)." -origin = "Surfaced triaging proven#68 / paint-type#86; refs panic-attack#32." -blocker = "none" - -[next-priorities] -hexad-patch-bridge = "Migrate Patch Bridge mitigation registry from JSON to hexad persistence (ROADMAP v2.2.0 / v2.4.0)" -multi-lockfile = "Extend Patch Bridge beyond Cargo.lock to package-lock.json, mix.lock, etc. (ROADMAP v2.4.0)" -trend-queries-vcl = "Historical trend queries via VCL (ROADMAP v2.2.0)" -chapel-wave-3 = "Cross-node gasnet/ofi over real NIC — needs cluster runner (issue #87 Wave 3)" -layer-1-0-closure = "stripIsIdentityOnStrippedBody — closes slash-slash inductive case of stripLineCommentsIdempotent (PROOF-PROGRAMME row 1 follow-up)" -layer-1-0-block-strings = "Stripping_Block.idr + Stripping_Strings.idr + Stripping_Composition.idr + Stripping_PositionPreservation.idr (PROOF-PROGRAMME row 1 remaining)" -hypatia-rule-wiring = "Hypatia ingestion of test_context / ffi_kind / jit_context metadata; ContextSuppressed bucket distinct from RuleSuppressed" -gitbot-panicbot-wiring = "gitbot-fleet panicbot translator: surface test_context + suppression-reason in fleet-side reports" - -[repair-2026-11-06-toml-dependency] -change = "toml_edit is required by unconditional assail configuration analysis; remove optional=true" -regression = "Verify matrix adds exact http-only downstream feature combination alongside default and http,sarif" -validation = "TOML/YAML structure and dependency declarations checked locally; Rust toolchain unavailable; compilation and full suite await CI" -status = "candidate; not a verified estate resolution" diff --git a/.machine_readable/CLADE.a2ml b/.machine_readable/CLADE.a2ml deleted file mode 100644 index cf405c23..00000000 --- a/.machine_readable/CLADE.a2ml +++ /dev/null @@ -1,50 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Clade declaration — part of the gv-clade-index registry -# See: https://github.com/hyperpolymath/gv-clade-index - -[identity] -uuid = "e4f11b6b-626c-5dd2-bb83-312c9dc0d968" -primary-forge = "github" -primary-owner = "hyperpolymath" -canonical-name = "panic-attack" -prefixed-name = "sc-panic-attack" - -[clade] -primary = "sc" -secondary = ["rm"] -assigned = "2026-03-16" -rationale = "" - -[forges] -github = "hyperpolymath/panic-attack" -gitlab = "hyperpolymath/panic-attack" -bitbucket = "hyperpolymath/panic-attack" - -[lineage] -type = "standalone" -parent = "Security scanning tool — static analysis" -born = "2026-03-16" - -# Lifecycle status (added by clade-status-backfill; see gv-clade-index ADR 0006). -# Identity (uuid) and status are SEPARATE layers: uuid follows the GitHub path -# (a move or rename there mints a new one, gv-clade-index ADR 0007; a mirror -# move or a phase change never does); phase is a mutable pointer. No phase is -# terminal (extinct -> active is a legal "Gitassic Park" transition on the same -# uuid). A prefixed-name (clade code) change with the GitHub path unchanged is -# NOT a phase change — the old prefixed-name goes to aliases[], uuid and phase -# are untouched. -[status] -# One of: reserved incubating active dormant | merged superseded archived extinct -phase = "active" -since = "2026-03-16" -present = true -aliases = [] -merged-into = "" -superseded-by = "" -successors = [] -ended = "" - -[[status.history]] -phase = "active" -since = "2026-03-16" -note = "backfilled default — correct if the true phase differs" diff --git a/.machine_readable/MUST.contractile b/.machine_readable/MUST.contractile index e5fa2313..aee7cd8c 100644 --- a/.machine_readable/MUST.contractile +++ b/.machine_readable/MUST.contractile @@ -63,7 +63,7 @@ ; Structure (must ".machine_readable/ directory preserved") - (must "0-AI-MANIFEST.a2ml preserved") + (must "0-AI-MANIFEST.deed preserved") (must "no SCM files in repo root — only in .machine_readable/") ; CI diff --git a/.machine_readable/agent_instructions/README.adoc b/.machine_readable/agent_instructions/README.adoc deleted file mode 100644 index 628249b6..00000000 --- a/.machine_readable/agent_instructions/README.adoc +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell -// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -= Agent Instructions -:toc: preamble - -Methodology-aware configuration for AI agents. Read by any AI agent -(Claude, Gemini, Copilot, etc.) at session start. - -== Files - -[cols="1,3"] -|=== -| File | Purpose - -| `methodology.a2ml` -| Default mode, invariants, ring ceiling, priority weights, convergent budget - -| `coverage.a2ml` -| Session coverage tracking — what was visited, what was skipped, what has MUSTs - -| `debt.a2ml` -| Meander debt — things found but not fixed, carried between sessions -|=== - -== How Agents Use These - -1. Read `methodology.a2ml` at session start — know mode, invariants, ceiling -2. Read `coverage.a2ml` — know what was visited last time, what was skipped -3. Read `debt.a2ml` — know what's outstanding from previous sessions -4. At session end, update `coverage.a2ml` and `debt.a2ml` - -== Relationship to Other Files - -* `AGENTIC.a2ml` says WHAT agents can do (permissions, gating) -* `agent_instructions/` says HOW agents should work (methodology) -* `bot_directives/` says what the gitbot-fleet does (fleet-specific) -* `CLAUDE.md` says how Claude specifically should work (Claude-specific) - -== Reference - -ADR-002 in `standards/agentic-a2ml/docs/ADR-002-methodology-layer.adoc` diff --git a/.machine_readable/agent_instructions/coverage.a2ml b/.machine_readable/agent_instructions/coverage.a2ml deleted file mode 100644 index 69796642..00000000 --- a/.machine_readable/agent_instructions/coverage.a2ml +++ /dev/null @@ -1,61 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# coverage.a2ml — Session coverage tracking -# Updated at the end of each AI agent session. -# Persists what was visited, what was skipped, and what has MUSTs. -# -# Reference: ADR-002 in standards/agentic-a2ml/docs/ - -[metadata] -version = "1.0.0" -last-updated = "2026-03-24" - -# ============================================================================ -# COVERAGE STATE -# ============================================================================ -# Updated by agents at session end. Tracks which components have been -# visited and which have known MUSTs that were skipped. - -[coverage] -total-components = 0 -visited-components = 0 -coverage-percent = 0 - -# ============================================================================ -# VISITED COMPONENTS -# ============================================================================ -# Component → session date + ring reached -# Agents add entries as they work through components. -# -# Example: -# [coverage.visited.emergency-room] -# date = "2026-03-23" -# ring = 2 -# fixes = 3 -# notes = "boot-guardian built, shutdown-marshal built" - -# ============================================================================ -# SKIPPED COMPONENTS WITH MUSTS -# ============================================================================ -# Components with known MUSTs that were not visited in the most recent session. -# These become P1 inputs for the next session's Phase 0. -# -# Example: -# [coverage.skipped-musts.session-sentinel] -# priority = "P0" -# issue = "56 SIGABRTs in 4 days, D-Bus race condition" -# discovered = "2026-03-23" - -# ============================================================================ -# CHERRY-PICKING AUDIT -# ============================================================================ -# At session end, agents report whether they chose easy work over hard work. -# This is the accountability mechanism for the weighted priority system. -# -# [coverage.cherry-picking] -# easy-high-completed = 3 -# hard-high-completed = 1 -# easy-low-completed = 2 -# hard-low-deferred = 4 -# assessment = "Correctly prioritised — all MUST items addressed before COULDs" diff --git a/.machine_readable/agent_instructions/debt.a2ml b/.machine_readable/agent_instructions/debt.a2ml deleted file mode 100644 index c0238c5d..00000000 --- a/.machine_readable/agent_instructions/debt.a2ml +++ /dev/null @@ -1,49 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# debt.a2ml — Meander debt list -# Things found but not fixed. Carried between sessions. -# Becomes the next session's Phase 0 input. -# -# Reference: ADR-002 in standards/agentic-a2ml/docs/ - -[metadata] -version = "1.0.0" -last-updated = "2026-03-24" - -# ============================================================================ -# DEBT ITEMS -# ============================================================================ -# Each item has: component, issue, effort (easy|medium|hard), impact (high|medium|low), -# priority (should|could), and discovered date. -# -# Items are consumed (removed) when fixed. New items are added at session end. -# The debt list prevents the "one more wave" loop — found things are persisted, -# not forgotten, and not used as justification for infinite meandering. - -# ============================================================================ -# SHOULD — would fix next wave -# ============================================================================ -# These are inputs for the next session if the user says "keep going". -# -# Example: -# [[debt.should]] -# component = "system-tools/monitoring/observatory" -# issue = "Stale duplicate of root observatory/" -# effort = "easy" -# impact = "medium" -# discovered = "2026-03-23" - -# ============================================================================ -# COULD — would fix eventually -# ============================================================================ -# These are low-priority items that don't justify a session on their own. -# They get picked up when an agent is in the area for other reasons. -# -# Example: -# [[debt.could]] -# component = "cicada" -# issue = "RSR_OUTLINE.adoc references banned AGPL-3.0" -# effort = "easy" -# impact = "low" -# discovered = "2026-03-23" diff --git a/.machine_readable/agent_instructions/methodology.a2ml b/.machine_readable/agent_instructions/methodology.a2ml deleted file mode 100644 index 754f3571..00000000 --- a/.machine_readable/agent_instructions/methodology.a2ml +++ /dev/null @@ -1,107 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -# -# methodology.a2ml — AI agent methodology configuration -# Declares how agents should approach work in this repository. -# Read at session start by any AI agent (Claude, Gemini, Copilot, etc.) -# -# Reference: ADR-002 in standards/agentic-a2ml/docs/ - -[metadata] -version = "1.0.0" -last-updated = "2026-03-24" -spec = "https://github.com/hyperpolymath/standards/blob/main/agentic-a2ml/docs/ADR-002-methodology-layer.adoc" - -# ============================================================================ -# MODE SELECTION -# ============================================================================ -# convergent: find gaps, fill them, build infrastructure (default for ops/infra) -# divergent: find what's strongest, push it further (for research/creative) -# hybrid: audit 20% of budget, then focus 80% on top MUSTs (default for most) - -[methodology] -default-mode = "hybrid" -ring-ceiling = 2 # Hard ceiling for ring expansion (0-3) -wave-cap = 2 # Max waves before requiring user "keep going" -spike-required = true # Every session must ship code, not just designs - -# ============================================================================ -# PRIORITY WEIGHTS -# ============================================================================ -# MUST (3x): Blocking the current work → fix immediately -# SHOULD (2x): Degrading quality of current work → fix if in zone -# COULD (1x): Improving quality of adjacent work → add to debt list - -[methodology.priority-weights] -must = 3 -should = 2 -could = 1 - -# ============================================================================ -# CONVERGENT BUDGET (when mode = convergent or hybrid) -# ============================================================================ -# How to allocate effort across work types. -# Prevents over-polishing docs while structural work waits. - -[methodology.convergent-budget] -structural = 70 # % for new modules, compilation fixes, wiring, integration -corrective = 20 # % for bugs found, broken imports, stale references -perfective = 10 # % for SPDX headers, doc updates, formatting, style - -# ============================================================================ -# UNIQUE STRENGTH (when mode = divergent) -# ============================================================================ -# What makes this project special. Agents should DEEPEN this, not broaden it. -# Customise this per project — the template default is generic. - -[methodology.unique-strength] -description = "{{PROJECT_UNIQUE_STRENGTH}}" -deepen-not-broaden = true - -# ============================================================================ -# DIVERGENT INVARIANTS -# ============================================================================ -# Constraints that divergent mode must NOT violate. -# These are the riverbanks — diverge within them, not across. -# "Amplify uniqueness" means deepen, not broaden. -# -# Test before any divergent action: -# "Does this deepen the existing strength, or add a parallel strength?" -# If parallel → stop. Note as cross-project insight. - -[methodology.divergent-invariants] -rules = [ - # Customise per project. Examples: - # "Idris2 only for formal verification — no Lean4, Coq, Agda", - # "believe_me count must remain zero", - # "FFI architecture: Idris2 → RefC → Zig → C ABI (no shortcuts)", -] - -# Optional: language invariant for the core strength -# If set, divergent mode will not introduce other languages for this purpose -# language-invariant = "idris2" - -# ============================================================================ -# CONSTRAINT HINTS -# ============================================================================ -# Help Phase 0 find the critical chain faster. -# Updated at session end with newly discovered constraints. - -[methodology.known-constraints] -constraints = [ - # Customise per project. Examples: - # "End-to-end build has never been verified", - # "libproject.so does not exist yet — all bindings call stubs", -] - -# ============================================================================ -# STATE FILE VALIDATION -# ============================================================================ -# Phase 0 reads STATE.a2ml first but it may be broken. -# These rules detect corrupt/template/stale state files. - -[methodology.state-validation] -reject-if-contains = ["{{PLACEHOLDER}}", "{{PROJECT}}", "rsr-template-repo"] -reject-if-project-name-mismatch = true -staleness-threshold-days = 90 -fallback-files = ["TODO.md", "TODO.adoc", "ROADMAP.adoc", "README.adoc"] diff --git a/.machine_readable/anchors/ANCHOR.a2ml b/.machine_readable/anchors/ANCHOR.a2ml deleted file mode 100644 index b7a9e018..00000000 --- a/.machine_readable/anchors/ANCHOR.a2ml +++ /dev/null @@ -1,20 +0,0 @@ -; SPDX-License-Identifier: MPL-2.0 -; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell -# ⚓ ANCHOR: panic-attack -# This is the canonical authority for the panic-attack repository. - -id: "org.hyperpolymath.panic-attack" -version: "1.0.0" -clade: "unknown" -status: "active" - -# SSG Configuration (Unified boj-server build) -ssg: - engine: "casket" - output_dir: "public" - boj_trigger: true - cartridge: "ssg-mcp" - -# Relationships -parents: - - "org.hyperpolymath.boj-server" diff --git a/.machine_readable/campaigns/2026-05-26.a2ml b/.machine_readable/campaigns/2026-05-26.a2ml deleted file mode 100644 index 7939924a..00000000 --- a/.machine_readable/campaigns/2026-05-26.a2ml +++ /dev/null @@ -1,382 +0,0 @@ -;; SPDX-License-Identifier: MPL-2.0 -;; Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -;; -;; Estate sweep campaign report — machine-readable A2ML form. -;; Companion to reports/campaign-2026-05-26.md (human-readable). -;; -;; Schema: panic-attack campaign-report v1.0.0 -;; Tracker: hyperpolymath/panic-attack#32 - -(campaign-report - (name "campaign-2026-05-26") - (project "panic-attack") - (version "1.0.0") - (metadata - (schema-version "1.0.0") - (campaign-id "campaign-2026-05-26") - (date "2026-05-26") - (owner "hyperpolymath") - (tracker "hyperpolymath/panic-attack#32") - (tool "panic-attack") - (tool-version "2.5.0") - (estate-root "~/developer/repos/") - (estate-size-repos 369) - (sessions 2)) - - (scope - (repos-walked 368) - (repos-scanned 349) - (repos-skipped 19) - (nested-containers 6) - (nested-containers-list - "a2ml" "awesome-projects" "idaptik" "isers" "julia-libraries" "k9")) - - ;; ─── Findings (post-scan, pre-classification) ────────────────────────────── - - (findings-summary - (total-critical-high 6069) - (already-suppressed 961) - (worktree-artefacts-skipped 40) - (actionable 2477)) - - (findings-by-category - (entry (category "UnsafeCode") (count 424) (severity "critical-high")) - (entry (category "UnsafeFFI") (count 73) (severity "critical-high")) - (entry (category "SupplyChain") (count 398) (severity "critical-high")) - (entry (category "UnboundedAllocation") (count 516) (severity "critical-high")) - (entry (category "DynamicCodeExecution") (count 472) (severity "critical-high")) - (entry (category "HardcodedSecret") (count 122) (severity "critical-high")) - (entry (category "CommandInjection") (count 113) (severity "critical-high")) - (entry (category "UnsafeDeserialization") (count 73) (severity "critical-high")) - (entry (category "UnsafeTypeCoercion") (count 32) (severity "critical-high")) - (entry (category "CryptoMisuse") (count 28) (severity "critical-high")) - (entry (category "ProofDrift") (count 219) (severity "critical-high")) - (entry (category "ExcessivePermissions") (count 13) (severity "critical-high")) - (entry (category "UncheckedAllocation") (count 12) (severity "critical-high")) - (entry (category "AtomExhaustion") (count 10) (severity "critical-high")) - (entry (category "PanicPath") (count 7) (severity "critical-high")) - (entry (category "UnboundedLoop") (count 5) (severity "critical-high"))) - - ;; ─── Track A — FFI/fixture classification PRs ────────────────────────────── - - (track-a - (description "Per-repo audits/assail-classifications.a2ml + audit doc writing a narrow allow-list for legitimate unsafe / fixture-context findings.") - (prs-count 13) - (findings-classified 391) - (pr - (repo "svalinn") (number 11) (state "open") (findings 4) - (classification "test-context-fixture") - (rationale "JWT decodeJwt in benches and tests; not production paths.")) - (pr - (repo "proven") (number 67) (state "open") (findings 150) - (classification "legitimate-ffi + protocol-type-identifier + binding-wrapper-naming") - (rationale "bindings//src and ffi//src wrappers over libproven C ABI; Idris2 protocol-type identifiers; binding-wrapper naming patterns.")) - (pr - (repo "gossamer") (number 54) (state "open") (findings 24) - (classification "legitimate-ffi") - (rationale "Zig FFI to GTK WebKit (webview_gtk) and CSP enforcer.")) - (pr - (repo "docudactyl") (number 20) (state "open") (findings 15) - (classification "legitimate-ffi") - (rationale "ffi/zig/src C-ABI bridge.")) - (pr - (repo "proven-servers") (number 11) (state "open") (findings 10) - (classification "legitimate-ffi") - (rationale "bindings/rust/src C-ABI bridge to libproven.")) - (pr - (repo "aerie") (number 35) (state "open") (findings 10) - (classification "legitimate-ffi") - (rationale "src/api/zig C-ABI bridge.")) - (pr - (repo "stapeln") (number 62) (state "open") (findings 10) - (classification "legitimate-ffi") - (rationale "vordr eBPF (kernel) + Zig FFI + Ada↔liboqs bindings via Unchecked_Conversion.")) - (pr - (repo "ambientops") (number 102) (state "open") (findings 10) - (classification "legitimate-ffi") - (rationale "Cross-subproject syscall + FFI cluster (cfk-providers libc::statvfs; ffi/{fuse,systemd}; port-endoscope; session-sentinel DBus; nerdsafe-restart ncurses).")) - (pr - (repo "valence-shell") (number 32) (state "open") (findings 8) - (classification "legitimate-ffi") - (rationale "POSIX shell job-control libc (chown/getpwnam/getgrnam/getpgrp/kill/pipe/WIFSTOPPED) + Zig FFI to Lean-verified core.")) - (pr - (repo "panll") (number 47) (state "open") (findings 6) - (classification "legitimate-ffi") - (rationale "Idris2 Zig FFI + src-gossamer (frozen, ADR-0001) OS-FFI for system_tray, sysinfo, coprocessor, llm_coding.")) - (pr - (repo "linguist") (number 3) (state "open") (findings 13) - (classification "sample-reference-fixture + vendored-grammar-tool") - (rationale "samples/ is third-party language-detection corpus (verbatim git/redis/JSON-C++); tools/grammars/pcre is vendored Go cgo binding.")) - (pr - (repo "boj-server") (number 154) (state "open") (findings 119) - (classification "legitimate-ffi") - (rationale "117 MCP cartridge_shim.zig + 2 backend FFI (federation, cartridge_shim). Supersedes #153.")) - (pr - (repo "idaptik") (number 98) (state "open") (findings 12) - (classification "game-content-fixture") - (rationale "In-game password dictionaries (PasswordCracker mini-game) + fictional credentials in GlobalNetworkData; file itself documents these as 'NOT real secrets'."))) - - ;; ─── Track B — real-bug remainder ────────────────────────────────────────── - - (track-b - (description "Genuine code-bug findings after Track A classifications drained the FFI noise.") - (issues-filed 1) - (prs-filed 1) - (item - (repo "svalinn") - (issue 12) - (pr 14) - (severity "critical-functional") - (severity-initial-assessment "critical-security-bypass") - (severity-final-assessment "critical-functional (fail-closed by accident, not by signature-skip)") - (description "Jwt.verifyJwt did not verify signatures; chain of %raw blocks referenced bindings ReScript optimised away as unused, so verifyJwt threw ReferenceError on every call. AuthMiddleware caught and returned authenticated:false — JWT auth fail-closed by accident, not by design.") - (related-bugs - "base64UrlDecode (_i vs i mismatch)" - "OAuth2.generateState (array var elided)" - "OAuth2.URLSearchParams (module shadowed global constructor)") - (fix-summary "Wire crypto.subtle.importKey + verify against JWK; build signing input via TextEncoder from raw b64 segments; algorithm allow-list (RS/PS/ES 256-512, EdDSA); reject 'none' and unrecognised algs; no-OIDC fallback in AuthMiddleware fails closed explicitly.") - (tests "29/29 auth tests pass (was 17/12 split on main)."))) - - ;; ─── Track C — per-repo human-triage tracking issues ─────────────────────── - - (track-c - (description "Critical/High findings aggregated per repo for human triage. Excludes PA001/PA007 (Track A) and ProofDrift (Track D).") - (issues-count 35) - (findings-surfaced 1300) - (issue (repo "stapeln") (number 63) (findings 13)) - (issue (repo "ambientops") (number 103) (findings 34)) - (issue (repo "gitbot-fleet") (number 207) (findings 51)) - (issue (repo "standards") (number 178) (findings 39)) - (issue (repo "reposystem") (number 68) (findings 37)) - (issue (repo "panll") (number 48) (findings 44)) - (issue (repo "proven") (number 68) (findings 33)) - (issue (repo "boj-server") (number 155)) - (issue (repo "valence-shell") (number 33)) - (issue (repo "grim-repo") (number 22) (findings 29)) - (issue (repo "protocol-squisher") (number 64) (findings 23)) - (issue (repo "burble") (number 91) (findings 19)) - (issue (repo "svalinn") (number 13)) - (issue (repo "wordpress-tools") (number 25) (findings 18)) - (issue (repo "academic-workflow-suite") (number 201) (findings 15)) - (issue (repo "my-lang") (number 67) (findings 14)) - (issue (repo "januskey") (number 37) (findings 13)) - (issue (repo "idaptik") (number 99) (findings 23)) - (issue (repo "patallm-gallery") (number 55) (findings 15)) - (issue (repo "echo-types") (number 113) (findings 12)) - (issue (repo "verisimdb") (number 47) (findings 10)) - (issue (repo "eclexia") (number 20) (findings 10)) - (issue (repo "conflow") (number 17) (findings 10)) - (issue (repo "claude-integrations") (number 38) (findings 10)) - (issue (repo "bofig") (number 80) (findings 10)) - (issue (repo "ssg-collection") (number 13) (findings 9)) - (issue (repo "asdf-tool-plugins") (number 32) (findings 9)) - (issue (repo "affinescript") (number 378) (findings 9)) - (issue (repo "game-server-admin") (number 20) (findings 8)) - (issue (repo "ephapax") (number 138) (findings 8)) - (issue (repo "echidna") (number 104) (findings 8)) - (issue (repo "conative-gating") (number 53) (findings 8)) - (issue (repo "proven-servers") (number 12) (findings 7)) - (issue (repo "odds-and-sods-package-manager") (number 31) (findings 7)) - (issue (repo "absolute-zero") (number 43) (findings 7)) - (issue (repo "wokelang") (number 61) (findings 6)) - (issue (repo "proof-burrower") (number 14) (findings 6)) - (issue (repo "julia-ecosystem") (number 6) (findings 209)) - (issue (repo "developer-ecosystem") (number 83) (findings 166)) - (issue (repo "project-wharf") (number 34) (findings 6)) - (issue (repo "palimpsest-plasma") (number 19) (findings 6)) - (issue (repo "betlang") (number 31) (findings 6)) - (issue (repo "zotero-tools") (number 14) (findings 5)) - (issue (repo "vex-tools") (number 24) (findings 5)) - (issue (repo "vexometer") (number 20) (findings 5)) - (issue (repo "social-media-tools") (number 27) (findings 5)) - (issue (repo "maa-framework") (number 72) (findings 5)) - (issue (repo "fireflag") (number 29) (findings 5)) - (issue (repo "filesoup") (number 18) (findings 5)) - (issue (repo "file-soup") (number 41) (findings 5)) - (issue (repo "accessibility-everywhere") (number 41) (findings 5))) - - ;; ─── Track D / Phase 5 — proof-aware ─────────────────────────────────────── - - (track-d - (description "ProofDrift findings in 3 proof repos. ZERO required actual proof discharge — all classifications.") - (prs-count 3) - (real-proof-debt-discharged 0) - (pr - (repo "echidna") (number 107) (state "merged") (findings 2) - (classification "legitimate-mathematical-axiom + intentional-parameter") - (rationale "Basic.agda funext (HoTT-standard function extensionality) + SoundnessPreservation.agda Conflicts (intentional design parameter, not debt).")) - (pr - (repo "tropical-resource-typing") (number 4) (state "merged") (findings 4) - (classification "detector-false-positive-comment-text") - (rationale "PA021 matched 'sorry'/'oops' inside Isabelle \\...\\ and @{text ...} comment antiquotations. No real proof debt.")) - (pr - (repo "standards") (number 184) (state "open") (findings 1) - (file "lol/proofs/theories/information_theory.agda") - (postulate-count 4) - (classification "justified-postulate-real-analysis") - (rationale "entropy-nonneg, kl-nonneg, js-symmetric, js-bounded; textbook proofs (HoTT/Gibbs/Lin 1991) requiring real-analysis formalisation over ℝ. File's own line 112 comment classifies these as 'justified postulates, not proof debt'.")) - (tracking-issues-closed - "hyperpolymath/echidna#105" - "hyperpolymath/tropical-resource-typing#3" - "hyperpolymath/standards#181") - (parked-debts-honoured - (entry (repo "ephapax") (file "formal/Semantics.v") (line 3327) (debt "preservation")) - (entry (repo "boj-server") (file "src/abi/Boj/SafetyLemmas.idr") (debt "5 believe_me — class-J primitive axioms (3-month dedicated harness)")) - (entry (repo "betlang") (debt "substTop_preserves_typing axiom (discharge recipe in PR#27)")))) - - ;; ─── Track E — bridge CVE triage ─────────────────────────────────────────── - - (track-e-bridge - (description "panic-attack bridge triage (RustSec advisory DB + reachability) across Rust repos with Cargo.lock.") - (rust-repos-scanned 58) - (rust-repos-with-cves 29) - (issues-filed 24) - (cves-total 165) - (cves-by-classification - (entry (classification "informational") (status "phantom") (count 157)) - (entry (classification "unmitigable") (status "reachable") (count 8))) - (real-risk-cves 8) - (real-risk-detail - (entry (repo "hesiod-dns-map") (package "hickory-proto") (version "0.25.2") (cves "GHSA-3v94-mw7p-v465" "GHSA-q2qq-hmj6-3wpp" "RUSTSEC-2026-0118" "RUSTSEC-2026-0119") (fix-available false)) - (entry (repo "presswerk") (package "rand") (version "0.7.3") (cves "GHSA-cq8v-f236-94qc" "RUSTSEC-2026-0097") (fix-available false)) - (entry (repo "reposystem") (package "rand") (version "0.9.2") (cves "GHSA-cq8v-f236-94qc" "RUSTSEC-2026-0097") (fix-available false)))) - - ;; ─── Track E — other specialised modes ───────────────────────────────────── - - (track-e-specialised - (subtrack - (name "signatures") - (status "n/a") - (reason "Subcommand does not exist in panic-attack v2.5.0; planned but never shipped.")) - (subtrack - (name "temporal") - (status "blocked") - (reason "No verisimdb-data/temporal-index.json exists anywhere in the estate. The 4 .verisimdb/ dirs found are verisimdb-service deployment configs, not snapshot data. Real coverage depends on panic-attack#33 (VeriSimDB hexad persistence) landing.")) - (subtrack - (name "assault") - (status "deferred") - (reason "Needs per-target long-running build + manually-chosen stdin/args. CLIs that exit on --help return 100% robustness because attacks never land. Not estate-wide automatable.") - (smoke-test - (target "panic-attack --help") - (intensity "light") - (duration-per-axis-seconds 5) - (axes "cpu,memory") - (crashes 0) - (signatures 0) - (robustness-percent 100.0) - (verdict "as-expected for fast-exit CLI")))) - - ;; ─── Upstream bugs filed against panic-attack itself ─────────────────────── - - (upstream-bugs - (bug - (number 33) - (type "design") - (title "Complete VeriSimDB hexad persistence") - (rationale "JSON output schema doesn't handle multi-axis well; would shrink scan-output and enable real temporal-diff coverage.")) - (bug - (number 43) - (type "bug") - (title "PA021 ProofDrift: detector matches sorry/oops inside Isabelle comment text") - (evidence "4 false positives on tropical-resource-typing; same blind spot likely in Agda/Coq/Idris detectors.")) - (bug - (number 47) - (type "bug") - (title "bridge triage: 'Remove unused dependency' action assumes direct dep, fires on transitive deps") - (evidence "28/28 phantom packages sampled across 6 repos were transitive, never declared in any Cargo.toml."))) - - ;; ─── Skipped / blocked ───────────────────────────────────────────────────── - - (skipped - (entry (repo "polystack") (reason "archived on GitHub (read-only)") (unblocking-action "owner unarchive")) - (entry (repo "hypatia") (reason "active working tree with 280+ untracked files at session start") (unblocking-action "wait for active session to commit/clear, then re-attempt classification")) - (entry (repo "linguist") (reason "fork with issues disabled") (unblocking-action "Track A PR #3 landed; Track C not filed")) - (entry (repo "rescript") (reason "fork with issues disabled") (unblocking-action "n/a — covered via developer-ecosystem container issue #83")) - (entry (repo "HOL") (reason "fork with issues disabled") (unblocking-action "n/a")) - (entry (repo "hyperpolymath-archive") (reason "repo deleted on GitHub") (unblocking-action "n/a")) - (entry (repo "standards-as-port") (reason "remote points to standards.git; orphan duplicate") (unblocking-action "n/a")) - (entry (repo "julia-libraries/*") (reason "Julia chapter closed per project memory") (unblocking-action "n/a — covered via julia-ecosystem container issue #6")) - (entry (repo "agda-stdlib") (reason "upstream agda/agda-stdlib clone, no hyperpolymath/ fork") (unblocking-action "n/a"))) - - ;; ─── Mid-campaign corrections ────────────────────────────────────────────── - - (corrections - (entry - (kind "file-overwrite") - (repo "echidna") - (pr 107) - (description "Initial commit overwrote 14 pre-existing FFI-boundary classification entries on audits/assail-classifications.a2ml. Driver script did 'cat >' without checking existing.") - (fix-commit "fix: restore pre-existing FFI-boundary classifications (was overwritten)") - (final-state "16 entries (14 original + 2 new PA021)") - (lesson "Future per-repo classification PRs should 'git show origin/main:audits/assail-classifications.a2ml' before truncating."))) - - ;; ─── Discoveries (significant findings worth surfacing) ──────────────────── - - (discoveries - (entry - (kind "language-level-bug") - (project "svalinn") - (title "ReScript %raw blocks elide bindings the compiler can't see") - (impact "JWT auth + OAuth2 state generation + URLSearchParams wrapper all non-functional at runtime despite looking correct in source. Fail-closed by accident.") - (resolution "PR svalinn#14; lesson: never trust a %raw block whose only 'use' of a binding is through the %raw string.")) - (entry - (kind "tool-limitation") - (project "panic-attack") - (title "bridge triage doesn't distinguish direct from transitive deps") - (impact "'Remove unused dependency' action is misleading for transitive deps (all 28 sampled phantoms); Lane 1 mechanical PR approach collapses.") - (resolution "panic-attack#47 filed; underlying 'informational + phantom' classification is correct.")) - (entry - (kind "tool-limitation") - (project "panic-attack") - (title "PA021 ProofDrift counts keywords inside docstring antiquotations") - (impact "All 4 tropical-resource-typing findings false positives; same blind spot likely affects Agda/Coq/Idris detectors.") - (resolution "panic-attack#43 filed; tropical-resource-typing PR #4 classified all 4 as detector-false-positive-comment-text and merged."))) - - ;; ─── Guardrails honoured ────────────────────────────────────────────────── - - (guardrails - (entry "All commits GPG-signed (key 4A03639C1EB1F86C7F0C97A91835A14A2867091E).") - (entry "Base = main for every PR.") - (entry "Auto-merge disabled on every PR (estate-wide auto-merge banned).") - (entry "No --no-verify / --no-gpg-sign.") - (entry "features/panic-attacker/ stub dirs untouched.") - (entry "vcl-ut/_wt-vclut*, hypatia/.claude/worktrees/agent-*, ephapax _wt-eph-* — all untouched.") - (entry "Parked debts (ephapax preservation, betlang substTop, boj-server class-J) not refiled.") - (entry "Julia chapter closed — no per-.jl issues filed.") - (entry "Parallel-session branches left alone: standards on claude/governance-allowlist-foundation, panic-attack on fix/idris-lang-chapel-not-c.") - (entry "valence-shell's stray local main commit preserved by branching from origin/main.")) - - ;; ─── Outputs summary ────────────────────────────────────────────────────── - - (outputs-summary - (prs-filed 17) - (prs-merged 2) - (prs-open 15) - (issues-filed 62) - (upstream-bugs-filed 3) - (tracker-comments 5) - (total-actions 87)) - - ;; ─── What remains (owner-side) ──────────────────────────────────────────── - - (carry-forward - (entry (kind "owner-review") (description "Merge the 15 open PRs.")) - (entry (kind "owner-triage") (description "Triage Track C tracking issues (~1300 findings) per-repo.")) - (entry (kind "owner-decision") (description "Decide on the 3 upstream panic-attack bugs (#33, #43, #47).")) - (entry (kind "deferred-session") (description "hypatia classification once active session clears.")) - (entry (kind "deferred-session") (description "polystack — owner unarchive on GitHub.")) - (entry (kind "deferred-session") (description "Track E assault campaign — heavyweight per-target work, dedicated session."))) - - ;; ─── Campaign workspace (preserved) ─────────────────────────────────────── - - (workspace - (path "/tmp/panic-attack-campaign-2026-05-26/") - (artefacts - (entry "per-repo/*.json — 349 assail reports") - (entry "bridge/*.json — 58 Rust-repo bridge reports") - (entry "02-plan.json — triage classification plan") - (entry "assault/self-test.json — Track E smoke test") - (entry "00-per-repo.sh, 00b-nested.sh, 01-triage.ts, file-ffi-pr-v2.sh, file-track-c-issue.sh — driver scripts") - (entry "TRACKER-UPDATE.md … TRACKER-UPDATE-V5.md — intermediate session summaries posted on #32"))) - - (status "complete-bounded-by-owner-throughput")) diff --git a/.machine_readable/contractiles/INDEX.a2ml b/.machine_readable/contractiles/INDEX.a2ml deleted file mode 100644 index 566da31e..00000000 --- a/.machine_readable/contractiles/INDEX.a2ml +++ /dev/null @@ -1,93 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# INDEX.a2ml — Contractile Registry (panic-attack) -# Author: Jonathan D.A. Jewell -# -# Machine-readable catalogue of the contractile verbs present in this repo. -# Consumers (CI scripts, the contractile CLI, Hypatia rules) SHOULD read this -# file to discover the available verbs and their on-disk locations rather than -# hard-coding the list. -# -# Canonical shape: hyperpolymath/standards docs/CONTRACTILE-SPEC.adoc §Registry, -# exemplified by hyperpolymath/echidna .machine_readable/contractiles/ (v2.0.0, -# full trident shape for all six verbs). -# -# STATUS: panic-attack's contractile set predates the trident consolidation and -# is currently SCATTERED across three trees (see [layout]). This registry -# catalogues what exists and its real location; the physical consolidation to -# the canonical .machine_readable/contractiles// trident shape is tracked -# in issue #124 — it is held because the root `contractiles/` tree is read by -# `contractile gen-just` to emit contractile.just, so a blind move would break -# the generator, and the authoritative CONTRACTILE-SPEC lives in the (here -# unreachable) standards repo. - ---- -id = "contractiles-registry" -project = "panic-attack" -version = "0.1.0" # 0.1.0: registry introduced over the existing pre-consolidation layout. -spec = "hyperpolymath/standards docs/CONTRACTILE-SPEC.adoc" -canonical_reference = "hyperpolymath/echidna .machine_readable/contractiles/INDEX.a2ml (v2.0.0)" -base_schema = ".machine_readable/contractiles/_base.ncl (NOT YET PRESENT — see #124; reference: echidna _base.ncl)" -last_updated = "2026-06-04" -consolidation_tracking = "https://github.com/hyperpolymath/panic-attack/issues/124" - -## Layout — current reality (three trees, pending consolidation in #124) - -[layout] -flat = ".machine_readable/*.contractile — ADJUST, INTENT, MUST, TRUST (legacy flat form)" -machine_readable_tridents = ".machine_readable/contractiles// — adjust, bust, dust, trust (partial: Xfile.a2ml + x.ncl)" -generator_source = "contractiles// — intend, must, trust (read by `contractile gen-just` → contractile.just)" -canonical_target = ".machine_readable/contractiles// — full trident: Xfile.a2ml + x.ncl + x.k9.ncl + manifest" - -## Verbs -# Canonical verb set per the standard: adjust, bust, dust, intend, must, trust -# (six, on the trident shape), plus the k9 trust-tier template exception. -# panic-attack has all six present in at least one tree; none yet on the full -# trident. `present` lists the actual on-disk files today. - -[[verbs]] -name = "must" -semantics = "invariant assertion — release-blocking" -authority = "blocking" -gating = "hard (exit-nonzero)" -present = ["contractiles/must/Mustfile.a2ml", ".machine_readable/MUST.contractile"] -trident_status = "file-only — missing must.ncl + must.k9.ncl + must.manifest.a2ml" - -[[verbs]] -name = "trust" -semantics = "security + provenance + safe-hacking" -authority = "blocking" -gating = "hard (exit-nonzero)" -present = ["contractiles/trust/Trustfile.a2ml", ".machine_readable/contractiles/trust/Trustfile.a2ml", ".machine_readable/TRUST.contractile"] -trident_status = "DUPLICATE — root and .machine_readable Trustfile.a2ml differ; reconcile in #124" - -[[verbs]] -name = "intend" -semantics = "north-star (commitments + aspirations)" -authority = "reporting" -gating = "non-gating (continue)" -present = ["contractiles/intend/Intentfile.a2ml", ".machine_readable/INTENT.contractile"] -trident_status = "file-only — missing intend.ncl + intend.k9.ncl + intend.manifest.a2ml" - -[[verbs]] -name = "adjust" -semantics = "drift tolerances + corrective actions" -authority = "advisory" -gating = "advisory (continue-with-warnings)" -present = [".machine_readable/contractiles/adjust/Adjustfile.a2ml", ".machine_readable/contractiles/adjust/adjust.ncl", ".machine_readable/ADJUST.contractile"] -trident_status = "pair — missing adjust.k9.ncl + adjust.manifest.a2ml" - -[[verbs]] -name = "bust" -semantics = "hard-stop / expiry / must-not-run declarations" -authority = "blocking" -gating = "hard (exit-nonzero)" -present = [".machine_readable/contractiles/bust/Bustfile.a2ml", ".machine_readable/contractiles/bust/bust.ncl"] -trident_status = "pair — missing bust.k9.ncl + bust.manifest.a2ml" - -[[verbs]] -name = "dust" -semantics = "rollback / recovery / deprecation / audit-trail preservation" -authority = "advisory" -gating = "advisory (continue-with-warnings)" -present = [".machine_readable/contractiles/dust/Dustfile.a2ml"] -trident_status = "file-only — missing dust.ncl + dust.k9.ncl + dust.manifest.a2ml" diff --git a/.machine_readable/contractiles/bust/Bustfile.a2ml b/.machine_readable/contractiles/bust/Bustfile.a2ml deleted file mode 100644 index 176aed5b..00000000 --- a/.machine_readable/contractiles/bust/Bustfile.a2ml +++ /dev/null @@ -1,28 +0,0 @@ -// Bustfile.a2ml — meta-repo bust contractile (breakage / rollback) -// SPDX-License-Identifier: MPL-2.0 - -Bust { - name: "panic-attack" - version: "1.0.0" - description: "Rollback procedures when something breaks in the meta-repo" - - scenarios: { - "bad-pointer-bump": "git revert in meta-repo; child repo itself untouched" - "submodule-pointer-points-at-missing-sha": "git submodule update --init --checkout resets child to parent-recorded SHA; OR revert the stale bump commit" - "submodule-orphan-after-local-only-commit": "roll back locally with git reset to before the stranded commit; fix remote situation before re-attempting" - "accidental-private-repo-content-leaked-to-public-submodule": "hard-rotate the leaked secret immediately; git-filter-repo or BFG on the submodule's own history; public re-publication only after rotation complete" - } - - escalation-ladder: [ - "1. revert the meta-repo commit (reversible, low blast radius)", - "2. reset the local submodule clone (affects only local workspace)", - "3. force-push to main — PROHIBITED without explicit user confirmation (violates branch protection)", - "4. registry-level (delete/archive the GitHub repo) — human-only action, never by AI" - ] - - backup-points: [ - "GitHub serves as the durable backup for every submodule's own history", - "Meta-repo history on origin/main is the durable backup for pointer state", - "Local backup tags (backup/pre--) retained on risky rewrites" - ] -} diff --git a/.machine_readable/contractiles/bust/bust.ncl b/.machine_readable/contractiles/bust/bust.ncl index fc8cb8cd..82171e0f 100644 --- a/.machine_readable/contractiles/bust/bust.ncl +++ b/.machine_readable/contractiles/bust/bust.ncl @@ -1,7 +1,9 @@ # SPDX-License-Identifier: MPL-2.0 # Bust — error-handling / failure-recovery runner # -# Pairs with: Bustfile.a2ml (same directory) +# Pairs with: Bustfile.deed (same directory; A7 8.1). Not yet written: the +# legacy Bustfile.a2ml was retired 2026-11-14 with no mapping +# spec to translate it (docs/history/A2ML-REMOVED.adoc). # Verb: bust # Semantics: every declared failure mode must have a recovery path that has # been exercised. Runner injects failures (via declared probes) @@ -33,7 +35,7 @@ let base = import "../_base.ncl" in name = "bust-runner", version = "1.0.0", description = "Exercises declared failure modes and verifies recovery paths. Hard-gates on any failure mode without working recovery.", - paired_xfile = "Bustfile.a2ml", + paired_xfile = "Bustfile.deed", author = "Jonathan D.A. Jewell ", }, }, diff --git a/.machine_readable/contractiles/dust/Dustfile.a2ml b/.machine_readable/contractiles/dust/Dustfile.a2ml deleted file mode 100644 index 0d619ee2..00000000 --- a/.machine_readable/contractiles/dust/Dustfile.a2ml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Dustfile — Cleanup and Hygiene Contract - -[dustfile] -version = "1.0.0" -format = "a2ml" - -[cleanup] -stale-branch-policy = "delete-after-merge" -artifact-retention = "90-days" -cache-policy = "clear-on-release" - -[hygiene] -linting = "required" -formatting = "required" -dead-code-removal = "encouraged" -todo-tracking = "tracked-in-issues" - -[reversibility] -backup-before-destructive = true -rollback-mechanism = "git-revert" -data-retention-policy = "preserve-30-days" diff --git a/.machine_readable/contractiles/trust/Trustfile.a2ml b/.machine_readable/contractiles/trust/Trustfile.a2ml deleted file mode 100644 index 0c95e15e..00000000 --- a/.machine_readable/contractiles/trust/Trustfile.a2ml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Trustfile — Integrity and Provenance Contract - -[trustfile] -version = "1.0.0" -format = "a2ml" - -[provenance] -source-control = "git" -forge = "github" -ci-verified = true -signing-policy = "commit-signing-preferred" - -[integrity] -spdx-compliant = true -license-audit = "required" -dependency-pinning = "sha-pinned" - -[verification] -reproducible-builds = "goal" -sbom-generation = "required" -attestation = "sigstore-preferred" diff --git a/.machine_readable/descriptiles/STATE.deed b/.machine_readable/descriptiles/STATE.deed new file mode 100644 index 00000000..faf3be2c --- /dev/null +++ b/.machine_readable/descriptiles/STATE.deed @@ -0,0 +1,37 @@ +;; SPDX-License-Identifier: CC-BY-SA-4.0 +;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +; The STATE descriptile of panic-attack (A7 7.2, J14, J15; profile +; clauses/state.abnf, checked by `deed_lint.js --state`). +; +; (status …) is CLADE.a2ml's [status] section and its one [[status.history]] +; entry, translated field for field under standards +; 1-formats/deed/mappings/clade-to-repo-deed.adoc as updated by standards#1579: +; lifecycle goes to STATE.deed, not to the chora deed. The values are the +; source's, including its own note that the history entry is a backfilled +; default. The (status …) clause the chora deed carried before (phase active, +; with a description as its note) is replaced by this one. +; +; The repo's (maturity …) clause is still in panic-attack_chora.deed: its level, +; `stable`, is outside the closed set in vocabulary/maturity.adoc, and choosing +; the level is the owner's call. +; +; STATE.a2ml (state-v1-decision.adoc, option B) adds nothing here: it has no +; maturity field, its status string duplicates the CLADE phase, and the rest +; is journal, archived by reference in docs/history/A2ML-REMOVED.adoc. +(descriptile-deed + :schema-version "1.0.0" + :canonical-name "panic-attack" + :of-chora #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b" + :affirmed "2026-11-14" + :affirmed-by agent + (status + :phase active + :since "2026-03-16" + :present #t + :aliases () + :merged-into "" + :superseded-by "" + :successors () + :ended "" + (history + (entry :phase active :since "2026-03-16" :note "backfilled default — correct if the true phase differs")))) diff --git a/.machine_readable/integrations/feedback-o-tron.a2ml b/.machine_readable/integrations/feedback-o-tron.a2ml deleted file mode 100644 index 5381604e..00000000 --- a/.machine_readable/integrations/feedback-o-tron.a2ml +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Feedback-o-Tron Integration — Autonomous Bug Reporting - -[integration] -name = "feedback-o-tron" -type = "bug-reporter" -repository = "https://github.com/hyperpolymath/feedback-o-tron" - -[reporting-config] -platforms = ["github", "gitlab", "bugzilla"] -deduplication = true -audit-logging = true -auto-file-upstream = "on-external-dependency-failure" diff --git a/.machine_readable/integrations/proven.a2ml b/.machine_readable/integrations/proven.a2ml deleted file mode 100644 index 9af33ffd..00000000 --- a/.machine_readable/integrations/proven.a2ml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Proven Integration — Formally Verified Safety Library - -[integration] -name = "proven" -type = "safety-library" -repository = "https://github.com/hyperpolymath/proven" -version = "1.2.0" - -[binding-policy] -approach = "thin-ffi-wrapper" -unsafe-patterns = "replace-with-proven-equivalent" -modules-available = ["SafeMath", "SafeString", "SafeJSON", "SafeURL", "SafeRegex", "SafeSQL", "SafeFile", "SafeTemplate", "SafeCrypto"] - -[adoption-guidance] -priority = "high" -scope = "all-string-json-url-crypto-operations" -migration = "incremental — replace unsafe patterns as encountered" diff --git a/.machine_readable/integrations/verisimdb.a2ml b/.machine_readable/integrations/verisimdb.a2ml deleted file mode 100644 index 164c5229..00000000 --- a/.machine_readable/integrations/verisimdb.a2ml +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# VeriSimDB Feed — Cross-Repo Analytics Data Store - -[integration] -name = "verisimdb" -type = "data-feed" -repository = "https://github.com/hyperpolymath/nextgen-databases" -data-store = "verisimdb-data" - -[feed-config] -emit-scan-results = true -emit-build-metrics = true -emit-dependency-graph = true -format = "hexad" -destination = "verisimdb-data/feeds/" diff --git a/.machine_readable/integrations/vexometer.a2ml b/.machine_readable/integrations/vexometer.a2ml deleted file mode 100644 index 238b3d2c..00000000 --- a/.machine_readable/integrations/vexometer.a2ml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Vexometer Integration — Irritation Surface Analysis - -[integration] -name = "vexometer" -type = "friction-measurement" -repository = "https://github.com/hyperpolymath/vexometer" - -[measurement-config] -dimensions = 10 -emit-isa-reports = true -lazy-eliminator = true -satellite-interventions = true - -[hooks] -cli-tools = "measure-on-error" -ui-panels = "measure-on-interaction" -build-failures = "measure-on-failure" diff --git a/0-AI-MANIFEST.a2ml b/0-AI-MANIFEST.a2ml deleted file mode 100644 index b4225e63..00000000 --- a/0-AI-MANIFEST.a2ml +++ /dev/null @@ -1,137 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# AI Manifest for panic-attack -# Version: 1.0 -# Format: A2ML (AI Agent Manifest Language) - -(manifest - (version "1.0") - (project "panic-attack") - (description "Universal stress testing and logic-based bug signature detection") - - (canonical-locations - (scm-files ".machine_readable/") - (workflows ".github/workflows/") - (docs "." - (readme "README.adoc") - (security "SECURITY.md") - (contributing "CONTRIBUTING.md") - (license "LICENSE") - (changelog "CHANGELOG.md") - (roadmap "ROADMAP.adoc") - (design "DESIGN.md") - (vision "VISION.md") - (explainme "EXPLAINME.adoc") - (proof-needs "PROOF-NEEDS.md") - (proof-programme "PROOF-PROGRAMME.md") - (test-needs "TEST-NEEDS.md")) - (source "src/") - (tests "tests/") - (examples "examples/") - (v255-modules - (test-context "src/test_context.rs" - "Cross-language test-path classification (Rust / Python / Go / JS-TS / Julia / Zig / Elixir / docs-examples)") - (comment-marker "src/comment_marker.rs" - "Inline // panic-attack: accepted [- reason] suppression marker (cross-language comment leaders)") - (ffi-kind "src/ffi_kind.rs" - "UnsafeFFI (PA013) subtyping: BuildSystem / RuntimeAbi / TestMock / Unknown") - (jit-context "src/jit_context.rs" - "JIT-framework classifier: Cranelift / Llvm / Wasm / Javascript / None")) - (proof-modules - (pa2 "src/abi/ClassificationSoundness.idr" - "Classification soundness — Severity total order + maxSeverity commutativity") - (layer-1-0 "src/abi/Stripping.idr" - "PROOF-PROGRAMME Layer 1.0 partial — line-comment-strip foundation lemmas"))) - - (critical-invariants - (rule "SCM files MUST be in .machine_readable/ directory ONLY" - (never ".machine_readable/6a2/STATE.a2ml in repository root") - (never ".machine_readable/6a2/ECOSYSTEM.a2ml in repository root") - (never ".machine_readable/6a2/META.a2ml in repository root") - (always "`.machine_readable/6a2/STATE.a2ml`") - (always "`.machine_readable/6a2/ECOSYSTEM.a2ml`") - (always "`.machine_readable/6a2/META.a2ml`")) - - (rule "License MUST be MPL-2.0" - (never "AGPL-3.0") - (never "GPL-*") - (always "SPDX-License-Identifier: MPL-2.0 in all source files")) - - (rule "Author attribution MUST be correct" - (always "Jonathan D.A. Jewell ") - (never "hyperpolymath as author name") - (never "jonathan.jewell@gmail.com")) - - (rule "Weak points MUST have file locations" - (never "location: None") - (always "location: Some(file_path)")) - - (rule "Per-file analysis prevents duplicates" - (never "running-total counts across files") - (always "fresh ProgramStatistics per file")) - - (rule "Zero compiler warnings" - (always "cargo build --release produces 0 warnings")) - - (rule "All tests MUST pass" - (always "cargo test returns 0 exit code"))) - - (repository-structure - (type "rust-binary-library") - (build-system "cargo") - (package-manager "cargo") - (language "rust") - (msrv "1.89") - (edition "2021")) - - (lifecycle - (on-enter - (action "read" (file "`.machine_readable/6a2/STATE.a2ml`")) - (action "read" (file "`.machine_readable/6a2/ECOSYSTEM.a2ml`")) - (action "read" (file "`.machine_readable/6a2/META.a2ml`")) - (action "acknowledge" - (message "AI manifest acknowledged. Canonical locations noted. Critical invariants loaded."))) - - (on-exit - (action "update" (file "`.machine_readable/6a2/STATE.a2ml`") - (condition "work completed")) - (action "verify" (invariants) - (message "All critical invariants respected")) - (action "report" - (message "Session complete. Files modified, tests status, new issues found.")))) - - (tools - (build "cargo build --release") - (test "cargo test") - (lint "cargo clippy -- -D warnings") - (format "cargo fmt --check") - (audit "cargo audit") - (coverage "cargo tarpaulin --out Xml")) - - (reports - (formats "json" "nickel" "yaml" "sarif") - (storage-targets "filesystem" "verisimdb")) - - (quality-standards - (test-coverage "target: 80%") - (documentation "rustdoc for all public APIs") - (linting "clippy with -D warnings") - (formatting "rustfmt enforced") - (security "cargo-audit in CI")) - - (deployment - (registry "crates.io") - (ci-cd "GitHub Actions") - (releases "GitHub Releases with binaries")) - - (integration - (hypatia "neurosymbolic CI/CD intelligence") - (gitbot-fleet "rhodibot, echidnabot, sustainabot, panicbot") - (panicbot "gitbot-fleet verifier bot — invokes `panic-attack assail --output-format json`, translates WeakPoints to fleet Findings (PA001–PA020)") - (panll "event-chain visualisation and mission control")) - - (metadata - (created "2026-02-07") - (updated "2026-03-01") - (version-current "2.0.0") - (version-next "2.1.0") - (status "active-development"))) diff --git a/0-AI-MANIFEST.deed b/0-AI-MANIFEST.deed new file mode 100644 index 00000000..be6ba944 --- /dev/null +++ b/0-AI-MANIFEST.deed @@ -0,0 +1,21 @@ +;; SPDX-License-Identifier: CC-BY-SA-4.0 +;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +; +; The machine front door of panic-attack: pointer-only (A7 ruling Q15). It names +; where to read and carries no facts of its own. Repository facts are in +; panic-attack_chora.deed; agent conventions are in .claude/CLAUDE.md. It +; replaces 0-AI-MANIFEST.a2ml, retired 2026-11-14 +; (docs/history/A2ML-REMOVED.adoc). +; +; `panic-attack manifest` and `panic-attack diagnostics` read this file before +; any legacy 0-AI-MANIFEST.a2ml. A pointer-only manifest carries no report +; settings, so the built-in defaults apply (formats json and nickel, storage +; filesystem). +(repo-deed + :schema-version "1.0.0" + :canonical-name "panic-attack" + :repo-uuid #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b" + :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" + (front-doors + :machine "panic-attack_chora.deed" + :human "README.adoc")) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index c2cf0a02..052cfbc2 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -32,6 +32,27 @@ field or clause, a string `+:category+`, an unknown category, a missing fail with it instead of reading it as an empty registry or falling back to the A2ML files. Library callers must handle the `+Result+`. +==== Changed — the AI manifest reads a deed first; this repo is off A2ML + +* `+Manifest::load_default+`, `+panic-attack manifest+` and +`+panic-attack diagnostics+` read `+0-AI-MANIFEST.deed+` first (a +pointer-only `+repo-deed+`, parsed with `+panic_attack::deed+`), then the +legacy `+0-AI-MANIFEST.a2ml+` or `+AI.a2ml+` as a read-only fallback. A +deed manifest carries no report settings, so it gets the built-in defaults +(formats json and nickel, storage filesystem); a legacy manifest's +`+(reports …)+` is still honoured. A malformed or non-`+repo-deed+` deed +manifest is an error. New: `+MANIFEST_CANDIDATES+`, +`+Manifest::default_path+`, `+Manifest::path+`, `+Manifest::is_deed+`. +* `+diagnostics+` looks for panicbot directives as the +`+(bot-directives (bot :name panicbot …))+` clause of the repo deed, not at +`+.machine_readable/bot_directives/panicbot.scm+`; none declared is reported +OK (panicbot runs the full suite) rather than as a warning. +* The repo's own `+.a2ml+` files are gone (25 of 26), translated where a +standards mapping spec covers them into `+panic-attack_chora.deed+`, +`+.machine_readable/descriptiles/STATE.deed+` and `+0-AI-MANIFEST.deed+`. +`+docs/history/A2ML-REMOVED.adoc+` records each file and what was dropped. +`+Adjustfile.a2ml+` stays while `+just adjust-check+` reads it. + === [2.6.0] - 2026-11-14 Release of the work merged on `+main+` since 2.5.5 (143 commits), including diff --git a/QUICKSTART-DEV.adoc b/QUICKSTART-DEV.adoc index 2a6a51d0..56af77e9 100644 --- a/QUICKSTART-DEV.adoc +++ b/QUICKSTART-DEV.adoc @@ -59,11 +59,11 @@ panic-attack/ ├── ffi/zig/ # Zig FFI bridge (if applicable) ├── tests/ # Test suite ├── docs/ # Documentation -├── .machine_readable/ # Checkpoint files (STATE, META, ECOSYSTEM) +├── .machine_readable/ # Descriptile deeds (descriptiles/STATE.deed) and contractiles ├── Justfile # Task runner recipes ├── guix.scm # Guix environment -├── flake.nix # Nix environment (fallback) -└── 0-AI-MANIFEST.a2ml # AI agent entry point +├── panic-attack_chora.deed # Repo deed: identity and repo facts +└── 0-AI-MANIFEST.deed # AI agent entry point (pointer-only) ---- == Key Recipes @@ -103,7 +103,8 @@ If using an AI assistant, load the warmup context first: just llm-context # Outputs role-appropriate context ---- -Or read `0-AI-MANIFEST.a2ml` and `.claude/CLAUDE.md` directly. +Or read `0-AI-MANIFEST.deed` (it points at `panic-attack_chora.deed`) and +`.claude/CLAUDE.md` directly. == Get Help diff --git a/contractile.just b/contractile.just index 5f479569..30b784e4 100644 --- a/contractile.just +++ b/contractile.just @@ -2,6 +2,13 @@ # Source directory: contractiles # Re-generate with: contractile gen-just --dir contractiles # +# The `# Source:` Dustfile, Intentfile, Mustfile and Trustfile named below were +# legacy .a2ml contractiles, retired 2026-11-14 with no mapping spec to +# translate them (docs/history/A2ML-REMOVED.adoc). Their recipes stand as +# generated until the edicts (file.deed, A7 8.1) exist; do not regenerate +# from the retired files. Adjustfile.a2ml remains, because adjust-check below +# reads its declared thresholds. +# # SPDX-License-Identifier: MPL-2.0 # === DUST (Recovery & Rollback) === diff --git a/contractiles/intend/Intentfile.a2ml b/contractiles/intend/Intentfile.a2ml deleted file mode 100644 index 671bc718..00000000 --- a/contractiles/intend/Intentfile.a2ml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Intentfile (A2ML Canonical) -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) - -@abstract: -Declared intent and purpose for Panic Attacker. -@end - -## Purpose - -Panic Attacker — // SPDX-License-Identifier: MPL-2.0 - -## Anti-Purpose - -This project is NOT: -- A fork or wrapper around another tool -- A monorepo (unless explicitly structured as one) - -## If In Doubt - -If you are unsure whether a change is in scope, ask. -Sensitive areas: ABI definitions, license headers, CI workflows. diff --git a/contractiles/must/Mustfile.a2ml b/contractiles/must/Mustfile.a2ml deleted file mode 100644 index aad4e391..00000000 --- a/contractiles/must/Mustfile.a2ml +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Mustfile (A2ML Canonical) -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) - -@abstract: -Physical State contract for Panic Attacker. Baseline UX Manifesto invariants -that MUST hold at all times. -@end - -@requires: -- section: Core-Files -- section: Banned -@end - -## Core-Files - -### license-present -- description: LICENSE file must exist -- run: test -f LICENSE -- severity: critical - -### readme-present -- description: README must exist -- run: test -f README.adoc || test -f README.md -- severity: critical - -## Banned - -### no-hardcoded-paths -- description: No hardcoded developer paths -- run: "! grep -rn '/home/hyper\|/mnt/eclipse' --include='*.rs' --include='*.res' --include='*.ex' --include='*.gleam' --include='*.zig' --include='*.sh' . 2>/dev/null | grep -v '.git/' | grep -v 'ux-rollout.jl' | head -1" -- severity: critical - -### no-dockerfiles -- description: No Dockerfiles (use Containerfile) -- run: test ! -f Dockerfile -- severity: warning - -### no-makefiles -- description: No Makefiles (use Justfile) -- run: test ! -f Makefile -- severity: warning diff --git a/contractiles/trust/Trustfile.a2ml b/contractiles/trust/Trustfile.a2ml deleted file mode 100644 index e43f7643..00000000 --- a/contractiles/trust/Trustfile.a2ml +++ /dev/null @@ -1,25 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0 -# Trustfile (A2ML Canonical) -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) - -@abstract: -Trust and provenance verification for Panic Attacker. -Maximal trust by default — LLM may read, build, test, lint, format. -@end - -@trust-level: maximal -@trust-boundary: repo -@trust-actions: [read, build, test, lint, format] -@trust-deny: [delete-branch, force-push, modify-ci-secrets, publish] - -## Integrity - -### license-content -- description: LICENSE contains expected SPDX identifier -- run: grep -q 'SPDX\|License\|MIT\|Apache\|PMPL\|MPL' LICENSE -- severity: critical - -### no-secrets-committed -- description: No .env or credential files in repo -- run: test ! -f .env && test ! -f credentials.json && test ! -f .env.local -- severity: critical diff --git a/docs/campaigns/2026-05-26/README.adoc b/docs/campaigns/2026-05-26/README.adoc index 7c1a8ce0..f829cce6 100644 --- a/docs/campaigns/2026-05-26/README.adoc +++ b/docs/campaigns/2026-05-26/README.adoc @@ -8,7 +8,11 @@ They’re filed alongside the human + machine campaign reports so the campaign is reproducible. See link:../2026-05-26.md[`+../2026-05-26.md+`] for the report. -=== Scripts +form was broken under jq operator precedence). *Historical since +2026-11-14:* it now exits at once, because it writes a retired `+.a2ml+` +registry; a registry is now `+audits/assail-classifications_praxis.deed+` +(see `+.claude/CLAUDE.md+`, User-Classification Registry). +|=== Scripts [width="100%",cols="50%,50%",options="header",] |=== @@ -65,7 +69,8 @@ bash 00-per-repo.sh && bash 00b-nested.sh # Phase 1b: triage deno run --allow-read --allow-write 01-triage.ts -# Phase 2..N: per-repo PRs (one invocation per repo) +# Phase 2..N: per-repo PRs (one invocation per repo). Historical: since +# 2026-11-14 the script refuses to run (it writes a retired .a2ml registry). BRANCH=panic-fix/PA001-PA007-ffi-legitimate \ bash file-ffi-pr-v2.sh \ \ diff --git a/docs/campaigns/2026-05-26/file-ffi-pr-v2.sh b/docs/campaigns/2026-05-26/file-ffi-pr-v2.sh index 96683dc4..7394f7d1 100755 --- a/docs/campaigns/2026-05-26/file-ffi-pr-v2.sh +++ b/docs/campaigns/2026-05-26/file-ffi-pr-v2.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC2317 # the body after `exit 1` is the historical record # Generate + file a legitimate-FFI classification PR for one repo. # v2: fixes broken chained-OR jq precedence by passing prefixes as --argjson array # and matching via .file as $f | $prefixes | any(.[]; . as $p | $f | startswith($p)). @@ -6,8 +7,20 @@ # Usage: file-ffi-pr-v2.sh REPO_NAME PREFIX_JSON SHORT_RATIONALE [CLASSIFICATION] # PREFIX_JSON: JSON array of path prefixes, e.g. '["ffi/zig/src/","bindings/"]' # CLASSIFICATION: defaults to "legitimate-ffi" +# +# HISTORICAL RECORD of the 2026-05-26 estate sweep: kept so the campaign can be +# read, not re-run. It writes audits/assail-classifications.a2ml, and A2ML is +# retired (standards CLAUDE.md, Machine-Readable Artefacts; panic-attack +# docs/history/A2ML-REMOVED.adoc). A classification registry is now a deed, +# audits/assail-classifications_praxis.deed, in the form .claude/CLAUDE.md +# (User-Classification Registry) gives; write that by hand, entry by entry. +# The exit below stops the script before it touches a repository; the body +# after it is the record of what ran. set -euo pipefail +echo "file-ffi-pr-v2.sh is a historical campaign record and writes a retired .a2ml registry; see its header." >&2 +exit 1 + REPO_NAME="$1" PREFIX_JSON="$2" SHORT_RATIONALE="$3" diff --git a/docs/history/A2ML-REMOVED.adoc b/docs/history/A2ML-REMOVED.adoc new file mode 100644 index 00000000..ef3aa57e --- /dev/null +++ b/docs/history/A2ML-REMOVED.adoc @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell += The A2ML files removed from panic-attack on 2026-11-14 + +The owner approved moving panic-attack off A2ML on 2026-11-14, the way +hypatia did (hyperpolymath/hypatia#1113). Every `.a2ml` file in panic-attack +is translated into deed form where a mapping spec says it translates, every +reader is moved off it, and the file is deleted. The mapping specs are in +standards `1-formats/deed/mappings/`; a field a spec does not list does not +translate and was dropped, not re-homed. Files with no mapping spec were +deleted (A7 section 11, ruling Q7). + +This record lists each removed file, what it was, and where its content +went. The contents are not copied here. Git history keeps them. To read one, +use its blob id, or read its path at the last commit that held it: + +[source,bash] +---- +git cat-file -p +git show 81eee5400c785f5e633f8983610e57c43295d3ed: +---- + +Size is in bytes. The sha256 is of the file as it was tracked. + +== Removed + +[cols="4,1,3,3,4,5",options="header"] +|=== +| Path | Size | sha256 | Git blob id | What it was | Where it went + +| `.machine_readable/CLADE.a2ml` +| 1563 +| `7dfc4482e223b13594e508e74ccab93a789a6097ad477bef0a0c06ed0f31dafa` +| `cf405c23665fd28aeb15ae0d691d0d23b7a4fba8` +| Clade declaration (gv-clade-index, now chora-registry): identity, clade, forges, lineage, status. +| `clade-to-repo-deed.adoc` as updated by standards#1579. Identity content to `panic-attack_chora.deed`: `(identity :owner :primary-forge :prefixed-name)`, `(clade :primary sc :secondary (rm) :assigned :rationale)`, `(forges …)`, `(lineage :type standalone)`. The `[status]` section and its one history entry to `(status …)` in `.machine_readable/descriptiles/STATE.deed` (A7 J15). Not carried: the v5 `uuid` (the retired identity; `:repo-uuid` stays the registry's v8 id, never reminted, U1); `[lineage] parent`, a description rather than a repo, where chora-registry records none (the deed keeps `""`); `[lineage] born` `2026-03-16`, the clade backfill date, which the deed's own lineage note (renamed 2026-02-08) contradicts. The chora deed's `(lineage :type)` said `hub` before; CLADE and chora-registry both say `standalone`, which it now says. + +| `.machine_readable/6a2/META.a2ml` +| 6181 +| `b00ab3a5063c81293518cfc52a984527604c48037ca790d403fb7c3f4d11a341` +| `2373d544ee2f76b1ed23cc142efcb2363fbc10af` +| META descriptile: metadata, project context, dependencies, six architecture decisions, practices, readiness-test grades. +| `(meta :version "2.5.5" :last-updated "2026-06-04")` per `meta-ecosystem-to-repo-deed.adoc`. Dropped: everything else. Author and licence sat under `[metadata]`, not the `[project-info]` rows the table lists; the six `[architecture.*]` decisions carry decision, rationale and consequence prose with no id, status or date, so they are not the `(adr …)` row. + +| `.machine_readable/6a2/ECOSYSTEM.a2ml` +| 3686 +| `ea268abfef2c3b0da94a7b529100c182cb8cdf2720f7f61786d5c4fa7db1d4e7` +| `4b3ac328922bcf7b21c5d6be8d0c1d11e5bc6212` +| ECOSYSTEM descriptile: project, purpose, position (hospital-model role), eight related projects, integration surface. +| `(ecosystem :project :ecosystem :position-type "component")` per `meta-ecosystem-to-repo-deed.adoc`. Dropped: `[project]` name, full-name, purpose and role (the purpose row is `[position] purpose`); `[position]` tier and hospital-model-role; `[integration-surface]`; and the eight `[related-projects]` entries, whose relationships (active-integration, active-consumer, core-subsystem, planned-integration, sibling, parent-context) are outside the 16-term closed set of `clauses/ecosystem.abnf` v1.1.0. + +| `.machine_readable/6a2/ANCHOR.a2ml` +| 572 +| `c629f4681d4d80a0fcd7ffad8cae3de490976bfff934a517cb481a0070d3d44f` +| `20e8a0f7c637a4ac44ff78f9ad810f9c83db5c67` +| Anchor (YAML-shaped): reverse-DNS id, version 1.0.0, clade "diagnostic", status, SSG config, parents boj-server and ambientops. +| A7 6.4. The parents to `(ecosystem (related :relationship parent :uuid …))` in `panic-attack_chora.deed` (J26), each written as its chora-registry v8 id: boj-server `6c7f9305-2a47-8f96-a1ed-bd0940e4d4e6`, ambientops `5c1e28a9-d8c0-8bfe-a57d-ae4abe7dc3be` (pre-V9 ids, kept in their gv-clade-index domain). No `(anchor …)` clause: the source has no `authority`, which the clause requires and a translator never invents, so the anchor is incomplete until the owner supplies it; its `version` 1.0.0 waits with it. Dropped under 6.4: the reverse-DNS id, clade and status. Not translated: the SSG config, which belongs to `META.deed` (J29), not adopted here. + +| `.machine_readable/anchors/ANCHOR.a2ml` +| 495 +| `0d579e52c8bcef01207373049522bb99c691cd44c11a5343f51e7e4a92e3966b` +| `b7a9e018e93c92fdaa58c1d933643c89a4bf8f46` +| A second anchor: the same shape, clade "unknown", parent boj-server only. +| As the row above; its one parent is already carried. No authority either. + +| `.machine_readable/6a2/AGENTIC.a2ml` +| 9122 +| `594ac48d1de46f93fd9cdb731ec09ad08432b5ee3900cab1333a343682062331` +| `92561916de6d6397d4d1a43579d6a310f3bc362b` +| AGENTIC descriptile: agent roles (panicbot, hypatia, echidnabot), gating policies, entropy budgets, risk thresholds, override paths, decision recording, permissions, constraints. +| `(agentic :version "0.1.0" :last-updated "2026-06-04" (permissions :source #t :tests #t :docs #t :config #t :create-files #t))` per `agentic-neurosym-playbook-to-repo-deed.adoc`. No `@profile` line and no `[maintenance-integrity]`, so no `(profile)` and no `(integrity)`. Dropped: the three extra permissions (can-run-scans, can-edit-suppression-registry, can-push-verisimdb), `[agent-constraints]` (unknown keys never-use and always-do, which fail closed), and every other section (no table rows). + +| `.machine_readable/6a2/NEUROSYM.a2ml` +| 12138 +| `487349def3b2dfdb0a4744319fec50b6c60bdf575abbcfe86dfdb766783e74a0` +| `4d5bf16a41be92143c7e1a0b60941deb6ac35c1e` +| NEUROSYM descriptile: architecture, operation definitions, composition rules, proof obligations, type system, search strategy, Hypatia config. +| `(neurosym :version "0.1.0" :last-updated "2026-06-04" (hypatia :scan-enabled #t :report-format "JSON (AssailReport)"))`. The source has no scan-depth. Dropped: the other `[hypatia-config]` keys and every other section, which fail closed pending table rows. + +| `.machine_readable/6a2/PLAYBOOK.a2ml` +| 6335 +| `60f7f3b35927a09d59734592a62dabd708f1f5d20a87cced54490daee08bd880` +| `0cbb30acf47f2f4b32d4bad2ced328dfa33bd1b2` +| PLAYBOOK descriptile: build, test, install, scan, patch-bridge, verisim-push, deployment modes, incident response, release, rollback, suppression runbook, monitoring. +| `(playbook :version "1.0.0" :last-updated "2026-06-04" (incident-response) (release-process))`: the two of the five operational sections the source has, kept as positions. Dropped: their contents and every other section (no table rows). + +| `.machine_readable/6a2/STATE.a2ml` +| 11309 +| `5f268324bf86423d9b287f76367860ec1ffa6de85077dc4a296e57134aa3980e` +| `de374a073fbb171929d976095e10dea84ee5812b` +| STATE descriptile v1: metadata (status "active"), project context (completion 99%, CRG C phase line), session journal 2026-03-23 to 2026-11-06, next priorities. +| Option B of `state-v1-decision.adoc`. Nothing translated: the source has no `maturity` field; its status string duplicates the CLADE phase now in `STATE.deed`; completion-percentage is derivable and dies; the session sections and next priorities are journal, archived here by reference. + +| `0-AI-MANIFEST.a2ml` +| 4990 +| `ca5d37998a002e9b4c3aea9bc373eac8e2b90ed4e10fbf359ab4940ed89a5a05` +| `b4225e63f5ab288cca2fe9088e9db443ce9f50f6` +| AI manifest (S-expression shape): description, canonical locations, critical invariants, repository structure, lifecycle hooks, tools, reports, quality standards, deployment, integration, metadata. +| Replaced by the pointer-only `0-AI-MANIFEST.deed` (A7 ruling Q15). Its sections do not match the table of `ai-manifest-decision.adoc`, so nothing was translated. Its `(reports (formats "json" "nickel" "yaml" "sarif") (storage-targets "filesystem" "verisimdb"))` set panic-attack's own report defaults when the binary ran in this directory; a deed manifest carries no report settings, so those runs now get the built-in json and nickel on the filesystem. + +| `.machine_readable/agent_instructions/methodology.a2ml` +| 4650 +| `566a383f83e6955fe207c88cff3fdf1cf029c36cead80ffb61ace786608a9cc6` +| `754f357105bd63d7e4700a0e881689cfa6850de1` +| Agent methodology template: mode, ring ceiling, wave cap, priority weights, budgets. +| Deleted: template boilerplate; no mapping spec. (The AGENTIC `(methodology …)` row reads AGENTIC's own `[methodology]`, which this repo's AGENTIC did not have.) + +| `.machine_readable/agent_instructions/coverage.a2ml` +| 2233 +| `ce9e1e2124e3a7d7dc86e3704d0bb68cf81eae1185fe6e6ddcf98c505ff1975d` +| `69796642033856ce09e8282f9dc2479500e07747` +| Agent methodology template: session coverage tracking. +| Deleted: template boilerplate; no mapping spec. + +| `.machine_readable/agent_instructions/debt.a2ml` +| 1879 +| `ae4680c353b887ddc636d5e0002dd79c94e917c69a33cb24d0a58e53e2178e9f` +| `c0238c5dfa488ecb12ab9e8f45d9fefac2b71f0e` +| Agent methodology template: meander debt. +| Deleted: template boilerplate; no mapping spec. The directory's `README.adoc` (1403 bytes, sha256 `cf8e8e4fa7725aeded093e4498db68bd04b2fc1637426f607ba3c166b870e483`, blob `628249b67bf55099e5d6f5fbfe64ffeaee637c25`), which only described these three files, went with them. + +| `.machine_readable/campaigns/2026-05-26.a2ml` +| 22454 +| `ddee6bb775919ad21f8cd7d3c343532db1a0655bc34306eb2e4206064a6d5e73` +| `7939924a7dc17ac2f69aac56a29c9c22cf3e85ef` +| Machine-readable report of the 2026-05-26 estate sweep campaign (schema "panic-attack campaign-report v1.0.0"). +| Deleted: no mapping spec, no reader. The human report `docs/campaigns/2026-05-26.adoc` and the driver scripts in `docs/campaigns/2026-05-26/` stay; `file-ffi-pr-v2.sh`, which wrote `.a2ml` registries, is marked historical and refuses to run. + +| `.machine_readable/contractiles/INDEX.a2ml` +| 4590 +| `9fc8c9bfcac08efbee5e302ae759cdd3a354f3fea36b283274739fcd767559f0` +| `566da31e1d493f6e43bfaad412acfa031256f61f` +| Contractile registry over the three pre-consolidation trees (issue #124). +| Deleted: no mapping spec, no reader. The A7 `(contractiles …)` clause is the successor; not adopted here yet. + +| `.machine_readable/contractiles/bust/Bustfile.a2ml` +| 1580 +| `d23f9a19c7454788df23ca9823ddbd9865e549d5ae54bb2d70dbd111aff25bf8` +| `176aed5b3b62e8dbe1b874a4944fa2f4ef285387` +| Bust contractile: meta-repo rollback scenarios (template residue). +| Deleted: no mapping spec. `bust.ncl` now names `Bustfile.deed` (A7 8.1), not yet written. + +| `.machine_readable/contractiles/dust/Dustfile.a2ml` +| 496 +| `422d7f1fe68b44391e6cebf30ed8c698ff6966305f2ac5b35ae84ef7e093bf51` +| `0d619ee22b2988df90498da65af4da1c148e7b19` +| Dust contractile: cleanup and hygiene settings. +| Deleted: no mapping spec, no reader. + +| `.machine_readable/contractiles/trust/Trustfile.a2ml` +| 454 +| `e8c4e1b37a562007c33feaa42e247280d97b40ddaabbdfc18dbc0c7470a8960d` +| `0c95e15e2a28a5e1c317b45e08ae5a8c2d96501a` +| Trust contractile: provenance, integrity and verification settings. +| Deleted: no mapping spec, no reader. + +| `contractiles/intend/Intentfile.a2ml` +| 521 +| `0a87e0c63b2b2cdc6a97e06bc3dd10cb99d8218fb2570507e8861da84ab3f474` +| `671bc71811c3233a4d88ff99d9c3a5015dbbe780` +| Intent contractile (generator source for `contractile gen-just`): purpose stub and anti-purpose. +| Deleted: no mapping spec. `contractile.just` keeps its generated recipes and says not to regenerate from the retired files. + +| `contractiles/must/Mustfile.a2ml` +| 1090 +| `173b4fbf41245b4a6c858dda06859afc2a7ba12220b33c483ba32f86fb77d7ff` +| `aad4e3912b2b2c648a86186f2a03a8135eadb57f` +| Must contractile (generator source): licence, README, hardcoded paths, Dockerfile, Makefile checks. +| Deleted: no mapping spec. `contractile.just` keeps its generated must recipes. + +| `contractiles/trust/Trustfile.a2ml` +| 777 +| `17e7b71f8f675eeba9a4d9a2deb0b38575a37e2bb5de38527ae9fe103bd95655` +| `e43f764367420e922f633ff0ecc1387f93950e55` +| Trust contractile (generator source): trust level and two integrity checks. +| Deleted: no mapping spec. `contractile.just` keeps its generated trust recipes. + +| `.machine_readable/integrations/feedback-o-tron.a2ml` +| 381 +| `e0befb80a2138f359524d6db4e5fdc598c4a233079990afe6303e382821e1550` +| `5381604eda94e014b309b62ffa43e41fdbed5e63` +| Integration note: feedback-o-tron bug reporter config. +| Deleted: no mapping spec, no reader. + +| `.machine_readable/integrations/proven.a2ml` +| 612 +| `11fabb802ac4a0285caa64c4000436c3e1b386b7a6190d735e10be0fb910dbd9` +| `9af33ffdc7e9faced46b474f2a07df389c9e1631` +| Integration note: proven safety-library adoption guidance. +| Deleted: no mapping spec, no reader. + +| `.machine_readable/integrations/verisimdb.a2ml` +| 387 +| `48f716912dbe895d0f4f59a767c22cea517fcb9bc3637b1540558cd3f647cc51` +| `164c5229a7e2a507cb9f123ccd681159a3376005` +| Integration note: VeriSimDB data feed config. +| Deleted: no mapping spec, no reader. + +| `.machine_readable/integrations/vexometer.a2ml` +| 444 +| `3f85155335da36a216049bc4434f976d19580b6bcd49c020117a5c133e3b9145` +| `238b3d2cdd3a9c59f5e21dcdadba8aaf81d24214` +| Integration note: vexometer measurement config. +| Deleted: no mapping spec, no reader. + +|=== + +`audits/assail-classifications.a2ml` was not here to remove: panic-attack +carries no classification registry of its own. Its deed form, +`audits/assail-classifications_praxis.deed`, is what the scanner reads +first (`src/assail/classifications.rs`). + +== Retained, with the reason + +[cols="3,5",options="header"] +|=== +| Path | Why it stays + +| `.machine_readable/contractiles/adjust/Adjustfile.a2ml` (2673 bytes, sha256 `a3cf23202801a05e3bd5d040cc9eb90a202f74e4cfdb0d6ff8ef2b71cca43288`, blob `0534a733dea0ec4afe60b4b437aae359747278c6`) +| `just adjust-check` (`contractile.just`) reads the four calibration thresholds it declares (production-unwrap-threshold, test-unwrap-threshold, test-panic-threshold, active-rules) and compares each with the source, and `adjust.ncl` checks the file is present. No mapping spec covers a contractile, so its values have no deed home to move to; deleting it would turn the drift check into a silent skip. It goes when its edict form (`Adjustfile.deed`, A7 8.1) exists and the recipe reads that. +|=== + +== Readers moved + +* `src/a2ml/mod.rs`: the AI manifest is read deed first. `0-AI-MANIFEST.deed` + (a pointer-only `repo-deed`, parsed with `src/deed.rs`) when it exists; + the legacy `0-AI-MANIFEST.a2ml` and `AI.a2ml` only as a fallback for + repositories that have not moved. A deed manifest carries no report + settings. `panic-attack manifest` and `panic-attack diagnostics` use the + same order. +* `src/diagnostics.rs`: panicbot directives are looked for as the + `(bot-directives (bot :name panicbot …))` clause of the repo deed + (`agentic-neurosym-playbook-to-repo-deed.adoc` §6), not at the stale + `.machine_readable/bot_directives/panicbot.scm`. None declared means the + full suite (owner ruling 2026-11-13). +* `src/assail/classifications.rs` was already deed first (#295); unchanged. +* `.machine_readable/MUST.contractile`, `contractile.just`, `bust.ncl`, + `.claude/CLAUDE.md`, `.github/CONTRIBUTING.md`, `QUICKSTART-DEV.adoc` and + the `scan-and-report.yml` comment point at the deeds. diff --git a/panic-attack_chora.deed b/panic-attack_chora.deed index 18d9ebb6..91175dc9 100644 --- a/panic-attack_chora.deed +++ b/panic-attack_chora.deed @@ -2,12 +2,36 @@ ;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell ; Repository deed for hyperpolymath/panic-attack. ; -; Grammar: hyperpolymath/standards 1-formats/deed/spec/abnf/deed.abnf (v1.2.0). +; Grammar: hyperpolymath/standards 1-formats/deed/spec/abnf/deed.abnf. ; Vocabulary: 1-formats/deed/vocabulary/*.adoc. ; ; This file is why `dogfood-gate.yml`'s "no .deed found" warning is gone: every ; RSR repository carries a repo deed at its root, and a warning that never fails ; is a warning nobody reads. +; +; The A2ML descriptiles were retired on 2026-11-14 (owner approval). Each clause +; below that came from one is translated field for field under the mapping spec +; for its family, in standards 1-formats/deed/mappings/. A field a table does not +; list does not translate: it was dropped, not re-homed. +; docs/history/A2ML-REMOVED.adoc records each removed file, its git blob id and +; what was dropped from it. +; +; CLADE.a2ml -> (identity) (clade) (forges) (lineage) +; clade-to-repo-deed.adoc as updated by standards#1579. +; Its [status] went to .machine_readable/descriptiles/STATE.deed +; (A7 J15), not here. +; META.a2ml -> (meta) meta-ecosystem-to-repo-deed.adoc +; ECOSYSTEM.a2ml -> (ecosystem) meta-ecosystem-to-repo-deed.adoc +; ANCHOR.a2ml -> (ecosystem (related … :relationship parent)), A7 6.4 and +; J26. No (anchor …) clause: the source has no authority, +; and a translator never invents one. +; AGENTIC.a2ml -> (agentic) agentic-neurosym-playbook-to-repo-deed.adoc +; NEUROSYM.a2ml -> (neurosym) agentic-neurosym-playbook-to-repo-deed.adoc +; PLAYBOOK.a2ml -> (playbook) agentic-neurosym-playbook-to-repo-deed.adoc +; STATE.a2ml -> nothing state-v1-decision.adoc option B: the source +; has no maturity field, its status string duplicates the +; CLADE phase, and the rest is journal, archived by +; reference in the ledger. (repo-deed :schema-version "1.0.0" :canonical-name "panic-attack" @@ -17,17 +41,107 @@ ; repo deed names, e.g. hypatia_chora.deed. :repo-uuid #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b" :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" - (status - :phase active - :note "static analysis, stress testing and logic-based bug signature detection") - (maturity - :level stable - :since "2026-02-08") + ; CLADE.a2ml [identity] primary-owner, primary-forge and prefixed-name. Its + ; uuid (a v5) is the retired identity and is never copied (P-1); its + ; canonical-name repeats the head. + (identity :owner "hyperpolymath" :primary-forge github :prefixed-name "sc-panic-attack") + ; CLADE.a2ml [clade]. The source has no primary-name, so none is emitted. + ; chora-registry places the repo the same way (sc primary, rm rank 1). + (clade + :primary sc + :secondary (rm) + :assigned "2026-03-16" + :rationale "") + (forges + :github "hyperpolymath/panic-attack" + :gitlab "hyperpolymath/panic-attack" + :bitbucket "hyperpolymath/panic-attack") + ; :type is CLADE.a2ml's [lineage] type, which chora-registry also records. + ; This clause said `hub` before the translation; neither source did. + ; :parent stays "": chora-registry records no parent, and the CLADE value + ; ("Security scanning tool — static analysis") is a description, not a repo. + ; CLADE's born "2026-03-16" is not carried: it is the clade backfill date, + ; and the rename below shows the repo existed before it. (lineage - :type hub + :type standalone :parent "" :previous-names ("panic-attacker") :note "renamed 2026-02-08: binary panic-attacker -> panic-attack, xray -> assail, XRayReport -> AssailReport") + ; Unchanged by the A2ML retirement. `stable` is outside the closed set in + ; vocabulary/maturity.adoc, and the clause belongs in STATE.deed (A7 J15); + ; the right level is an owner decision, so it waits here. + (maturity + :level stable + :since "2026-02-08") + ; META.a2ml: [metadata] version and last-updated are the rows the table + ; lists. Not translated: [metadata] project, author, license, standard and + ; status (author and license are [project-info] rows, not [metadata] + ; ones); [project-context]; [dependencies]; the six [architecture.*] + ; decisions (decision, rationale and consequence prose with no id, status + ; or date, so not the (adr …) row); [practices]; [readiness-tests]. + (meta + :version "2.5.5" + :last-updated "2026-06-04") + ; ECOSYSTEM.a2ml: [metadata] project and ecosystem, [position] type. Not + ; translated: [metadata] version and last-updated; [project] name, + ; full-name, purpose and role (the purpose row is [position] purpose); + ; [position] tier and hospital-model-role; [integration-surface]; and the + ; eight [related-projects] entries, whose relationships (active-integration, + ; active-consumer, core-subsystem, planned-integration, sibling, + ; parent-context) are outside the closed set of clauses/ecosystem.abnf. + ; The source has no [pipeline] section, so there is no :coordination. + (ecosystem + :project "panic-attack" + :ecosystem "hyperpolymath" + :position-type "component" + ; ANCHOR.a2ml's parents (A7 6.4, J26). Each uuid is the parent's v8 id in + ; chora-registry (pre-V9 ids, kept in their gv-clade-index domain). + ; .machine_readable/6a2/ANCHOR.a2ml named both; the copy in + ; .machine_readable/anchors/ named boj-server only. + (related + :name "boj-server" + :relationship parent + :notes "Parent named by ANCHOR.a2ml." + :uuid #uuid"6c7f9305-2a47-8f96-a1ed-bd0940e4d4e6") + (related + :name "ambientops" + :relationship parent + :notes "Parent named by .machine_readable/6a2/ANCHOR.a2ml." + :uuid #uuid"5c1e28a9-d8c0-8bfe-a57d-ae4abe7dc3be")) + ; AGENTIC.a2ml: [metadata] version and last-updated, and the five + ; [agent-permissions] booleans the table lists. The source has no @profile + ; line and no [maintenance-integrity] section, so there is no (profile) and + ; no (integrity). Not translated: [metadata] spec-version, authority and + ; conformance; [agent-permissions] can-run-scans, + ; can-edit-suppression-registry and can-push-verisimdb; [agent-constraints] + ; (never-use and always-do are unknown keys, which fail closed); + ; [agent-roles.*], [gating-policies], [entropy-budgets.*], + ; [risk-thresholds.*], [override-paths.*] and [decision-recording]. + (agentic + :version "0.1.0" + :last-updated "2026-06-04" + (permissions :source #t :tests #t :docs #t :config #t :create-files #t)) + ; NEUROSYM.a2ml: [metadata] version and last-updated, [hypatia-config] + ; scan-enabled and report-format. The source has no scan-depth. Not + ; translated: [hypatia-config] consumer, finding-codes, env-watcher and + ; planned; [architecture], [operation-definitions.*], + ; [composition-rules.*], [proof-obligations.*], [type-system.*] and + ; [search-strategy], which fail closed pending table rows. + (neurosym + :version "0.1.0" + :last-updated "2026-06-04" + (hypatia :scan-enabled #t :report-format "JSON (AssailReport)")) + ; PLAYBOOK.a2ml: [metadata] version and last-updated, and the two of the + ; five operational sections the source has, kept as positions (the slot + ; doctrine). Their contents have no table rows and did not translate; nor + ; did [build], [test], [install], [scan], [patch-bridge], [verisim-push], + ; [deployment-modes.*], [rollback-process], [suppression-runbook] and + ; [monitoring]. + (playbook + :version "1.0.0" + :last-updated "2026-06-04" + (incident-response) + (release-process)) (obligation :name "evidence-not-proof" :note "T0 syntax heuristics are labelled T0. A finding is never dressed up as a parser or dataflow proof; see docs/RECON-AND-EVIDENCE.adoc") diff --git a/src/a2ml/mod.rs b/src/a2ml/mod.rs index 5c2cddab..9ce554c1 100644 --- a/src/a2ml/mod.rs +++ b/src/a2ml/mod.rs @@ -1,7 +1,13 @@ // SPDX-License-Identifier: MPL-2.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell -//! Minimal A2ML parser and Nickel exporter +//! AI manifest reader, Nickel exporter and the A2ML report-bundle codec. +//! +//! The AI manifest is read deed first: `0-AI-MANIFEST.deed` (a pointer-only +//! `repo-deed`, A7 ruling Q15) when it exists, else the legacy +//! `0-AI-MANIFEST.a2ml` or `AI.a2ml`, which are read only as a fallback for +//! repositories that have not moved to the deed. A2ML is retired: nothing +//! here writes a manifest. use crate::report::formatter::nickel_escape_string; use crate::report::ReportOutputFormat; @@ -135,10 +141,20 @@ impl ReportBundle { } } +/// The AI manifest file names, in read order: the pointer-only deed first, +/// then the legacy A2ML names, read only as a fallback for repositories that +/// have not yet moved to the deed. A deed that exists is the manifest; the +/// A2ML files beside it are not read. +pub const MANIFEST_CANDIDATES: &[&str] = &["0-AI-MANIFEST.deed", "0-AI-MANIFEST.a2ml", "AI.a2ml"]; + #[derive(Clone, Debug)] pub struct Manifest { root_name: String, entries: Vec, + /// The file the manifest was read from; `None` for the built-in defaults. + path: Option, + /// True when read from a `0-AI-MANIFEST.deed`. + from_deed: bool, } impl Default for Manifest { @@ -146,30 +162,74 @@ impl Default for Manifest { Self { root_name: "manifest".to_string(), entries: Vec::new(), + path: None, + from_deed: false, } } } impl Manifest { + /// The manifest path in the current directory: the first of + /// [`MANIFEST_CANDIDATES`] that exists, else the deed name (so a missing + /// manifest is reported under the name it should have). + pub fn default_path() -> PathBuf { + MANIFEST_CANDIDATES + .iter() + .map(PathBuf::from) + .find(|path| path.exists()) + .unwrap_or_else(|| PathBuf::from(MANIFEST_CANDIDATES[0])) + } + pub fn load_default() -> Result { - // Try RSR standard name first, then legacy name - let candidates = [ - PathBuf::from("0-AI-MANIFEST.a2ml"), - PathBuf::from("AI.a2ml"), - ]; - for path in &candidates { - if path.exists() { - return Self::load(path); - } - } - // Fall through with the primary name for a clear error message - Self::load(&candidates[0]) + Self::load(&Self::default_path()) } + /// Load a manifest. A `.deed` file is read with the deed grammar + /// (`crate::deed`) and must be a `repo-deed`; anything else is read as + /// legacy A2ML. pub fn load(path: &Path) -> Result { let raw = fs::read_to_string(path) - .with_context(|| format!("reading A2ML manifest {}", path.display()))?; + .with_context(|| format!("reading AI manifest {}", path.display()))?; + let mut manifest = if path.extension().and_then(|e| e.to_str()) == Some("deed") { + Self::parse_deed(&raw, path)? + } else { + Self::parse_a2ml(&raw)? + }; + manifest.path = Some(path.to_path_buf()); + Ok(manifest) + } + + /// The file this manifest was read from, if any. + pub fn path(&self) -> Option<&Path> { + self.path.as_deref() + } + /// True when this manifest was read from a deed. + pub fn is_deed(&self) -> bool { + self.from_deed + } + + /// Parse a deed manifest. The head becomes the root name and each field + /// or clause one entry, so `to_nickel` renders the deed as it stands. + fn parse_deed(raw: &str, path: &Path) -> Result { + let deed = crate::deed::parse(raw, Some(path)) + .map_err(|e| anyhow!("{}: {}", path.display(), e))?; + if deed.head != "repo-deed" { + return Err(anyhow!( + "{}: expected a repo-deed, found {}", + path.display(), + deed.head + )); + } + Ok(Self { + root_name: deed.head.clone(), + entries: deed.items.iter().map(deed_item_to_sexpr).collect(), + path: None, + from_deed: true, + }) + } + + fn parse_a2ml(raw: &str) -> Result { // Detect format: TOML-like ([sections]) vs S-expression ((manifest ...)) let trimmed = raw.trim_start(); let first_meaningful = trimmed @@ -182,10 +242,10 @@ impl Manifest { if first_meaningful.trim().starts_with('[') { // TOML-like A2ML format — parse sections into S-expression tree - Self::parse_toml_like(&raw) + Self::parse_toml_like(raw) } else { // Classic S-expression format - let mut parser = Parser::new(&raw); + let mut parser = Parser::new(raw); let tree = parser.parse_all()?; if let Sexpr::List(mut items) = tree { if let Some(Sexpr::Atom(root)) = items.first() { @@ -194,6 +254,7 @@ impl Manifest { return Ok(Self { root_name, entries: items, + ..Self::default() }); } } @@ -259,11 +320,18 @@ impl Manifest { }) .collect(); - Ok(Self { root_name, entries }) + Ok(Self { + root_name, + entries, + ..Self::default() + }) } + /// Report formats from a legacy manifest's `(reports (formats …))`, else + /// json and nickel. A deed manifest is pointer-only (A7 Q15) and carries + /// no report settings, so it always gets the defaults. pub fn report_formats(&self) -> Vec { - self.section_entries("reports") + self.reports_section() .and_then(|entries| { entries .iter() @@ -283,8 +351,10 @@ impl Manifest { .unwrap_or_else(|| vec![ReportOutputFormat::Json, ReportOutputFormat::Nickel]) } + /// Storage targets from a legacy manifest's `(reports (storage-targets …))`, + /// else the filesystem. A deed manifest always gets the default. pub fn storage_modes(&self) -> Vec { - self.section_entries("reports") + self.reports_section() .and_then(|entries| { entries .iter() @@ -312,6 +382,14 @@ impl Manifest { format!("let {} = {};\n{}", self.root_name, body, self.root_name) } + /// The legacy `(reports …)` section; never read from a deed. + fn reports_section(&self) -> Option>)>> { + if self.from_deed { + return None; + } + self.section_entries("reports") + } + fn section_entries(&self, key: &str) -> Option>)>> { self.entries.iter().find_map(|entry| { if let Sexpr::List(list) = entry { @@ -721,6 +799,42 @@ impl<'a> Parser<'a> { } } +/// A deed member as a manifest entry: a field `:key value` becomes +/// `(key value)` (a list value contributes its elements), a clause +/// `(name …)` becomes `(name …)` with its members converted in turn. +fn deed_item_to_sexpr(item: &crate::deed::Item) -> Sexpr { + match item { + crate::deed::Item::Field { key, value, .. } => { + let mut list = vec![Sexpr::Atom(key.clone())]; + match value { + crate::deed::Value::List(values) => { + list.extend(values.iter().map(deed_value_to_sexpr)); + } + other => list.push(deed_value_to_sexpr(other)), + } + Sexpr::List(list) + } + crate::deed::Item::Clause { name, items, .. } => { + let mut list = vec![Sexpr::Atom(name.clone())]; + list.extend(items.iter().map(deed_item_to_sexpr)); + Sexpr::List(list) + } + } +} + +fn deed_value_to_sexpr(value: &crate::deed::Value) -> Sexpr { + use crate::deed::Value; + match value { + Value::Str(s) | Value::Uuid(s) => Sexpr::String(s.clone()), + Value::Uuid8(s) => Sexpr::String(format!("#u8:{s}")), + Value::Uuid5(s) => Sexpr::String(format!("#u5:{s}")), + Value::Symbol(s) | Value::Integer(s) => Sexpr::Atom(s.clone()), + Value::Boolean(b) => Sexpr::Atom(if *b { "#t" } else { "#f" }.to_string()), + Value::Quoted(inner) => deed_value_to_sexpr(inner), + Value::List(values) => Sexpr::List(values.iter().map(deed_value_to_sexpr).collect()), + } +} + fn gather_entries(entries: &[Sexpr]) -> Vec<(String, Vec>)> { let mut grouped: Vec<(String, Vec>)> = Vec::new(); for entry in entries { @@ -1334,4 +1448,98 @@ mod tests { let mut parser = Parser::new(manifest); parser.parse_all().expect("parse should succeed"); } + + const DEED_MANIFEST: &str = r#";; SPDX-License-Identifier: CC-BY-SA-4.0 +(repo-deed + :schema-version "1.0.0" + :canonical-name "example" + :repo-uuid #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b" + :beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e" + (front-doors :machine "example_chora.deed" :human "README.adoc")) +"#; + + const LEGACY_MANIFEST: &str = r#"(manifest + (project "example") + (reports (formats "json" "sarif") (storage-targets "filesystem" "verisimdb"))) +"#; + + #[test] + fn manifest_candidates_put_the_deed_first() { + assert_eq!(MANIFEST_CANDIDATES[0], "0-AI-MANIFEST.deed"); + assert!(MANIFEST_CANDIDATES[1..] + .iter() + .all(|c| c.ends_with(".a2ml"))); + } + + #[test] + fn deed_manifest_loads_and_exports_to_nickel() { + let dir = TempDir::new().expect("tempdir"); + let path = dir.path().join("0-AI-MANIFEST.deed"); + fs::write(&path, DEED_MANIFEST).expect("write"); + let manifest = Manifest::load(&path).expect("deed manifest should load"); + assert!(manifest.is_deed()); + assert_eq!(manifest.path(), Some(path.as_path())); + let nickel = manifest.to_nickel(); + assert!(nickel.starts_with("let repo-deed = "), "{nickel}"); + assert!(nickel.contains("example_chora.deed"), "{nickel}"); + assert!( + nickel.contains("a39ad6b1-51e0-854d-aa9a-d9ee97ba519b"), + "{nickel}" + ); + } + + #[test] + fn deed_manifest_carries_no_report_settings() { + // Pointer-only: even a (reports …) clause is not read from a deed. + let dir = TempDir::new().expect("tempdir"); + let path = dir.path().join("0-AI-MANIFEST.deed"); + let text = DEED_MANIFEST.replace( + "(front-doors", + "(reports :formats (\"sarif\") :storage-targets (\"verisimdb\"))\n (front-doors", + ); + fs::write(&path, text).expect("write"); + let manifest = Manifest::load(&path).expect("load"); + assert_eq!( + manifest.report_formats(), + vec![ReportOutputFormat::Json, ReportOutputFormat::Nickel] + ); + assert_eq!(manifest.storage_modes(), vec![StorageMode::Filesystem]); + } + + #[test] + fn malformed_or_misheaded_deed_manifest_is_an_error() { + let dir = TempDir::new().expect("tempdir"); + let path = dir.path().join("0-AI-MANIFEST.deed"); + fs::write( + &path, + DEED_MANIFEST.replace("#uuid\"a39ad6b1", "#u5\"a39ad6b1"), + ) + .expect("write"); + assert!( + Manifest::load(&path).is_err(), + "#u5 identity must be refused" + ); + fs::write(&path, "(manifest (project \"x\"))\n").expect("write"); + assert!( + Manifest::load(&path).is_err(), + "A2ML text in a .deed must be refused" + ); + } + + #[test] + fn legacy_a2ml_manifest_still_reads_report_settings() { + let dir = TempDir::new().expect("tempdir"); + let path = dir.path().join("0-AI-MANIFEST.a2ml"); + fs::write(&path, LEGACY_MANIFEST).expect("write"); + let manifest = Manifest::load(&path).expect("legacy manifest should load"); + assert!(!manifest.is_deed()); + assert_eq!( + manifest.report_formats(), + vec![ReportOutputFormat::Json, ReportOutputFormat::Sarif] + ); + assert_eq!( + manifest.storage_modes(), + vec![StorageMode::Filesystem, StorageMode::VerisimDb] + ); + } } diff --git a/src/diagnostics.rs b/src/diagnostics.rs index 16c696c8..48338b13 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -9,7 +9,6 @@ use std::path::Path; const HYPATIA_ENV: &str = "HYPATIA_API_KEY"; const GITBOT_FLEET_ENV: &str = "GITBOT_FLEET_ENDPOINT"; -const PANICBOT_DIRECTIVE_PATH: &str = ".machine_readable/bot_directives/panicbot.scm"; /// Print readiness checks using `manifest`, paths relative to the current /// working directory and the configured integration environment variables. @@ -28,7 +27,11 @@ pub fn run_self_diagnostics(manifest: &Manifest) -> Result<()> { checks.push(Diagnostic::ok( "AI manifest", format!( - "AI.a2ml parsed (formats: {:?}, storage: {:?})", + "{} parsed (formats: {:?}, storage: {:?})", + manifest + .path() + .map(|p| p.display().to_string()) + .unwrap_or_else(|| "no manifest file; built-in defaults".to_string()), manifest.report_formats(), manifest.storage_modes(), ), @@ -197,16 +200,18 @@ fn check_watcher(label: &'static str, env_key: &str) -> Diagnostic { /// Check panicbot integration readiness. /// /// Verifies: -/// 1. Bot directives file exists at `.machine_readable/bot_directives/panicbot.scm` +/// 1. Whether the repo deed (`_chora.deed` in the current directory) +/// declares `(bot-directives (bot :name panicbot …))` (standards +/// `agentic-neurosym-playbook-to-repo-deed.adoc` §6). No declaration is +/// valid: panicbot then runs the full suite (owner ruling 2026-11-13). /// 2. JSON output contract: AssailReport serialises with the fields panicbot expects /// (`program_path`, `weak_points`, `language`) /// 3. WeakPointCategory and Severity serialise in PascalCase (no serde rename_all) /// /// Failed JSON checks, including serialisation errors, yield an error diagnostic; -/// missing directives alone yield a warning. +/// a repo deed that does not parse yields a warning. fn check_panicbot_readiness() -> Diagnostic { - let directive_path = Path::new(PANICBOT_DIRECTIVE_PATH); - let has_directives = directive_path.is_file(); + let directives = panicbot_directives(Path::new(".")); // Verify JSON output contract by serialising a minimal AssailReport let test_report = crate::types::AssailReport { @@ -249,30 +254,75 @@ fn check_panicbot_readiness() -> Diagnostic { Err(_) => false, }; - match (has_directives, json_ok) { - (true, true) => Diagnostic::ok( + if !json_ok { + return Diagnostic::error( "panicbot integration", - "directives present, JSON contract verified (PA001–PA021)".to_string(), - ), - (false, true) => Diagnostic::warning( + "JSON output contract broken — AssailReport serialisation mismatch".to_string(), + ); + } + match directives { + Ok(Some(deed)) => Diagnostic::ok( "panicbot integration", format!( - "JSON contract OK but {} missing (panicbot will use defaults)", - PANICBOT_DIRECTIVE_PATH + "directives declared in {} (bot-directives), JSON contract verified", + deed.display() ), ), - (true, false) => Diagnostic::error( + Ok(None) => Diagnostic::ok( "panicbot integration", - "directives present but JSON output contract broken — panicbot cannot parse output" + "no panicbot directives declared (panicbot runs the full suite), JSON contract verified" .to_string(), ), - (false, false) => Diagnostic::error( + Err(err) => Diagnostic::warning( "panicbot integration", - "JSON output contract broken — AssailReport serialisation mismatch".to_string(), + format!("JSON contract OK but the repo deed could not be read: {err}"), ), } } +/// The repo deed in `root` that declares `(bot-directives (bot :name +/// panicbot …))`, if any. `Err` when a `*_chora.deed` there does not parse. +fn panicbot_directives(root: &Path) -> Result> { + use panic_attack::deed::{Item, Value}; + let Ok(entries) = fs::read_dir(root) else { + return Ok(None); + }; + let mut deeds: Vec<_> = entries + .filter_map(|e| e.ok().map(|e| e.path())) + .filter(|p| { + p.file_name() + .and_then(|n| n.to_str()) + .is_some_and(|n| n.ends_with("_chora.deed")) + }) + .collect(); + deeds.sort(); + let names_panicbot = |items: &[Item]| { + items.iter().any(|item| { + matches!(item, Item::Field { key, value: Value::Symbol(name), .. } + if key == "name" && name == "panicbot") + }) + }; + for path in deeds { + let text = + fs::read_to_string(&path).with_context(|| format!("reading {}", path.display()))?; + let deed = panic_attack::deed::parse(&text, Some(&path)) + .map_err(|e| anyhow!("{}: {}", path.display(), e))?; + let declared = deed.items.iter().any(|item| match item { + Item::Clause { name, items, .. } if name == "bot-directives" => { + items.iter().any(|bot| { + matches!(bot, Item::Clause { name, items, .. } + if name == "bot" && names_panicbot(items)) + }) + } + _ => false, + }); + if declared { + return Ok(Some(path)); + } + } + Ok(None) +} + /// Check attestation readiness: whether signing is available and if a /// signing key is configured via the `PANIC_ATTACK_SIGNING_KEY` env var. fn check_attestation_health() -> Diagnostic { diff --git a/src/main.rs b/src/main.rs index 0383e59a..01d2ff06 100644 --- a/src/main.rs +++ b/src/main.rs @@ -623,7 +623,8 @@ enum Commands { /// Export the AI manifest as Nickel Manifest { - /// Alternate AI manifest file + /// Alternate AI manifest file (default: 0-AI-MANIFEST.deed, else the + /// legacy 0-AI-MANIFEST.a2ml or AI.a2ml) #[arg(short, long, value_name = "PATH")] path: Option, @@ -709,7 +710,8 @@ enum Commands { /// Run panic-attack self-diagnostics for Hypatia/gitbot-fleet visibility Diagnostics { - /// Alternate AI manifest file (default: AI.a2ml) + /// Alternate AI manifest file (default: 0-AI-MANIFEST.deed, else the + /// legacy 0-AI-MANIFEST.a2ml or AI.a2ml) #[arg(long, value_name = "PATH")] manifest: Option, }, @@ -2243,13 +2245,7 @@ fn run_main() -> Result<()> { } Commands::Manifest { path, output } => { - let target = path.unwrap_or_else(|| { - if PathBuf::from("0-AI-MANIFEST.a2ml").exists() { - PathBuf::from("0-AI-MANIFEST.a2ml") - } else { - PathBuf::from("AI.a2ml") - } - }); + let target = path.unwrap_or_else(Manifest::default_path); let manifest = Manifest::load(&target).unwrap_or_default(); let nickel = manifest.to_nickel(); if let Some(output_path) = output {