memcache - chore: defense - bootstrap Aikido Safe Chain - #107
Conversation
Install Safe Chain with a pinned installer on Codespaces and Cursor Cloud, then install dependencies through shims with a frozen lockfile. Reconcile CODEOWNERS as merged in PR #106. Co-authored-by: Jared Wray <me@jaredwray.com>
Co-authored-by: Jared Wray <me@jaredwray.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 1399 1399
Branches 308 303 -5
=========================================
Hits 1399 1399 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Bootstrap skips nvm before pnpm
- The setup script now sources nvm.sh before the corepack/pnpm checks so a Cursor Cloud install hook with a reset PATH uses nvm Node 24 instead of failing or wrapping /exec-daemon/node.
- ✅ Fixed: Floating unpinned devcontainer base image
- The Codespaces image is pinned to javascript-node:24 so bootstrap stays on the Node major that still ships corepack instead of drifting with latest.
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 110716e. Configure here.
| if ! command -v pnpm >/dev/null; then | ||
| echo "error: pnpm is required on PATH before Safe Chain can wrap it" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Bootstrap skips nvm before pnpm
High Severity
The bootstrap requires pnpm on PATH after an optional corepack enable, but never activates nvm or sources ~/.bashrc first. AGENTS.md states Cursor Cloud’s system node at /exec-daemon/node is too old and that the usable Node/pnpm come from nvm via ~/.bashrc. Cursor’s install hook can run with a minimal PATH, so the script can exit before Safe Chain runs or wrap the wrong Node, breaking cloud agent setup.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 110716e. Configure here.
| { | ||
| "name": "Node.js", | ||
| "image": "mcr.microsoft.com/devcontainers/javascript-node:latest", | ||
| "postCreateCommand": "bash ./scripts/setup-cloud-environment.sh" |
There was a problem hiding this comment.
Floating unpinned devcontainer base image
Medium Severity
The Codespaces config pins the bootstrap to mcr.microsoft.com/devcontainers/javascript-node:latest. That tag can move to Node releases that no longer bundle corepack, while the setup script only enables pnpm through corepack. When latest drifts, postCreateCommand can fail before Safe Chain installs, or run on an unexpected toolchain, weakening the supply-chain control this PR adds.
Reviewed by Cursor Bugbot for commit 110716e. Configure here.
* chore: defense - set pnpm 7-day dependency cooldown Raise minimumReleaseAge from 2 days to 7 and fail closed on too-new versions or missing publish-time metadata. Reconcile Safe Chain as merged in PR #107. Co-authored-by: Jared Wray <me@jaredwray.com> * chore: defense - record PR #108 on pnpm cooldown checklist Co-authored-by: Jared Wray <me@jaredwray.com> * chore: defense - pin wrangler to a 7-day-aged release wrangler 4.122.0 and its workerd/miniflare tree were published inside the 7-day cooldown. Pin to 4.120.1 so the lockfile satisfies the policy. Co-authored-by: Jared Wray <me@jaredwray.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>


Summary
Bootstrap Aikido Safe Chain on Codespaces and Cursor Cloud Agents so package installs go through pinned shims and a frozen lockfile.
Status update
DEFENSE_IN_DEPTH.md: § 2 Safe Chain → (PR #107 pending); CODEOWNERS → PR #106 (merged)Changes
scripts/setup-cloud-environment.sh(Safe Chain 1.5.15, installer SHA-256 pinned,--cishims,pnpm install --frozen-lockfile).devcontainer/devcontainer.jsonand.cursor/environment.jsoninvoking that scriptAGENTS.mdSECURITY.mdNo leftover PMG / VM-egress catalog line was present.
Verification
.devcontainer/devcontainer.jsonand.cursor/environment.jsonare valid JSONbash ./scripts/setup-cloud-environment.sh— installer SHA verified,pnpm safe-chain-verifyOK, frozen lockfile install succeededReference
defense-in-depth-nodejs § 2