Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
09a91c3
first iteration
SoyGema Jul 15, 2025
a532758
Update evolutionary_simulation.py with latest changes
SoyGema Jul 16, 2025
21ec0fe
Merge branch 'main' into evolutionary_exp
SoyGema Jul 16, 2025
a4405ab
fix linter
SoyGema Jul 16, 2025
be002da
Merge branch 'google-deepmind:main' into evolutionary_exp
SoyGema Jul 22, 2025
b228edb
helper functions, checkpoint
SoyGema Jul 22, 2025
4fb1411
Merge branch 'google-deepmind:main' into evolutionary_exp
SoyGema Jul 24, 2025
a49566b
Fix workflow triggers: run on PRs to main, remove DeepMind repo refer…
SoyGema Jul 24, 2025
ef40f16
example and refactor
SoyGema Jul 24, 2025
8f7ff4b
Add automated upstream sync workflow with evolutionary simulation tes…
SoyGema Jul 24, 2025
aad9c49
Add evolutionary simulation documentation to README
SoyGema Jul 24, 2025
aa0bacc
Security fix: Implement minimal permissions for upstream sync workflow
SoyGema Jul 24, 2025
87c464f
Security fix: Pin GitHub Actions to specific commit hashes
SoyGema Jul 24, 2025
28d5152
Final security fix: Update GitHub Actions to latest pinned hashes
SoyGema Jul 24, 2025
9902025
Fix type annotations and JSON exception handling in checkpointing module
SoyGema Jul 24, 2025
44f334b
Fix GitHub Actions to use Python 3.11 for compatibility
SoyGema Jul 24, 2025
7c4fd72
Add dual copyright headers to evolutionary simulation contributions
SoyGema Jul 24, 2025
1fa20ac
Fix contrib module imports by adding proper __init__.py exports
SoyGema Jul 25, 2025
5bca87e
Add configurable language model support to evolutionary simulation
SoyGema Jul 25, 2025
d438e2b
Fix missing imports in contrib components __init__.py files
SoyGema Jul 26, 2025
7a655d7
Add explicit module declarations to help pytype import resolution
SoyGema Jul 26, 2025
f45b4f3
Merge pull request #1 from SoyGema/evolutionary_exp
SoyGema Jul 26, 2025
5bbc31c
Add Claude context configuration and upstream automation utilities
SoyGema Jul 26, 2025
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
1 change: 0 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '36 13 * * 4'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
release:
types: [published]
workflow_dispatch:
pull_request:
branches:
- main

permissions: read-all

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ on:
push:
branches:
- main
paths:
- '.github/workflows/pypi-test.yml'
pull_request:
branches:
- main
paths:
- '.github/workflows/pypi-test.yml'
workflow_run:
workflows:
- pypi-publish
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Scorecards supply-chain security
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '17 10 * * 0'
push:
branches: [ "main" ]
pull_request:
branches:
- main

# Declare default permissions as read only.
permissions: read-all
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/test-concordia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,9 @@ on:
push:
branches:
- main
paths:
- '.github/actions/install/action.yml'
- '.github/workflows/test-concordia.yml'
- '.pylintrc'
- 'bin/install.sh'
- 'concordia/**'
- 'pyproject.toml'
- 'requirements.txt'
- 'setup.py'
pull_request:
branches:
- main
paths:
- '.github/actions/install/action.yml'
- '.github/workflows/test-concordia.yml'
- '.pylintrc'
- '.python-version'
- 'bin/install.sh'
- 'concordia/**'
- 'pyproject.toml'
- 'requirements.txt'
- 'setup.py'
workflow_dispatch:

concurrency:
Expand All @@ -44,6 +25,8 @@ jobs:

- name: Install Concordia
uses: ./.github/actions/install
with:
python-version: '3.11'

- name: Test Concordia
run: pytest concordia
Expand Down
25 changes: 2 additions & 23 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,9 @@ on:
push:
branches:
- main
paths:
- '.github/actions/install/action.yml'
- '.github/workflows/test-examples.yml'
- '.pylintrc'
- 'bin/convert_notebooks.sh'
- 'bin/install.sh'
- 'concordia/**'
- 'examples/**'
- 'pyproject.toml'
- 'requirements.txt'
- 'setup.py'
pull_request:
branches:
- main
paths:
- '.github/actions/install/action.yml'
- '.github/workflows/test-examples.yml'
- '.pylintrc'
- '.python-version'
- 'bin/convert_notebooks.sh'
- 'bin/install.sh'
- 'concordia/**'
- 'examples/**'
- 'pyproject.toml'
- 'requirements.txt'
- 'setup.py'
workflow_dispatch:

