Skip to content

Commit 8f5f4e4

Browse files
committed
docs: sharpen multi-repository positioning (#3)
1 parent 1d01ca9 commit 8f5f4e4

3 files changed

Lines changed: 272 additions & 55 deletions

File tree

README.md

Lines changed: 107 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88

99
Repository: [libaie/onboard-code-projects](https://github.com/libaie/onboard-code-projects)
1010

11-
onboard-code-projects is a Windows-first Codex Desktop multi-repository workflow-isolation Skill.
11+
`onboard-code-projects` is the Codex Desktop multi-repository workflow-isolation Skill that reduces context pollution with verified, reusable project tasks and `codebase-memory` indexes, plus an optional controller for cross-project coordination and evidence-backed reuse of accepted successes and deterministic failures.
1212

1313
- **Use when:** work crosses two or more related repositories.
1414
- **You get:** exact-root, verified project-bound entry tasks, a `codebase-memory` index for each repository, and an optional controller for cross-project coordination.
1515
- **It does not:** create saved Codex projects or approve permissions.
1616
- **It is not:** a security sandbox, and it does not deploy software.
1717

18-
This reduces the risk of repository instructions, branches, permissions, evidence, and edits being mixed in one long conversation.
19-
2018
> **Preview:** Windows and Codex Desktop are the supported release surface. Other platforms are not yet release-tested end to end.
2119
2220
## Problems this Skill solves
@@ -43,23 +41,117 @@ Project entry tasks may still use subagents internally; the two approaches are c
4341

4442
## What you get
4543

46-
```mermaid
47-
flowchart LR
48-
U["User"] --> A["Project A entry task"]
49-
U --> B["Project B entry task"]
50-
U -.->|optional cross-project work| C["Controller"]
51-
C --> A
52-
C --> B
53-
A --> RA["Repository A + index"]
54-
B --> RB["Repository B + index"]
55-
```
56-
5744
- For each source: one verified saved-project binding, one reusable local entry task, and one `codebase-memory` index.
5845
- Optionally: one controller directory and controller task outside every business repository.
5946
- Optionally: durable result return when the plugin Stop Hook and Node.js are available; automatic wake additionally requires validated rule, worker, and automation capabilities.
6047

6148
The Skill cannot create a saved Codex project. Add each exact directory in Codex Desktop first; the Skill verifies and uses that identity.
6249

50+
## Core workflows
51+
52+
The four flows below cover the public lifecycle. Exact payloads, hashes, reason codes, and recovery commands remain in the [controller runtime reference](./references/controller-runtime.md).
53+
54+
### 1. Onboard or reuse each repository
55+
56+
```mermaid
57+
flowchart TD
58+
O1["Local paths or Git URLs"] --> O2["Load or confirm the saved index mode, then parse inputs and run read-only preflight"]
59+
O2 --> O3{"Source type?"}
60+
O3 -->|Local directory| O7{"One exact saved project on this host?"}
61+
O3 -->|Git URL| O4["Clone only into a new cloneRoot child"]
62+
O4 --> O5["Return needs-project-add"]
63+
O5 --> O6["User saves the exact clone and reruns"]
64+
O6 --> O7
65+
O7 -->|No or ambiguous| O8["Block with a precise next action"]
66+
O7 -->|Yes| O9["Read AGENTS and verify root, branch, HEAD, and dirty state"]
67+
O9 --> O10["Create or reuse one project-bound entry task"]
68+
O10 --> O11["Build or refresh the selected codebase-memory index"]
69+
O11 --> O12["Verify index root and revision"]
70+
O12 --> O13["Repository lane ready for direct work"]
71+
O13 -.->|Optional cross-project work| O14["Verify or initialize an external controller and register this entry"]
72+
O14 -.->|Controller unavailable or creation result unknown| O15["Keep ready repositories; report pending registration or reconcile evidence without retrying"]
73+
```
74+
75+
Saved projects stay user-owned. The Skill creates neither projectless tasks nor worktrees, and the optional controller must remain outside every business repository.
76+
77+
### 2. Coordinate, dispatch, and accept cross-project work
78+
79+
```mermaid
80+
flowchart TD
81+
D1["Cross-project request"] --> D2["Four-quadrant intake; freeze objective, contract, scope, and acceptance"]
82+
D2 --> D3["Queue work by project"]
83+
D3 -->|Same project runs one active task in FIFO order| D4
84+
D3 -->|Independent projects run in parallel| D4
85+
D4["Seal the dispatch and select the model class by complexity and risk"] --> D5["Send only to the verified project entry task"]
86+
D5 -.->|Timeout or empty delivery| D15["Stop or hold only this lane; never resend blindly or expand authority"]
87+
D5 -->|Delivered| D6["Re-read AGENTS and verify root, baseline, and scope"]
88+
D6 --> D7{"Runtime approval required?"}
89+
D7 -->|Yes| D8["Only this project waits; other lanes continue"]
90+
D7 -->|No| D9["Implement and test inside the repository"]
91+
D8 -->|Approved| D9
92+
D8 -.->|Declined| D15
93+
D9 --> D10{"Available return channel?"}
94+
D10 -->|Hook receipt, with optional wake| D11["Controller re-reads branch, HEAD, diff, tests, and contract; wake is not acceptance"]
95+
D10 -->|native-callback| D11
96+
D10 -->|foreground| D11
97+
D11 --> D12{"Result and evidence disposition?"}
98+
D12 -->|accepted success| D13["Record success, release the lease, and start the next FIFO item"]
99+
D12 -->|Eligible business or review failure| D14["Keep the lease and enter the bounded convergence flow below"]
100+
D12 -->|Cancelled, declined, or non-retryable blocked| D15
101+
```
102+
103+
The controller writes governance state only. Repository edits and tests remain in the exact project entry task; a callback or receipt only signals that evidence is ready to inspect.
104+
105+
### 3. Reuse evidence-backed experience and stop retry loops
106+
107+
```mermaid
108+
flowchart TD
109+
E1["Canonical goal logs and curated evidence-bound imports"] --> E2["ExperienceRead verifies the bounded experience index"]
110+
E2 --> E3["Match problem, strategy family, and material conditions"]
111+
E3 --> E4{"Prior verified outcome?"}
112+
E4 -->|accepted success| E5["Reuse the proven strategy, then recheck current readiness"]
113+
E4 -->|deterministic failure: reject the same mechanism| E6["Reserve the next allowed strategy"]
114+
E4 -->|No match or proved material change| E6
115+
E5 --> E7["Execute, test, and collect current evidence"]
116+
E6 --> E7
117+
E7 --> E8{"Reviewed outcome?"}
118+
E8 -->|accepted success| E9["Store reusable success in the bounded index and close the lane"]
119+
E8 -->|deterministic failure| E10["Store the hard failure in the bounded index"]
120+
E8 -->|Transient, environment, superseded, cancelled, or authorization result| E11["Audit only; do not blacklist; cancellation or declined authorization stops the lane"]
121+
E10 --> E12{"Which business attempt failed?"}
122+
E11 -.->|Eligible environment change or supersession| E12
123+
E12 -->|Initial| E13["Run one comprehensive repair"]
124+
E12 -->|Repair| E14["Run one whole-goal rebaseline"]
125+
E12 -->|Rebaseline| E15["convergence-failed: stop for a user decision"]
126+
E13 --> E2
127+
E14 --> E2
128+
```
129+
130+
This is evidence reuse, not automatic learning. A changed material condition needs direct canonical evidence; renaming a task, opening a new conversation, or changing an unproved hash cannot erase a known deterministic failure. Only a zero-repository-write transport, tool-bootstrap, or payload-parse failure may receive one same-attempt preflight replay.
131+
132+
### 4. Refresh a long-lived controller task set
133+
134+
```mermaid
135+
flowchart TD
136+
R1["Explicit reset request from an external coordinator"] --> R2{"Exact generated v3, task APIs, Node.js, single roots, and quiet state?"}
137+
R2 -->|No| R3["Block without changing or deleting tasks"]
138+
R2 -->|Yes| R4["Read-only Plan returns planHash"]
139+
R4 --> R5["Separately authorized Apply uses the exact planHash"]
140+
R5 --> R6["Re-read complete history, quiet state, and active work; prepare the runtime fence"]
141+
R6 --> R7["Create bootstrap-only standby tasks exactly once; projects first, controller last"]
142+
R7 --> R8["Read, sanitize, bound, and hash every old task history"]
143+
R8 --> R9["Archive old project tasks, then the old controller, with readback"]
144+
R9 --> R10{"Did archived history change?"}
145+
R10 -->|Yes| R11["Re-read and rebuild the complete final handoff"]
146+
R10 -->|No| R12["Persist and send the bounded handoff; verify standby acknowledgements"]
147+
R11 --> R12
148+
R12 --> R13["Atomically switch the whole task set; commit and read back runtime state"]
149+
R13 --> R14["Seal, recover, and unfreeze; retain the same heartbeat"]
150+
R14 --> R15["New tasks inherit canonical state; old tasks stay archived; coordinator archives last"]
151+
```
152+
153+
Apply is forward-only. An interruption keeps the set frozen and resumes the same operation; it never rolls back, deletes tasks, mutates canonical work records, or retries a task creation whose result is unknown.
154+
63155
## Quick start
64156

65157
### 1. Install
@@ -126,7 +218,6 @@ When a controller and its project entry tasks need fresh conversations, exact ge
126218
```text
127219
resetControllerTasks: true
128220
Action: Plan
129-
130221
# Review the returned planHash, then send the same request with:
131222
Action: Apply
132223
planHash: <returned planHash>
@@ -153,18 +244,10 @@ indexMode: full
153244

154245
The Skill clones only into a new child of `cloneRoot` and then returns `needs-project-add`. Save the exact clone as a Codex project and rerun the same request. The existing clone is reused only after its root, credential-free origin, and requested branch or ref are verified.
155246

156-
## How it works
157-
158-
1. Match each source to one exact saved project on the current host.
159-
2. Verify its task identity, root, Git baseline, dirty state, and `codebase-memory` index.
160-
3. Keep repository changes and tests in that repository's entry task.
161-
4. Use the optional controller only for shared contracts, sequencing, dispatch, and end-to-end acceptance.
162-
5. Validate returned branch, HEAD, diff, tests, contract impact, and remaining risk before accepting a result.
247+
## Boundaries
163248

164249
This is **workflow isolation**, not a security sandbox. It does not change filesystem permissions, and manually mixing repositories in one task can reintroduce context pollution.
165250

166-
Detailed queue, recovery, convergence, receipt, and controller-state contracts live in [the controller runtime reference](./references/controller-runtime.md), not in this project overview.
167-
168251
## Inputs
169252

170253
| Field | Required | Meaning |

README.zh-CN.md

Lines changed: 107 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88

99
开源仓库:[libaie/onboard-code-projects](https://github.com/libaie/onboard-code-projects)
1010

11-
onboard-code-projects 是 Windows-first 的 Codex Desktop 多仓库工作流隔离 Skill。
11+
`onboard-code-projects` 是减少 Codex Desktop 多仓库上下文污染的工作流隔离 Skill:为每个仓库建立独立、经过核验且可复用的项目任务和 `codebase-memory` 索引,并通过可选中控协调跨项目工作、沉淀并复用有证据支撑的成功与确定性失败经验
1212

1313
- **适用于:** 工作横跨两个及以上仓库。
1414
- **你会得到:** 绑定到精确根目录、经过核验的项目入口任务,每个仓库对应一个 `codebase-memory` 索引,以及负责跨项目协作的可选中控。
1515
- **它不会:** 创建或保存 Codex 项目,也不会代替用户授权或批准权限。
1616
- **它不是:** 安全沙箱,也不会部署软件。
1717

18-
它解决的核心问题是:多个仓库放在同一个长期会话里,会混淆项目指令、分支、权限、证据和修改范围。
19-
2018
> **状态:预览版。** 当前支持的发布面是 Windows 和 Codex Desktop,其他平台尚未完成发布级端到端验证。
2119
2220
## 它解决什么痛点
@@ -43,23 +41,117 @@ onboard-code-projects 是 Windows-first 的 Codex Desktop 多仓库工作流隔
4341

4442
## 你会得到什么
4543

46-
```mermaid
47-
flowchart LR
48-
U["用户"] --> A["项目 A 入口任务"]
49-
U --> B["项目 B 入口任务"]
50-
U -.->|可选的跨项目工作| C["中控"]
51-
C --> A
52-
C --> B
53-
A --> RA["仓库 A + 索引"]
54-
B --> RB["仓库 B + 索引"]
55-
```
56-
5744
- 每个 source:一个已核验的保存项目绑定、一个可复用的本地入口任务和一个 `codebase-memory` 索引。
5845
- 可选:位于所有业务仓库之外的一个中控目录和中控任务。
5946
- 可选:耐久结果回传需要插件 Stop Hook 与 Node.js;自动唤醒还需要额外的规则、worker 和自动化能力。
6047

6148
Skill 不能创建 Codex 已保存项目。用户需先在 Codex Desktop 中添加每个精确目录,Skill 再核验并使用该身份。
6249

50+
## 核心流程
51+
52+
下面四张图覆盖对用户可见的完整生命周期。精确 payload、哈希、reason code 和恢复命令仍放在[中控运行时参考](./references/controller-runtime.md)中。
53+
54+
### 1. 接入或复用每个仓库
55+
56+
```mermaid
57+
flowchart TD
58+
O1["本地路径或 Git URL"] --> O2["加载或确认已保存的索引模式,再解析输入并执行只读依赖预检"]
59+
O2 --> O3{"source 类型?"}
60+
O3 -->|本地目录| O7{"当前主机上是否存在唯一精确的已保存项目?"}
61+
O3 -->|Git URL| O4["只克隆到 cloneRoot 的新子目录"]
62+
O4 --> O5["返回 needs-project-add"]
63+
O5 --> O6["用户保存精确克隆目录后重跑"]
64+
O6 --> O7
65+
O7 -->|不存在或有歧义| O8["阻断并返回明确的下一步"]
66+
O7 -->|是| O9["读取 AGENTS,核验根目录、分支、HEAD 和脏工作区"]
67+
O9 --> O10["创建或复用一个项目绑定入口任务"]
68+
O10 --> O11["按所选模式建立或刷新 codebase-memory 索引"]
69+
O11 --> O12["核验索引根目录与版本"]
70+
O12 --> O13["仓库通道就绪,可直接工作"]
71+
O13 -.->|可选跨项目工作| O14["核验或初始化仓库外中控,并登记该入口"]
72+
O14 -.->|中控不可用或创建结果未知| O15["保持已就绪仓库;报告待登记状态,或根据权威证据恢复且不重试"]
73+
```
74+
75+
Codex 已保存项目仍由用户管理。Skill 不创建 projectless 任务或 worktree;可选中控必须位于所有业务仓库之外。
76+
77+
### 2. 协调、派发并验收跨项目工作
78+
79+
```mermaid
80+
flowchart TD
81+
D1["跨项目请求"] --> D2["四象限接收;冻结目标、契约、范围和验收标准"]
82+
D2 --> D3["按项目进入队列"]
83+
D3 -->|同一项目只运行一个活动任务并按 FIFO 排队| D4
84+
D3 -->|独立项目并行执行| D4
85+
D4["密封派发包,并按难度与风险选择模型等级"] --> D5["只发送给已核验的项目入口任务"]
86+
D5 -.->|超时或空返回| D15["只停止或挂起当前通道;禁止盲目重发或扩大授权"]
87+
D5 -->|已送达| D6["重读 AGENTS,核验根目录、基线和范围"]
88+
D6 --> D7{"需要运行时授权?"}
89+
D7 -->|是| D8["只等待当前项目,其他通道继续"]
90+
D7 -->|否| D9["在仓库内实现并测试"]
91+
D8 -->|已批准| D9
92+
D8 -.->|已拒绝| D15
93+
D9 --> D10{"当前可用的回传通道?"}
94+
D10 -->|Hook 回执,可选自动唤醒| D11["中控重读分支、HEAD、diff、测试和契约;唤醒不等于验收"]
95+
D10 -->|native-callback| D11
96+
D10 -->|foreground| D11
97+
D11 --> D12{"结果与证据应如何处置?"}
98+
D12 -->|已接受的成功| D13["记录成功、释放租约并启动下一个 FIFO 项"]
99+
D12 -->|符合条件的业务或评审失败| D14["保留租约并进入下方有界收敛流程"]
100+
D12 -->|已取消、拒绝授权或不可重试的阻断| D15
101+
```
102+
103+
中控只写治理状态。仓库修改和测试始终留在精确项目入口任务中;callback 或 receipt 只表示已有证据可供读取,不代表任务已通过验收。
104+
105+
### 3. 复用有证据支撑的经验并终止重试循环
106+
107+
```mermaid
108+
flowchart TD
109+
E1["规范 goal 日志与绑定证据的人工导入"] --> E2["ExperienceRead 核验有界经验索引"]
110+
E2 --> E3["匹配问题、策略族和关键前提"]
111+
E3 --> E4{"此前已核验结果?"}
112+
E4 -->|已接受的成功| E5["复用已证明策略,并重新核验当前 readiness"]
113+
E4 -->|确定性失败:拒绝相同机制| E6["预留下一个允许的策略"]
114+
E4 -->|无匹配或已证明关键前提变化| E6
115+
E5 --> E7["执行、测试并收集本次证据"]
116+
E6 --> E7
117+
E7 --> E8{"评审结果?"}
118+
E8 -->|已接受的成功| E9["把可复用成功写入有界索引并关闭通道"]
119+
E8 -->|确定性失败| E10["把硬失败写入有界索引"]
120+
E8 -->|瞬态、环境阻断、被取代、取消或授权结果| E11["只记审计,不拉黑;取消或拒绝授权会终止当前通道"]
121+
E10 --> E12{"失败发生在哪次业务尝试?"}
122+
E11 -.->|符合条件的环境变化或策略取代| E12
123+
E12 -->|初始尝试| E13["执行一次完整修复"]
124+
E12 -->|修复尝试| E14["执行一次全目标重新基线"]
125+
E12 -->|重新基线| E15["convergence-failed:停止并等待用户决策"]
126+
E13 --> E2
127+
E14 --> E2
128+
```
129+
130+
这是证据复用,不是自动学习。关键前提变化必须有直接规范证据;改任务名、新开会话或修改未经证明的哈希,都不能抹掉已知确定性失败。只有仓库零写入的 transport、tool-bootstrap 或 payload-parse 失败,才允许一次不消耗业务尝试的同 attempt 预检重放。
131+
132+
### 4. 刷新长期运行的中控任务组
133+
134+
```mermaid
135+
flowchart TD
136+
R1["由集合外 coordinator 显式请求重置"] --> R2{"精确生成的 v3、任务 API、Node.js、单根目录且状态静默?"}
137+
R2 -->|否| R3["不修改也不删除任务,安全阻断"]
138+
R2 -->|是| R4["只读 Plan 返回 planHash"]
139+
R4 --> R5["单独授权的 Apply 使用精确 planHash"]
140+
R5 --> R6["重读完整历史、静默状态与活动工作;准备运行时 fence"]
141+
R6 --> R7["仅创建一次 bootstrap 待命任务;项目在前,中控最后"]
142+
R7 --> R8["读取、脱敏、限长并哈希每个旧任务的完整历史"]
143+
R8 --> R9["先归档旧项目任务,再归档旧中控,并逐一回读"]
144+
R9 --> R10{"归档后的历史发生变化?"}
145+
R10 -->|是| R11["重新读取并重建完整最终交接"]
146+
R10 -->|否| R12["持久化并发送有界交接;核验待命任务确认"]
147+
R11 --> R12
148+
R12 --> R13["原子切换整组任务;提交并回读运行时状态"]
149+
R13 --> R14["封存、恢复并解冻;继续使用同一个 heartbeat"]
150+
R14 --> R15["新任务继承规范状态;旧任务保持归档;coordinator 最后归档"]
151+
```
152+
153+
Apply 是前向恢复流程。中断时保持冻结并继续同一 operation;不会回滚、删除任务、修改规范工作记录,也不会重试结果未知的任务创建。
154+
63155
## 快速开始
64156

65157
### 1. 安装
@@ -126,7 +218,6 @@ dispatchReturnMode: foreground
126218
```text
127219
resetControllerTasks: true
128220
Action: Plan
129-
130221
# 检查返回的 planHash,再使用相同请求发送:
131222
Action: Apply
132223
planHash: <返回的 planHash>
@@ -153,18 +244,10 @@ indexMode: full
153244

154245
Skill 只克隆到 `cloneRoot` 的新子目录,随后返回 `needs-project-add`。把精确克隆目录保存为 Codex 项目,再使用相同请求重跑。只有根目录、不含凭据的 origin 以及请求的 branch 或 ref 均通过核验时,才会复用既有克隆。
155246

156-
## 工作方式
157-
158-
1. 把每个 source 匹配到当前主机上的精确已保存项目。
159-
2. 核验任务身份、根目录、Git 基线、脏工作区和 `codebase-memory` 索引。
160-
3. 仓库内修改和测试始终留在该仓库的入口任务中。
161-
4. 可选中控只负责共享契约、依赖顺序、任务下发与全链路验收。
162-
5. 验收前核对项目返回的分支、HEAD、diff、测试、契约影响和剩余风险。
247+
## 能力边界
163248

164249
这是**工作流隔离(workflow isolation)**,不是安全沙箱。它不会改变文件系统权限;人为在一个任务中混合多个仓库时,上下文污染仍会回来。
165250

166-
队列、恢复、收敛、回执和中控状态等详细契约见[中控运行时参考](./references/controller-runtime.md),无需放在项目首页。
167-
168251
## 输入
169252

170253
| 字段 | 是否必需 | 含义 |

0 commit comments

Comments
 (0)