Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions jean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scripts": {
"setup": "bash \"$JEAN_ROOT_PATH/scripts/jean-setup.sh\""
}
}
36 changes: 36 additions & 0 deletions scripts/jean-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail

echo "Setting up Jean worktree..."

# JEAN_ROOT_PATH is set by Jean to the main repo checkout.
# We copy local config files from there into this worktree so each
# worktree can be modified independently.
if [ -z "${JEAN_ROOT_PATH:-}" ]; then
echo " JEAN_ROOT_PATH is not set β€” skipping config file copy."
else
copy_if_exists() {
local src="$JEAN_ROOT_PATH/$1"
if [ -f "$src" ]; then
Comment on lines +9 to +14
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The script uses single brackets [ ] for test conditions (line 9, 14), but all other bash scripts in the repository consistently use double brackets [[ ]] which is the bash-specific, more feature-rich test operator. Update to use [[ ]] for consistency with scripts/codex-setup.sh, scripts/codex-maintenance.sh, and scripts/local-postgres.sh.

Suggested change
if [ -z "${JEAN_ROOT_PATH:-}" ]; then
echo " JEAN_ROOT_PATH is not set β€” skipping config file copy."
else
copy_if_exists() {
local src="$JEAN_ROOT_PATH/$1"
if [ -f "$src" ]; then
if [[ -z "${JEAN_ROOT_PATH:-}" ]]; then
echo " JEAN_ROOT_PATH is not set β€” skipping config file copy."
else
copy_if_exists() {
local src="$JEAN_ROOT_PATH/$1"
if [[ -f "$src" ]]; then

Copilot uses AI. Check for mistakes.
mkdir -p "$(dirname "$1")"
cp "$src" "$1"
echo " copied $1"
else
echo " skipped $1 (not found in root)"
fi
}

echo "Copying local config files..."
copy_if_exists "server/application-server/src/main/resources/application-local.yml"
copy_if_exists "server/application-server/src/test/resources/application-live-local.yml"
copy_if_exists "server/application-server/.env"
copy_if_exists "server/intelligence-service/.env"
copy_if_exists "server/webhook-ingest/.env"
copy_if_exists "docker/.env"
copy_if_exists ".claude/settings.local.json"
Comment on lines +10 to +30
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

This script uses 2-space indentation, but all other bash scripts in the repository (codex-setup.sh, codex-maintenance.sh, local-postgres.sh, db-utils.sh) consistently use 4-space indentation. Update the indentation to use 4 spaces to match the established codebase convention.

Suggested change
echo " JEAN_ROOT_PATH is not set β€” skipping config file copy."
else
copy_if_exists() {
local src="$JEAN_ROOT_PATH/$1"
if [ -f "$src" ]; then
mkdir -p "$(dirname "$1")"
cp "$src" "$1"
echo " copied $1"
else
echo " skipped $1 (not found in root)"
fi
}
echo "Copying local config files..."
copy_if_exists "server/application-server/src/main/resources/application-local.yml"
copy_if_exists "server/application-server/src/test/resources/application-live-local.yml"
copy_if_exists "server/application-server/.env"
copy_if_exists "server/intelligence-service/.env"
copy_if_exists "server/webhook-ingest/.env"
copy_if_exists "docker/.env"
copy_if_exists ".claude/settings.local.json"
echo " JEAN_ROOT_PATH is not set β€” skipping config file copy."
else
copy_if_exists() {
local src="$JEAN_ROOT_PATH/$1"
if [ -f "$src" ]; then
mkdir -p "$(dirname "$1")"
cp "$src" "$1"
echo " copied $1"
else
echo " skipped $1 (not found in root)"
fi
}
echo "Copying local config files..."
copy_if_exists "server/application-server/src/main/resources/application-local.yml"
copy_if_exists "server/application-server/src/test/resources/application-live-local.yml"
copy_if_exists "server/application-server/.env"
copy_if_exists "server/intelligence-service/.env"
copy_if_exists "server/webhook-ingest/.env"
copy_if_exists "docker/.env"
copy_if_exists ".claude/settings.local.json"

Copilot uses AI. Check for mistakes.
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.

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether .claude/settings.local.json is covered by any .gitignore in the repo
rg -n "settings\.local\.json" --glob ".gitignore" --glob "**/.gitignore"

Repository: ls1intum/Hephaestus

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Also check for broader .claude directory patterns in .gitignore
rg -n "\.claude" --glob ".gitignore" --glob "**/.gitignore"

Repository: ls1intum/Hephaestus

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Examine the context around line 30 in scripts/jean-setup.sh
cat -n scripts/jean-setup.sh | sed -n '20,40p'

Repository: ls1intum/Hephaestus

Length of output: 729


🏁 Script executed:

#!/bin/bash
# Check if there's a .claude directory and settings.local.json file in the repo
find . -type d -name ".claude" 2>/dev/null
find . -type f -name "settings.local.json" 2>/dev/null

Repository: ls1intum/Hephaestus

Length of output: 72


Add documentation and ensure .claude/settings.local.json is in .gitignore.

This file is being copied to every new worktree without explanation or protection. .claude/settings.local.json is not currently covered by any .gitignore rule, creating a risk that developers could accidentally commit credentials if the file is staged in a worktree commit. Add a comment above line 30 explaining the intent, and add .claude/settings.local.json (or .claude/) to the project's .gitignore.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/jean-setup.sh` at line 30, Add a short comment above the
copy_if_exists ".claude/settings.local.json" call explaining that this copies a
developer-local Claude settings file (non-committed, may contain credentials)
for convenience; then update the repository .gitignore to include either
".claude/settings.local.json" or the entire ".claude/" directory to prevent
accidental commits of credentials. Ensure the comment references copy_if_exists
and the filename ".claude/settings.local.json" so future readers understand
intent, and commit the .gitignore change alongside the script update.

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if .claude/settings.local.json is covered by any .gitignore
rg -n "settings\.local\.json" --glob "*.gitignore" --glob ".gitignore"

Repository: ls1intum/Hephaestus

Length of output: 45


🏁 Script executed:

# Check for .gitignore files in the repo
fd -H ".gitignore" -x cat -n {}

Repository: ls1intum/Hephaestus

Length of output: 9525


🏁 Script executed:

# Examine the jean-setup.sh script around line 30
cat -n scripts/jean-setup.sh | head -50

Repository: ls1intum/Hephaestus

Length of output: 1431


Add an inline comment explaining the security implications of copying .claude/settings.local.json.

The file .claude/settings.local.json is not explicitly covered by any .gitignore pattern in the repository (the *.local pattern does not match filenames ending in .json). Since this file can contain sensitive credentials, it should have an inline comment explaining why it's safe to copy silently into worktrees, and the assumption that .gitignore coverage is in place elsewhere should be documented.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/jean-setup.sh` at line 30, Add an inline comment immediately above
the call to copy_if_exists for ".claude/settings.local.json" that explains this
file may contain sensitive credentials, notes that the repo’s existing "*.local"
.gitignore pattern does not match ".json" filenames (so this specific filename
must be ignored elsewhere or handled securely), states the assumption under
which it's safe to copy silently (e.g., that developers have configured a
repo-level or global ignore or secrets manager), and instructs maintainers to
ensure .gitignore or other controls explicitly exclude this file if that
assumption is not met; reference the copy_if_exists call and the literal
".claude/settings.local.json" when adding the comment.

fi

echo "Installing npm dependencies..."
npm install
Comment on lines +33 to +34
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.

⚠️ Potential issue | 🟠 Major

Guard npm install against a missing package.json.

With set -e, a failed npm install (e.g., no package.json at the worktree root, or npm not on PATH) aborts the entire setup ungracefully. The rest of the script β€” file copying, config propagation β€” will have succeeded, so a hard failure here discards useful partial work. At minimum, skip gracefully when there's no manifest; alternatively mirror the same pattern used for config files.

πŸ›‘οΈ Proposed fix
-echo "Installing npm dependencies..."
-npm install
+if [ -f "package.json" ]; then
+  echo "Installing npm dependencies..."
+  npm install
+else
+  echo "  skipped npm install (no package.json found)"
+fi
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "Installing npm dependencies..."
npm install
if [ -f "package.json" ]; then
echo "Installing npm dependencies..."
npm install
else
echo " skipped npm install (no package.json found)"
fi
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/jean-setup.sh` around lines 33 - 34, Guard the npm install step so
the script doesn't abort under set -e when npm or package.json is missing:
before the existing "npm install" invocation check for the presence of
package.json and that npm is on PATH (same pattern used for config propagation),
and only run the "npm install" command when both checks pass; otherwise log a
clear skip/warning and continue. Ensure you update the block that currently
contains the echo "Installing npm dependencies..." / npm install to use these
checks and a non-failing fallback so partial setup isn't discarded.


echo "βœ… Jean worktree setup complete."