Skip to content

memcache - chore: defense - bootstrap Aikido Safe Chain - #107

Merged
jaredwray merged 2 commits into
mainfrom
cursor/defense-safe-chain-cloud-2602
Aug 17, 2026
Merged

memcache - chore: defense - bootstrap Aikido Safe Chain#107
jaredwray merged 2 commits into
mainfrom
cursor/defense-safe-chain-cloud-2602

Conversation

@jaredwray

@jaredwray jaredwray commented Aug 17, 2026

Copy link
Copy Markdown
Owner

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

  • Add scripts/setup-cloud-environment.sh (Safe Chain 1.5.15, installer SHA-256 pinned, --ci shims, pnpm install --frozen-lockfile)
  • Add .devcontainer/devcontainer.json and .cursor/environment.json invoking that script
  • Append the Safe Chain section to AGENTS.md
  • List the live Safe Chain control in SECURITY.md
  • Reconcile CODEOWNERS after PR memcache - chore: defense - add CODEOWNERS #106

No leftover PMG / VM-egress catalog line was present.

Verification

  • .devcontainer/devcontainer.json and .cursor/environment.json are valid JSON
  • bash ./scripts/setup-cloud-environment.sh — installer SHA verified, pnpm safe-chain-verify OK, frozen lockfile install succeeded
  • Followed the Contributing and Code of Conduct guidelines

Reference

defense-in-depth-nodejs § 2

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 17, 2026 23:10
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>
@jaredwray
jaredwray marked this pull request as ready for review August 17, 2026 23:13
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a61167b) to head (110716e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 110716e. Configure here.

@jaredwray
jaredwray merged commit 0fbd4e0 into main Aug 17, 2026
16 checks passed
@jaredwray
jaredwray deleted the cursor/defense-safe-chain-cloud-2602 branch August 17, 2026 23:23
jaredwray added a commit that referenced this pull request Aug 17, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants