#!/usr/bin/env bash
# Runs only local, non-broadcast regression coverage. No RPC, wallet, secret,
# signature, deployment, or live-chain action is used by this runner.
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO="$(cd "$ROOT/../.." && pwd)"

python3 -m unittest discover -s "$ROOT/tests" -v

if ! command -v forge >/dev/null 2>&1; then
  echo "BLOCKED: Foundry (forge) is not installed; Solidity local regression tests were not run." >&2
  exit 2
fi

cd "$REPO/v3-src"
forge test --match-path test/bonds/BondLifecycleDeadlineBoundsV3.t.sol -vv
forge test --match-path test/bonds/BondDisputeHardeningV3.t.sol -vv
forge test --match-path test/governance/MultisigGovernanceV3.t.sol -vv
forge test --match-path test/pilot/BasePilotAccessControllerV3.t.sol -vv
forge test --match-path test/pilot/SafeBondFactoryControllerIntegrationV3.t.sol -vv
