From fa32ea50a3b563555497b9643b491a3df31cb3ca Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Jul 2026 00:46:24 +0000 Subject: [PATCH] test(cli): live interop check against the real ngit-published amethyst repo Adds a `--live` block that reads the actual amethyst repository ngit publishes to relay.ngit.dev and asserts our reader parses ngit's real multi-value `clone` tag (currently 4 URLs) plus its published issues. This is the real-world proof of the multi-value interop fix: the pre-fix reader would have surfaced only the first clone URL. Opt-in (needs network + the live relay), skipped by default. Verified manually end-to-end against the live repo: repo announcement (4 clone URLs), issues (1621), patches (1617), pull requests (1618, with a real `closed` status derived from ngit's status event), and a NIP-22 comment via `git thread` all read correctly. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01UKMaNoK5M2PQKCAxhxWzPr --- cli/tests/git/git-nip34-headless.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/cli/tests/git/git-nip34-headless.sh b/cli/tests/git/git-nip34-headless.sh index 88a54e21f5..6a898abd26 100755 --- a/cli/tests/git/git-nip34-headless.sh +++ b/cli/tests/git/git-nip34-headless.sh @@ -278,8 +278,30 @@ if [[ "$LIVE" -eq 1 ]]; then fi LOG="$(M git log "$LIVE_REPO" --depth 2 --json)" assert_nonempty "$(echo "$LOG" | jq -r '.commits[0].oid')" live.log "log returns at least one commit" + + # ngit interop against the REAL amethyst repo (published by ngit to relay.ngit.dev). + # Proves our reader parses ngit's actual multi-value `clone` tag (4 URLs) — the + # exact case the pre-fix reader collapsed to one. + banner "live: reading the real ngit-published amethyst repo" + NGIT_RELAY="${NGIT_RELAY:-wss://relay.ngit.dev}" + NGIT_REPO="30617:460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c:amethyst" + RSHOW="$(M git show "$NGIT_REPO" --relay "$NGIT_RELAY")" + if [[ -n "$RSHOW" && "$(echo "$RSHOW" | jq -r '.name // empty')" == "amethyst" ]]; then + CLONES="$(echo "$RSHOW" | jq -r '.clone | length')" + if [[ "$CLONES" -ge 2 ]]; then + pass_msg "ngit.clone_multivalue: read $CLONES clone URLs from ngit's multi-value tag" + record_result ngit.clone_multivalue pass "$CLONES clone URLs" + else + fail_msg "ngit.clone_multivalue: only $CLONES clone URL parsed from ngit's multi-value tag" + record_result ngit.clone_multivalue fail "expected >=2, got $CLONES" + fi + RISS="$(M git issues "$NGIT_REPO" --relay "$NGIT_RELAY" --limit 1 | jq -r '.count')" + assert_nonempty "$RISS" ngit.issues "read ngit-published issues" + else + skip_msg "ngit live repo unreachable (relay.ngit.dev) — skipping real-repo interop check" + fi else - skip_msg "live git smart-HTTP reads (browse/cat/log) — pass --live to run" + skip_msg "live git smart-HTTP reads (browse/cat/log) + real ngit repo — pass --live to run" fi grep -q $'\tfail\t' "$RESULTS_FILE" && exit 1