Skip to content

Commit dd0962b

Browse files
committed
Use FieldWorks.proj for main file
Add local mulit-agent capability We can't close VSCode windows. Just resuse the folders and code-workspace files.
1 parent dee74e1 commit dd0962b

38 files changed

+2457
-400
lines changed

.github/BUILD_REQUIREMENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you only need to build C# projects and already have native artifacts from a p
3232

3333
```powershell
3434
# Build only managed projects (skips native C++)
35-
msbuild dirs.proj /p:Configuration=Debug /p:Platform=x64
35+
msbuild FieldWorks.proj /p:Configuration=Debug /p:Platform=x64
3636
```
3737

3838
## CI Builds
@@ -76,7 +76,7 @@ Both `build.ps1` and `build.sh` now include:
7676
1. **Automatic FwBuildTasks bootstrap**: Builds build infrastructure before main build
7777
2. **Environment validation**: Warns if Developer environment is not detected
7878
3. **Package restoration**: Restores NuGet packages before build
79-
4. **Traversal build**: Uses MSBuild Traversal SDK (dirs.proj) for correct dependency ordering
79+
4. **Traversal build**: Uses MSBuild Traversal SDK (FieldWorks.proj) for correct dependency ordering
8080

8181
## Visual Studio Requirements
8282

.github/copilot-instructions.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,22 @@ Before submitting a PR:
173173

174174
--------------------------------------------------------------------------------
175175

176+
## Multi-agent worktree builds (containers)
177+
178+
CRITICAL: When working in a worktree folder (path contains '\worktrees\agent-'), ALWAYS build inside the matching Docker container. Extract the agent number from the path and use: `docker exec fw-agent-N powershell -NoProfile -c "msbuild <solution> /m /p:Configuration=Debug"`
179+
180+
To identify which container to use: if workspace path is '...\worktrees\agent-2\...', use container 'fw-agent-2'
181+
182+
For agent worktrees, NEVER run msbuild directly on the host. COM/registry operations must happen in the isolated container.
183+
184+
In agent worktrees, prefer using VS Code tasks ('Terminal > Run Task > Restore + Build Debug') which are pre-configured for the correct container.
185+
186+
For the main repository (not in worktrees), build directly with: `.\build.ps1 -Configuration Debug` or `msbuild dirs.proj`
187+
188+
Read-only operations (git, Get-Content, ls, dir) always run on the host, regardless of worktree.
189+
190+
--------------------------------------------------------------------------------
191+
176192
## Where to make changes
177193

178194
- Core source: Src/ contains the primary C# and C++ projects. Mirror existing patterns for new code.

.github/instructions/build.instructions.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "FieldWorks build guidelines and inner-loop tips"
66

77
## Quick Start
88

9-
FieldWorks uses the **MSBuild Traversal SDK** for declarative build ordering. All builds use `dirs.proj`.
9+
FieldWorks uses the **MSBuild Traversal SDK** for declarative build ordering. All builds use `FieldWorks.proj`.
1010

