From 4a2af4395a25f4af83122636fd9a31ded07518ed Mon Sep 17 00:00:00 2001 From: StengoS Date: Sat, 25 Jul 2026 16:32:07 -0700 Subject: [PATCH 01/21] docs: add CONTRIBUTING.md Contributing guidelines tailored to the UC Irvine / Cyber@UCI research context: branching conventions, Conventional Commits format, PR process, test markers, and per-area project map. Co-Authored-By: Claude Sonnet 4.6 --- CONTRIBUTING.md | 175 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d68fc4c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,175 @@ +# Contributing to Game of Everything + +Game of Everything is an open-source research project developed at **UC Irvine**, maintained by faculty and student members of [Cyber@UCI](https://cyberatuci.com). We welcome contributions from the broader community — whether you are fixing a bug, adding a new atom, or improving documentation. + +--- + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Reporting Issues](#reporting-issues) +- [Contributing Changes](#contributing-changes) + - [Branching](#branching) + - [Commit Messages](#commit-messages) + - [Pull Requests](#pull-requests) +- [Development Setup](#development-setup) +- [Running Tests](#running-tests) +- [Project Areas](#project-areas) +- [Research & Attribution](#research--attribution) + +--- + +## Code of Conduct + +This project is a research and educational effort. All contributors are expected to engage respectfully and constructively. Harassment, discrimination, or hostile behavior of any kind will not be tolerated. + +--- + +## Getting Started + +1. **Fork** the repository and clone your fork locally. +2. Follow the [setup instructions in the README](README.md#installation) to install dependencies and configure your environment. +3. Confirm your setup works by running the test suite (see [Running Tests](#running-tests)). +4. Find something to work on — open issues, items labeled `good first issue`, or reach out to a maintainer. + +--- + +## Reporting Issues + +Before opening a new issue, search existing issues to avoid duplicates. + +When filing a bug, include: +- A clear, descriptive title +- Steps to reproduce (including the prompt/scenario used if applicable) +- Expected vs. actual behavior +- Relevant log output (found in `output/.log`) — redact any credentials or AWS keys +- Environment: OS, Python version, Docker version, AWS region + +For feature requests, describe the use case and the problem it solves rather than jumping straight to a proposed solution. + +--- + +## Contributing Changes + +### Branching + +Branch off `main` for new work. Use the same `type/short-description` pattern used elsewhere in this repo: + +``` +feat/add-postgres-atom +fix/chain-test-edge-propagation +docs/update-contributing +chore/bump-boto3 +``` + +### Commit Messages + +Follow the [Conventional Commits](https://www.conventionalcommits.org/) format already established in this repository: + +``` +type(scope): short imperative description +``` + +| Type | When to use | +|---|---| +| `feat` | New feature or capability | +| `fix` | Bug fix | +| `docs` | Documentation only | +| `test` | Adding or updating tests | +| `refactor` | Code restructure with no behavior change | +| `chore` | Build, deps, tooling, CI | + +**Examples from this repo:** +``` +feat(tui): tui added + diagnostician improvements +fix(attacker_container): ensure attacker container has necessary tools for testing loop +docs(CLAUDE.md): update for Phase 4 completion + Phase 5 roadmap +test(procedures): tests for basic execution, SSH logins, step chaining, and SUID privesc +``` + +Keep the subject line under 72 characters. Use the body for _why_, not _what_. + +### Pull Requests + +- Target `main` unless a maintainer directs otherwise. +- PR titles follow the same `type(scope): description` format as commits. +- Keep PRs focused — one logical change per PR. +- Fill out the PR description with a summary of what changed and why. +- All CI checks must pass before review. +- At least one maintainer approval is required to merge. + +For large changes (new pipeline phase, new runtime, significant refactor), open an issue or draft PR first to discuss the approach before investing significant time. + +--- + +## Development Setup + +```bash +cd game_of_everything +uv sync +source .venv/bin/activate +``` + +Configure your environment: + +```bash +cp goe.toml.example goe.toml +# Fill in AWS credentials and model settings +``` + +Verify Bedrock access and ingest the RAG atom database before running the full pipeline: + +```bash +python scripts/bedrock_access.py +python scripts/rag_gen.py +``` + +See the [README](README.md) for full setup and command documentation. + +--- + +## Running Tests + +The test suite is split by marker to separate fast unit tests from slow Docker/LLM tests: + +```bash +# Fast unit tests (no Docker, no AWS) +.venv/bin/python -m pytest -m "not docker and not llm" + +# Docker integration tests (~1-3 min each) +.venv/bin/python -m pytest -m docker + +# Full suite (requires Docker + AWS credentials) +.venv/bin/python -m pytest tests/ +``` + +New features should include corresponding tests. Bug fixes should include a test that would have caught the bug. + +--- + +## Project Areas + +| Area | Location | Notes | +|---|---|---| +| v2 planner | `goe/planner/` | NL → EntityGraph; LLM prompts in `prompts/` | +| v2 construction crew | `goe/construction_crew/` | Engineer / Developer / Attacker agents | +| v2 flow & orchestration | `goe/flow/` | Run/resume pipeline, chain test | +| v2 retry & diagnostics | `goe/retry/` | Failure categorization and agent routing | +| Misconfig/privesc atoms | `atoms/` | Markdown + YAML frontmatter | +| Web vulnerability atoms | `atoms/web_vulnerabilities/` | Markdown + YAML frontmatter | +| Runtime templates | `goe/runtimes/templates/` | Per-runtime install/start/healthcheck | +| Docker images | `docker/` | Target and attacker Dockerfiles | +| v1 system (legacy) | `src/game_of_everything/` | crewAI-based; maintained but not actively extended | + +When adding a new atom or runtime, follow the patterns documented in [CLAUDE.md](game_of_everything/CLAUDE.md). + +--- + +## Research & Attribution + +Game of Everything is developed as part of ongoing cybersecurity research at **UC Irvine**. Student contributors through [Cyber@UCI](https://cyberatuci.com) are the primary maintainers. + +If you use this project in academic work, please cite it appropriately and reach out to the maintainers — we welcome collaboration and co-authorship opportunities with researchers building on this work. + +Contributions are accepted under the project's [GPLv3 license](LICENSE). By submitting a pull request you agree that your contributions will be licensed under the same terms. From 420b335eaa494f7080e2127c6fe4fffaacefa30a Mon Sep 17 00:00:00 2001 From: StengoS Date: Sat, 25 Jul 2026 17:19:19 -0700 Subject: [PATCH 02/21] fix(install): rag_gen robustness + Docker image caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rag_gen.py: print a clear error when goe.toml is missing instead of raising FileNotFoundError; skip passing empty-string credentials to boto3.Session so the default credential chain is used correctly. test_environment.py: check image existence before building attacker, target, and browser images in setup() — skips multi-minute rebuilds when the image is already present locally. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/scripts/rag_gen.py | 22 ++++++--- .../tools/test_environment.py | 48 ++++++++++++------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/game_of_everything/scripts/rag_gen.py b/game_of_everything/scripts/rag_gen.py index 29742fe..5f205e6 100644 --- a/game_of_everything/scripts/rag_gen.py +++ b/game_of_everything/scripts/rag_gen.py @@ -17,14 +17,24 @@ # grab aws keys/data from goe.toml import tomllib -with open(PROJECT_DIR / "goe.toml", 'rb') as f: + +toml_path = PROJECT_DIR / "goe.toml" +if not toml_path.exists(): + print("Error: goe.toml not found. Run: cp goe.toml.example goe.toml") + raise SystemExit(1) + +with open(toml_path, 'rb') as f: data = tomllib.load(f) -aws_session = boto3.Session( - aws_access_key_id=data['aws']['access_key_id'], - aws_secret_access_key=data['aws']['secret_access_key'], - region_name=os.getenv("AWS_REGION", "us-east-1"), -) +aws_cfg = data.get('aws', {}) +session_kwargs: dict = {"region_name": os.getenv("AWS_REGION", aws_cfg.get("region", "us-east-1"))} +key_id = aws_cfg.get("access_key_id", "") +secret = aws_cfg.get("secret_access_key", "") +if key_id and secret: + session_kwargs["aws_access_key_id"] = key_id + session_kwargs["aws_secret_access_key"] = secret + +aws_session = boto3.Session(**session_kwargs) bedrock_ef = AmazonBedrockEmbeddingFunction( session=aws_session, diff --git a/game_of_everything/src/game_of_everything/tools/test_environment.py b/game_of_everything/src/game_of_everything/tools/test_environment.py index c4101c1..e25c00c 100644 --- a/game_of_everything/src/game_of_everything/tools/test_environment.py +++ b/game_of_everything/src/game_of_everything/tools/test_environment.py @@ -275,9 +275,13 @@ def setup(self) -> None: dockerfile_dir = info["dockerfile_dir"] break if dockerfile_dir: - logger.info(f"Building target image {self._target_image} from {dockerfile_dir}...") - self.client.images.build(path=dockerfile_dir, tag=self._target_image, rm=True) - logger.info(f"Built target image: {self._target_image}") + try: + self.client.images.get(self._target_image) + logger.info(f"Target image {self._target_image} already exists — skipping build.") + except Exception: + logger.info(f"Building target image {self._target_image} from {dockerfile_dir}...") + self.client.images.build(path=dockerfile_dir, tag=self._target_image, rm=True) + logger.info(f"Built target image: {self._target_image}") # Start target container port_bindings = {f"{cp}/tcp": hp for cp, hp in self._expose_ports.items()} if self._expose_ports else None @@ -309,14 +313,18 @@ def setup(self) -> None: else: logger.info("Skipping bootstrap — pre-built target image already has base tools.") - # Build the attacker image from the Kali Dockerfile - logger.info(f"Building attacker image from {ATTACKER_DOCKERFILE_DIR}...") - self.client.images.build( - path=ATTACKER_DOCKERFILE_DIR, - tag=ATTACKER_IMAGE_TAG, - rm=True, - ) - logger.info(f"Built attacker image: {ATTACKER_IMAGE_TAG}") + # Build the attacker image only if it doesn't already exist locally + try: + self.client.images.get(ATTACKER_IMAGE_TAG) + logger.info(f"Attacker image {ATTACKER_IMAGE_TAG} already exists — skipping build.") + except Exception: + logger.info(f"Building attacker image from {ATTACKER_DOCKERFILE_DIR}...") + self.client.images.build( + path=ATTACKER_DOCKERFILE_DIR, + tag=ATTACKER_IMAGE_TAG, + rm=True, + ) + logger.info(f"Built attacker image: {ATTACKER_IMAGE_TAG}") # Start attacker container on the same network self.attacker_container = self.client.containers.run( @@ -332,13 +340,17 @@ def setup(self) -> None: # Start browser sidecar if requested if self._enable_browser: - logger.info(f"Building browser image from {BROWSER_DOCKERFILE_DIR}...") - self.client.images.build( - path=BROWSER_DOCKERFILE_DIR, - tag=BROWSER_IMAGE_TAG, - rm=True, - ) - logger.info(f"Built browser image: {BROWSER_IMAGE_TAG}") + try: + self.client.images.get(BROWSER_IMAGE_TAG) + logger.info(f"Browser image {BROWSER_IMAGE_TAG} already exists — skipping build.") + except Exception: + logger.info(f"Building browser image from {BROWSER_DOCKERFILE_DIR}...") + self.client.images.build( + path=BROWSER_DOCKERFILE_DIR, + tag=BROWSER_IMAGE_TAG, + rm=True, + ) + logger.info(f"Built browser image: {BROWSER_IMAGE_TAG}") # Pick a free host port for CDP endpoint import socket From 1d591d2afb58feed05c6959b1b7082d66f8cf82b Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 02:43:15 -0700 Subject: [PATCH 03/21] docs: edit CONTRIBUTING.md --- CONTRIBUTING.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d68fc4c..695d824 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing to Game of Everything -Game of Everything is an open-source research project developed at **UC Irvine**, maintained by faculty and student members of [Cyber@UCI](https://cyberatuci.com). We welcome contributions from the broader community — whether you are fixing a bug, adding a new atom, or improving documentation. +We welcome contributions from the broader community — whether you are fixing a bug, adding a new atom, or improving documentation. --- @@ -152,15 +152,14 @@ New features should include corresponding tests. Bug fixes should include a test | Area | Location | Notes | |---|---|---| -| v2 planner | `goe/planner/` | NL → EntityGraph; LLM prompts in `prompts/` | -| v2 construction crew | `goe/construction_crew/` | Engineer / Developer / Attacker agents | -| v2 flow & orchestration | `goe/flow/` | Run/resume pipeline, chain test | -| v2 retry & diagnostics | `goe/retry/` | Failure categorization and agent routing | +| planner | `goe/planner/` | NL → EntityGraph; LLM prompts in `prompts/` | +| construction crew | `goe/construction_crew/` | Engineer / Developer / Attacker agents | +| flow & orchestration | `goe/flow/` | Run/resume pipeline, chain test | +| retry & diagnostics | `goe/retry/` | Failure categorization and agent routing | | Misconfig/privesc atoms | `atoms/` | Markdown + YAML frontmatter | | Web vulnerability atoms | `atoms/web_vulnerabilities/` | Markdown + YAML frontmatter | | Runtime templates | `goe/runtimes/templates/` | Per-runtime install/start/healthcheck | | Docker images | `docker/` | Target and attacker Dockerfiles | -| v1 system (legacy) | `src/game_of_everything/` | crewAI-based; maintained but not actively extended | When adding a new atom or runtime, follow the patterns documented in [CLAUDE.md](game_of_everything/CLAUDE.md). @@ -168,8 +167,6 @@ When adding a new atom or runtime, follow the patterns documented in [CLAUDE.md] ## Research & Attribution -Game of Everything is developed as part of ongoing cybersecurity research at **UC Irvine**. Student contributors through [Cyber@UCI](https://cyberatuci.com) are the primary maintainers. - If you use this project in academic work, please cite it appropriately and reach out to the maintainers — we welcome collaboration and co-authorship opportunities with researchers building on this work. Contributions are accepted under the project's [GPLv3 license](LICENSE). By submitting a pull request you agree that your contributions will be licensed under the same terms. From 171b2e49924b3033901cb11af88c305c0e00208b Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 11:26:56 -0700 Subject: [PATCH 04/21] docs(README): fix broken commands, bedrock invocation, and stale claims MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bedrock_access.py: fix section heading ("Verify" → "Enable") and show the correct invocation with model IDs as positional args - Docker image management: replace broken build_attacker_image command with the correct build_attacker entry point; remove false "7-day cache" claim — images skip rebuild when already present locally - EC2 instance type default: correct t3.medium → t3.small to match actual CLI defaults in kickoff() and deploy_from_output() Co-Authored-By: Claude Sonnet 4.6 --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c3d1ec2..e7dcb76 100644 --- a/README.md +++ b/README.md @@ -76,10 +76,15 @@ subnet_id = "" # auto-selected if blank Environment variables override toml values: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, `GOE_DEFAULT_MODEL`, `GOE_MODEL_`. -### Verify Bedrock Access +### Enable Bedrock Model Access + +Run this once per AWS account to accept model agreements and request entitlements: ```bash -python scripts/bedrock_access.py +python scripts/bedrock_access.py \ + us.anthropic.claude-sonnet-4-6-20251001-v1:0 \ + us.anthropic.claude-opus-4-6-v1:0 \ + amazon.titan-embed-text-v2:0 ``` --- @@ -130,7 +135,7 @@ crewai run | `--deploy ec2` | — | After generation, deploy the scenario to AWS EC2 | | `--review` | off | After script generation, pause for interactive per-box review before deploying | | `--ec2-region REGION` | `us-east-1` | AWS region for EC2 deployment | -| `--ec2-instance-type TYPE` | `t3.medium` | EC2 instance type | +| `--ec2-instance-type TYPE` | `t3.small` | EC2 instance type | | `--ec2-attacker-cidr CIDR` | `$GOE_ATTACKER_CIDR` | Your IP in CIDR notation — required for `--deploy ec2` | | `--ec2-ttl-hours N` | `4` | Auto-destroy TTL in hours (`0` = no auto-destroy) | @@ -164,7 +169,7 @@ goe-deploy output/20260418_200538_ --attacker-cidr 203.0.113.5/32 |---|---| | `output_dir` (positional) | Path to the output directory containing `playbook.json` and `*_deploy.sh` files | | `--region REGION` | AWS region (default: `$GOE_EC2_REGION` or `us-east-1`) | -| `--instance-type TYPE` | EC2 instance type (default: `$GOE_EC2_INSTANCE_TYPE` or `t3.medium`) | +| `--instance-type TYPE` | EC2 instance type (default: `$GOE_EC2_INSTANCE_TYPE` or `t3.small`) | | `--attacker-cidr CIDR` | Your IP in CIDR notation — required | | `--ttl-hours N` | Auto-destroy TTL in hours (default: `$GOE_EC2_TTL_HOURS` or `4`) | @@ -200,10 +205,10 @@ plot Pre-build the attacker container to separate build failures from test failures: ```bash -python -m game_of_everything.main build_attacker_image +build_attacker ``` -Per-runtime target images (`goe-target-express`, `goe-target-flask`, `goe-target-php`) and the browser sidecar image (`goe-browser`) are built automatically on first use. Images are cached for 7 days. +All images (`goe-attacker`, `goe-target-express`, `goe-target-flask`, `goe-target-php`, `goe-browser`) are built on first use and skipped on subsequent runs if they already exist locally. --- From bb7828c698295638ce749ff9e9e06bc16eae9a67 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 11:29:25 -0700 Subject: [PATCH 05/21] fix(config): update goe.toml.example with correct model IDs and role overrides Use the full cross-region inference profile ID format for the default model. Replace the old per-agent v1 override keys with the current per-role keys (planner, engineer, developer, attacker, diagnostician, chain_attacker). Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/goe.toml.example | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/game_of_everything/goe.toml.example b/game_of_everything/goe.toml.example index 0b0f3f5..16e0a44 100644 --- a/game_of_everything/goe.toml.example +++ b/game_of_everything/goe.toml.example @@ -12,25 +12,19 @@ secret_access_key = "" region = "us-east-1" [models] -# Default Bedrock model ID used when an agent has no explicit override. -# The "us." inference-profile prefix is added automatically by llm_factory. -default = "anthropic.claude-sonnet-4-6" +# Default Bedrock model ID. Use the full cross-region inference profile ID: +# e.g. "us.anthropic.claude-sonnet-4-6-20251001-v1:0" +default = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" [models.overrides] -# Per-agent model overrides. Keys must match agent names in config/agents.yaml. -# Uncomment to override a specific agent; otherwise the defaults from -# config/models.yaml (Opus for app_generation_agent, Sonnet for attack_agent) -# are used. -# request_parser_agent = "anthropic.claude-haiku-3-5" -# mapping_agent = "anthropic.claude-sonnet-4-6" -# mapping_validator_agent = "anthropic.claude-haiku-3-5" -# dependency_enumeration_agent = "anthropic.claude-haiku-3-5" -# sequencing_agent = "anthropic.claude-haiku-3-5" -# snippet_generation_agent = "anthropic.claude-sonnet-4-6" -# testing_agent = "anthropic.claude-haiku-3-5" -# diagnostic_agent = "anthropic.claude-sonnet-4-6" -# app_generation_agent = "anthropic.claude-opus-4-6-v1" -# attack_agent = "anthropic.claude-sonnet-4-6" +# Per-role model overrides. Keys match role names in goe/config.py. +# Uncomment to override a specific role; otherwise [models].default is used. +# planner = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" +# engineer = "us.anthropic.claude-opus-4-6-v1:0" +# developer = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" +# attacker = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" +# diagnostician = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" +# chain_attacker = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" [deploy] # EC2 one-click deploy settings used by steps/deploy.py + ec2_deploy.py. From aff9312cdec2695d000ce499b3b2b4c2ed6d4481 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:29:30 -0700 Subject: [PATCH 06/21] docs: reorganize documentation into structured layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidates all docs into a single docs/ tree at the repo root: - docs/architecture/ — stable v2 design specs (entity graph, build spec, impl plan) - docs/design/ — feature design docs (custom apps, multi-box, browser use, preset apps) - docs/eval/ — eval system reference (overview, quick ref, LLM judge, planning evals) - docs/samples/ — sample requests - docs/notes/ — archived session/working notes Moves AGENT.md and CLAUDE.md to repo root for visibility; adds working-directory note to CLAUDE.md since commands are relative to game_of_everything/. Updates CONTRIBUTING.md link to match new CLAUDE.md location. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/AGENT.md => AGENT.md | 0 game_of_everything/CLAUDE.md => CLAUDE.md | 2 ++ CONTRIBUTING.md | 2 +- .../docs/rewrite => docs/architecture}/entity_graph_model.md | 0 .../architecture/v2_implementation_plan.md | 0 .../docs/rewrite/goe_rewrite.md => docs/architecture/v2_spec.md | 0 {game_of_everything/docs => docs/design}/browser_use.md | 0 docs/{custom_apps_design.md => design/custom_apps.md} | 0 .../multi_box_design.md => docs/design/multi_box_topology.md | 0 .../docs/preset_apps_plan.md => docs/design/preset_apps.md | 0 .../goe/eval/LLM_JUDGE_GUIDE.md => docs/eval/llm_judge.md | 0 game_of_everything/EVAL_SYSTEM.md => docs/eval/overview.md | 0 .../EVAL_QUICK_REF.md => docs/eval/quick_reference.md | 0 .../eval/understanding_planning.md | 0 {game_of_everything/goe/eval => docs/notes}/BUGFIX_PYDANTIC.md | 0 {game_of_everything => docs/notes}/DIAGNOSTICS_IMPROVEMENTS.md | 0 {game_of_everything => docs/notes}/EVAL_FINAL_SUMMARY.md | 0 {game_of_everything => docs/notes}/EVAL_IMPROVEMENTS.md | 0 {game_of_everything => docs/notes}/EVAL_TEST_RESULTS.md | 0 {game_of_everything => docs/notes}/FIXES_SUMMARY.md | 0 {game_of_everything/docs => docs/notes}/phase1_complete.md | 0 .../docs => docs/notes}/phase2_bedrock_tool_blocker.md | 0 .../docs => docs/notes}/phase2_implementation_summary.md | 0 {game_of_everything/docs => docs/notes}/phase2_status.md | 0 docs/{ => samples}/requests.md | 0 25 files changed, 3 insertions(+), 1 deletion(-) rename game_of_everything/AGENT.md => AGENT.md (100%) rename game_of_everything/CLAUDE.md => CLAUDE.md (99%) rename {game_of_everything/docs/rewrite => docs/architecture}/entity_graph_model.md (100%) rename game_of_everything/docs/rewrite/implementation_plan.md => docs/architecture/v2_implementation_plan.md (100%) rename game_of_everything/docs/rewrite/goe_rewrite.md => docs/architecture/v2_spec.md (100%) rename {game_of_everything/docs => docs/design}/browser_use.md (100%) rename docs/{custom_apps_design.md => design/custom_apps.md} (100%) rename game_of_everything/docs/multi_box_design.md => docs/design/multi_box_topology.md (100%) rename game_of_everything/docs/preset_apps_plan.md => docs/design/preset_apps.md (100%) rename game_of_everything/goe/eval/LLM_JUDGE_GUIDE.md => docs/eval/llm_judge.md (100%) rename game_of_everything/EVAL_SYSTEM.md => docs/eval/overview.md (100%) rename game_of_everything/EVAL_QUICK_REF.md => docs/eval/quick_reference.md (100%) rename game_of_everything/goe/eval/UNDERSTANDING_PLANNING_EVALS.md => docs/eval/understanding_planning.md (100%) rename {game_of_everything/goe/eval => docs/notes}/BUGFIX_PYDANTIC.md (100%) rename {game_of_everything => docs/notes}/DIAGNOSTICS_IMPROVEMENTS.md (100%) rename {game_of_everything => docs/notes}/EVAL_FINAL_SUMMARY.md (100%) rename {game_of_everything => docs/notes}/EVAL_IMPROVEMENTS.md (100%) rename {game_of_everything => docs/notes}/EVAL_TEST_RESULTS.md (100%) rename {game_of_everything => docs/notes}/FIXES_SUMMARY.md (100%) rename {game_of_everything/docs => docs/notes}/phase1_complete.md (100%) rename {game_of_everything/docs => docs/notes}/phase2_bedrock_tool_blocker.md (100%) rename {game_of_everything/docs => docs/notes}/phase2_implementation_summary.md (100%) rename {game_of_everything/docs => docs/notes}/phase2_status.md (100%) rename docs/{ => samples}/requests.md (100%) diff --git a/game_of_everything/AGENT.md b/AGENT.md similarity index 100% rename from game_of_everything/AGENT.md rename to AGENT.md diff --git a/game_of_everything/CLAUDE.md b/CLAUDE.md similarity index 99% rename from game_of_everything/CLAUDE.md rename to CLAUDE.md index 580b0d4..8964201 100644 --- a/game_of_everything/CLAUDE.md +++ b/CLAUDE.md @@ -2,6 +2,8 @@ Guidance for Claude Code when working with this repository. +> **Working directory**: all commands below are relative to `game_of_everything/` unless noted otherwise. + --- ## GoE v2 (`goe/`) — Active Development Branch: `goe-rewrite` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 695d824..f00ed79 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -161,7 +161,7 @@ New features should include corresponding tests. Bug fixes should include a test | Runtime templates | `goe/runtimes/templates/` | Per-runtime install/start/healthcheck | | Docker images | `docker/` | Target and attacker Dockerfiles | -When adding a new atom or runtime, follow the patterns documented in [CLAUDE.md](game_of_everything/CLAUDE.md). +When adding a new atom or runtime, follow the patterns documented in [CLAUDE.md](CLAUDE.md). --- diff --git a/game_of_everything/docs/rewrite/entity_graph_model.md b/docs/architecture/entity_graph_model.md similarity index 100% rename from game_of_everything/docs/rewrite/entity_graph_model.md rename to docs/architecture/entity_graph_model.md diff --git a/game_of_everything/docs/rewrite/implementation_plan.md b/docs/architecture/v2_implementation_plan.md similarity index 100% rename from game_of_everything/docs/rewrite/implementation_plan.md rename to docs/architecture/v2_implementation_plan.md diff --git a/game_of_everything/docs/rewrite/goe_rewrite.md b/docs/architecture/v2_spec.md similarity index 100% rename from game_of_everything/docs/rewrite/goe_rewrite.md rename to docs/architecture/v2_spec.md diff --git a/game_of_everything/docs/browser_use.md b/docs/design/browser_use.md similarity index 100% rename from game_of_everything/docs/browser_use.md rename to docs/design/browser_use.md diff --git a/docs/custom_apps_design.md b/docs/design/custom_apps.md similarity index 100% rename from docs/custom_apps_design.md rename to docs/design/custom_apps.md diff --git a/game_of_everything/docs/multi_box_design.md b/docs/design/multi_box_topology.md similarity index 100% rename from game_of_everything/docs/multi_box_design.md rename to docs/design/multi_box_topology.md diff --git a/game_of_everything/docs/preset_apps_plan.md b/docs/design/preset_apps.md similarity index 100% rename from game_of_everything/docs/preset_apps_plan.md rename to docs/design/preset_apps.md diff --git a/game_of_everything/goe/eval/LLM_JUDGE_GUIDE.md b/docs/eval/llm_judge.md similarity index 100% rename from game_of_everything/goe/eval/LLM_JUDGE_GUIDE.md rename to docs/eval/llm_judge.md diff --git a/game_of_everything/EVAL_SYSTEM.md b/docs/eval/overview.md similarity index 100% rename from game_of_everything/EVAL_SYSTEM.md rename to docs/eval/overview.md diff --git a/game_of_everything/EVAL_QUICK_REF.md b/docs/eval/quick_reference.md similarity index 100% rename from game_of_everything/EVAL_QUICK_REF.md rename to docs/eval/quick_reference.md diff --git a/game_of_everything/goe/eval/UNDERSTANDING_PLANNING_EVALS.md b/docs/eval/understanding_planning.md similarity index 100% rename from game_of_everything/goe/eval/UNDERSTANDING_PLANNING_EVALS.md rename to docs/eval/understanding_planning.md diff --git a/game_of_everything/goe/eval/BUGFIX_PYDANTIC.md b/docs/notes/BUGFIX_PYDANTIC.md similarity index 100% rename from game_of_everything/goe/eval/BUGFIX_PYDANTIC.md rename to docs/notes/BUGFIX_PYDANTIC.md diff --git a/game_of_everything/DIAGNOSTICS_IMPROVEMENTS.md b/docs/notes/DIAGNOSTICS_IMPROVEMENTS.md similarity index 100% rename from game_of_everything/DIAGNOSTICS_IMPROVEMENTS.md rename to docs/notes/DIAGNOSTICS_IMPROVEMENTS.md diff --git a/game_of_everything/EVAL_FINAL_SUMMARY.md b/docs/notes/EVAL_FINAL_SUMMARY.md similarity index 100% rename from game_of_everything/EVAL_FINAL_SUMMARY.md rename to docs/notes/EVAL_FINAL_SUMMARY.md diff --git a/game_of_everything/EVAL_IMPROVEMENTS.md b/docs/notes/EVAL_IMPROVEMENTS.md similarity index 100% rename from game_of_everything/EVAL_IMPROVEMENTS.md rename to docs/notes/EVAL_IMPROVEMENTS.md diff --git a/game_of_everything/EVAL_TEST_RESULTS.md b/docs/notes/EVAL_TEST_RESULTS.md similarity index 100% rename from game_of_everything/EVAL_TEST_RESULTS.md rename to docs/notes/EVAL_TEST_RESULTS.md diff --git a/game_of_everything/FIXES_SUMMARY.md b/docs/notes/FIXES_SUMMARY.md similarity index 100% rename from game_of_everything/FIXES_SUMMARY.md rename to docs/notes/FIXES_SUMMARY.md diff --git a/game_of_everything/docs/phase1_complete.md b/docs/notes/phase1_complete.md similarity index 100% rename from game_of_everything/docs/phase1_complete.md rename to docs/notes/phase1_complete.md diff --git a/game_of_everything/docs/phase2_bedrock_tool_blocker.md b/docs/notes/phase2_bedrock_tool_blocker.md similarity index 100% rename from game_of_everything/docs/phase2_bedrock_tool_blocker.md rename to docs/notes/phase2_bedrock_tool_blocker.md diff --git a/game_of_everything/docs/phase2_implementation_summary.md b/docs/notes/phase2_implementation_summary.md similarity index 100% rename from game_of_everything/docs/phase2_implementation_summary.md rename to docs/notes/phase2_implementation_summary.md diff --git a/game_of_everything/docs/phase2_status.md b/docs/notes/phase2_status.md similarity index 100% rename from game_of_everything/docs/phase2_status.md rename to docs/notes/phase2_status.md diff --git a/docs/requests.md b/docs/samples/requests.md similarity index 100% rename from docs/requests.md rename to docs/samples/requests.md From f746f7bcd6e5c06b435db6d1bdec0989576d769e Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:36:16 -0700 Subject: [PATCH 07/21] docs(AGENT.md): update v2 status to phases 0-4 complete, phase 5 next Current state section, key components listing, commands, and roadmap table were all stale (still described Phase 2 as the latest). Bring everything in sync with CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 --- AGENT.md | 58 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/AGENT.md b/AGENT.md index 84efffa..8a1254e 100644 --- a/AGENT.md +++ b/AGENT.md @@ -16,20 +16,22 @@ The project is in active rewrite. There are two parallel codebases: v2 models scenarios as a directed graph of **entities** (exploitable vulnerabilities) connected by **typed edges** (attacker capabilities). See `docs/rewrite/entity_graph_model.md` for full spec. -### Current State (Phase 2 complete, Phase 3 next) +### Current State (Phases 0–4 complete, Phase 5 next) **What works now:** -- Single entity → full construction crew (Engineer/Opus → Developer/Sonnet → Attacker/Sonnet) → deploy → L2 test → retry escalation +- Full end-to-end single-system flow: `goe.flow run "..."` → plan → build all entities → package output +- Multi-system flow: parallel builds across systems, `TopologyEnvironment`, `docker-compose.yml` + `chain_playbook.yaml` +- L3 chain test gates overall success; `chain_attacker` synthesizes end-to-end procedures +- Checkpoint/resume: `--resume output/.checkpoints//` +- Artifacts/eval: opt-in LLM conversation persistence and evaluation suites - 3 runtimes: Express (Node.js 20), Flask (Python 3), Apache/PHP - 13 web vulnerability atoms (SQLi, CMDi, XSS, SSTI, file upload, path traversal, deserialization, etc.) -- Confirmed passing: SQLi/Express, CMDi/Flask, SQLi/PHP, XSS-stored/PHP, XSS-admin-bot/Express -- `python -m goe.planner "..."` → validated entity graph YAML (all planning agents use Sonnet) -- Static validator (7 checks), BuildScheduler (topological ordering + value propagation) +- Confirmed passing single entities: SQLi/Express, CMDi/Flask, SQLi/PHP, XSS-stored/PHP, XSS-admin-bot/Express -**What's next (Phase 3):** -- Flow orchestrator: graph → build all entities → package output -- `goe run "..."` CLI end-to-end -- Deliverable: user request → validated deploy script + playbook +**What's next (Phase 5 — Polish and Parity):** +- Atom integration into construction crew (engineer receives relevant atoms via RAG) +- EC2 deploy (port v1's `ec2_deploy.py`) +- Cost optimization, observability, preset apps ### Key Components @@ -37,32 +39,44 @@ v2 models scenarios as a directed graph of **entities** (exploitable vulnerabili goe/ bedrock.py Direct boto3 Bedrock wrapper (no crewAI) build.py Single-entity pipeline + CLI entry point - construction_crew/ Engineer → Developer → Attacker agents + construction_crew/ Engineer → Developer → Attacker agents (+ chain_attacker) executor/ Procedure DSL runner (HTTP, shell, browser) runtimes/ Deterministic deploy script generation retry/ Diagnostician + escalation router container/ TestEnvironment adapter over v1 Docker tools graph/ EntityGraph, validator (7 checks), topology, BuildScheduler - planner/ design_systems, plan_entities, specify_entities, connect_edges, resolve, pipeline + planner/ design_systems, plan_killchain, plan_entities, specify_entities, connect_edges, resolve, pipeline + flow/ Orchestrator (plan → build → package), CLI entry point, checkpoint/resume + packaging/ deploy.sh + playbook.yaml + README generation + metrics/ MetricsSession, token/latency/cost instrumentation + artifacts/ Opt-in LLM conversation + file persistence + eval/ Evaluation suites (build, planning, full) + services/ Shared service helpers ``` ### Running v2 ```bash -# Plan an attack graph from natural language (requires AWS creds) +# Full end-to-end run (requires AWS creds + Docker) cd game_of_everything +.venv/bin/python -m goe.flow run "web app with SQL injection that leaks credentials" +.venv/bin/python -m goe.flow run --verbose "SSH server with weak credentials and SUID privesc" +.venv/bin/python -m goe.flow run --resume output/.checkpoints// + +# Re-test an existing output directory (no LLM — deploys in Docker and runs playbook) +.venv/bin/python -m goe.flow test output// + +# Plan only (Steps 0–3, outputs graph YAML) .venv/bin/python -m goe.planner "web app with SQL injection leading to credential theft" -.venv/bin/python -m goe.planner "..." --output graph.yaml --verbose # Build a single entity end-to-end .venv/bin/python -m goe.build --spec tests/fixtures/entities/sqli_express.yaml -# Run the entity test suite (requires Docker + AWS creds) -.venv/bin/pytest tests/test_build.py -v -m "llm and docker" -k "sqli" - # Fast unit tests (no Docker, no LLM) -.venv/bin/pytest tests/test_bedrock.py tests/test_runtimes.py -v -.venv/bin/pytest tests/test_graph_models.py tests/test_topology.py tests/test_validator.py tests/test_build_scheduler.py tests/test_resolve.py tests/test_planner.py -v +.venv/bin/python -m pytest -m "not docker and not llm" + +# Full test suite (requires Docker + AWS creds) +.venv/bin/python -m pytest tests/ ``` ### Procedure DSL @@ -110,7 +124,7 @@ See `docs/rewrite/implementation_plan.md` for the full phased plan with status. |-------|--------|-------------| | 0 — Foundation | ✅ Complete | Models, executor, container adapter | | 1 — Construction Crew | ✅ Complete | Single entity E2E with retry | -| 2 — Graph Planning | ✅ Complete | `goe plan "..."` → valid entity graph | -| 3 — E2E Single System | ⬜ Planned | `goe run "..."` → deploy script + playbook | -| 4 — Multi-System | ⬜ Planned | docker-compose + chain test | -| 5 — Polish | ⬜ Planned | Atom RAG, EC2, cost optimization | +| 2 — Graph Planning | ✅ Complete | `goe.planner "..."` → valid entity graph | +| 3 — E2E Single System | ✅ Complete | `goe.flow run "..."` → deploy script + playbook | +| 4 — Multi-System | ✅ Complete | docker-compose + chain test | +| 5 — Polish and Parity | ⬜ Planned | Atom RAG, EC2, cost optimization, preset apps | From 55a2f43161029e954e08a9870265acc6e22473a8 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:36:43 -0700 Subject: [PATCH 08/21] docs(v2_implementation_plan): mark Phase 4 as complete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add status summary and ✅ markers for Phase 4 sub-sections, matching CLAUDE.md which already notes phases 0-4 complete. Co-Authored-By: Claude Sonnet 4.6 --- docs/architecture/v2_implementation_plan.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/architecture/v2_implementation_plan.md b/docs/architecture/v2_implementation_plan.md index e7de56e..65b3c00 100644 --- a/docs/architecture/v2_implementation_plan.md +++ b/docs/architecture/v2_implementation_plan.md @@ -189,16 +189,22 @@ Port v1's checkpoint system. Port v1's `GoEConsole` for minimal terminal output. --- -## Phase 4: Multi-System +## Phase 4: Multi-System ✅ COMPLETE -### 4.1 — Multi-System Build -Extend build scheduler for parallel builds across systems (ThreadPoolExecutor). Cross-system edges still enforce ordering. Port v1's `PipelineRenderer` + `BoxEventEmitter`. +**Status**: Implemented. `TopologyEnvironment` deploys systems in Docker; `chain_attacker` synthesizes +end-to-end procedures with `${system..host/port}` interpolation. Multi-system output: per-system +deploy scripts + `docker-compose.yml` + `chain_playbook.yaml`. L3 chain test gates overall success. -### 4.2 — Chain Test -After all entities pass individual L2, deploy full topology and execute procedures in edge order, piping outputs between entities. +### 4.1 — Multi-System Build ✅ +Parallel builds across systems via `BuildScheduler`. Cross-system edges enforce ordering. Port v1's +`PipelineRenderer` + `BoxEventEmitter` pattern. -### 4.3 — Docker Compose Generation -Per-system `deploy_.sh` + `docker-compose.yml` + chain-validated playbook. +### 4.2 — Chain Test ✅ +`chain_attacker.py` (Sonnet) produces a combined `Procedure` across all built entities. `TopologyEnvironment` +deploys all systems and executes the chain playbook end-to-end. + +### 4.3 — Docker Compose Generation ✅ +Per-system `deploy_.sh` + `docker-compose.yml` + `chain_playbook.yaml` written by `packager.py`. --- From 05e194e40a8258030141c40d15d66f5ec89c7fea Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:37:27 -0700 Subject: [PATCH 09/21] docs(AGENT.md): fix three broken docs/rewrite/ paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs/rewrite/ no longer exists; update links to the correct docs/architecture/ paths. goe_rewrite.md never existed — use v2_spec.md which has the full Procedure DSL reference. Co-Authored-By: Claude Sonnet 4.6 --- AGENT.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENT.md b/AGENT.md index 8a1254e..2f9f039 100644 --- a/AGENT.md +++ b/AGENT.md @@ -14,7 +14,7 @@ The project is in active rewrite. There are two parallel codebases: ## v2 Architecture -v2 models scenarios as a directed graph of **entities** (exploitable vulnerabilities) connected by **typed edges** (attacker capabilities). See `docs/rewrite/entity_graph_model.md` for full spec. +v2 models scenarios as a directed graph of **entities** (exploitable vulnerabilities) connected by **typed edges** (attacker capabilities). See `docs/architecture/entity_graph_model.md` for full spec. ### Current State (Phases 0–4 complete, Phase 5 next) @@ -81,7 +81,7 @@ cd game_of_everything ### Procedure DSL -Attack procedures are YAML files with a strict schema. Actions: `http_request`, `exec_attacker`, `exec_attacker_bg` (detached background), `exec_target`, `listen`, `sleep`, browser actions (`navigate`, `click`, `fill_and_submit`, `evaluate`, etc.). See `docs/rewrite/goe_rewrite.md` for full DSL reference. +Attack procedures are YAML files with a strict schema. Actions: `http_request`, `exec_attacker`, `exec_attacker_bg` (detached background), `exec_target`, `listen`, `sleep`, browser actions (`navigate`, `click`, `fill_and_submit`, `evaluate`, etc.). See `docs/architecture/v2_spec.md` for the full DSL reference. ### Runtime Templates @@ -118,7 +118,7 @@ v1 uses crewAI Flow with a multi-agent pipeline. See `CLAUDE.md` for full v1 doc ## Implementation Roadmap -See `docs/rewrite/implementation_plan.md` for the full phased plan with status. +See `docs/architecture/v2_implementation_plan.md` for the full phased plan with status. | Phase | Status | Deliverable | |-------|--------|-------------| From 42e0f635379a57aab8cc915a83552d3e24294db9 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:39:20 -0700 Subject: [PATCH 10/21] docs(README): fix stale model IDs and config key names - Prerequisites: use full inference profile IDs (added version suffix) - Configuration example: update default model ID to full profile format - models.overrides: use v2 role names (engineer/attacker/etc.) instead of v1 agent names (app_generation_agent); note keys match goe/config.py - GOE_MODEL env var suffix: not Co-Authored-By: Claude Sonnet 4.6 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e7dcb76..bc7b0f8 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Game of Everything is an agentic framework for building vulnerable cybersecurity - AWS account with access to **Amazon Bedrock** (Claude Sonnet/Opus models + `amazon.titan-embed-text-v2:0`) > **Bedrock model access**: Enable the following models in your AWS Bedrock console before first use: -> `us.anthropic.claude-sonnet-4-6`, `us.anthropic.claude-opus-4-6-v1`, `amazon.titan-embed-text-v2:0` +> `us.anthropic.claude-sonnet-4-6-20251001-v1:0`, `us.anthropic.claude-opus-4-6-v1:0`, `amazon.titan-embed-text-v2:0` --- @@ -61,11 +61,12 @@ secret_access_key = "" region = "us-east-1" [models] -default = "anthropic.claude-sonnet-4-6" # default Bedrock model for all agents +# Use the full cross-region inference profile ID +default = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" [models.overrides] -# Per-agent overrides — keys match agent names in config/agents.yaml -# app_generation_agent = "anthropic.claude-opus-4-6-v1" +# Per-role overrides — keys match role names in goe/config.py +# engineer = "us.anthropic.claude-opus-4-6-v1:0" [deploy] instance_type = "t3.medium" @@ -74,7 +75,7 @@ security_group_id = "" # auto-created if blank subnet_id = "" # auto-selected if blank ``` -Environment variables override toml values: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, `GOE_DEFAULT_MODEL`, `GOE_MODEL_`. +Environment variables override toml values: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, `GOE_DEFAULT_MODEL`, `GOE_MODEL_`. ### Enable Bedrock Model Access From 0014618f996ac56fa0df963681e5c3ff95237b1a Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:40:01 -0700 Subject: [PATCH 11/21] chore: remove temp-requirements.txt scratch file Unreferenced leftover from development; uv + pyproject.toml is the authoritative dependency source. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/temp-requirements.txt | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 game_of_everything/temp-requirements.txt diff --git a/game_of_everything/temp-requirements.txt b/game_of_everything/temp-requirements.txt deleted file mode 100644 index 95be937..0000000 --- a/game_of_everything/temp-requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -boto3==1.43.40 -botocore==1.43.40 -chromadb==1.5.9 -crewai==1.15.1 -cryptography==49.0.0 -Flask==3.1.3 -json_repair==0.61.2 -playwright==1.61.0 -pydantic==2.13.4 -pytest==9.1.1 -python-dotenv==1.2.2 -PyYAML==6.0.3 -rich==15.0.0 -tomli==2.4.1 From 55579bb73036a767b60e88090822b3f91983731f Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:51:08 -0700 Subject: [PATCH 12/21] fix(main): implement build_attacker entry point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The command was documented in README and CLAUDE.md but never wired up — running it would print "command not found". Adds the function and registers it in [project.scripts] so `uv sync` makes it available. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/pyproject.toml | 1 + .../src/game_of_everything/main.py | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/game_of_everything/pyproject.toml b/game_of_everything/pyproject.toml index 7f42216..24d7eff 100644 --- a/game_of_everything/pyproject.toml +++ b/game_of_everything/pyproject.toml @@ -29,6 +29,7 @@ goe = "goe.flow.__main__:main" kickoff = "game_of_everything.main:kickoff" run_crew = "game_of_everything.main:kickoff" plot = "game_of_everything.main:plot" +build_attacker = "game_of_everything.main:build_attacker" goe-destroy = "game_of_everything.main:destroy" goe-deploy = "game_of_everything.main:deploy_from_output" diff --git a/game_of_everything/src/game_of_everything/main.py b/game_of_everything/src/game_of_everything/main.py index 72902a3..082666b 100644 --- a/game_of_everything/src/game_of_everything/main.py +++ b/game_of_everything/src/game_of_everything/main.py @@ -423,5 +423,28 @@ def destroy(): print(f"Destroyed infrastructure for run {args.run_id}") +def build_attacker(): + """Pre-build the goe-attacker Docker image. + + Separates image build failures from test failures so you know before + running a full pipeline whether the attacker Dockerfile is broken. + """ + import docker + from game_of_everything.tools.test_environment import ( + ATTACKER_DOCKERFILE_DIR, + ATTACKER_IMAGE_TAG, + ) + + client = docker.from_env() + print(f"Building {ATTACKER_IMAGE_TAG} from {ATTACKER_DOCKERFILE_DIR} ...") + _, logs = client.images.build( + path=ATTACKER_DOCKERFILE_DIR, tag=ATTACKER_IMAGE_TAG, rm=True + ) + for chunk in logs: + if "stream" in chunk: + print(chunk["stream"], end="", flush=True) + print(f"Done: {ATTACKER_IMAGE_TAG}") + + if __name__ == "__main__": kickoff() From e56b3aae12e66d11ea1f075157eac897fe930df6 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:51:41 -0700 Subject: [PATCH 13/21] =?UTF-8?q?docs(CONTRIBUTING):=20fix=20bedrock=5Facc?= =?UTF-8?q?ess.py=20invocation=20=E2=80=94=20model=20IDs=20required?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script exits 1 when called without args; omitting them as CONTRIBUTING showed would confuse a first-time contributor. Align with the correct full invocation already shown in README.md. Co-Authored-By: Claude Sonnet 4.6 --- CONTRIBUTING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f00ed79..5152dc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -121,7 +121,10 @@ cp goe.toml.example goe.toml Verify Bedrock access and ingest the RAG atom database before running the full pipeline: ```bash -python scripts/bedrock_access.py +python scripts/bedrock_access.py \ + us.anthropic.claude-sonnet-4-6-20251001-v1:0 \ + us.anthropic.claude-opus-4-6-v1:0 \ + amazon.titan-embed-text-v2:0 python scripts/rag_gen.py ``` From 9b05ad11640f309fe6cbea79c6df5a42da26a04c Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 16:53:46 -0700 Subject: [PATCH 14/21] fix(scripts/query): read AWS credentials from goe.toml query.py only read credentials from env vars, while rag_gen.py reads from goe.toml (with env var override). A dev with creds only in goe.toml would get Bedrock auth errors when verifying RAG results. Align to the same credential-resolution pattern as rag_gen.py. Also removes the dotenv dependency which wasn't doing anything useful here. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/scripts/query.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/game_of_everything/scripts/query.py b/game_of_everything/scripts/query.py index cf0ae98..88d3c33 100644 --- a/game_of_everything/scripts/query.py +++ b/game_of_everything/scripts/query.py @@ -10,14 +10,12 @@ import os import sys import argparse +import tomllib from pathlib import Path import chromadb import boto3 -from dotenv import load_dotenv from chromadb.utils.embedding_functions import AmazonBedrockEmbeddingFunction -load_dotenv() - SCRIPT_DIR = Path(__file__).parent PROJECT_DIR = SCRIPT_DIR.parent CHROMA_DB_PATH = PROJECT_DIR / "src/game_of_everything" / "chroma_db" @@ -27,11 +25,23 @@ "web_vuln_atoms": "web_vuln_atoms", } -aws_session = boto3.Session( - aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID", ""), - aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY", ""), - region_name=os.getenv("AWS_REGION", "us-east-1"), -) +# Read AWS credentials from goe.toml (same as rag_gen.py), with env var override. +toml_path = PROJECT_DIR / "goe.toml" +_aws_cfg: dict = {} +if toml_path.exists(): + with open(toml_path, "rb") as _f: + _aws_cfg = tomllib.load(_f).get("aws", {}) + +_session_kwargs: dict = { + "region_name": os.getenv("AWS_REGION", _aws_cfg.get("region", "us-east-1")) +} +_key_id = os.getenv("AWS_ACCESS_KEY_ID") or _aws_cfg.get("access_key_id", "") +_secret = os.getenv("AWS_SECRET_ACCESS_KEY") or _aws_cfg.get("secret_access_key", "") +if _key_id and _secret: + _session_kwargs["aws_access_key_id"] = _key_id + _session_kwargs["aws_secret_access_key"] = _secret + +aws_session = boto3.Session(**_session_kwargs) bedrock_ef = AmazonBedrockEmbeddingFunction( session=aws_session, From 77d71d1062fc26fbca3ad73b2390c2d8da3b0366 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:41:54 -0700 Subject: [PATCH 15/21] fix(goe.toml.example): remove stale module names from [deploy] comment The old comment named steps/deploy.py + ec2_deploy.py which was the pre-Terraform deploy path. Shorten to just "EC2 deploy settings." Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/goe.toml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game_of_everything/goe.toml.example b/game_of_everything/goe.toml.example index 16e0a44..6f6af9d 100644 --- a/game_of_everything/goe.toml.example +++ b/game_of_everything/goe.toml.example @@ -27,7 +27,7 @@ default = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" # chain_attacker = "us.anthropic.claude-sonnet-4-6-20251001-v1:0" [deploy] -# EC2 one-click deploy settings used by steps/deploy.py + ec2_deploy.py. +# EC2 deploy settings. # key_pair_name is required for deploy to proceed; the other fields are # optional and auto-discovered/created when blank. instance_type = "t3.medium" From bf28186e872112d8fe0ccc3b5bb035b735c06ffa Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:42:27 -0700 Subject: [PATCH 16/21] chore(topology_environment): remove dead _V1_TOOLS constant + fix stale comment _V1_TOOLS was never read anywhere; the actual imports come from goe.container.test_environment_tool. The bootstrap comment also referenced "v1's chain test" which has no meaning outside the development sprint context. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/goe/container/topology_environment.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/game_of_everything/goe/container/topology_environment.py b/game_of_everything/goe/container/topology_environment.py index 7434b6e..c348284 100644 --- a/game_of_everything/goe/container/topology_environment.py +++ b/game_of_everything/goe/container/topology_environment.py @@ -22,15 +22,12 @@ logger = logging.getLogger(__name__) -# Reuse the attacker image and wait_for_docker from v1 -_V1_TOOLS = "game_of_everything.tools.test_environment" - _BASE_TARGET_IMAGE = "ubuntu:22.04" _CHAIN_NETWORK_NAME = "goe_chain_net" _ATTACKER_CONTAINER_PREFIX = "goe_chain_attacker" -# Bootstrap installed into each target before the deploy script runs. -# Matches the subset that v1's chain test installed. +# Bootstrap installed into each target before the deploy script runs: +# apt update + curl, netcat, and common build/network tools. # Bootstrap command imported from central registry from goe.container.bootstrap import get_bootstrap_command _BOOTSTRAP_CMD = get_bootstrap_command("ubuntu") From fee3485c4ee6208560991714f3df561ea3e7e880 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:43:52 -0700 Subject: [PATCH 17/21] refactor(attacker): hoist duplicate _parse to module level attack() and fix_procedure() each defined an identical nested _parse function. chain_attacker.py already uses a module-level _parse; align attacker.py to the same pattern. Co-Authored-By: Claude Sonnet 4.6 --- .../goe/construction_crew/attacker.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/game_of_everything/goe/construction_crew/attacker.py b/game_of_everything/goe/construction_crew/attacker.py index 2276e24..035cc59 100644 --- a/game_of_everything/goe/construction_crew/attacker.py +++ b/game_of_everything/goe/construction_crew/attacker.py @@ -18,6 +18,13 @@ _RUNTIMES_DIR = Path(__file__).resolve().parent.parent / "runtimes" / "templates" +def _parse(raw: str) -> "Procedure": + from goe.models.procedure import Procedure + from goe.construction_crew._yaml_repair import safe_parse_yaml + data = safe_parse_yaml(raw) + return Procedure.model_validate(data) + + def _load_attacker_rules(runtime_id: str) -> str: path = _RUNTIMES_DIR / f"{runtime_id}.yaml" if not path.exists(): @@ -103,12 +110,6 @@ def attack( Write a YAML procedure that exploits the vulnerability and verifies success. Output ONLY valid YAML (no markdown fences).""" - def _parse(raw: str) -> "Procedure": - from goe.models.procedure import Procedure - from goe.construction_crew._yaml_repair import safe_parse_yaml - data = safe_parse_yaml(raw) - return Procedure.model_validate(data) - # Inject Testing Guidance as verification (during self-review) testing_guidance = "\n\n".join( f"### Atom: {a}\n{load_testing_guidance(a)}" @@ -194,12 +195,6 @@ def fix_procedure( Fix the procedure to address exactly this issue. Do not change steps that are working correctly. Output ONLY valid YAML (no markdown fences, no explanation).""" - def _parse(raw: str) -> "Procedure": - from goe.models.procedure import Procedure - from goe.construction_crew._yaml_repair import safe_parse_yaml - data = safe_parse_yaml(raw) - return Procedure.model_validate(data) - raw = call(model_id=model, system=_SYSTEM_PROMPT, messages=[{"role": "user", "content": user_msg}], caller="attacker.fix_procedure") try: From 3a2181350c691a4f9ab62da9e07a419c9c2d02f6 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:45:24 -0700 Subject: [PATCH 18/21] chore(goe): remove stale phase comments and redundant local imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit packager.py: drop "(unchanged from Phase 3)" from docstring (stale milestone note); remove local `import logging` inside two conditional blocks — logging is already imported at module scope. orchestrator.py: replace the stale "Phase 0-2 / chain test is Phase 4" module docstring with a clean four-line phase summary matching the inline section comments already in the file. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/goe/flow/orchestrator.py | 11 ++++++----- game_of_everything/goe/packaging/packager.py | 7 ++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/game_of_everything/goe/flow/orchestrator.py b/game_of_everything/goe/flow/orchestrator.py index f04f7eb..38eb81f 100644 --- a/game_of_everything/goe/flow/orchestrator.py +++ b/game_of_everything/goe/flow/orchestrator.py @@ -1,11 +1,12 @@ -"""Top-level single-system orchestrator: plan → schedule → build → package. +"""Top-level orchestrator: plan → schedule → build → chain test → package. -Wires the existing Phase 0-2 pieces together: - planner.pipeline.plan → graph.BuildScheduler → build.build_entity → packaging.package +Phase 1 — plan: planner.pipeline.plan → EntityGraph +Phase 2 — build: BuildScheduler drives build.build_entity per entity +Phase 3 — test: optional L3 chain test via TopologyEnvironment + chain_attacker +Phase 4 — package: packaging.package writes deploy.sh / playbook.yaml / README build_entity manages its own per-entity Docker container lifecycle, so the -orchestrator never touches Docker directly. Per-entity isolation is the existing -design; the full-topology chain test is Phase 4. +orchestrator never touches Docker directly. """ from __future__ import annotations diff --git a/game_of_everything/goe/packaging/packager.py b/game_of_everything/goe/packaging/packager.py index b10258d..3f18add 100644 --- a/game_of_everything/goe/packaging/packager.py +++ b/game_of_everything/goe/packaging/packager.py @@ -1,7 +1,7 @@ """Packager — assemble built entities into a self-contained deploy package. Single-system: all entities deploy onto one box → one ``deploy.sh``, one -``playbook.yaml``, one ``README.md`` (unchanged from Phase 3). +``playbook.yaml``, one ``README.md``. Multi-system: entities grouped by system_id → per-system ``_deploy.sh`` files, a ``docker-compose.yml`` (one ubuntu:22.04 service per system on a shared @@ -152,9 +152,7 @@ def _build_deploy_sh(graph: "EntityGraph", built: dict[str, "BuildOutcome"], ord sections.insert(0, svc) combined, warnings = assemble_deploy_script(sections) if warnings: - import logging - logger = logging.getLogger(__name__) - logger.warning(f"Deploy script grader fixed {len(warnings)} conflict(s): {warnings}") + logging.getLogger(__name__).warning(f"Deploy script grader fixed {len(warnings)} conflict(s): {warnings}") return combined @@ -341,7 +339,6 @@ def package( from goe.packaging.grader import assemble_deploy_script combined, warnings = assemble_deploy_script(sections) if warnings: - import logging logging.getLogger(__name__).warning( f"Deploy script grader fixed {len(warnings)} conflict(s) on system " f"'{sid}': {warnings}" From 9eda634bb591e904c0fb783499e9df0ff49b0e37 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:47:09 -0700 Subject: [PATCH 19/21] types(goe): fill missing/bare annotations in orchestrator, developer, packager - orchestrator.py: add outcome: "BuildOutcome" to _snapshot, _outcome_from_snapshot (+ return type), _extract_build_summary - developer.py: tighten -> tuple to -> tuple[BuildArtifact, dict[...]] - packager.py: formalize chain_procedure: "Procedure | None" = None (was a bare default with a trailing comment); add Procedure to TYPE_CHECKING imports All annotation-only changes; no runtime effect. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/goe/construction_crew/developer.py | 2 +- game_of_everything/goe/flow/orchestrator.py | 6 +++--- game_of_everything/goe/packaging/packager.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/game_of_everything/goe/construction_crew/developer.py b/game_of_everything/goe/construction_crew/developer.py index c1b9c20..0bc8cf3 100644 --- a/game_of_everything/goe/construction_crew/developer.py +++ b/game_of_everything/goe/construction_crew/developer.py @@ -65,7 +65,7 @@ def develop( edge_schemas: dict | None = None, system_context: str | None = None, provided_values: dict | None = None, -) -> tuple: +) -> tuple["BuildArtifact", dict[str, dict[str, str]]]: """Call the Developer LLM to produce source code and a BuildArtifact. Args: diff --git a/game_of_everything/goe/flow/orchestrator.py b/game_of_everything/goe/flow/orchestrator.py index 38eb81f..b9f31a2 100644 --- a/game_of_everything/goe/flow/orchestrator.py +++ b/game_of_everything/goe/flow/orchestrator.py @@ -60,7 +60,7 @@ def _slug(text: str, max_len: int = 40) -> str: return (s[:max_len].rstrip("_")) or "run" -def _snapshot(outcome) -> "ckpt.BuildOutcomeSnapshot": +def _snapshot(outcome: "BuildOutcome") -> "ckpt.BuildOutcomeSnapshot": proc = outcome.procedure return ckpt.BuildOutcomeSnapshot( deploy_script=outcome.deploy_script or "", @@ -70,7 +70,7 @@ def _snapshot(outcome) -> "ckpt.BuildOutcomeSnapshot": ) -def _outcome_from_snapshot(entity_id: str, snap: "ckpt.BuildOutcomeSnapshot"): +def _outcome_from_snapshot(entity_id: str, snap: "ckpt.BuildOutcomeSnapshot") -> "BuildOutcome": """Rebuild a BuildOutcome from a checkpoint snapshot (for packaging on resume).""" from goe.models.procedure import Procedure from goe.models.report import BuildOutcome, EntityResult, EntityStatus @@ -385,7 +385,7 @@ def _provided_values_for(graph: "EntityGraph", entity: "Entity") -> dict: return out -def _extract_build_summary(entity: "Entity", outcome) -> dict: +def _extract_build_summary(entity: "Entity", outcome: "BuildOutcome") -> dict: """Parse a completed BuildOutcome into a lightweight summary of concrete facts. Extracts from the deploy script: which users were created, which paths were written, diff --git a/game_of_everything/goe/packaging/packager.py b/game_of_everything/goe/packaging/packager.py index 3f18add..ae13477 100644 --- a/game_of_everything/goe/packaging/packager.py +++ b/game_of_everything/goe/packaging/packager.py @@ -24,6 +24,7 @@ if TYPE_CHECKING: from goe.graph.models import EntityGraph + from goe.models.procedure import Procedure from goe.models.report import BuildOutcome @@ -285,7 +286,7 @@ def package( built: dict[str, "BuildOutcome"], out_dir: Path, request: str = "", - chain_procedure=None, # Procedure | None — from chain_test + chain_procedure: "Procedure | None" = None, ) -> Path: """Assemble PASSED entities into a self-contained package under ``out_dir``. From d27566ef1619214750659a8ec412a500b4c3a1c2 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:48:56 -0700 Subject: [PATCH 20/21] chore(v1/src): unused imports, mid-file import, steps __init__ prune MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - engineer_requirements.py: remove unused `import rich` - ui.py: remove unused `import time` (datetime is used instead) - preset_app_flow.py: move `from pydantic import BaseModel` from line 163 to the top-of-file imports (PEP 8 E402) - steps/__init__.py: prune 6 re-exports that are never imported via the package — callers import directly from the submodule. Keep only the 7 names that main.py actually pulls through __init__. Co-Authored-By: Claude Sonnet 4.6 --- game_of_everything/src/game_of_everything/steps/__init__.py | 6 ------ .../src/game_of_everything/steps/engineer_requirements.py | 1 - .../src/game_of_everything/steps/preset_app_flow.py | 4 ++-- game_of_everything/src/game_of_everything/ui.py | 1 - 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/game_of_everything/src/game_of_everything/steps/__init__.py b/game_of_everything/src/game_of_everything/steps/__init__.py index 2b0c30f..d694846 100644 --- a/game_of_everything/src/game_of_everything/steps/__init__.py +++ b/game_of_everything/src/game_of_everything/steps/__init__.py @@ -1,10 +1,4 @@ -from game_of_everything.steps.synthesize_scenario import run_synthesize_scenario from game_of_everything.steps.synthesize_topology import run_synthesize_topology -from game_of_everything.steps.resolve_custom_apps import run_resolve_custom_apps -from game_of_everything.steps.engineer_requirements import run_engineer_requirements -from game_of_everything.steps.generate_implementation import run_generate_implementation -from game_of_everything.steps.test_snippets import run_test_snippets -from game_of_everything.steps.finalize_script import run_finalize_script from game_of_everything.steps.run_box_pipelines import run_box_pipelines from game_of_everything.steps.test_chain import run_chain_test from game_of_everything.steps.finalize_topology import run_finalize_topology diff --git a/game_of_everything/src/game_of_everything/steps/engineer_requirements.py b/game_of_everything/src/game_of_everything/steps/engineer_requirements.py index b20a90e..e998938 100644 --- a/game_of_everything/src/game_of_everything/steps/engineer_requirements.py +++ b/game_of_everything/src/game_of_everything/steps/engineer_requirements.py @@ -2,7 +2,6 @@ import json import re -import rich from typing import Optional, TYPE_CHECKING from crewai import Agent, Task, Crew, Process diff --git a/game_of_everything/src/game_of_everything/steps/preset_app_flow.py b/game_of_everything/src/game_of_everything/steps/preset_app_flow.py index 8b342f2..a673473 100644 --- a/game_of_everything/src/game_of_everything/steps/preset_app_flow.py +++ b/game_of_everything/src/game_of_everything/steps/preset_app_flow.py @@ -18,6 +18,8 @@ from pathlib import Path from typing import Optional, TYPE_CHECKING +from pydantic import BaseModel + from crewai import Agent, Task, Crew, Process from crewai.flow import Flow, listen, start @@ -160,8 +162,6 @@ def _run_verdict_crew( # State model for the flow # --------------------------------------------------------------------------- -from pydantic import BaseModel - class PresetAppState(BaseModel): vector: Optional[PresetVector] = None diff --git a/game_of_everything/src/game_of_everything/ui.py b/game_of_everything/src/game_of_everything/ui.py index af6b064..f5fb7fc 100644 --- a/game_of_everything/src/game_of_everything/ui.py +++ b/game_of_everything/src/game_of_everything/ui.py @@ -7,7 +7,6 @@ import io import logging import sys -import time from contextlib import contextmanager from datetime import datetime from pathlib import Path From 1c1c5ca76ad2d79c9deb3586d999cd92c44b2a92 Mon Sep 17 00:00:00 2001 From: StengoS Date: Sun, 26 Jul 2026 17:50:31 -0700 Subject: [PATCH 21/21] chore: delete superseded test_browser_phase1.py script This was a one-time verification tool for Phase 1 browser infrastructure. Its CDP startup, teardown, and BoundBrowserTool smoke tests are all now covered by tests/test_executor.py and tests/test_solve_script.py. The script used sys.path hackery, was not wired into pytest, and silently skipped if imports failed. Co-Authored-By: Claude Sonnet 4.6 --- .../scripts/test_browser_phase1.py | 129 ------------------ 1 file changed, 129 deletions(-) delete mode 100755 game_of_everything/scripts/test_browser_phase1.py diff --git a/game_of_everything/scripts/test_browser_phase1.py b/game_of_everything/scripts/test_browser_phase1.py deleted file mode 100755 index 0d0a518..0000000 --- a/game_of_everything/scripts/test_browser_phase1.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -""" -Phase 1 verification script for browser-use infrastructure. - -Tests: -1. Browser sidecar starts and CDP endpoint becomes reachable -2. All three containers (target, attacker, browser) start and teardown cleanly -3. BoundBrowserTool can execute a simple task -""" - -import sys -from pathlib import Path - -# Add src to path so we can import game_of_everything modules -sys.path.insert(0, str(Path(__file__).parent.parent / "src")) - -from game_of_everything.tools.test_environment import TestEnvironmentTool - - -def test_browser_startup(): - """Test 1 & 2: Start environment with browser enabled and verify CDP is reachable.""" - print("=" * 70) - print("TEST 1 & 2: Browser sidecar startup and teardown") - print("=" * 70) - - env = TestEnvironmentTool(enable_browser=True) - - try: - print("\nStarting test environment with browser enabled...") - env.setup() - - print(f"✓ Target container: {env.target_name}") - print(f"✓ Attacker container: {env.attacker_name}") - print(f"✓ Browser container: {env._prefix}browser") - print(f"✓ Network: {env.network_name}") - print(f"✓ Browser CDP URL: {env.browser_cdp_url}") - print(f"✓ Browser host port: {env._browser_host_port}") - - # Verify containers are actually running - assert env.target_container is not None - assert env.attacker_container is not None - assert env.browser_container is not None - assert env.browser_cdp_url.startswith("ws://localhost:") - assert env._browser_host_port > 0 - - print("\n✓ All containers started successfully") - print("✓ CDP endpoint is reachable") - - finally: - print("\nTearing down test environment...") - env.teardown() - print("✓ Teardown complete") - - print("\n" + "=" * 70) - print("TEST 1 & 2: PASSED") - print("=" * 70) - - -def test_browser_tool(): - """Test 3: Smoke-test BoundBrowserTool with a simple navigation task.""" - print("\n" + "=" * 70) - print("TEST 3: BoundBrowserTool smoke test") - print("=" * 70) - - # Note: This requires browser-use and playwright to be installed - # If not installed, the test will fail gracefully with an import error - - try: - from game_of_everything.tools.bound_browser_tool import BoundBrowserTool - except ImportError as e: - print(f"\n⚠ SKIPPED: BoundBrowserTool import failed: {e}") - print("Run `crewai install` and `playwright install chromium` to enable this test") - return - - env = TestEnvironmentTool(enable_browser=True) - - try: - print("\nStarting test environment with browser...") - env.setup() - - print(f"Browser CDP URL: {env.browser_cdp_url}") - - # Create the tool - tool = BoundBrowserTool( - cdp_url=env.browser_cdp_url, - target_base_url="http://example.com" - ) - - print("\nExecuting browser task: 'Navigate to http://example.com and return the page title'") - result = tool._run("Navigate to http://example.com and return the page title") - - print(f"\nBrowser task result: {result[:200]}...") - - if "ERROR" in result: - print(f"\n✗ Browser task returned an error: {result}") - else: - print("\n✓ Browser task executed successfully") - - except Exception as e: - print(f"\n✗ Browser tool test failed: {e}") - import traceback - traceback.print_exc() - finally: - print("\nTearing down test environment...") - env.teardown() - print("✓ Teardown complete") - - print("\n" + "=" * 70) - print("TEST 3: COMPLETED (check output above for pass/fail)") - print("=" * 70) - - -if __name__ == "__main__": - print("\nPhase 1 Verification: Browser Infrastructure") - print("=" * 70) - - try: - test_browser_startup() - test_browser_tool() - - print("\n" + "=" * 70) - print("PHASE 1 VERIFICATION: ALL TESTS COMPLETED") - print("=" * 70) - - except Exception as e: - print(f"\n✗ PHASE 1 VERIFICATION FAILED: {e}") - import traceback - traceback.print_exc() - sys.exit(1)