[codex] add default project source workflow#24
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a “default Foundry project” concept as the primary writable project root, adds a backend endpoint to write Solidity source files into that project on first use, and updates the frontend to use this flow (including Docker changes to persist the default project via a dedicated volume).
Changes:
- Add
default_project_rootconfiguration and Docker volume support for a persistent default Foundry project. - Add
POST /projects/default/sourceto initialize the default project (viaforge init) and write Solidity files undersrc/. - Update the frontend to support “Add Source” via the new endpoint and to set the simulation
projectPathbased on the backend response (with new tests).
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new default_project_root and Docker default-project volume behavior. |
| frontend/tests/simulation-ui.spec.ts | Adds browser test coverage for adding source via /projects/default/source and using returned projectPath for simulation. |
| frontend/src/styles/request.css | Adds styling for source file panel/status and tweaks Foundry project row layout. |
| frontend/src/features/request/RequestForm.tsx | Adds “Add Source” UI and wires it to the new backend endpoint, updating projectPath from the response. |
| frontend/src/api/types.ts | Re-exports the new ProjectSourceFile request/response types. |
| frontend/src/api/schemas.ts | Adds Zod schemas/types for ProjectSourceFile request/response. |
| frontend/src/api/client.ts | Implements addProjectSourceFile() calling POST /projects/default/source. |
| docker-compose.yml | Removes external projects mount and adds a dedicated default-project volume. |
| config.example.yml | Adds default_project_root to example configuration. |
| config.docker.yml | Sets project_roots: [] and configures default_project_root to the Docker volume mount. |
| backend/README.md | Documents the new endpoint and default-project behavior (especially in Docker). |
| backend/internal/simulation/validation.go | Adds validation/normalization for Solidity source paths under src/. |
| backend/internal/simulation/service.go | Implements default project initialization, source-file writing, and conditional forge build src behavior. |
| backend/internal/simulation/service_test.go | Adds unit tests for default project init/write behavior and path validation. |
| backend/internal/model/types.go | Adds backend model types for ProjectSourceFile request/response. |
| backend/internal/httpapi/server.go | Adds the /projects/default/source route and handler. |
| backend/internal/httpapi/openapi.go | Exposes new endpoint and schemas in OpenAPI. |
| backend/internal/httpapi/openapi_test.go | Extends OpenAPI and handler tests for the new endpoint and request shape. |
| backend/internal/config/config.go | Adds DefaultProjectRoot config loading/normalization with a default under work_dir. |
| backend/internal/config/config_test.go | Adds coverage for DefaultProjectRoot defaulting/path resolution. |
| .env.example | Removes Docker external project mount env vars that are no longer used. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests