OverviewFilesCommitsIssuesDocsReleasesPeers

ap-bridge commits / 3771af2

0.10.13: the canonical CI build works again
⛔ No CI build of ap-bridge had landed since 2026-08-18. A failed build records no version, so `pgh deploy log` simply showed nothing newer, and every release since went out by hand from the dev tree. Dry-running ci.yaml's steps on a git-archive export of the commit (everything but the publish) found two blockers, in order: 1. TESTS RAN BEFORE VENDORING, on the claim that "the suites use fakes and import no sibling". They import anproto, favela-peer and favela-peer's test helpers, which in the export are dangling file: symlinks until the vendor step: MODULE_NOT_FOUND: anproto. Tests now run AFTER vendor and guard, against the tree about to be published. brittle goes into a separate prefix, only the packages the tree lacks are copied in, the suite runs with the tree's own brittle (brittle-bare runs tests in-process), and exactly those packages are removed again. npm never touches the vendored tree, which is what deleted vendored siblings before ("removed 1194 packages"). brittle is pinned to the devDependency range, not "latest". 2. lib/swarm-keypair.js imports hypercore-crypto, which was undeclared and resolved only by hoisting: the exact bug class the declare-deps guard exists for. Declared at the version already resolved (^3.7.0). 0.10.13 rather than a rebuild of 0.10.12: the registry accepts a second tree under an existing version, and that is how pear-git-v3 split-brained in July. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3771af20b72b2fa55bd3570cf83658d68669e3fb
by plankatron <fleeky@gmail.com> · 2026-10-12T20:46:52.000Z

Changed files (2) +38 -15

.pear-git/ci.yaml +36 -14
……@@ -18,20 +18,6 @@ steps:
1818 run: npm install --production
1919 timeout: 300
2020
21 # Tests run BEFORE vendoring, and that ordering is load-bearing in a way that is not obvious:
22 # `npm install brittle` RE-RESOLVES the tree and deletes hand-vendored directories (it reported
23 # "removed 1194 packages" doing exactly that), so anything vendored earlier is gone by publish
24 # time. pgh publish catches it — "declared file: dependencies did not resolve into the closure"
25 # — but only after the whole build. The suites use fakes and import no sibling, so they have no
26 # reason to run late.
27 #
28 # brittle is a devDependency and `npm install --production` skips it, so brittle-bare is not on
29 # disk (npx then 404s — it is a bin from brittle, not its own package). Install transiently and
30 # prune, so the tree pgh publish content-addresses is the production closure with no test deps.
31 - name: tests (offline)
32 run: npm install --no-save --no-audit --no-fund brittle && npx brittle-bare test/*.test.js && npm prune --production
33 timeout: 240
34
3521 # Vendor LAST — after every npm operation, immediately before the guard and publish. A vendored
3622 # sibling is copied from the WORKING TREE, so whatever is checked out on the build machine ships
3723 # to the fleet, reviewed or not. Refuse unless each sibling HEAD is reachable from some hosted
……@@ -90,6 +76,42 @@ steps:
9076 exit $rc
9177 timeout: 60
9278
79 # Tests run AFTER vendoring, against the exact tree that is about to be published.
80 #
81 # ⛔ They used to run BEFORE vendoring, on the claim that "the suites use fakes and import no
82 # sibling". That stopped being true: the suites import anproto, favela-peer and favela-peer's test
83 # helpers, which in the git-archive checkout are dangling file: symlinks until the vendor step. So
84 # every build failed here (MODULE_NOT_FOUND: anproto), and a failed build records no version. That
85 # is why no CI build of ap-bridge landed between 2026-08-18 and 2026-10-12. Found by dry-running
86 # these steps on a git-archive export.
87 #
88 # ⛔ AND npm MUST NOT TOUCH THIS TREE NOW. `npm install brittle` re-resolves and deletes
89 # hand-vendored directories (it reported "removed 1194 packages"). So brittle is installed into a
90 # SEPARATE prefix, only the packages this tree lacks are copied in, the suite runs with the TREE'S
91 # copy of brittle (brittle-bare runs tests in-process, so runner and tests must share one instance),
92 # and exactly those added packages are removed again. The published closure is byte-for-byte what
93 # it was before this step. The version is the devDependency's range, not whatever is latest.
94 - name: tests (offline, against the vendored closure)
95 run: |
96 B=$(mktemp -d)
97 RANGE=$(node -p 'require("./package.json").devDependencies.brittle')
98 npm install --prefix "$B" --no-audit --no-fund --no-save "brittle@$RANGE" >/dev/null 2>&1 || { echo "could not install brittle@$RANGE"; exit 1; }
99 ADDED=""
100 for p in $(cd "$B/node_modules" && ls -A | grep -v -E '^\.'); do
101 case "$p" in
102 @*) for q in $(ls -A "$B/node_modules/$p"); do
103 if [ ! -e "node_modules/$p/$q" ]; then mkdir -p "node_modules/$p" && cp -r "$B/node_modules/$p/$q" "node_modules/$p/$q" && ADDED="$ADDED $p/$q"; fi
104 done ;;
105 *) if [ ! -e "node_modules/$p" ]; then cp -r "$B/node_modules/$p" "node_modules/$p" && ADDED="$ADDED $p"; fi ;;
106 esac
107 done
108 echo "overlaid for the test run only:$ADDED"
109 bare node_modules/brittle/bin/bare.js test/*.test.js; rc=$?
110 for p in $ADDED; do rm -rf "node_modules/$p"; done
111 rm -rf "$B"
112 exit $rc
113 timeout: 300
114
93115 - name: pgh publish (content-addressed -> installable app)
94116 run: pgh publish . --accept-conflict "automated CI publish; dep version-splits inherited from per-app lockfiles across the pgh ecosystem"
95117 timeout: 300
package.json +2 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "ap-bridge",
3 "version": "0.10.12",
3 "version": "0.10.13",
44 "description": "ActivityPub membrane \u2014 a second projection of the self-custody atproto peer",
55 "type": "module",
66 "main": "index.js",
……@@ -30,6 +30,7 @@
3030 "favela-peer": "file:../favela-peer",
3131 "hyper-overlay": "file:../hyper-overlay",
3232 "hyper-svc": "file:../hyper-svc",
33 "hypercore-crypto": "^3.7.0",
3334 "hyperswarm": "^4.17.0",
3435 "protomux": "^3.11.0",
3536 "protomux-rpc": "^1.10.0"