1111
### Windows (PowerShell)
1212
```powershell
@@ -36,13 +36,13 @@ FieldWorks uses the **MSBuild Traversal SDK** for declarative build ordering. Al
3636
- Declarative dependency ordering (110+ projects organized into 21 phases)
3737
- Automatic parallel builds where safe
3838
- Better incremental build performance
39-
- Works with `dotnet build dirs.proj`
39+
- Works with `dotnet build FieldWorks.proj`
4040
- Clear error messages when prerequisites missing
4141

4242
## Build Architecture
4343

4444
### Traversal Build Phases
45-
The `dirs.proj` file defines a declarative build order:
45+
The `FieldWorks.proj` file defines a declarative build order:
4646

4747
1. **Phase 1**: FwBuildTasks (build infrastructure)
4848
2. **Phase 2**: Native C++ components (via `allCppNoTest` target)
@@ -78,9 +78,9 @@ Run: msbuild Build\Src\NativeBuild\NativeBuild.csproj
7878
- Generated code out of sync (delete `Src/Common/ViewsInterfaces/Views.cs`)
7979

8080
### Choose the right path
81-
- **Full system build**: `.\build.ps1` or `./build.sh` (uses dirs.proj traversal)
82-
- **Direct MSBuild**: `msbuild dirs.proj /p:Configuration=Debug /p:Platform=x64 /m`
83-
- **Dotnet CLI**: `dotnet build dirs.proj` (requires .NET SDK)
81+
- **Full system build**: `.\build.ps1` or `./build.sh` (uses FieldWorks.proj traversal)
82+
- **Direct MSBuild**: `msbuild FieldWorks.proj /p:Configuration=Debug /p:Platform=x64 /m`
83+
- **Dotnet CLI**: `dotnet build FieldWorks.proj` (requires .NET SDK)
8484
- **Single project**: `msbuild Src/<Path>/<Project>.csproj` (for quick iterations)
8585
- **Native only**: `msbuild Build\Src\NativeBuild\NativeBuild.csproj` (Phase 2 of traversal)
8686
- **Installer**: See `Build/Installer.targets` for installer build targets (requires WiX Toolset)
@@ -114,18 +114,18 @@ msbuild Build\Src\NativeBuild\NativeBuild.csproj /p:Configuration=Debug /p:Platf
114114
### Build Order Issues
115115
**Symptom**: Project X fails because it can't find assembly from project Y
116116

117-
**Solution**: The traversal build handles this automatically through `dirs.proj`:
117+
**Solution**: The traversal build handles this automatically through `FieldWorks.proj`:
118118
- Check that the dependency is listed in an earlier phase than the dependent
119-
- Verify both projects are included in `dirs.proj`
120-
- If you find a missing dependency, update `dirs.proj` phase ordering
119+
- Verify both projects are included in `FieldWorks.proj`
120+
- If you find a missing dependency, update `FieldWorks.proj` phase ordering
121121

122122
### Parallel Build Race Conditions
123123
**Symptom**: Random failures in parallel builds
124124

125125
**Solution**:
126126
- Traversal SDK respects dependencies and avoids races
127127
- If you encounter race conditions, reduce parallelism: `.\build.ps1 -MsBuildArgs @('/m:1')`
128-
- Report race conditions so dependencies can be added to `dirs.proj`
128+
- Report race conditions so dependencies can be added to `FieldWorks.proj`
129129

130130
### Clean Build Required
131131
```powershell
@@ -150,39 +150,39 @@ msbuild Build\Src\NativeBuild\NativeBuild.csproj /p:Configuration=Debug /p:Platf
150150
### Direct MSBuild Invocation
151151
```powershell
152152
# Traversal build with MSBuild
153-
msbuild dirs.proj /p:Configuration=Debug /p:Platform=x64 /m
153+
msbuild FieldWorks.proj /p:Configuration=Debug /p:Platform=x64 /m
154154
155155
# With tests
156-
msbuild dirs.proj /p:Configuration=Debug /p:Platform=x64 /p:action=test /m
156+
msbuild FieldWorks.proj /p:Configuration=Debug /p:Platform=x64 /p:action=test /m
157157
```
158158

159159
### Building Specific Project Groups
160160
```powershell
161161
# Native C++ only (Phase 2 of traversal)
162162
msbuild Build\Src\NativeBuild\NativeBuild.csproj
163163
164-
# Specific phase from dirs.proj (not typically needed)
164+
# Specific phase from FieldWorks.proj (not typically needed)
165165
# The traversal build handles ordering automatically
166166
```
167167

168168
### Dotnet CLI (Traversal Only)
169169
```powershell
170-
# Works with dirs.proj
171-
dotnet build dirs.proj
170+
# Works with FieldWorks.proj
171+
dotnet build FieldWorks.proj
172172
173173
# Restore packages
174-
dotnet restore dirs.proj --packages packages/
174+
dotnet restore FieldWorks.proj --packages packages/
175175
```
176176

177177
## Don't modify build files lightly
178-
- **`dirs.proj`**: Traversal build order; verify changes don't create circular dependencies
178+
- **`FieldWorks.proj`**: Traversal build order; verify changes don't create circular dependencies
179179
- **`Build/mkall.targets`**: Native C++ build orchestration; changes affect all developers
180180
- **`Build/SetupInclude.targets`**: Environment setup; touch only when absolutely needed
181181
- **`Directory.Build.props`**: Shared properties for all projects; changes affect everyone
182182

