Skip to content

Commit ebd9ba2

Browse files
committed
docs: define repository-group scoped execution with add-dir launch
1 parent 665a9ea commit ebd9ba2

6 files changed

Lines changed: 64 additions & 20 deletions

File tree

docs/api.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ Request:
112112
Response:
113113
- `group: RepositoryGroup`
114114

115+
Rules:
116+
117+
1. `repository_ids` must contain at least one repository.
118+
2. `repository_ids` order is preserved exactly as provided.
119+
3. the first repository becomes the primary execution repository for agent runs.
120+
115121
### UpdateRepositoryGroup
116122

117123
Request:
@@ -122,6 +128,12 @@ Request:
122128
Response:
123129
- `group: RepositoryGroup`
124130

131+
Rules:
132+
133+
1. when `repository_ids` is updated, it must contain at least one repository.
134+
2. execution order is updated to the new list order.
135+
3. the first repository in the updated list becomes the primary execution repository.
136+
125137
### DeleteRepositoryGroup
126138

127139
Request:
@@ -193,6 +205,7 @@ Usage rule:
193205
2. request uses `type = PR_CREATE`
194206
3. prompt is `Create A PR` for the default PR creation action
195207
4. subtask execution output must include real git commits (one or more) when code changes exist
208+
5. execution resolves RepositoryGroup repositories, creates worktrees for each repo, and launches agent in the first repository with additional repositories attached via `--add-dir` (or equivalent option)
196209

197210
### ListSubTasks
198211

docs/design.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Core entities:
105105
### UnitTask
106106

107107
UnitTask is the top-level user-visible work item.
108+
Execution scope is one RepositoryGroup.
108109

109110
### SubTask
110111

@@ -143,11 +144,20 @@ DeliDev does not support editing directly against arbitrary local folders.
143144
All code execution paths must:
144145

145146
1. resolve repository through workspace-scoped repository settings
146-
2. materialize task-specific git worktree
147-
3. execute agent operations in that worktree
147+
2. materialize task-specific git worktrees for each repository in the target RepositoryGroup
148+
3. execute agent operations from the first repository worktree and attach other repository worktrees via `--add-dir` or equivalent option
148149
4. persist real git commit chain and commit metadata
149150
5. cleanup or archive worktree by retention policy
150151

152+
## RepositoryGroup Execution Rule
153+
154+
RepositoryGroup is the execution unit for agent runs.
155+
156+
1. Worker creates one worktree per repository in the group.
157+
2. Repository order is preserved from `repositoryIds`.
158+
3. Agent process starts in the first repository worktree.
159+
4. Additional repositories are passed as extra directories using `--add-dir` (or agent-equivalent flags).
160+
151161
## PR Management
152162

153163
PR management is part of the standard lifecycle:

docs/entities.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,18 @@ enum StreamEventType {
183183
| id | UUID | Y | Group ID |
184184
| workspaceId | UUID | Y | Parent workspace |
185185
| name | string | Y | Group name |
186-
| repositoryIds | UUID[] | Y | Included repositories |
186+
| repositoryIds | UUID[] | Y | Ordered repositories (first item is primary execution repository) |
187187
| createdAt | timestamp | Y | Created time |
188188
| updatedAt | timestamp | Y | Updated time |
189189

190+
RepositoryGroup execution semantics:
191+
192+
1. RepositoryGroup is the unit of task execution scope.
193+
2. `repositoryIds` order is significant.
194+
3. repository group must contain at least one repository.
195+
4. the first repository is the primary execution repository.
196+
5. remaining repositories are attached as additional working directories for agent execution.
197+
190198
### UnitTask
191199

192200
| Field | Type | Required | Description |

docs/main-server.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ Main server stores and owns:
5555

5656
1. workspace records
5757
2. repository metadata and grouping
58-
3. UnitTask and SubTask state machines
59-
4. SubTask commit-chain metadata and commit ancestry
60-
5. AgentSession metadata and log pointers
61-
6. PR tracking state and auto-fix counters
62-
7. review assist items
63-
8. badge theme settings
64-
9. notification records
65-
10. event sequence offsets
58+
3. ordered RepositoryGroup membership and primary repository selection (first repository in group)
59+
4. UnitTask and SubTask state machines
60+
5. SubTask commit-chain metadata and commit ancestry
61+
6. AgentSession metadata and log pointers
62+
7. PR tracking state and auto-fix counters
63+
8. review assist items
64+
9. badge theme settings
65+
10. notification records
66+
11. event sequence offsets
6667

6768
## Task Orchestration Flow
6869

docs/user-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This guide explains the DeliDev user workflow.
1717
1. open Repositories
1818
2. add repository remote URLs
1919
3. create RepositoryGroup for related repositories
20+
4. order repositories intentionally (first repository becomes primary agent execution repository)
2021

2122
## 3. Create a UnitTask
2223

docs/worker-server.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Worker Server executes SubTasks using AI coding agents in isolated worktree envi
1313
## Execution Principles
1414

1515
1. worktree-only execution
16-
2. one SubTask execution context per worktree
16+
2. one SubTask execution context per RepositoryGroup
1717
3. one or more AgentSession runs per SubTask
1818
4. deterministic cleanup policy by outcome
1919

@@ -39,18 +39,20 @@ Worker Server executes SubTasks using AI coding agents in isolated worktree envi
3939

4040
## Worktree Lifecycle
4141

42-
1. resolve repository from workspace and repository group context
43-
2. ensure repository cache is up to date
44-
3. create task-specific worktree path
45-
4. execute agent sessions in that worktree
46-
5. create and persist real git commits in branch history
47-
6. export patch and metadata derived from commits
48-
7. cleanup according to retention policy
42+
1. resolve ordered repositories from workspace and repository group context
43+
2. ensure each repository cache is up to date
44+
3. create task-specific worktree path for every repository in the group
45+
4. choose the first repository worktree as primary execution directory
46+
5. execute agent sessions in the primary directory
47+
6. pass remaining repository worktrees as `--add-dir` (or equivalent agent options)
48+
7. create and persist real git commits in branch history
49+
8. export patch and metadata derived from commits
50+
9. cleanup according to retention policy
4951

5052
Path convention:
5153

5254
- cache: `~/.delidev/repo-cache/<repo-hash>/`
53-
- worktree: `~/.delidev/worktrees/<unit-task-id>/<sub-task-id>/`
55+
- worktree: `~/.delidev/worktrees/<unit-task-id>/<sub-task-id>/<repo-id>/`
5456

5557
## SubTask and Session Flow
5658

@@ -90,6 +92,14 @@ Worker output must be a real git commit chain.
9092
4. patch artifacts are generated from those commits for diff views
9193
5. PR creation and Commit to Local must consume commit-chain metadata, not patch-only output
9294

95+
## Primary Repository Launch Rule
96+
97+
Agent process launch uses the RepositoryGroup ordering rule.
98+
99+
1. first repository in `repositoryIds` is the launch directory
100+
2. all other repositories are attached using `--add-dir` (or equivalent option per agent adapter)
101+
3. adapter command builders must preserve directory order when constructing arguments
102+
93103
## Agent Abstraction
94104

95105
Worker uses adapter interfaces for multiple agents.
@@ -158,6 +168,7 @@ Emit structured logs for:
158168
5. artifact export
159169
6. usage checkpoints and final cost summary
160170
7. cancellation checkpoints
171+
8. primary repository selection and add-dir argument mapping
161172

162173
## Security Baseline
163174

0 commit comments

Comments
 (0)