Skip to content

Commit 883892c

Browse files
authored
Merge pull request #26 from GraphDone/develop
Develop sync up
2 parents 943d5fe + fe663f1 commit 883892c

259 files changed

Lines changed: 68723 additions & 11108 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
PORT=4127
33
NODE_ENV=development
44

5+
# SSL/TLS Configuration
6+
SSL_ENABLED=false
7+
# Set to true to enable HTTPS/TLS encryption
8+
# SSL_KEY_PATH=./certs/dev-key.pem
9+
# SSL_CERT_PATH=./certs/dev-cert.pem
10+
# HTTPS_PORT=4128
11+
512
# Database Configuration
613
NEO4J_URI=bolt://localhost:7687
714
NEO4J_USER=neo4j
@@ -29,4 +36,14 @@ CLIENT_URL=http://localhost:3127
2936

3037
# Development URLs
3138
VITE_API_URL=http://localhost:4127
32-
VITE_WS_URL=ws://localhost:4127
39+
VITE_WS_URL=ws://localhost:4127
40+
41+
# HTTPS Development URLs (when SSL_ENABLED=true)
42+
# VITE_GRAPHQL_URL=https://localhost:4128/graphql
43+
# VITE_GRAPHQL_WS_URL=wss://localhost:4128/graphql
44+
45+
# Tailscale Configuration (for VM mesh networking)
46+
# Get your auth key from: https://login.tailscale.com/admin/settings/keys
47+
# IMPORTANT: Use an ephemeral key for security
48+
# Example: tskey-auth-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
49+
TAILSCALE_AUTH_KEY=

.env.vm.example

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# GraphDone VM Environment Variables
2+
# Copy this file to .env.vm and fill in your values
3+
# These variables can be used to configure VM launches
4+
5+
# Tailscale Configuration
6+
# Get your auth key from: https://login.tailscale.com/admin/settings/keys
7+
# IMPORTANT: Use ephemeral keys for security
8+
TAILSCALE_AUTH_KEY=
9+
10+
# VM Resource Overrides
11+
# These override values in vm.config.yml
12+
# VM_CPUS=4
13+
# VM_MEMORY=8G
14+
# VM_DISK=30G
15+
16+
# Git Configuration
17+
# VM_BRANCH=main
18+
# VM_REPO_URL=https://github.com/GraphDone/GraphDone-Core.git
19+
20+
# VM Name Override
21+
# VM_NAME=graphdone-dev
22+
23+
# Docker Registry (for private images)
24+
# DOCKER_REGISTRY_URL=
25+
# DOCKER_REGISTRY_USER=
26+
# DOCKER_REGISTRY_PASSWORD=
27+
28+
# Neo4j Configuration (if different from defaults)
29+
# NEO4J_PASSWORD=graphdone_password
30+
# NEO4J_USER=neo4j
31+
32+
# Development Settings
33+
# NODE_ENV=development
34+
# DEBUG=graphdone:*
35+
36+
# Network Configuration
37+
# VM_BRIDGE_INTERFACE=eth0
38+
# VM_USE_BRIDGE=false
39+
40+
# Startup Configuration
41+
# VM_AUTO_SETUP=true
42+
# VM_AUTO_SEED=true
43+
# VM_RUN_ON_BOOT=true
44+
45+
# Additional Mounts (comma-separated host:vm pairs)
46+
# VM_MOUNTS=~/data:/home/ubuntu/data,~/projects:/home/ubuntu/projects
47+
48+
# Cloud Provider Settings (for cloud VMs)
49+
# CLOUD_PROVIDER=aws
50+
# CLOUD_REGION=us-west-2
51+
# CLOUD_INSTANCE_TYPE=t3.xlarge

