Skip to content

alexgreensh/repo-forensics / skills/repo-forensics

repo-forensics

Flagged

Security forensics for git repos, AI skills, and MCP servers. Audits dependencies, detects prompt injection, credential theft, runtime dynamism, manifest drift, known CVEs, CISA KEV (actively exploited) vulns, and 2026 attack patterns. Not for fixing vulnerabilities or pentesting.

FileKindSize
.gitignoreother193 B
SKILL.mdskill md43.4 KB
checksums.jsonconfig10.8 KB
checksums.json.sigother64 B
data/README.mdmarkdown1.3 KB
data/compromised_versions.jsonconfig188.3 KB
data/rule_ids.csvother35.3 KB
data/rulepacks/.gitkeepother221 B
data/rulepacks/dead_anchors.jsonconfig9.0 KB
data/rulepacks/mcp_security.jsonconfig31.2 KB
data/rulepacks/runtime_dynamism.jsonconfig46.7 KB
data/rulepacks/sast.jsonconfig107.6 KB
data/rulepacks/secrets.jsonconfig30.4 KB
data/rulepacks/shared.jsonconfig4.4 KB
data/rulepacks/skill_threats.jsonconfig95.4 KB
data/runtime_floors.jsonconfig2.3 KB
data/yara/cryptominers.yarother1.8 KB
data/yara/hacktools.yarother2.2 KB
data/yara/malware.yarother2.2 KB
data/yara/manifest.jsonconfig8.0 KB
data/yara/webshells.yarother2.5 KB
references/cursor-hook-contract.mdmarkdown5.6 KB
references/kernel_privesc_sandbox_pack.mdmarkdown5.0 KB
references/mcp-attack-patterns.mdmarkdown8.7 KB
references/research_sources.mdmarkdown8.0 KB
references/threat_patterns.mdmarkdown20.3 KB
scripts/_context_gate.pyscript21.7 KB
scripts/_ed25519.pyscript5.1 KB
scripts/_pyc_unmarshal.pyscript17.1 KB
scripts/_shared_patterns.pyscript4.8 KB
scripts/adjudication.pyscript16.4 KB
scripts/adjudication_bridge.pyscript1.0 KB
scripts/aggregate_json.pyscript69.2 KB
scripts/auto_scan.pyexecutablescript152.1 KB
scripts/corpus_sync.pyscript10.0 KB
scripts/cursor_pre_scan.pyscript22.5 KB
scripts/dast_sandbox.sbother1.6 KB
scripts/dead_anchors_extract.pyscript14.8 KB
scripts/dead_anchors_probe.pyscript27.1 KB
scripts/forensics_core.pyscript176.5 KB
scripts/gen_rule_ids.pyscript8.6 KB
scripts/hook_adapter.pyscript19.4 KB
scripts/ioc_manager.pyscript49.6 KB
scripts/parse_pnpm_lock.pyscript7.9 KB
scripts/pre_scan.pyscript143.5 KB
scripts/pypi_pins.pyscript8.1 KB
scripts/refresh_controller.pyexecutablescript48.4 KB
scripts/refresh_threat_dbs.pyexecutablescript19.4 KB
scripts/rule_loader.pyscript44.8 KB
scripts/rulepack_feed.pyscript26.4 KB
scripts/run_forensics.shexecutablescript20.3 KB
scripts/sarif_export.pyscript18.6 KB
scripts/scan_agent_skills.pyscript33.2 KB
scripts/scan_archive.pyscript29.1 KB
scripts/scan_ast.pyscript44.9 KB
scripts/scan_binary.pyscript10.9 KB
scripts/scan_bytecode.pyscript28.2 KB
scripts/scan_dast.pyscript28.8 KB
scripts/scan_dataflow.pyscript15.4 KB
scripts/scan_dead_anchors.pyscript15.9 KB
scripts/scan_decode.pyscript37.5 KB
scripts/scan_dependencies.pyscript124.5 KB
scripts/scan_devcontainer.pyscript8.5 KB
scripts/scan_entropy.pyscript15.6 KB
scripts/scan_entrypoint.pyscript34.3 KB
scripts/scan_git_config.pyscript96.3 KB
scripts/scan_git_forensics.pyscript24.1 KB
scripts/scan_history.pyscript14.5 KB
scripts/scan_infra.pyscript54.3 KB
scripts/scan_integrity.pyscript41.0 KB
scripts/scan_lifecycle.pyscript65.1 KB
scripts/scan_manifest_drift.pyscript47.0 KB
scripts/scan_mcp_security.pyscript42.3 KB
scripts/scan_oversize.pyscript11.7 KB
scripts/scan_post_incident.pyscript36.9 KB
scripts/scan_provenance.pyscript19.4 KB
scripts/scan_runtime_dynamism.pyscript23.5 KB
scripts/scan_runtime_floors.pyscript33.5 KB
scripts/scan_sast.pyscript59.1 KB
scripts/scan_secrets.pyscript11.9 KB
scripts/scan_skill_threats.pyscript102.4 KB
scripts/scan_splitstream.pyscript29.5 KB
scripts/scan_yara.pyscript19.7 KB
scripts/session_scan.pyscript54.1 KB
scripts/suppressions.pyscript15.4 KB
scripts/validate_manifests.pyscript13.7 KB
scripts/verify_install.pyscript26.2 KB
scripts/vuln_feed.pyscript31.1 KB
tests/conftest.pyscript13.4 KB
tests/corpus/DEAD_ANCHORS_CORPUS.mdmarkdown2.3 KB
tests/corpus/budgets.jsonconfig5.6 KB
tests/cursor_helpers.pyscript12.6 KB
tests/fixtures/legacy_main_blocks.jsonconfig10.3 KB
tests/fixtures/powershell_verdict_corpus.jsonconfig114.9 KB
tests/golden/parity_mcp_security.jsonconfig17.5 KB
tests/golden/parity_runtime_dynamism.jsonconfig31.7 KB
tests/golden/parity_sast.jsonconfig59.8 KB
tests/golden/parity_secrets.jsonconfig18.8 KB
tests/golden/parity_skill_threats.jsonconfig48.8 KB
tests/parity_corpus.pyscript6.3 KB
tests/powershell_hook.pyscript8.2 KB
tests/report_builders.pyscript5.0 KB
tests/schemas/sarif-schema-2.1.0.jsonconfig109.1 KB
tests/shell_compat.pyscript2.2 KB
tests/test_adjudication_bridge.pyscript832 B
tests/test_adjudication_containment.pyscript1.4 KB
tests/test_adjudication_output.pyscript20.0 KB
tests/test_adjudication_suppressions.pyscript18.7 KB
tests/test_advisory_adjudication.pyscript1.3 KB
tests/test_agent_relay_rules.pyscript7.8 KB
tests/test_aggregate_json.pyscript10.0 KB
tests/test_auto_scan_patterns.pyscript10.5 KB
tests/test_benign_corpus.pyscript16.4 KB
tests/test_benign_new_scanners.pyscript6.1 KB
tests/test_build_output_skip.pyscript10.6 KB
tests/test_capability_ledger.pyscript18.8 KB
tests/test_codex_install.pyscript10.0 KB
tests/test_codex_marketplace.pyscript3.3 KB
tests/test_comment_false_positives.pyscript2.2 KB
tests/test_composer_dependencies.pyscript4.0 KB
tests/test_compromised_versions.pyscript51.2 KB
tests/test_context_gate.pyscript32.4 KB
tests/test_coverage_status.pyscript7.6 KB
tests/test_css_compounding_shrink.pyscript20.8 KB
tests/test_cursor_adapter.pyscript7.8 KB
tests/test_cursor_benign.pyscript3.4 KB
tests/test_cursor_degrade.pyscript12.7 KB
tests/test_cursor_install.pyscript17.1 KB
tests/test_cursor_latency.pyscript7.2 KB
tests/test_cursor_parity.pyscript5.8 KB
tests/test_cursor_redteam_fn.pyscript4.9 KB
tests/test_cursor_tamper_modify.pyscript14.2 KB
tests/test_cursor_wiring.pyscript32.3 KB
tests/test_d1_yara_correlation.pyscript9.2 KB
tests/test_dead_anchors_extract.pyscript7.6 KB
tests/test_dead_anchors_probe.pyscript19.7 KB
tests/test_evidence_engine_parity.pyscript8.1 KB
tests/test_evidence_model.pyscript11.4 KB
tests/test_forensics_core.pyscript79.2 KB
tests/test_fp_hardening_r3.pyscript9.7 KB
tests/test_fp_hardening_r4.pyscript18.8 KB
tests/test_fp_regression_pairs.pyscript62.5 KB
tests/test_fp_structural.pyscript21.2 KB
tests/test_freshness.pyscript6.2 KB
tests/test_frontmatter_validity.pyscript7.0 KB
tests/test_gpg_rce_hotfix.pyscript4.8 KB
tests/test_hook_inert_data.pyscript6.1 KB
tests/test_hook_scripts.pyscript14.0 KB
tests/test_inspection_cpu_budget.pyscript11.6 KB
tests/test_ioc_manager.pyscript55.4 KB
tests/test_kernel_privesc_rules.pyscript27.8 KB
tests/test_legit_precision_regressions.pyscript6.8 KB
tests/test_lethal_trifecta.pyscript20.7 KB
tests/test_manifest_signature.pyscript1.5 KB
tests/test_manifest_validity.pyscript2.9 KB
tests/test_monotonic_trust_e2e.pyscript4.4 KB
tests/test_non_breaking_contract.pyscript22.7 KB
tests/test_openclaw_install.pyscript6.6 KB
tests/test_pack_parity.pyscript24.8 KB
tests/test_parse_pnpm_lock.pyscript10.7 KB
tests/test_plugin_checkout_provenance.pyscript11.1 KB
tests/test_powershell_hook_wire.pyscript10.6 KB
tests/test_powershell_verdict_corpus.pyscript6.2 KB
tests/test_pr44_hardening.pyscript6.5 KB
tests/test_pre_scan.pyscript19.6 KB
tests/test_pre_scan_composer.pyscript7.4 KB
tests/test_precondition_fields.pyscript4.6 KB
tests/test_provenance_offline.pyscript2.5 KB
tests/test_published_rulepack_feed_current.pyscript1.4 KB
tests/test_py38_compat.pyscript3.3 KB
tests/test_pypi_pinned_versions.pyscript19.3 KB
tests/test_pyproject_string_forms.pyscript2.2 KB
tests/test_redteam_fn_regression.pyscript32.5 KB
tests/test_reflective_fetch_execute.pyscript23.5 KB
tests/test_reflective_review_fixes.pyscript17.8 KB
tests/test_refresh_controller.pyscript19.9 KB
tests/test_refresh_rulepacks.pyscript12.4 KB
tests/test_review_gate_regressions.pyscript9.3 KB
tests/test_rule_loader.pyscript23.2 KB
tests/test_rulepack_feed.pyscript38.1 KB
tests/test_run_forensics_json.pyscript1012 B
tests/test_run_scanner_fail_loud.pyscript6.5 KB
tests/test_runtime_floors.pyscript19.8 KB
tests/test_sandbox_probing_rules.pyscript9.6 KB
tests/test_sarif_export.pyscript19.9 KB
tests/test_scan_agent_skills.pyscript31.3 KB
tests/test_scan_archive.pyscript11.6 KB
tests/test_scan_ast.pyscript12.8 KB
tests/test_scan_binary.pyscript15.3 KB
tests/test_scan_bytecode.pyscript21.5 KB
tests/test_scan_dast.pyscript32.1 KB
tests/test_scan_dataflow.pyscript7.1 KB
tests/test_scan_dead_anchors.pyscript11.5 KB
tests/test_scan_decode.pyscript28.0 KB
tests/test_scan_dependencies.pyscript37.8 KB
tests/test_scan_devcontainer.pyscript8.5 KB
tests/test_scan_entropy.pyscript11.2 KB
tests/test_scan_entrypoint.pyscript19.5 KB
tests/test_scan_git_config.pyscript58.5 KB
tests/test_scan_git_config_review_fixes.pyscript33.3 KB