concurrency:
Expand All @@ -49,6 +26,8 @@ jobs:

- name: Install Concordia
uses: ./.github/actions/install
with:
python-version: '3.11'

- name: Test examples
run: pytest examples
Expand Down
158 changes: 158 additions & 0 deletions .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Copyright 2023 DeepMind Technologies Limited.
# Copyright 2025 [SoyGema] - Modifications and additions with Claude Code
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Sync with Upstream and Test Evolutionary Simulation

on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual triggering

# Set minimal default permissions
permissions: read-all

jobs:
sync-upstream:
name: Sync with upstream and test evolutionary simulation
runs-on: ubuntu-latest

# Grant specific permissions only to this job
permissions:
contents: write # Need to push sync branches
pull-requests: write # Need to create PRs
actions: read # Need to read workflow info

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Add upstream remote
run: |
git remote add upstream https://github.com/google-deepmind/concordia.git || true
git fetch upstream

- name: Check for upstream changes
id: check_changes
run: |
# Get the latest commit from upstream main
UPSTREAM_SHA=$(git rev-parse upstream/main)
CURRENT_SHA=$(git rev-parse origin/main)

echo "upstream_sha=$UPSTREAM_SHA" >> $GITHUB_OUTPUT
echo "current_sha=$CURRENT_SHA" >> $GITHUB_OUTPUT

if [ "$UPSTREAM_SHA" != "$CURRENT_SHA" ]; then
echo "changes_detected=true" >> $GITHUB_OUTPUT
echo "Changes detected in upstream repository"
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
echo "No changes detected in upstream repository"
fi

- name: Create sync branch
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
BRANCH_NAME="sync-upstream-$(date +%Y%m%d-%H%M%S)"
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
git checkout -b "$BRANCH_NAME"

- name: Merge upstream changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git merge upstream/main --no-edit || {
echo "Merge conflicts detected. Manual intervention required."
git merge --abort
exit 1
}

- name: Install Concordia and dependencies
if: steps.check_changes.outputs.changes_detected == 'true'
uses: ./.github/actions/install
with:
python-version: '3.11'

- name: Test evolutionary simulation
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
echo "Testing evolutionary simulation..."
python concordia/testing/test_evolutionary_simulation.py

- name: Run additional concordia tests
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
# Run core concordia tests to ensure compatibility
python -m pytest concordia/utils/ -v --tb=short

- name: Push sync branch
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git push origin "$branch_name"

- name: Create Pull Request
if: steps.check_changes.outputs.changes_detected == 'true'
uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 # v7.0.1
with:
script: |
const { data: pr } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `🔄 Sync with upstream (${new Date().toISOString().split('T')[0]})`,
head: process.env.branch_name,
base: 'main',
body: `## 🔄 Automatic Upstream Sync

This PR automatically syncs changes from the upstream repository [google-deepmind/concordia](https://github.com/google-deepmind/concordia).

### ✅ Tests Passed
- [x] Evolutionary simulation test completed successfully
- [x] Core Concordia utilities tests passed
- [x] No merge conflicts detected

### 📊 Changes
- **Upstream SHA**: \`${process.env.upstream_sha?.substring(0, 7)}\`
- **Previous SHA**: \`${process.env.current_sha?.substring(0, 7)}\`

### 🎯 What's Next
Review the changes and merge if everything looks good. The evolutionary simulation has been tested and is working correctly with the new upstream changes.

---
*This PR was created automatically by the upstream sync workflow.*
`,
draft: false
});

console.log(`Created PR #${pr.number}: ${pr.html_url}`);

// Add labels
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['automated', 'upstream-sync', 'evolutionary-tested']
});

- name: Comment on success
if: steps.check_changes.outputs.changes_detected == 'false'
run: |
echo "✅ Repository is up to date with upstream. No action needed."
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MacOS metadata.
# MacOS metadata.
.DS_Store

# Pycharm metadata.
Expand All @@ -12,6 +12,7 @@ __pycache__/
# Common venv names.
/*venv/
/venv*/
evolutionary_env/

# Ignore files created during installation and building.
*.egg-info
Expand Down
Loading
Loading