gabriel / muse public
create_wire_test_repo.sh bash
89 lines 3.0 KB
Raw
sha256:be3641f35bdbcc094677776a77b9aa6a5dab891f8fab201dc162d03c2bab5aea fix(read): strip position:null from structured_delta ops in… Sonnet 4.6 patch 24 days ago
1 #!/usr/bin/env bash
2 # create_wire_test_repo.sh <N> [--large]
3 #
4 # Creates (or resets) ~/ecosystem/muse-wire-test with exactly N files.
5 # Without --large: each file is ~1 KB of deterministic pseudorandom content.
6 # With --large: each file is ~400 KB (forces OC-frame chunking via Phase 14B).
7 #
8 # After reset, configures staging + direct remotes and creates the repo on
9 # MuseHub staging if it does not already exist.
10 #
11 # Usage:
12 # bash create_wire_test_repo.sh 2000
13 # bash create_wire_test_repo.sh 10 --large
14
15 set -euo pipefail
16
17 N=${1:-10}
18 LARGE=0
19 for arg in "${@:2}"; do
20 [[ "$arg" == "--large" ]] && LARGE=1
21 done
22
23 REPO_DIR="$HOME/ecosystem/muse-wire-test"
24 STAGING_URL="https://staging.musehub.ai/gabriel/muse-wire-test"
25 DIRECT_URL="http://23.22.27.39:1337/gabriel/muse-wire-test"
26
27 echo "==> Resetting $REPO_DIR with N=$N files ($([ $LARGE -eq 1 ] && echo 'LARGE ~400KB' || echo 'small ~1KB') each)"
28
29 # Remove and reinitialise
30 rm -rf "$REPO_DIR"
31 mkdir -p "$REPO_DIR"
32 muse -C "$REPO_DIR" init --json > /dev/null
33
34 # Generate N files with deterministic content — single Python invocation
35 echo "==> Generating $N files..."
36 python3 - "$REPO_DIR" "$N" "$LARGE" <<'PYEOF'
37 import sys, hashlib, os
38 repo_dir, n, large = sys.argv[1], int(sys.argv[2]), sys.argv[3] == "1"
39 for i in range(n):
40 fname = os.path.join(repo_dir, f"file_{i:06d}.txt")
41 if large:
42 lines = []
43 for line in range(400):
44 seed = f"wire-test-large-{i}-{line}"
45 h = hashlib.sha256(seed.encode()).hexdigest()
46 lines.append((h * 32)[:1024])
47 content = "\n".join(lines) + "\n"
48 else:
49 h = hashlib.sha256(f"wire-test-{i}".encode()).hexdigest()
50 content = (h * 32)[:1024] + "\n"
51 with open(fname, "w") as f:
52 f.write(content)
53 PYEOF
54
55 # Stage and commit
56 echo "==> Staging and committing..."
57 muse -C "$REPO_DIR" code add . --json > /dev/null
58 muse -C "$REPO_DIR" commit \
59 -m "test: $N $([ $LARGE -eq 1 ] && echo 'large' || echo 'small') objects for wire protocol testing" \
60 --agent-id claude-code \
61 --model-id claude-sonnet-4-6 \
62 --sign \
63 --json > /dev/null
64
65 # Configure remotes (add or update)
66 echo "==> Configuring remotes..."
67 muse -C "$REPO_DIR" remote add staging "$STAGING_URL" --json > /dev/null 2>&1 || \
68 muse -C "$REPO_DIR" remote set-url staging "$STAGING_URL" --json > /dev/null
69 muse -C "$REPO_DIR" remote add direct "$DIRECT_URL" --json > /dev/null 2>&1 || \
70 muse -C "$REPO_DIR" remote set-url direct "$DIRECT_URL" --json > /dev/null
71
72 # Create repo on MuseHub staging if missing
73 echo "==> Ensuring gabriel/muse-wire-test exists on staging..."
74 muse -C "$REPO_DIR" hub repo read \
75 --hub https://staging.musehub.ai --json > /dev/null 2>&1 || \
76 muse -C "$REPO_DIR" hub repo create \
77 --name muse-wire-test \
78 --visibility public \
79 --hub https://staging.musehub.ai \
80 --json > /dev/null
81
82 echo ""
83 echo "==> Done. $REPO_DIR ready with $N files."
84 echo " Remotes:"
85 muse -C "$REPO_DIR" remote --json | python3 -c "
86 import sys, json
87 for r in json.load(sys.stdin)['remotes']:
88 print(f' {r[\"name\"]}: {r[\"url\"]}')
89 "
File History 3 commits
sha256:36c3cb3e76619d4c30a6d9bf81b5ec4ff148e30dcfed913e3114ca7b43b81c7e fix: rename objects→blobs in push client and all stale test… Sonnet 4.6 patch 23 days ago
sha256:c06a9b9b9fee26c68ea725b44d54b2c0a171301ce9de746d5b656617b4463a9a fix: repair four test failures from post-migration audit Sonnet 4.6 patch 29 days ago
sha256:1900655993c83c4107067375548a7be823e471d2515830842f1a12cba4bd3cdf fix: unified object store migration — idempotent writes, JS… Sonnet 4.6 minor 29 days ago