@consiliency/agent-board-schema 1.74.0 → 1.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fixtures/already-applied.json +8 -0
- package/migrations/20261108000100_agent_board_send_outcome.sql +708 -0
- package/migrations/20261109000100_agent_board_step_up_groundwork.sql +343 -0
- package/package.json +1 -1
- package/schema-manifest.json +21 -3
- package/src/deployment-drift-main.test.mjs +20 -3
- package/src/deployment-drift-script.test.mjs +77 -2
- package/src/deployment-drift.test.mjs +60 -0
- package/src/tooling.test.mjs +4 -2
- package/tests/agent_board_667_history_class.test.sql +2 -0
- package/tests/agent_board_717_native_surface.test.sql +223 -0
- package/tests/agent_board_delegate_role_class.test.sql +2 -2
- package/tests/agent_board_delivery_writer_execute.test.sql +4 -2
- package/tests/agent_board_enrollment_audit_content.test.sql +6 -1
- package/tests/agent_board_hosted_delegates.test.sql +8 -1
- package/tests/agent_board_send_outcome.test.sql +805 -0
- package/tests/agent_board_step_up_helper.test.sql +711 -0
- package/tests/agent_board_write_enforcement_class.test.sql +12 -5
- package/tests/catalog/function_execute_privileges.json +96 -0
- package/tests/catalog/p_metadata_parameters.json +40 -0
- package/tests/fixtures/isolation-substrate.sql +8 -0
- package/tests/fixtures/pgtap-unexposed.sql +61 -0
- package/tests/isolation/expected/send_outcome_cross_board.out +40 -0
- package/tests/isolation/expected/send_outcome_independence.out +295 -0
- package/tests/isolation/expected/send_outcome_membership.out +140 -0
- package/tests/isolation/expected/send_outcome_overlap.out +89 -0
- package/tests/isolation/expected/send_outcome_reader.out +87 -0
- package/tests/isolation/expected/send_outcome_recovery.out +107 -0
- package/tests/isolation/specs/send_outcome_cross_board.spec +66 -0
- package/tests/isolation/specs/send_outcome_independence.spec +95 -0
- package/tests/isolation/specs/send_outcome_membership.spec +73 -0
- package/tests/isolation/specs/send_outcome_overlap.spec +69 -0
- package/tests/isolation/specs/send_outcome_reader.spec +61 -0
- package/tests/isolation/specs/send_outcome_recovery.spec +68 -0
- package/tests/mutations/669/M10_service_role_blanket.sql +10 -0
- package/tests/mutations/669/M12a_no_parse_wrapper.sql +17 -0
- package/tests/mutations/669/M12b_no_session_wrapper.sql +23 -0
- package/tests/mutations/669/M12c_no_claim_type_guard.sql +13 -0
- package/tests/mutations/669/M12d_no_amr_element_guards.sql +15 -0
- package/tests/mutations/669/M14_now_not_clock.sql +9 -0
- package/tests/mutations/669/M15_classifier_reads_metadata.sql +17 -0
- package/tests/mutations/669/M17_skip_ledger.sql +15 -0
- package/tests/mutations/669/M18_service_role_sub_insensitive.sql +9 -0
- package/tests/mutations/669/M18b_drop_uid_conjunct.sql +9 -0
- package/tests/mutations/669/M23_definer_wrapper_over_writer.sql +5 -0
- package/tests/mutations/669/M3_age_from_iat.sql +9 -0
- package/tests/mutations/669/M4_window_900.sql +9 -0
- package/tests/mutations/669/M4b_lt_to_le.sql +9 -0
- package/tests/mutations/669/M5_no_skew_bound.sql +9 -0
- package/tests/mutations/669/M6a_user_metadata_amr.sql +9 -0
- package/tests/mutations/669/M6b_app_metadata_claim.sql +9 -0
- package/tests/mutations/669/M6c_legacy_guc.sql +9 -0
- package/tests/mutations/669/M7_either_claim_any_human.sql +9 -0
- package/tests/mutations/669/M8_any_amr_method.sql +9 -0
- package/tests/mutations/669/M8b_accept_aal2.sql +9 -0
- package/tests/mutations/669/M9_every_kind.sql +9 -0
- package/tests/mutations/669/MAL_allowlist_nonempty.sql +9 -0
- package/tests/mutations/669/MAR_writer_arg_renamed.sql +14 -0
- package/tests/mutations/669/MAU_audit_mode_retyped.sql +2 -0
- package/tests/mutations/669/MA_helper_always_raises.sql +10 -0
- package/tests/mutations/669/MDX_dynamic_execute_definer.sql +5 -0
- package/tests/mutations/669/MD_detail_carries_value.sql +12 -0
- package/tests/mutations/669/MEC0_caller_of_helper.sql +4 -0
- package/tests/mutations/669/MEC0b_overload_caller.sql +4 -0
- package/tests/mutations/669/MG1_helper_granted_authenticated.sql +2 -0
- package/tests/mutations/669/MG2_ledger_insert_authenticated.sql +2 -0
- package/tests/mutations/669/MG3_ledger_policy.sql +2 -0
- package/tests/mutations/669/MR1_writer_no_class_check.sql +9 -0
- package/tests/mutations/669/MR2_writer_wide_window.sql +9 -0
- package/tests/mutations/669/MR3_writer_prunes_everyone.sql +11 -0
- package/tests/mutations/669/MR4_writer_lower_exclusive.sql +9 -0
- package/tests/mutations/669/MR5_writer_upper_exclusive.sql +9 -0
- package/tests/mutations/669/MR6_writer_upper_61.sql +9 -0
- package/tests/mutations/669/MW2_second_ledger_writer.sql +4 -0
- package/tests/mutations/669/MXS_cross_schema_wrapper.sql +4 -0
- package/tests/mutations/669/run.sh +72 -0
- package/tests/mutations/670/E1_helper_author_from_message.sql +7 -0
- package/tests/mutations/670/E2_helper_no_null_check.sql +13 -0
- package/tests/mutations/670/M10_lock_removed.sql +10 -0
- package/tests/mutations/670/M11_table_granted_to_authenticated.sql +2 -0
- package/tests/mutations/670/M12_helper_granted_to_service_role.sql +2 -0
- package/tests/mutations/670/M13_message_fk_no_cascade.sql +8 -0
- package/tests/mutations/670/M14_post_message_mints_from_metadata.sql +11 -0
- package/tests/mutations/670/M15_second_receipt_writer.sql +9 -0
- package/tests/mutations/670/M16_read_no_btrim.sql +7 -0
- package/tests/mutations/670/M17_read_volatile.sql +2 -0
- package/tests/mutations/670/M1_helper_no_service_role_guard.sql +13 -0
- package/tests/mutations/670/M3_helper_on_replay_branch.sql +10 -0
- package/tests/mutations/670/M4_read_checks_thread_existence.sql +10 -0
- package/tests/mutations/670/M5a_read_requires_thread_access.sql +10 -0
- package/tests/mutations/670/M5b_read_requires_board_membership.sql +11 -0
- package/tests/mutations/670/M6_read_admits_service_role.sql +14 -0
- package/tests/mutations/670/M7_confirmed_adds_message_sequence.sql +12 -0
- package/tests/mutations/670/M8_delivery_swallows_errors.sql +19 -0
- package/tests/mutations/670/M9_lock_key_includes_board.sql +10 -0
- package/tests/mutations/670/run.sh +84 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- helper: the _is_service_role() guard is removed
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board._record_send_outcome(text,uuid,text,uuid)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ if agent_board._is_service_role() then
|
|
4
|
+
return;
|
|
5
|
+
end if;
|
|
6
|
+
$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board._record_send_outcome(text,uuid,text,uuid)'; end if;
|
|
7
|
+
n := replace(d, $q$ if agent_board._is_service_role() then
|
|
8
|
+
return;
|
|
9
|
+
end if;
|
|
10
|
+
$q$, $q$$q$);
|
|
11
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
12
|
+
execute n;
|
|
13
|
+
end $m$;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- post_board_message: the helper is called on the replay branch too
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ if v_inserted and v_idempotency_key is not null then
|
|
4
|
+
$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'; end if;
|
|
5
|
+
n := replace(d, $q$ if v_inserted and v_idempotency_key is not null then
|
|
6
|
+
$q$, $q$ if v_idempotency_key is not null then
|
|
7
|
+
$q$);
|
|
8
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
9
|
+
execute n;
|
|
10
|
+
end $m$;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- read: checks thread existence and raises P0002
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.get_send_outcome(uuid,text,text)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ -- Step 3, the lookup:$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.get_send_outcome(uuid,text,text)'; end if;
|
|
4
|
+
n := replace(d, $q$ -- Step 3, the lookup:$q$, $q$ if not exists (select 1 from agent_board.threads t where t.id = p_thread_id) then
|
|
5
|
+
raise exception 'thread not found' using errcode = 'P0002';
|
|
6
|
+
end if;
|
|
7
|
+
-- Step 3, the lookup:$q$);
|
|
8
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
9
|
+
execute n;
|
|
10
|
+
end $m$;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- read: requires thread access (M5a: the thread-access form)
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.get_send_outcome(uuid,text,text)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ -- Step 3, the lookup:$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.get_send_outcome(uuid,text,text)'; end if;
|
|
4
|
+
n := replace(d, $q$ -- Step 3, the lookup:$q$, $q$ if not agent_board._current_agent_can_access_thread(p_thread_id) then
|
|
5
|
+
raise exception 'thread not accessible to current agent' using errcode = '42501';
|
|
6
|
+
end if;
|
|
7
|
+
-- Step 3, the lookup:$q$);
|
|
8
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
9
|
+
execute n;
|
|
10
|
+
end $m$;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- read: requires current board access to the thread's board (membership)
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.get_send_outcome(uuid,text,text)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ -- Step 3, the lookup:$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.get_send_outcome(uuid,text,text)'; end if;
|
|
4
|
+
n := replace(d, $q$ -- Step 3, the lookup:$q$, $q$ if exists (select 1 from agent_board.threads t where t.id = p_thread_id and t.board_id is not null
|
|
5
|
+
and not agent_board._current_agent_has_board_access(t.board_id)) then
|
|
6
|
+
raise exception 'board not accessible to current agent' using errcode = '42501';
|
|
7
|
+
end if;
|
|
8
|
+
-- Step 3, the lookup:$q$);
|
|
9
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
10
|
+
execute n;
|
|
11
|
+
end $m$;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- read: the service_role refusal is dropped, and service_role gets a (test-only) grant
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.get_send_outcome(uuid,text,text)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ if agent_board._is_service_role() then
|
|
4
|
+
raise exception 'get_send_outcome requires an agent session' using errcode = '42501';
|
|
5
|
+
end if;
|
|
6
|
+
$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.get_send_outcome(uuid,text,text)'; end if;
|
|
7
|
+
n := replace(d, $q$ if agent_board._is_service_role() then
|
|
8
|
+
raise exception 'get_send_outcome requires an agent session' using errcode = '42501';
|
|
9
|
+
end if;
|
|
10
|
+
$q$, $q$$q$);
|
|
11
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
12
|
+
execute n;
|
|
13
|
+
end $m$;
|
|
14
|
+
grant execute on function agent_board.get_send_outcome(uuid,text,text) to service_role;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- read: the confirmed row also carries message_sequence (drop + recreate, grants restated)
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.get_send_outcome(uuid,text,text)'::regprocedure); n text; begin
|
|
3
|
+
n := replace(d, $q$created_at timestamp with time zone)$q$, $q$created_at timestamp with time zone, message_sequence bigint)$q$);
|
|
4
|
+
n := replace(n, $q$null::uuid, null::timestamptz;$q$, $q$null::uuid, null::timestamptz, null::bigint;$q$);
|
|
5
|
+
n := replace(n, $q$v_row.board_id, v_row.created_at;$q$, $q$v_row.board_id, v_row.created_at, (select m.message_sequence from agent_board.messages m where m.id = v_row.message_id);$q$);
|
|
6
|
+
if n = d or position('message_sequence bigint' in n) = 0 or position('null::bigint' in n) = 0 or position('m.message_sequence' in n) = 0 then
|
|
7
|
+
raise exception 'M7 anchors not found';
|
|
8
|
+
end if;
|
|
9
|
+
execute 'drop function agent_board.get_send_outcome(uuid,text,text)';
|
|
10
|
+
execute n;
|
|
11
|
+
end $m$;
|
|
12
|
+
grant execute on function agent_board.get_send_outcome(uuid,text,text) to authenticated, agent_board_delegate;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
-- post_board_message: delivery is wrapped in exception when others then null
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ select d.delivered_recipient_count, d.callback_outbox_count
|
|
4
|
+
into v_delivered_count, v_callback_count
|
|
5
|
+
from agent_board._deliver_board_message(v_message.id, trim(p_subject), p_body, p_priority) d;
|
|
6
|
+
$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'; end if;
|
|
7
|
+
n := replace(d, $q$ select d.delivered_recipient_count, d.callback_outbox_count
|
|
8
|
+
into v_delivered_count, v_callback_count
|
|
9
|
+
from agent_board._deliver_board_message(v_message.id, trim(p_subject), p_body, p_priority) d;
|
|
10
|
+
$q$, $q$ begin
|
|
11
|
+
select d.delivered_recipient_count, d.callback_outbox_count
|
|
12
|
+
into v_delivered_count, v_callback_count
|
|
13
|
+
from agent_board._deliver_board_message(v_message.id, trim(p_subject), p_body, p_priority) d;
|
|
14
|
+
exception when others then null;
|
|
15
|
+
end;
|
|
16
|
+
$q$);
|
|
17
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
18
|
+
execute n;
|
|
19
|
+
end $m$;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- post_board_message: the board is put back into the idempotency lock key
|
|
2
|
+
do $m$ declare d text := pg_get_functiondef('agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'::regprocedure); n text; begin
|
|
3
|
+
if position($q$ 'post_board_message:' || p_thread_id::text || ':' || v_actor_agent_id::text,
|
|
4
|
+
$q$ in d) = 0 then raise exception 'mutation anchor not found in agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)'; end if;
|
|
5
|
+
n := replace(d, $q$ 'post_board_message:' || p_thread_id::text || ':' || v_actor_agent_id::text,
|
|
6
|
+
$q$, $q$ 'post_board_message:' || p_thread_id::text || ':' || v_actor_agent_id::text || ':' || p_board_id::text,
|
|
7
|
+
$q$);
|
|
8
|
+
if n = d then raise exception 'mutation is a no-op'; end if;
|
|
9
|
+
execute n;
|
|
10
|
+
end $m$;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# #670 SENDOUTCOME mutation receipts (D11). Connection comes ONLY from libpq environment (PGHOST/
|
|
3
|
+
# PGPORT/PGUSER/PGPASSWORD/PGDATABASE), never argv. The target must be an OWNED database holding this
|
|
4
|
+
# tree's applied bundle (CI: the dev job's throwaway Supabase; never a shared cluster).
|
|
5
|
+
#
|
|
6
|
+
# Per mutation:
|
|
7
|
+
# pgTAP the mutation and agent_board_send_outcome.test.sql run in ONE transaction that is
|
|
8
|
+
# rolled back. The receipt records the plan, emitted, ok and not ok counts and every
|
|
9
|
+
# failing line, counted from the TAP, never inferred from an absence. An aborted file
|
|
10
|
+
# (emitted < plan) or a mutation that failed to apply is NOT a kill.
|
|
11
|
+
# isolation (M9, M10 only) the mutation is COMMITTED, its target spec is diffed against the
|
|
12
|
+
# committed golden, and every touched definition is restored from text captured BEFORE
|
|
13
|
+
# mutating.
|
|
14
|
+
# Both legs require the agent_board catalog fingerprint (every routine's signature, ACL, source and
|
|
15
|
+
# comment, plus send_outcomes' constraints and ACL) to equal the pre-run value afterwards.
|
|
16
|
+
# Usage: run.sh <receipt-path> [mutation.sql ...] (default: every *.sql beside this script)
|
|
17
|
+
set -uo pipefail
|
|
18
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
19
|
+
PKG="$(cd "$HERE/../../.." && pwd)"
|
|
20
|
+
TEST="$PKG/tests/agent_board_send_outcome.test.sql"
|
|
21
|
+
SPECS="$PKG/tests/isolation/specs"
|
|
22
|
+
GOLDEN="$PKG/tests/isolation/expected"
|
|
23
|
+
OUT="${1:?receipt path}"; shift
|
|
24
|
+
if [ "$#" -gt 0 ]; then MUTS=("$@"); else mapfile -t MUTS < <(find "$HERE" -maxdepth 1 -name '*.sql' | sort -V); fi
|
|
25
|
+
[ -n "${PGDATABASE:-}" ] || { echo "FATAL: PGDATABASE unset (libpq environment required)" >&2; exit 3; }
|
|
26
|
+
ISO="$(ls -1 /usr/lib/postgresql/*/lib/pgxs/src/test/isolation/isolationtester 2>/dev/null | sort -V | tail -1)"
|
|
27
|
+
WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT
|
|
28
|
+
P=(psql -X -qtA)
|
|
29
|
+
FNS=("agent_board.post_board_message(uuid,uuid,uuid,text,text,text,text,text,jsonb)")
|
|
30
|
+
fp() { "${P[@]}" -c "select md5(coalesce((select string_agg(p.oid::regprocedure::text || coalesce(p.proacl::text, '') || p.prosrc || p.provolatile::text || coalesce(obj_description(p.oid, 'pg_proc'), ''), '|' order by p.oid::regprocedure::text) from pg_proc p where p.pronamespace = 'agent_board'::regnamespace), '') || coalesce((select string_agg(conname || pg_get_constraintdef(oid), '|' order by conname) from pg_constraint where conrelid = 'agent_board.send_outcomes'::regclass), '') || coalesce((select relacl::text from pg_class where oid = 'agent_board.send_outcomes'::regclass), ''))"; }
|
|
31
|
+
: > "$WORK/restore.sql"
|
|
32
|
+
for f in "${FNS[@]}"; do
|
|
33
|
+
"${P[@]}" -c "select pg_get_functiondef('$f'::regprocedure)" >> "$WORK/restore.sql" || exit 3
|
|
34
|
+
printf ';\n' >> "$WORK/restore.sql"
|
|
35
|
+
done
|
|
36
|
+
ORIG="$(fp)"
|
|
37
|
+
|
|
38
|
+
tap() { # $1 label, $2 mutation file or empty
|
|
39
|
+
local out plan ok nok
|
|
40
|
+
if [ -n "$2" ]; then out="$(printf 'begin;\n\\i %s\n\\i %s\nrollback;\n' "$2" "$TEST" | "${P[@]}" 2>&1)"
|
|
41
|
+
else out="$(printf 'begin;\n\\i %s\nrollback;\n' "$TEST" | "${P[@]}" 2>&1)"; fi
|
|
42
|
+
plan="$(sed -nE 's/^1\.\.([0-9]+)$/\1/p' <<<"$out" | head -1)"
|
|
43
|
+
ok="$(grep -cE '^ok [0-9]+' <<<"$out")"; nok="$(grep -cE '^not ok [0-9]+' <<<"$out")"
|
|
44
|
+
printf '%s: pgtap plan=%s emitted=%s ok=%s not_ok=%s%s\n' "$1" "${plan:-NONE}" "$((ok + nok))" "$ok" "$nok" \
|
|
45
|
+
"$([ "${plan:-x}" = "$((ok + nok))" ] || echo ' ABORTED')"
|
|
46
|
+
grep -E '^not ok [0-9]+' <<<"$out" | sed 's/^/ /'
|
|
47
|
+
grep -E '(ERROR|FATAL):' <<<"$out" | head -3 | sed 's/^/ ERR /'
|
|
48
|
+
}
|
|
49
|
+
iso() { # $1 label, $2 spec basename
|
|
50
|
+
[ -x "$ISO" ] || { echo " isolation=UNDETERMINED (no isolationtester)"; return; }
|
|
51
|
+
"$ISO" "dbname=$PGDATABASE" < "$SPECS/$2.spec" > "$WORK/iso.out" 2>&1
|
|
52
|
+
if diff -q "$GOLDEN/$2.out" "$WORK/iso.out" >/dev/null; then echo " isolation[$2]=identical"
|
|
53
|
+
else
|
|
54
|
+
echo " isolation[$2]=DIFFERS ($(diff "$GOLDEN/$2.out" "$WORK/iso.out" | grep -cE '^[<>]') lines)"
|
|
55
|
+
diff "$GOLDEN/$2.out" "$WORK/iso.out" | grep -E '^[<>]' | head -12 | sed 's/^/ /'
|
|
56
|
+
fi
|
|
57
|
+
}
|
|
58
|
+
spec_for() { case "$1" in M9_*) echo send_outcome_cross_board ;; M10_*) echo send_outcome_overlap ;; *) echo "" ;; esac; }
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
echo "# #670 SENDOUTCOME mutation receipt -- $(date -u +%FT%TZ)"
|
|
62
|
+
echo "# tree $(git -C "$PKG" rev-parse HEAD)$(git -C "$PKG" diff --quiet HEAD -- . || echo ' + uncommitted changes')"
|
|
63
|
+
echo "# catalog fingerprint before: $ORIG"
|
|
64
|
+
tap "BASELINE" ""
|
|
65
|
+
iso "BASELINE" send_outcome_cross_board; iso "BASELINE" send_outcome_overlap
|
|
66
|
+
for m in "${MUTS[@]}"; do
|
|
67
|
+
name="$(basename "$m" .sql)"
|
|
68
|
+
echo "-- $name: $(head -1 "$m" | sed 's/^-- //') [sha256 $(sha256sum "$m" | cut -c1-16)]"
|
|
69
|
+
tap "$name" "$m"
|
|
70
|
+
[ "$(fp)" = "$ORIG" ] || { echo "FATAL: fingerprint changed after the rolled-back pgTAP leg of $name"; exit 3; }
|
|
71
|
+
spec="$(spec_for "$name")"
|
|
72
|
+
if [ -n "$spec" ]; then
|
|
73
|
+
"${P[@]}" -v ON_ERROR_STOP=1 -1 -f "$m" >/dev/null 2>&1 || { echo "FATAL: $name did not apply for the isolation leg"; exit 3; }
|
|
74
|
+
[ "$(fp)" != "$ORIG" ] || { echo "FATAL: $name applied but the fingerprint is unchanged (no-op)"; exit 3; }
|
|
75
|
+
iso "$name" "$spec"
|
|
76
|
+
"${P[@]}" -v ON_ERROR_STOP=1 -1 -f "$WORK/restore.sql" >/dev/null || { echo "FATAL: restore failed after $name"; exit 3; }
|
|
77
|
+
[ "$(fp)" = "$ORIG" ] || { echo "FATAL: restore fingerprint differs after $name"; exit 3; }
|
|
78
|
+
echo " restored: fingerprint identical"
|
|
79
|
+
fi
|
|
80
|
+
done
|
|
81
|
+
tap "AFTER-RESTORE" ""
|
|
82
|
+
iso "AFTER-RESTORE" send_outcome_cross_board; iso "AFTER-RESTORE" send_outcome_overlap
|
|
83
|
+
echo "# catalog fingerprint after: $(fp)"
|
|
84
|
+
} | tee "$OUT"
|