Skip to content

[codex] add default project source workflow#24

Merged
thepluck merged 5 commits into
masterfrom
codex/default-project-source-workflow
Jun 8, 2026
Merged

[codex] add default project source workflow#24
thepluck merged 5 commits into
masterfrom
codex/default-project-source-workflow

Conversation

@thepluck

@thepluck thepluck commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • add default_project_root as the single writable Foundry project root
  • expose POST /projects/default/source to initialize on first use and write Solidity files under src
  • make Add Source set the simulation project path from the backend response
  • store Docker default project files in a dedicated default-project volume

Tests

  • go test ./...
  • yarn build
  • yarn lint
  • yarn test:browser
  • docker compose config

Copilot AI review requested due to automatic review settings June 5, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_root configuration and Docker volume support for a persistent default Foundry project.
  • Add POST /projects/default/source to initialize the default project (via forge init) and write Solidity files under src/.
  • Update the frontend to support “Add Source” via the new endpoint and to set the simulation projectPath based 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.

Comment thread backend/internal/simulation/validation.go
Comment thread backend/internal/simulation/service.go
Comment thread frontend/src/styles/request.css Outdated
@thepluck thepluck merged commit 9f65764 into master Jun 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants