Skip to content

donaldfilimon/abi / .agents/skills/wdbx-roundtrip

wdbx-roundtrip

Verified

Build the abi CLI and drive a full WDBX persistence round-trip on a scratch segment — db init → block insert → query → db verify — proving the on-disk checkpoint + WAL chain stays valid. Use to smoke-test WDBX persistence/durability after touching the store, checkpoint, or WAL code, or to demo the block lifecycle.

FileKindSize
SKILL.mdskill md3.3 KB
roundtrip.shexecutablescript2.0 KB

roundtrip.sh

View on GitHub
#!/usr/bin/env bash
# wdbx-roundtrip driver: build the abi CLI and drive a full WDBX persistence
# round-trip on a scratch segment — db init -> block insert -> query -> db verify.
# Proves the on-disk checkpoint + WAL chain stays valid across the cycle.
# Asserts exit codes + output markers. Resolves repo root from own path.
#
# Usage: .agents/skills/wdbx-roundtrip/roundtrip.sh [profile] [metadata-json]
set -uo pipefail
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(cd -- "$SCRIPT_DIR/../../.." && pwd)
cd "$REPO_ROOT"
ABI="$REPO_ROOT/target/debug/abi"
PROFILE="${1:-abi}"
META="${2:-{\"note\":\"wdbx-roundtrip\"}}"
SCRATCH=$(mktemp -d "${TMPDIR:-/tmp}/abi-wdbx-roundtrip-skill.XXXXXX")
STORE="$SCRATCH/store"
cleanup() { rm -rf -- "$SCRATCH"; }
trap cleanup EXIT
fail=0
say() { printf '\n=== %s ===\n' "$*"; }
step() { local label="$1"; shift; local -a markers=(); local a
    while [ "$1" != "--" ]; do markers+=("$1"); shift; done; shift
    local out; out=$("$@" 2>&1); local rc=$?
    printf '%s\n' "$out"
    [ "$rc" -eq 0 ] || { echo "[FAIL] $label exit $rc"; fail=$((fail+1)); }
    for a in "${markers[@]}"; do
        grep -qF -- "$a" <<<"$out" && echo "[ok] $label :: $a" \
            || { echo "[FAIL] $label missing: $a"; fail=$((fail+1)); }; done; }

say "build cli"
./tools/cargo.sh build -p abi-cli >/dev/null 2>&1 && echo "[ok] build" || { echo "[FAIL] build"; exit 1; }
[ -x "$ABI" ] || { echo "[FAIL] $ABI not produced"; exit 1; }
say "wdbx db init";      step "init"   "initialized empty WDBX v2" -- "$ABI" wdbx db init "$STORE"
say "wdbx block insert"; step "insert" "appended block:" "blocks=1" -- "$ABI" wdbx block insert "$STORE" "$PROFILE" "$META"
say "wdbx query";        step "query"  '"blocks":1' -- "$ABI" wdbx query "$STORE"
say "wdbx db verify";    step "verify" "v2 verify OK:" "merged_chain_valid=true" -- "$ABI" wdbx db verify "$STORE"

say "summary"; echo "failed checks: $fail"
[ "$fail" -eq 0 ] && echo "RESULT: PASS — WDBX persistence round-trip verified." || echo "RESULT: FAIL — $fail check(s)."
exit "$fail"
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 323kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 323kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 323kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall