Skip to content

mono - chore: sync defense-in-depth files from agentic - #79

Merged
jaredwray merged 1 commit into
mainfrom
chore/agentic-sync
Oct 13, 2026
Merged

jaredwray merged 1 commit into
mainfrom
chore/agentic-sync

Conversation

@jaredwray

Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

  • Followed the Contributing guidelines and Code of Conduct
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Chore. Syncs copied defense-in-depth files with jaredwray/agentic.

Summary

The Safe Chain bootstrap script and the Safe Chain section in AGENTS.md were behind jaredwray/agentic. This refreshes those copies and adds the template sections that were missing. DEFENSE_IN_DEPTH.md is not changed.

Changes

  • Replace scripts/setup-cloud-environment.sh with the copy at ea156c03785398c8c156caa046ca954595f396c8. It now writes Safe Chain shims into CLAUDE_ENV_FILE before setup can fail.
  • Replace the stale ## Safe Chain section in AGENTS.md (it matched agentic 8ec1c46) with the section at that same commit.
  • Append the missing template sections ## Simplified Technical English, ## Test audit, and ## Pull requests.

Verification

  • bash -n scripts/setup-cloud-environment.sh

Catalog

DEFENSE_IN_DEPTH.md is behind the upstream scaffold. This PR does not edit it. Run defense-in-depth-nodejs to re-audit. Upstream item lines that the local catalog does not have:

  • CODEOWNERS also covers /.claude/ and /.codex/
  • The Safe Chain bootstrap item now includes Claude Code on the web and .claude/hooks/session-start.sh
  • Codex cloud environments use Manual setup with bash ./scripts/setup-cloud-environment.sh
  • Claude Code on the web allows malware-list.aikido.dev

Local sections that are not in the template were left as they are: Package Manager, Development Guidelines, and Common Development Tasks.

Open in Web Open in Cursor 

Refresh the Safe Chain bootstrap script and the stale Safe Chain section
in AGENTS.md, and add the missing template sections, from agentic ea156c0.

Co-authored-by: Jared Wray <me@jaredwray.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T00:09:28.685844Z 36e3220 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cb310e8) to head (36e3220).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #79   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           19        19           
  Branches         1         1           
=========================================
  Hits            19        19           

☔ 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates AGENTS.md with comprehensive guidelines on Safe Chain shims, Simplified Technical English, test auditing, and pull request workflows. It also modifies scripts/setup-cloud-environment.sh to support Claude Code and Codex cloud environments, introducing environment-specific shim persistence. Feedback on the script highlights that the updated path-matching logic in persist_shim_path is overly strict and could cause duplicate entries in shell configuration files, recommending a more flexible grep check instead.

Comment on lines +19 to +21
if [[ -f "$rc" ]] && grep -Fqx -- "$line" "$rc"; then
return 0
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using grep -Fqx with the exact expanded path ($line) is prone to false negatives. For example, if a developer uses $HOME or ~ instead of the absolute path (e.g., export PATH="$HOME/.safe-chain/shims..."), or if there are minor formatting differences (such as trailing comments or different quoting), grep -Fqx will fail to match and the script will repeatedly append duplicate export lines to the startup files (like .bashrc or .profile). Reverting to a more flexible check, such as checking for the presence of .safe-chain/shims in the file, prevents duplicate entries.

Suggested change
if [[ -f "$rc" ]] && grep -Fqx -- "$line" "$rc"; then
return 0
fi
if [[ -f "$rc" ]] && grep -Fq ".safe-chain/shims" "$rc"; then
return 0
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.

This file is a verbatim copy of skills/security/defense-in-depth-nodejs/scripts/setup-cloud-environment.sh at ea156c03785398c8c156caa046ca954595f396c8. That revision replaced grep -Fq ".safe-chain/shims" with the exact-line check at scripts/setup-cloud-environment.sh:19. A substring match treats any mention of .safe-chain/shims as already configured, including a comment or a different PATH order. Changing it here would make this copy diverge from upstream again.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36e3220717

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# and runs CLAUDE_ENV_FILE before every command instead. A failed SessionStart hook does not stop
# the session, so the shims go on its PATH before anything here can fail, holding stubs that
# refuse to run until Safe Chain's setup-ci replaces them.
if [[ -n "${CLAUDE_ENV_FILE:-}" ]]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the Claude SessionStart hook

In Claude Code on the web, this block runs only if another hook starts the script. The target tree has no tracked .claude hook or other Claude caller. Thus, later package-manager commands can bypass Safe Chain. Add and track the SessionStart hook.

AGENTS.md reference: AGENTS.md:L42-L50

Useful? React with 👍 / 👎.

Comment on lines +33 to +35
if [[ ! -e "${SAFE_CHAIN_SHIMS}/${cmd}" ]]; then
printf '#!/bin/sh\necho "error: Safe Chain is not set up, so %s is blocked; run bash ./scripts/setup-cloud-environment.sh" >&2\nexit 1\n' \
"$cmd" > "${SAFE_CHAIN_SHIMS}/${cmd}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not treat the blocker stub as pnpm

When a prior Claude setup stops before Corepack creates pnpm, the next command sources the persisted shim path. command -v pnpm then finds this blocker, so the Corepack branch does not run. Safe Chain replaces the blocker but has no real pnpm for pnpm install, so setup cannot recover. Ignore this stub during the pnpm prerequisite check.

Useful? React with 👍 / 👎.

chmod +x "${SAFE_CHAIN_SHIMS}/${cmd}"
fi
done
persist_shim_path "$CLAUDE_ENV_FILE"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run setup-ci when Safe Chain is already installed

When Safe Chain 1.5.15 already exists from normal setup, the installer exits before it runs setup-ci. These new blocker files remain in the persisted path, so pnpm safe-chain-verify stops instead of using Safe Chain. Run safe-chain setup-ci even when the installer reports the same version.

AGENTS.md reference: AGENTS.md:L42-L47

Useful? React with 👍 / 👎.

@jaredwray
jaredwray merged commit 24474cf into main Oct 13, 2026
12 checks passed
@jaredwray
jaredwray deleted the chore/agentic-sync branch October 13, 2026 00:09
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