scripts/suppressions.py

View on GitHub
#!/usr/bin/env python3
"""suppressions.py - persistent WARN-tier adjudication downgrades.

When the adjudicating agent downgrades a WARN-tier finding as benign in
context, it may record that decision here as a rejected-claim fingerprint:
(rule id, repo-relative file, SHA-256 of the file's content). Future scans
suppress an exact re-match instead of re-emitting the same standing WARN and
re-burning a host-agent adjudication on identical content.

Hard guards (the adjudication threat model is adversarial):
  * WARN tier only. BLOCK-tier findings and pre_scan.py blocks can NEVER be
    persisted away: the apply-side eligibility check refuses anything outside
    the WARN confidence band, so a stored record is inert the moment a finding
    escalates (e.g. a rule-pack update raises its confidence).
  * Any content edit re-fires. The fingerprint covers the file's full content,
    so a single changed byte produces a new fingerprint and the finding
    resurfaces for adjudication.
  * Always visible. Every report lists active suppressions with a one-command
    revoke.

Storage lives in the local history DB (scan_history.py); reads never create
it and storage failures never change scan output or exit codes.

CLI (for the adjudicating agent or the user):
  python3 suppressions.py add --repo <path> --file <relpath> --rule-id <id> --reason <text>
  python3 suppressions.py list
  python3 suppressions.py revoke --fingerprint <id-or-prefix>
  python3 suppressions.py revoke --all
"""

