From b0f5e0993379dc601333e821b467af1b385dfc60 Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Thu, 3 Sep 2026 07:03:52 -0400 Subject: [PATCH] Remove a stray verification script from the repository root verify.sh was a local scratch script that got committed by mistake. Nothing in the code, the workflows, or the docs refers to it. This change only deletes the file. --- verify.sh | 159 ------------------------------------------------------ 1 file changed, 159 deletions(-) delete mode 100755 verify.sh diff --git a/verify.sh b/verify.sh deleted file mode 100755 index bfad1124..00000000 --- a/verify.sh +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env bash -# -# verify.sh — executable verification recipe for om-5n5k -# openmeet-api: RSVP intake's atprotoUri fallback throws a TypeError and -# reports a generic not-found. -# -# FROZEN AT FIRE TIME. The implementing agent runs it; the verify step re-runs -# it independently and pastes the output as VERIFY BLOCK evidence. Agents append -# findings to the bead — they do NOT edit this file. Editing it is an automatic -# FAIL, because verify is graded against a fixed target. -# -# Exits 0 only when every check passes. Prints the evidence it checked. -# -set -uo pipefail - -BASE_SHA=6d378af4953f2348a1c09ce03d650342c566d6a5 # origin/main at contract time -SVC=src/event/services/rsvp-integration.service.ts -SPEC=src/event/services/rsvp-integration.service.spec.ts - -fails=0 -pass() { printf ' PASS %s\n' "$1"; } -fail() { printf ' FAIL %s\n' "$1"; fails=$((fails+1)); } -hdr() { printf '\n=== %s\n' "$1"; } - -cd "$(dirname "$0")" || exit 2 - -# --------------------------------------------------------------------------- -# CHECK 0 — deterministic precondition (T2). -# The commit this contract was written against must be an ancestor of what is -# under review. This is the om-gvrh class of failure: on 2026-07-09 a live gate -# was stale because the validated worktree was NOT an ancestor of the PR head, -# and security-adjacent code entered the branch having passed nothing. -# A stale or rebased-away base makes every check below meaningless, so this -# runs first and aborts hard. -# --------------------------------------------------------------------------- -hdr "CHECK 0 — base $BASE_SHA is an ancestor of HEAD" -printf ' HEAD %s\n' "$(git rev-parse HEAD)" -printf ' base %s\n' "$BASE_SHA" -if git merge-base --is-ancestor "$BASE_SHA" HEAD 2>/dev/null; then - pass "validated base is an ancestor of HEAD" -else - fail "base is NOT an ancestor of HEAD — contract is stale, nothing below is valid" - printf '\nRESULT: FAIL (precondition) — %d check(s) failed\n' "$fails" - exit 2 -fi - -# --------------------------------------------------------------------------- -# CHECK 1 — the bug is covered by a test that fails for the RIGHT reason. -# AC1: the fallback's INTERNAL-ERROR path must be exercised. The baseline's -# recorded pain is tautological tests; a happy-path assertion on a grafted mock -# cannot catch this defect, so the recipe demands a rejecting mock specifically. -# --------------------------------------------------------------------------- -hdr "CHECK 1 — failure-path coverage exists for the atprotoUri fallback" -if grep -qE 'findByAtprotoUri[^)]*mockRejected|mockRejectedValue' "$SPEC"; then - pass "spec drives findByAtprotoUri into a rejection" - grep -nE 'mockRejected' "$SPEC" | sed 's/^/ /' -else - fail "no test makes findByAtprotoUri reject — the error path is unexercised" -fi - -# --------------------------------------------------------------------------- -# CHECK 2 — the tautology is gone. -# The pre-fix spec grafts the method onto the mock at test time -# ((eventQueryService as any).findByAtprotoUri = jest.fn()), then asserts that -# graft was called. That construction passes whether or not the real provider -# exposes the method. The mock factory already declares it (line 78), so the -# graft is pure tautology and must not survive. -# --------------------------------------------------------------------------- -hdr "CHECK 2 — no test-time graft of findByAtprotoUri onto the mock" -n_graft=$(grep -cE '\(eventQueryService as any\)\.findByAtprotoUri\s*=' "$SPEC") -printf ' grafts found: %s (required: 0)\n' "$n_graft" -if [ "$n_graft" -eq 0 ]; then - pass "findByAtprotoUri comes from the declared mock, not a test-time assignment" -else - fail "spec still assigns findByAtprotoUri onto the mock at test time" - grep -nE '\(eventQueryService as any\)\.findByAtprotoUri\s*=' "$SPEC" | sed 's/^/ /' -fi - -# --------------------------------------------------------------------------- -# CHECK 3 — an internal failure is not reported as a clean miss. -# AC3: the generic "not found" string must not be the surface for an error -# raised INSIDE the fallback. Asserted behaviorally by the spec, and here -# structurally: the not-found throw must not be reachable by swallowing. -# --------------------------------------------------------------------------- -hdr "CHECK 3 — the generic not-found message is raised in exactly one place" -n_notfound=$(grep -cE 'not found`' "$SVC") -printf ' not-found throw sites in %s: %s (required: 1)\n' "$SVC" "$n_notfound" -if [ "$n_notfound" -eq 1 ]; then - pass "single not-found surface" -else - fail "expected exactly 1 not-found throw site, found $n_notfound" - grep -nE 'not found`' "$SVC" | sed 's/^/ /' -fi - -# --------------------------------------------------------------------------- -# CHECK 4 — targeted unit specs pass. -# --------------------------------------------------------------------------- -hdr "CHECK 4 — rsvp-integration + event-query unit specs" -# jest-setup.ts imports src/database/data-source, which constructs a TypeORM -# DataSource at module load. Without env it throws MissingDriverError and every -# suite fails before a test runs. This is exactly what CI does -# (.github/workflows/deploy-to-dev.yml:27) — same fixture, same export. -set -a; export $(grep -v '^#' env-example-relational | xargs) >/dev/null 2>&1; set +a -if npm test -- --silent \ - event/services/rsvp-integration.service.spec.ts \ - event/services/event-query.service.spec.ts 2>&1 | tail -25; then - pass "targeted specs green" -else - fail "targeted specs red" -fi - -# --------------------------------------------------------------------------- -# CHECK 5 — typecheck. Standing pod rule: tsc --noEmit before a TS commit. -# Seven fresh TypeScript errors once rode into a commit; hence this check. -# --------------------------------------------------------------------------- -hdr "CHECK 5 — tsc --noEmit" -# NOTE: `tsc --noEmit` is red on origin/main — 308 errors at BASE_SHA, measured -# 2026-09-03, none of them in this bead's two files. A clean-tree gate would be -# unsatisfiable, so this asserts the two things that ARE actionable: -# (a) zero errors in the touched files, (b) no repo-wide regression. -TSC_BASELINE=308 -tsc_out=$(npx tsc --noEmit 2>&1) -tsc_total=$(printf '%s\n' "$tsc_out" | grep -c 'error TS') -tsc_ours=$(printf '%s\n' "$tsc_out" | grep -c 'rsvp-integration.service') -printf ' repo-wide errors: %s (baseline %s)\n' "$tsc_total" "$TSC_BASELINE" -printf ' errors in touched files: %s (required: 0)\n' "$tsc_ours" -if [ "$tsc_ours" -eq 0 ]; then - pass "no typecheck errors in the touched files" -else - fail "typecheck errors in the touched files" - printf '%s\n' "$tsc_out" | grep 'rsvp-integration.service' | head -20 | sed 's/^/ /' -fi -if [ "$tsc_total" -le "$TSC_BASELINE" ]; then - pass "no repo-wide typecheck regression" -else - fail "repo-wide typecheck errors rose from $TSC_BASELINE to $tsc_total" -fi - -# --------------------------------------------------------------------------- -# CHECK 6 — blast radius. This bead is one service plus its spec. -# --------------------------------------------------------------------------- -hdr "CHECK 6 — touch-set stays inside the frozen scope" -changed=$(git diff --name-only "$BASE_SHA"...HEAD | grep -v '^verify.sh$' || true) -printf ' changed (excl. verify.sh):\n'; printf '%s\n' "$changed" | sed 's/^/ /' -outside=$(printf '%s\n' "$changed" | grep -vE "^(${SVC//\//\\/}|${SPEC//\//\\/})$" | grep -v '^$' || true) -if [ -z "$outside" ]; then - pass "no files outside the predicted touch-set" -else - fail "files changed outside the frozen touch-set:" - printf '%s\n' "$outside" | sed 's/^/ /' -fi - -# --------------------------------------------------------------------------- -hdr "RESULT" -if [ "$fails" -eq 0 ]; then - echo " VERIFY PASS — all checks green"; exit 0 -else - echo " VERIFY FAIL — $fails check(s) failed"; exit 1 -fi