|
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +# Trust — security + safe-hacking runner |
| 3 | +# |
| 4 | +# Pairs with: Trustfile.a2ml (same directory) |
| 5 | +# Verb: trust |
| 6 | +# Semantics: integrity / provenance / security verification PLUS a declared |
| 7 | +# "safe hacking + testing" section — authorised offensive probes |
| 8 | +# (pen-test harness runs, chaos-engineering probes) scoped to the |
| 9 | +# repo under test, NEVER touching external systems. |
| 10 | +# CLI: `contractile trust verify` → run all verifications (read-only) |
| 11 | +# `contractile trust probe` → run declared safe-hacking probes |
| 12 | +# |
| 13 | +# Anything else in this directory is human-only notes/archive; machines ignore. |
| 14 | + |
| 15 | +{ |
| 16 | + pedigree = { |
| 17 | + schema_version = "1.0.0", |
| 18 | + contractile_verb = "trust", |
| 19 | + semantics = "security + provenance + safe-hacking", |
| 20 | + security = { |
| 21 | + leash = 'Kennel, |
| 22 | + trust_level = "verification + authorised-probe", |
| 23 | + allow_network = false, # verifications are offline by default |
| 24 | + allow_filesystem_write = false, # trust writes NOTHING |
| 25 | + allow_subprocess = true, |
| 26 | + authorised_probes_only = true, # probe section must explicitly list allowed targets |
| 27 | + }, |
| 28 | + metadata = { |
| 29 | + name = "trust-runner", |
| 30 | + version = "1.0.0", |
| 31 | + description = "Security + provenance verifications plus authorised safe-hacking probes. All probes are scoped to the repo under test; never hits external systems.", |
| 32 | + paired_xfile = "Trustfile.a2ml", |
| 33 | + author = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>", |
| 34 | + }, |
| 35 | + }, |
| 36 | + |
| 37 | + schema = { |
| 38 | + verifications |
| 39 | + | Array { |
| 40 | + id | String, |
| 41 | + description | String, |
| 42 | + probe | String, # read-only; exit 0 = pass |
| 43 | + status | [| 'declared, 'verified, 'failing |] | default = 'declared, |
| 44 | + severity | [| 'critical, 'high, 'medium, 'low |] | default = 'high, |
| 45 | + notes | String | optional, |
| 46 | + }, |
| 47 | + |
| 48 | + # Safe-hacking + testing section (added 2026-04-17 per user direction). |
| 49 | + # Each probe here is an ACTIVELY EXECUTED test — fuzz runs, chaos probes, |
| 50 | + # auth-bypass attempts, injection tests. All scoped to the current repo. |
| 51 | + safe_hacking |
| 52 | + | { |
| 53 | + scope | String, # e.g. "this-repo-only" / "localhost" |
| 54 | + allowed_probe_classes |
| 55 | + | Array [| 'fuzz, 'property_test, 'chaos, 'auth_bypass, 'injection, 'timing |] |
| 56 | + | default = [], |
| 57 | + probes |
| 58 | + | Array { |
| 59 | + id | String, |
| 60 | + class | [| 'fuzz, 'property_test, 'chaos, 'auth_bypass, 'injection, 'timing |], |
| 61 | + description | String, |
| 62 | + probe | String, # command to run the probe |
| 63 | + expected_outcome | [| 'probe_blocks_attempt, 'probe_finds_no_issue |], |
| 64 | + timeout_seconds | Number | default = 300, |
| 65 | + notes | String | optional, |
| 66 | + } |
| 67 | + | default = [], |
| 68 | + } |
| 69 | + | default = { scope = "this-repo-only", allowed_probe_classes = [], probes = [] }, |
| 70 | + }, |
| 71 | + |
| 72 | + run = { |
| 73 | + on_pass = "continue", |
| 74 | + on_any_fail = "exit-nonzero", # hard gate on verifications |
| 75 | + safe_hacking_on_unexpected_outcome = "exit-nonzero", # probe found what it shouldn't = block |
| 76 | + report_format = "a2ml", |
| 77 | + emit_summary = true, |
| 78 | + }, |
| 79 | +} |
0 commit comments