from __future__ import annotations

import argparse
import hashlib
import json
import os
import shlex
import stat
import sys
import time

sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

import scan_history  # noqa: E402

# Verdict-tier boundaries mirror aggregate_json / adjudication (locked KTD-7
# contract; kept local to avoid import cycles).
VERDICT_BLOCK_MIN = 0.92
VERDICT_WARN_MIN = 0.60

# Refuse to fingerprint files past this size. Scanner findings never point at
# files anywhere near this; the cap keeps `add` from hashing a multi-GB blob.
MAX_FILE_BYTES = 64 * 1024 * 1024

import re as _re

_CONTROL_CHARS_RE = _re.compile(
    "[" 
    "\x00-\x1f\x7f\x80-\x9f"   # C0/C1 controls
    "\u202a-\u202e\u2066-\u2069"  # bidi overrides + isolates
    "\u2060-\u2064\ufeff"          # zero-width / joiner controls
    "\x1b"                            # ESC (ANSI/OSC sequences)
    "]"
)


def _sanitize_reason(text: str, max_len: int = 300) -> str:
    """Strip control chars / ANSI / bidi / zero-widths from a stored reason so
    the report's suppression listing cannot carry terminal escapes or hidden
    text. Reuses adjudication.sanitize_snippet (full ANSI/CSI/OSC + orphan-SGR
    handling) with a local fallback when it is unavailable."""
    try:
        import adjudication
        return adjudication.sanitize_snippet(text, max_len=max_len)
    except (ImportError, AttributeError):
        cleaned = _CONTROL_CHARS_RE.sub("", text or "")
        cleaned = _re.sub(r"\s+", " ", cleaned).strip()
        return cleaned[:max_len]