183183
## References
184184
- **CI/CD**: `.github/workflows/` for CI steps
185185
- **Build Infrastructure**: `Build/` for targets/props and build infrastructure
186-
- **Traversal Project**: `dirs.proj` for declarative build order
186+
- **Traversal Project**: `FieldWorks.proj` for declarative build order
187187
- **Shared Properties**: `Directory.Build.props` for all projects
188188
- **Native Build**: `Build/mkall.targets` for C++ build orchestration

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ Src/Kernel/*.idh
147147
.github/machine-specific.md
148148
build_output.txt
149149
*.backup
150+
*.code-workspace
151+
config.json

.serena/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/cache

.serena/project.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# list of languages for which language servers are started; choose from:
2+
# al bash clojure cpp csharp csharp_omnisharp
3+
# dart elixir elm erlang fortran go
4+
# haskell java julia kotlin lua markdown
5+
# nix perl php python python_jedi r
6+
# rego ruby ruby_solargraph rust scala swift
7+
# terraform typescript typescript_vts zig
8+
# Note:
9+
# - For C, use cpp
10+
# - For JavaScript, use typescript
11+
# Special requirements:
12+
# - csharp: Requires the presence of a .sln file in the project folder.
13+
# When using multiple languages, the first language server that supports a given file will be used for that file.
14+
# The first language is the default language and the respective language server will be used as a fallback.
15+
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
16+
languages:
17+
- csharp
18+
19+
# the encoding used by text files in the project
20+
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
21+
encoding: "utf-8"
22+
23+
# whether to use the project's gitignore file to ignore files
24+
# Added on 2025-04-07
25+
ignore_all_files_in_gitignore: true
26+
27+
# list of additional paths to ignore
28+
# same syntax as gitignore, so you can use * and **
29+
# Was previously called `ignored_dirs`, please update your config if you are using that.
30+
# Added (renamed) on 2025-04-07
31+
ignored_paths: []
32+
33+
# whether the project is in read-only mode
34+
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
35+
# Added on 2025-04-18
36+
read_only: false
37+
38+
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
39+
# Below is the complete list of tools for convenience.
40+
# To make sure you have the latest list of tools, and to view their descriptions,
41+
# execute `uv run scripts/print_tool_overview.py`.
42+
#
43+
# * `activate_project`: Activates a project by name.
44+
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
45+
# * `create_text_file`: Creates/overwrites a file in the project directory.
46+
# * `delete_lines`: Deletes a range of lines within a file.
47+
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
48+
# * `execute_shell_command`: Executes a shell command.
49+
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
50+
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
51+
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
52+
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
53+
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
54+
# * `initial_instructions`: Gets the initial instructions for the current project.
55+
# Should only be used in settings where the system prompt cannot be set,
56+
# e.g. in clients you have no control over, like Claude Desktop.
57+
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
58+
# * `insert_at_line`: Inserts content at a given line in a file.
59+
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
60+
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
61+
# * `list_memories`: Lists memories in Serena's project-specific memory store.
62+
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
63+
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
64+
# * `read_file`: Reads a file within the project directory.
65+
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
66+
# * `remove_project`: Removes a project from the Serena configuration.
67+
# * `replace_lines`: Replaces a range of lines within a file with new content.
68+
# * `replace_symbol_body`: Replaces the full definition of a symbol.
69+
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
70+
# * `search_for_pattern`: Performs a search for a pattern in the project.
71+
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
72+
# * `switch_modes`: Activates modes by providing a list of their names
73+
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
74+
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
75+
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
76+
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
77+
excluded_tools: []
78+
79+
# initial prompt for the project. It will always be given to the LLM upon activating the project
80+
# (contrary to the memories, which are loaded on demand).
81+
initial_prompt: ""
82+
83+
project_name: "FieldWorks"
84+
included_optional_tools: []

.vscode/settings.json

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,52 @@
77
"speckit.implement": true
88
},
99
"chat.tools.terminal.autoApprove": {
10+
// Specify scripts
1011
".specify/scripts/bash/": true,
11-
".specify/scripts/powershell/": true
12+
".specify/scripts/powershell/": true,
13+
// Read-only operations
14+
"Get-Content": true,
15+
"cat": true,
16+
"type": true,
17+
"Get-ChildItem": true,
18+
"ls": true,
19+
"dir": true,
20+
"tree": true,
21+
"Test-Path": true,
22+
"Get-Location": true,
23+
"pwd": true,
24+
"Get-Item": true,
25+
"Get-ItemProperty": true,
26+
// Git operations (read-only)
27+
"git status": true,
28+
"git log": true,
29+
"git diff": true,
30+
"git show": true,
31+
"git branch": true,
32+
"git worktree list": true,
33+
// Docker read-only operations
34+
"docker ps": true,
35+
"docker images": true,
36+
"docker logs": true,
37+
"docker info": true,
38+
"docker inspect": true,
39+
// Docker exec - ONLY for agent containers (safe, isolated)
40+
"docker exec fw-agent-": true,
41+
// Build operations (host-based for main repo)
42+
"msbuild": true,
43+
"dotnet build": true,
44+
"dotnet restore": true,
45+
".\\build.ps1": true,
46+
".\\build.sh": true,
47+
// Test operations
48+
"dotnet test": true,
49+
"vstest.console": true,
50+
"nunit3-console": true,
51+
// Agent workflow scripts
52+
".\\scripts\\spin-up-agents.ps1": true,
53+
".\\scripts\\tear-down-agents.ps1": true,
54+
".\\scripts\\check-agents.ps1": true
1255
},
13-
"cmake.ignoreCMakeListsMissing": true
56+
"cmake.ignoreCMakeListsMissing": true,
57+
"dotnet.defaultSolution": "FieldWorks.sln"
1458
}

0 commit comments

Comments
 (0)