Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
ref: main
path: intentproof-spec

- name: Ensure spec sdk-signing golden checkout
run: |
if [[ -d intentproof-spec/golden/sdk-signing ]]; then
exit 0
fi
git -C intentproof-spec fetch origin phase3-ecosystem-conformance
git -C intentproof-spec checkout FETCH_HEAD

- uses: actions/setup-node@v4
with:
node-version: '22'
Expand All @@ -32,3 +40,8 @@ jobs:
env:
INTENTPROOF_SPEC_DIR: intentproof-spec
run: npm run test:coverage

- name: Verify sdk-signing fixtures synced with spec
env:
INTENTPROOF_SPEC_DIR: intentproof-spec
run: bash ./scripts/check-sdk-signing-fixtures-sync.sh
38 changes: 38 additions & 0 deletions scripts/check-sdk-signing-fixtures-sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Fail when mirrored SDK signing fixtures drift from intentproof-spec.
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
LOCAL="${ROOT}/tests/fixtures"
CANONICAL="${INTENTPROOF_SPEC_DIR:?INTENTPROOF_SPEC_DIR must point at intentproof-spec}/golden/sdk-signing"

if [[ ! -d "$CANONICAL" ]]; then
echo "canonical sdk-signing fixtures not found at ${CANONICAL}" >&2
exit 1
fi

shopt -s nullglob
files=("${CANONICAL}"/signing_*)
if [[ ${#files[@]} -eq 0 ]]; then
echo "no signing fixtures under ${CANONICAL}" >&2
exit 1
fi

fail=0
for canonical in "${files[@]}"; do
base="$(basename "$canonical")"
local_path="${LOCAL}/${base}"
if [[ ! -f "$local_path" ]]; then
continue
fi
if ! cmp -s "$canonical" "$local_path"; then
echo "sdk-signing fixture drift: ${base} differs from spec golden/sdk-signing" >&2
fail=1
fi
done

if [[ "$fail" -ne 0 ]]; then
exit 1
fi

echo "PASS: sdk-signing fixture mirrors match spec golden."
8 changes: 7 additions & 1 deletion tests/signing_golden.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import {
} from '../src/signing';
import { getPublicKeyAsync } from '@noble/ed25519';

const fixtureDir = path.join(__dirname, 'fixtures');
const fixtureDir = (() => {
const specDir = process.env.INTENTPROOF_SPEC_DIR?.trim();
if (specDir) {
return path.join(specDir, 'golden', 'sdk-signing');
}
return path.join(__dirname, 'fixtures');
})();

describe('shared signing golden fixtures', () => {
it('matches Python cross-SDK canonical bytes, hash, and signature', async () => {
Expand Down
Loading