def _normalize_relpath(relpath: str) -> str | None:
    """Normalize a repo-relative path to posix form; None when it escapes.

    Rejects absolute paths, drive-letter paths, empty paths, and any path
    containing a parent traversal after normalization.
    """
    if not isinstance(relpath, str) or not relpath.strip():
        return None
    rel = relpath.replace("\\", "/")
    if rel.startswith("/") or (len(rel) > 1 and rel[1] == ":"):
        return None
    parts = []
    for part in rel.split("/"):
        if part in ("", "."):
            continue
        if part == "..":
            return None
        parts.append(part)
    if not parts:
        return None
    return "/".join(parts)


def fingerprint_for(repo_path: str, relpath: str, rule_id: str) -> str | None:
    """Compute the rejected-claim fingerprint for one finding location.

    Identity = (rule_id, normalized repo-relative path, SHA-256 of file
    content). Returns None when the file is missing, unreadable, not a regular
    file, too large, or resolves outside the repo (symlink escape) — a finding
    that cannot be fingerprinted can never be suppressed, so it simply
    re-fires next scan.
    """
    rel = _normalize_relpath(relpath)
    if rel is None or not isinstance(rule_id, str) or not rule_id:
        return None
    try:
        root = os.path.realpath(repo_path)
        target = os.path.realpath(os.path.join(root, rel))
        if target != root and not target.startswith(root + os.sep):
            return None
        st = os.stat(target)
        if not stat.S_ISREG(st.st_mode) or st.st_size > MAX_FILE_BYTES:
            return None
        digest = hashlib.sha256()
        with open(target, "rb") as handle:
            for chunk in iter(lambda: handle.read(1 << 20), b""):
                digest.update(chunk)
    except (OSError, ValueError):
        return None
    return _fingerprint_from_parts(rel, rule_id, digest.hexdigest())