.githooks/commit-msg

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/sh
2+
# Commit-msg hook to block Co-Authored-By lines
3+
# GraphDone does not use pair programming and maintains clean git logs
4+
5+
# First argument is the commit message file
6+
COMMIT_MSG_FILE="$1"
7+
8+
# Read the commit message
9+
if [ ! -f "$COMMIT_MSG_FILE" ]; then
10+
exit 0
11+
fi
12+
13+
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
14+
15+
# Function to check for co-author patterns
16+
check_coauthor_patterns() {
17+
echo "$1" | grep -iE "(co-authored-by:|co-author:|coauthor:|pair[- ]programm)" >/dev/null 2>&1
18+
}
19+
20+
# Check for Co-Authored-By and related patterns
21+
if check_coauthor_patterns "$COMMIT_MSG"; then
22+
echo ""
23+
echo "════════════════════════════════════════════════════════════════════"
24+
echo " ❌ COMMIT BLOCKED "
25+
echo "════════════════════════════════════════════════════════════════════"
26+
echo ""
27+
echo "Co-authorship attribution detected in commit message."
28+
echo ""
29+
echo "GraphDone policy: Individual commits only (no pair programming)"
30+
echo ""
31+
echo "Found in your commit message:"
32+
echo "────────────────────────────────────────────────────────────────────"
33+
echo "$COMMIT_MSG" | grep -iE "(co-authored-by:|co-author:|coauthor:|pair[- ]programm)" | head -5
34+
echo "────────────────────────────────────────────────────────────────────"
35+
echo ""
36+
echo "Please remove:"
37+
echo " • Co-Authored-By: <name> <email>"
38+
echo " • Co-Author: ..."
39+
echo " • References to pair programming"
40+
echo " • Any collaborative attribution"
41+
echo ""
42+
echo "Each commit should have a single author for:"
43+
echo " ✓ Clear accountability"
44+
echo " ✓ Clean git history"
45+
echo " ✓ Accurate contribution tracking"
46+
echo ""
47+
echo "To fix: Edit your commit message and remove co-authorship lines"
48+
echo "════════════════════════════════════════════════════════════════════"
49+
echo ""
50+
exit 1
51+
fi
52+
53+
# Also check for specific AI assistant attributions that might slip through
54+
if echo "$COMMIT_MSG" | grep -iE "(claude.*anthropic|generated.*by.*claude|claude.*ai|noreply@anthropic)" >/dev/null 2>&1; then
55+
echo ""
56+
echo "════════════════════════════════════════════════════════════════════"
57+
echo " ⚠️ AI ATTRIBUTION DETECTED "
58+
echo "════════════════════════════════════════════════════════════════════"
59+
echo ""
60+
echo "Found AI assistant attribution in commit message."
61+
echo ""
62+
echo "While AI tools may assist with code, commits should be"
63+
echo "attributed only to the human developer who reviewed and"
64+
echo "submitted the code."
65+
echo ""
66+
echo "Please remove any lines like:"
67+
echo " • Co-Authored-By: Claude <noreply@anthropic.com>"
68+
echo " • Generated with Claude"
69+
echo " • AI-assisted attribution"
70+
echo ""
71+
echo "════════════════════════════════════════════════════════════════════"
72+
echo ""
73+
exit 1
74+
fi
75+
76+
# Check for suspiciously formatted email addresses that might be bots
77+
if echo "$COMMIT_MSG" | grep -iE "co-authored-by:.*<.*(bot|action|automated|ci-cd|pipeline).*@.*>" >/dev/null 2>&1; then
78+
echo ""
79+
echo "⚠️ WARNING: Automated co-author detected"
80+
echo " Blocking bot/automation co-authorship attributions"
81+
echo ""
82+
exit 1
83+
fi
84+
85+
# All checks passed
86+
exit 0

.githooks/pre-commit

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/sh
2+
# Pre-commit hook to block Co-Authored-By lines
3+
# GraphDone does not use pair programming and maintains clean git logs
4+
5+
# Get the commit message file path
6+
COMMIT_MSG_FILE="$1"
7+
8+
# Check if we're in the middle of a commit (not a merge/rebase)
9+
if git rev-parse --verify HEAD >/dev/null 2>&1; then
10+
# Get the staged commit message from git
11+
COMMIT_MSG=$(git diff --cached --diff-filter=A -z --name-only | xargs -0 cat 2>/dev/null | grep -i "co-authored-by:" || true)
12+
13+
# If no staged message, check for message passed via -m flag
14+
if [ -z "$COMMIT_MSG" ] && [ -n "$GIT_EDITOR" ]; then
15+
COMMIT_MSG=$(echo "$GIT_EDITOR" | grep -i "co-authored-by:" || true)
16+
fi
17+
18+
# Check the commit message template if it exists
19+
if [ -z "$COMMIT_MSG" ] && [ -f ".gitmessage" ]; then
20+
COMMIT_MSG=$(grep -i "co-authored-by:" .gitmessage 2>/dev/null || true)
21+
fi
22+
23+
# For checking the actual commit message being prepared
24+
# This catches -m flag commits and editor commits
25+
if git diff --cached --quiet; then
26+
# No staged changes, skip
27+
exit 0
28+
fi
29+
fi
30+
31+
# Function to check commit message
32+
check_commit_message() {
33+
# Check for Co-Authored-By in various formats
34+
if echo "$1" | grep -iE "(co-authored-by:|co-author:|coauthor:|pair[- ]programm)" >/dev/null 2>&1; then
35+
echo ""
36+
echo "❌ ERROR: Commit blocked - Co-Authored-By detected"
37+
echo ""
38+
echo "GraphDone maintains individual attribution in git logs."
39+
echo "Please remove any of the following from your commit message:"
40+
echo " • Co-Authored-By: ..."
41+
echo " • Co-Author: ..."
42+
echo " • References to pair programming"
43+
echo ""
44+
echo "Each commit should have a single author for clear accountability."
45+
echo ""
46+
return 1
47+
fi
48+
return 0
49+
}
50+
51+
# Main pre-commit check
52+
# This will be called during the actual commit process
53+
# The commit message will be checked in the commit-msg hook
54+
# Here we just set up the environment
55+
56+
# Check if there are any Co-Authored-By lines in staged files' content
57+
# (in case someone accidentally committed a file with Co-Authored-By in it)
58+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
59+
if [ -n "$STAGED_FILES" ]; then
60+
for FILE in $STAGED_FILES; do
61+
# Skip binary files and this hook file itself
62+
if [ "$FILE" = ".githooks/pre-commit" ] || [ "$FILE" = ".githooks/commit-msg" ]; then
63+
continue
64+
fi
65+
66+
# Only check text files for accidental Co-Authored-By content
67+
if file --mime "$FILE" 2>/dev/null | grep -q "text/"; then
68+
if git show ":$FILE" 2>/dev/null | grep -iE "^[^#]*co-authored-by:" >/dev/null 2>&1; then
69+
echo ""
70+
echo "⚠️ WARNING: File '$FILE' contains 'Co-Authored-By' text"
71+
echo " This may be intentional (documentation, etc.) but please verify."
72+
echo ""
73+
# Don't block, just warn for file content
74+
fi
75+
fi
76+
done
77+
fi
78+
79+
# Pre-commit passes, actual message check happens in commit-msg hook
80+
exit 0

0 commit comments

Comments
 (0)