#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SKILL_ROOT="$(dirname "$SCRIPT_DIR")" source "$SCRIPT_DIR/_common.sh" : "${BACKUP_SKILL_DIR:=}" : "${RUN_DIR:=}" main() { local status="$SKILL_ROOT/outputs/status_matrix.json" local ok_validate=false ok_restore=false ok_verify=false if [[ -n "$BACKUP_SKILL_DIR" ]]; then local run_dir; run_dir="$(resolve_run_dir "$BACKUP_SKILL_DIR" "$RUN_DIR")" if [[ -f "$run_dir/ROOT.txt" && -f "$run_dir/manifest.json" && -f "$run_dir/archive.tar.gz.age" ]]; then ok_validate=true fi fi local ptr="$SKILL_ROOT/outputs/last_drill_target.txt" if [[ -f "$ptr" ]]; then ok_restore=true local target; target="$(cat "$ptr")" if [[ -f "$target/restored_manifest_check.json" ]]; then ok_verify=true fi fi blockers="[]" if [[ "$ok_restore" != "true" ]]; then blockers='["restore_not_performed"]' elif [[ "$ok_verify" != "true" ]]; then blockers='["post_restore_verification_missing"]' fi cat > "$status" <