def _fingerprint_from_parts(rel: str, rule_id: str, content_hash: str) -> str:
    payload = {"file": rel, "rule_id": rule_id, "sha256": content_hash}
    encoded = json.dumps(payload, sort_keys=True, separators=(",", ":"))
    return hashlib.sha256(encoded.encode("utf-8")).hexdigest()


def fingerprint_and_hash(repo_path: str, relpath: str, rule_id: str):
    """Like fingerprint_for but also returns the raw content hash (for storage)."""
    rel = _normalize_relpath(relpath)
    if rel is None or not isinstance(rule_id, str) or not rule_id:
        return None
    try:
        root = os.path.realpath(repo_path)
        target = os.path.realpath(os.path.join(root, rel))
        if target != root and not target.startswith(root + os.sep):
            return None
        st = os.stat(target)
        if not stat.S_ISREG(st.st_mode) or st.st_size > MAX_FILE_BYTES:
            return None
        digest = hashlib.sha256()
        with open(target, "rb") as handle:
            for chunk in iter(lambda: handle.read(1 << 20), b""):
                digest.update(chunk)
    except (OSError, ValueError):
        return None
    content_hash = digest.hexdigest()
    return _fingerprint_from_parts(rel, rule_id, content_hash), content_hash


PROMPT_INJECTION_PREFIXES = ("ST-PI-",)


def persist_command(finding) -> str | None:
    """Ready-to-run, shell-quoted persist command for one finding, or None.

    The file name comes from the scanned repo, so the reviewer must never
    compose this command by hand. Returns None when the finding can never be
    suppressed or when the path holds characters that would not survive
    display unchanged (then the fingerprint could not match anyway).
    """
    if not _finding_eligible(finding):
        return None
    raw_file = str(finding.get("file", ""))
    raw_rule = str(finding.get("rule_id", ""))
    if _normalize_relpath(raw_file) is None:
        return None
    if any(ord(ch) < 0x20 or ord(ch) == 0x7F or not ch.isprintable() for ch in raw_file + raw_rule):
        return None
    return (
        f"{command_hint('add')} --repo <scanned-repo> --file {shlex.quote(raw_file)} "
        f"--rule-id {shlex.quote(raw_rule)} --reason '<why>'"
    )


