1# CI attestations land in ci, one row each: commit and tree, result,2# duration, runner, and the signer once the signature checks out. Notes3# that didn't move are skipped; a new attestation adds one row.4. "$(dirname "$0")/../lib.sh"5user dami6repo dami/greet7clone dami dami/greet "$T/w/d"8mkdir -p "$T/w/d/.forge"9printf '#!/bin/sh\ntest -f ok\n' >"$T/w/d/.forge/ci"10chmod +x "$T/w/d/.forge/ci"11at "$T/w/d" commit "ci script, no ok file yet"12fails at "$T/w/d" "$FORGE" attest13at "$T/w/d" commit "add ok" ok14ok at "$T/w/d" "$FORGE" attest15ok push_as dami "$T/w/d" origin main refs/notes/ci16ok forge lake17has "$T_LOG" ', 2 attestations, '18pass=$(git -C "$T/w/d" rev-parse HEAD)19eq "$(lq "SELECT string_agg(result, ' ' ORDER BY result) FROM ci")" "fail pass"20eq "$(lq "SELECT \"commit\" || ' ' || tree FROM ci WHERE result = 'pass'")" "$pass $(git -C "$T/w/d" rev-parse HEAD^{tree})"21eq "$(lq "SELECT count(*) FROM ci WHERE verified AND signer = 'dami' AND runner LIKE '%@%' AND duration_s >= 0 AND exit = (result = 'fail')::INT AND started IS NOT NULL")" 222ok forge lake23has "$T_LOG" ', 0 attestations, '24at "$T/w/d" commit "more"25ok at "$T/w/d" "$FORGE" attest26ok push_as dami "$T/w/d" origin main refs/notes/ci27ok forge lake28has "$T_LOG" ', 1 attestation, '29eq "$(lq "SELECT count(*) || ' ' || count(DISTINCT id) FROM ci")" "3 3"