def _finding_eligible(finding) -> bool:
    """Apply-side guard: ONLY WARN-tier, non-correlation findings with both a
    rule id and a file can ever be matched to a stored suppression."""
    if not isinstance(finding, dict):
        return False
    if finding.get("scanner") == "correlation":
        return False
    if not finding.get("rule_id") or not finding.get("file"):
        return False
    # Exit code is severity-driven while the tier is confidence-driven, and
    # many critical rules sit in the WARN confidence band. A critical finding
    # must never be silenced, and a prompt-injection snippet is by definition
    # text trying to talk the reviewer into a benign verdict.
    if str(finding.get("severity", "")).lower() == "critical":
        return False
    if str(finding.get("rule_id", "")).upper().startswith(PROMPT_INJECTION_PREFIXES):
        return False
    try:
        confidence = float(finding.get("confidence"))
    except (TypeError, ValueError):
        return False
    return VERDICT_WARN_MIN <= confidence < VERDICT_BLOCK_MIN


def partition_suppressed(findings, repo_path, records):
    """Split findings into (active, adjudication-suppressed).

    A finding is suppressed only when it is WARN-tier eligible AND its freshly
    computed fingerprint matches a stored record — so identical rule+file with
    edited content (different content hash) stays active and re-fires.
    Suppressed findings lose needs_adjudication and gain audit metadata.
    """
    if not records:
        return list(findings), []
    index = {record["fingerprint"]: record for record in records}
    fingerprint_cache = {}
    active, suppressed = [], []
    for finding in findings:
        record = None
        if _finding_eligible(finding):
            key = (finding.get("file", ""), finding.get("rule_id", ""))
            if key not in fingerprint_cache:
                fingerprint_cache[key] = fingerprint_for(
                    repo_path, finding.get("file", ""), finding.get("rule_id", "")
                )
            fingerprint = fingerprint_cache[key]
            if fingerprint:
                record = index.get(fingerprint)
            if record is not None:
                annotated = dict(finding)
                annotated.pop("needs_adjudication", None)
                annotated["suppression_source"] = "adjudication"
                annotated["suppression"] = {
                    "fingerprint": fingerprint,
                    "rule_id": record["rule_id"],
                    "reason": record["reason"],
                    "created_at": record["created_at"],
                }
                suppressed.append(annotated)
                continue
        active.append(finding)
    return active, suppressed


def load_active_records(db_path: str | None = None) -> list[dict]:
    """Failure-safe read of all active suppression records (never creates the DB)."""
    return scan_history.load_suppressions_safely(db_path)


def record_applies_to_repo(record: dict, repo_path: str) -> bool:
    """True when the record's file exists inside repo_path (any content)."""
    rel = _normalize_relpath(str(record.get("relpath", "")))
    if rel is None:
        return False
    try:
        root = os.path.realpath(repo_path)
        target = os.path.realpath(os.path.join(root, rel))
    except (OSError, ValueError):
        return False
    return target.startswith(root + os.sep) and os.path.isfile(target)


def summarize_record(record: dict) -> dict:
    """Compact, JSON-safe view of one record for report embedding."""
    return {
        "fingerprint": record["fingerprint"],
        "rule_id": record["rule_id"],
        "file": record["relpath"],
        "reason": record["reason"],
        "created_at": record["created_at"],
    }


def command_hint(*args: str) -> str:
    """Absolute invocation string for this script, for report embedding."""
    script = os.path.join(os.path.dirname(os.path.abspath(__file__)), "suppressions.py")
    return " ".join([f'python3 "{script}"', *args])


# --- CLI -----------------------------------------------------------------

def _cli_add(args) -> int:
    repo = os.path.realpath(args.repo)
    if not os.path.isdir(repo):
        print(f"[!] --repo is not a directory: {args.repo}", file=sys.stderr)
        return 2
    rel = _normalize_relpath(args.file)
    if rel is None:
        print(f"[!] --file must be a repo-relative path: {args.file!r}", file=sys.stderr)
        return 2
    reason = _sanitize_reason(args.reason)
    if not reason:
        print("[!] --reason is required (a downgrade without a reason is not auditable)",
              file=sys.stderr)
        return 2
    parts = fingerprint_and_hash(repo, rel, args.rule_id)
    if parts is None:
        print(f"[!] cannot fingerprint {rel}: missing, unreadable, not a regular "
              f"file, too large, or outside the repo", file=sys.stderr)
        return 2
    fingerprint, content_hash = parts
    result = scan_history.add_suppression_safely(
        fingerprint, args.rule_id, rel, content_hash, reason
    )
    if result is None:
        return 3
    print(f"suppressed {fingerprint[:12]}  {args.rule_id}  {rel}")
    print("applies to WARN-tier re-matches with byte-identical content; "
          "any edit re-fires the finding.")
    return 0


def _cli_list(args) -> int:
    records = load_active_records()
    if args.json:
        json.dump([summarize_record(r) for r in records], sys.stdout, indent=2,
                  sort_keys=True)
        sys.stdout.write("\n")
        return 0
    if not records:
        print("no active adjudication suppressions")
        return 0
    print(f"{len(records)} active adjudication suppression(s):")
    for record in records:
        stamp = time.strftime("%Y-%m-%d", time.localtime(record["created_at"]))
        rule_id = _sanitize_reason(str(record["rule_id"]), max_len=80)
        relpath = _sanitize_reason(str(record["relpath"]), max_len=160)
        reason = _sanitize_reason(str(record["reason"]), max_len=300)
        print(f"  {record['fingerprint'][:12]}  {rule_id}  {relpath}")
        print(f"      reason: {reason}  (recorded {stamp})")
    print(f"revoke one: {command_hint('revoke', '--fingerprint', '<id>')}")
    print(f"revoke all: {command_hint('revoke', '--all')}")
    return 0


def _cli_revoke(args) -> int:
    path = scan_history.suppressions_db_path()
    if not os.path.isfile(path):
        print("no active adjudication suppressions")
        return 0
    try:
        store = scan_history.HistoryStore(path)
        if args.all:
            removed = store.clear_suppressions()
            print(f"revoked {removed} suppression(s)")
            return 0
        removed = store.revoke_suppression(args.fingerprint)
    except ValueError as exc:
        print(f"[!] {exc}", file=sys.stderr)
        return 2
    except Exception as exc:  # storage failure: clean message, no traceback
        print(f"[!] could not revoke: {exc}", file=sys.stderr)
        return 3
    if removed:
        print(f"revoked {removed} suppression(s)")
    else:
        print(f"[!] no suppression matches {args.fingerprint!r}", file=sys.stderr)
        return 2
    return 0


def main(argv=None) -> int:
    parser = argparse.ArgumentParser(
        description="Manage persistent WARN-tier adjudication suppressions."
    )
    sub = parser.add_subparsers(dest="command", required=True)

    p_add = sub.add_parser("add", help="record a downgrade for exact re-matches")
    p_add.add_argument("--repo", required=True, help="scanned repository root")
    p_add.add_argument("--file", required=True, help="repo-relative file path")
    p_add.add_argument("--rule-id", required=True, help="rule id from the finding")
    p_add.add_argument("--reason", required=True, help="why the finding is benign")
    p_add.set_defaults(func=_cli_add)

    p_list = sub.add_parser("list", help="list active suppressions")
    p_list.add_argument("--json", action="store_true", help="machine-readable output")
    p_list.set_defaults(func=_cli_list)

    p_revoke = sub.add_parser("revoke", help="remove suppressions")
    group = p_revoke.add_mutually_exclusive_group(required=True)
    group.add_argument("--fingerprint", help="fingerprint or unique prefix")
    group.add_argument("--all", action="store_true", help="revoke every suppression")
    p_revoke.set_defaults(func=_cli_revoke)

    args = parser.parse_args(argv)
    return args.func(args)


if __name__ == "__main__":
    sys.exit(main())
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall