Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
workspaces: "./src-tauri -> target"
shared-key: "ci-macos"

- name: Stage org2-pm sidecar
run: node scripts/tauri/prepare-sidecars.cjs --profile debug

# Clippy runs the full compiler front-end, so it subsumes `cargo check`.
# Check every target and reject new warnings now that the workspace
# baseline is clean.
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ jobs:
run: python3 scripts/tools/download_sidecars.py

# ── Build Tauri app (sign + notarize + updater artifacts) ─
- name: Stage org2-pm sidecar
run: node scripts/tauri/prepare-sidecars.cjs --profile release --target aarch64-apple-darwin

- name: Build ORGII
env:
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
Expand Down Expand Up @@ -306,6 +309,9 @@ jobs:
shared-key: "release-windows-x64"

# ── Build Tauri app ──────────────────────────────────────────
- name: Stage org2-pm sidecar
run: node scripts/tauri/prepare-sidecars.cjs --profile release --target x86_64-pc-windows-msvc

- name: Build ORGII
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
Expand Down Expand Up @@ -517,6 +523,9 @@ jobs:
shared-key: "release-linux-x64"

# ── Build Tauri app ──────────────────────────────────────────
- name: Stage org2-pm sidecar
run: node scripts/tauri/prepare-sidecars.cjs --profile release --target x86_64-unknown-linux-gnu

- name: Build ORGII
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ subagent_history.json
*_subagent_history.json

# Downloaded / locally built sidecar binaries
src-tauri/binaries/
src-tauri/bin/agent-browser-*
src-tauri/bin/peekaboo*
src-tauri/bin/qdrant-*
Expand Down
37 changes: 37 additions & 0 deletions docs/orgtrack-pm-protocol/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,40 @@ seq INTEGER NOT NULL)`;
- 云端 `orgii_acquire_work_item_lock` 保持为 human 协作**编辑锁**:编辑锁 ≠
工作 claim,两者并存但互不代理;Phase 2a 落地时在 service 层写清依赖关系
(持有编辑锁不阻止 claim,claim 不授予编辑权)。

## 修订记录

### 2026-08-07 — S0 conformance 收敛(PR #737)

- `execution-context.schema.json`:`scopeId` 与 `actor` 增加 null 分支——未初始化 workspace 下的裸 `org2 context` 输出 null 是合法状态,schema 此前与实现矛盾(实现自 Phase 3 起即输出 null)。
- 错误 fixture 文案与实现对齐(byte-golden 前置):`actor-required`(补 `<kind:id>` 格式提示)、`idempotency-conflict`(去尾词 "body")、`invalid-transition`(统一为信封映射的通用句式)、`project-mode-required`("WorkItem mutation" → "WorkItem/Routine mutation")。
- claim 竞争的第二分支(active linked session)修正为 `ALREADY_CLAIMED`(此前误落 `STORE_UNAVAILABLE`,违反 §3 的 claim 竞争优先规则)。
- `ALREADY_EXISTS` 获得生产者:`work.create` 全局存在性守卫(跨 scope 短 ID 碰撞从静默覆盖改为结构化拒绝)。

### 2026-08-07 — S1 载荷形态裁决(PR #737)

- `work.*` 成功载荷本轮**维持存储形态**(`frontmatter` + `portableState` + `revision`)。阻塞:`work-item.schema.json` 的 `id` 要求 `^work_[A-Za-z0-9]+$` 持久 id,而存储沿用 `id = short_id`(如 `AAA-0001`);在 id 方案迁移落地前切换会产出无法通过自身 schema 的载荷。schema 与 6 个 success fixture 明确标记为 **id 迁移后的目标形态**,`commands.rs` 头部 residual 注记为唯一真相点的状态就此解除——真相点移至本条。
- 分页(`--cursor`/`meta.nextCursor`)、portable `--status` 词表、`work assign/release`、`org2 project` 命令族(无 delete)已实装并入 conformance 覆盖。

### 2026-08-07 — PM Case CLI 载体裁决(用户拍板)

修订 §4/§9 的"本轮无 PM CLI"条目:**PM Case 的 agent 载体从出生即 CLI**。`org2 pm` 命令族携独立版本 `org2/pm/v1` contract,与 PM Case 实现同期落地(不提前、不做类型化工具例外)。

理由:agent 平面已统一走 `org2-pm`(见 agent-cli-unification-design.md §5.6);PM 工具若做唯一类型化例外会破坏"agent 可见面 = CLI 面"等式,且 conformance 是必修课,早接比晚接便宜。

约束:

- `org2 pm` 落地时必须同步 schemas、fixtures、权限矩阵、入口一致性测试,且**不得静默改变 `orgtrack/v1`**(独立版本命名空间)。
- 不向 agent 暴露的动词永不进 CLI 面:`commit-confirmed-graph`、`promote-standalone-to-project` 只存在于用户确认 handler 内部。
- 本条不改变本轮范围——本轮仍不实现 PM Case,故 `org2 pm` 仍未落地;改变的只是"未来它以何种形态出现"从未决转为已定。

### 2026-08-07 — S4 类型化工具退役执行(PR #737)

`manage_work_item` / `manage_project` 从工具面删除(impl、注册、编排 fresh-registry 分支、builtin 表项、能力种子)。agent 平面唯一入口自此为 `org2-pm`;product_mode 的 deny-delta 工具层(`product_mode_layer`/`with_modes`)随之退役——门控收敛到 CLI 的 application boundary(`ORGII_MODE` + `require_project_mode`)。

配套裁决:

- 工具名进入 `SUBAGENT_RETIRED_TOOL_ALIASES` 防御旧 checkpoint;常量保留用于历史转录渲染(前端渲染路径不删,先例同 `manage_story`)。
- standalone(无项目)工作项获得 CLI 面:`work show/update/create --standalone`,org 上下文经 `ORGII_ORG` env 与 session marker `org` 字段注入;`--schedule-cron`/`--schedule-at` 补齐周期任务能力。
- 子代理 CLI 身份解析到**顶层祖先 session**(workspace marker 绑定所有者,env 必须与之一致,否则共享 workspace 的 worker 全部被拒为冒充);子代理 session record 继承父 `product_mode`。
- `debug_session_execute_tool` 收窄为 `read_file`;两条经 debug hook 驱动类型化工具的 e2e 场景删除(agent 平面覆盖由 `orgtrack-pm-cli` 跨进程 e2e 承接)。
46 changes: 46 additions & 0 deletions docs/orgtrack-pm-protocol/dual-instance-s4-2026-08-07.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 双机实测 — S4 工具退役(PR #737,2026-08-07)

双机协议(`.orgii/skills/dual-instance-verification/SKILL.md`)对 S4(typed 工具删除 → org2-pm CLI 唯一 agent 入口)的实测记录。发送端 instance-1 = 本分支 debug 构建(webdriver feature,真实 `~/.orgii`),接收端 instance-2 = 旧构建(ORGII-instance2,未动)。

## Cell 结果

| Cell | 内容 | 结果 |
| ---- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A | filler-via-CLI:真实 Create-with-AI 渲染 UI + deepseek-v4-flash 真 LLM 轮次(wdio,隔离 live home) | **GREEN**(13.3s)。transcript:`work show --standalone` → `work update --title … --body …` → `work show` 复核,exit code 全 0;store 标题/正文逐字一致;audit `work.create → work.patch(app) → work.patch:agent:os`;会话行 `org=bfa7b134 / build / project` |
| B | 双机 collab 同步:CLI 跨进程写共享 org "CU New Target 0720" | **GREEN**。`WI-0013` CLI create+update → workitems 落库 → outbox 行 → watermark(2s poller) → `orgii-data-changed` → forceProjects → 云 `cloud_work_items` 行(rev2 标题,两次写合并推送)→ instance-2 拉取到本地。JWT 过期一度阻塞(GoTrue 多 client 竞态,自愈);两端窗口失焦时按 minimize-aware 设计不推/不拉,置前后立即走通 |
| C | 子代理 root-walk:真实 `builtin:general` delegation 跑 `org2-pm context` | **GREEN**。envelope `sessionRef = 顶层父会话`,exit 0。C-lite 三姿势(身份匹配 / 子会话 env 冒充 / human 冒充)分别 OK / PERMISSION_DENIED / PERMISSION_DENIED |
| D | 舰队账本(cloud_sessions 全量 1365→1368 行) | boot-1 出现 bfa7b134 org 全量 claudecodeapp epoch+1 波 + 2 行 `deleted_at→None` 复活;**boot-2 确定性 cell:0 增删、0 epoch 变**,仅本会话转录与一个活跃 codex 会话单调增长 → 定性为升级重锚定(旧 0829a9b 构建 → develop+737 序列化差异)恰好一次收敛 |
| E | 破坏性动词审计(两实例日志,boot 窗口) | 干净:仅 disabled-tool 跳过日志与临时 scratchpad housekeeping 两条良性命中 |

## 实测挖出并已修(全部进 #737)

1. **Ask/Plan 拒 shell → filler 填不了**:agent 连搜 15 次 `run_shell` 后放弃("能动 WorkItem⟺有 shell" 未决假设第一次爆雷)。修:filler 与 Create-Project-with-AI 启动 pin `agentExecMode:"build"`(`97f67fa3e`)
2. **filler 会话不带 org → ORGII_ORG 不注入 → org-standalone 草稿 CLI 找不到**。修:launch 顶层带 `orgId`(同上)
3. **standalone 分配器按 org 计数 vs id 全局主键**:真实 home 上 `WI-0001` 跨 org 碰撞被 S0 create 守卫拦下(旧代码是静默覆盖他 org 条目)。修:分配器跳过全局占用 id(`202185e6a`)
4. **standalone patch 审计 actor 为空**。修:actor 线穿 `update_standalone_work_item_atomic_by`(`09a8e8b9a`)
5. e2e spec 三处修复(Harry launchpad 改版死 selector / org-aware 扫描 + 抖动稳定 / `readProjectOrgs` helper 注册)(`97f67fa3e` + `835d6cf19`)

## 追加发现(2026-08-07 晚,用户真机·bundled 构建)

**P0 — bundle 不带 org2-pm**:`externalBin: []`,.app 只装主二进制;PATH prepend 指向 exe 目录但 CLI 不存在 → 打包构建里 agent 对工作系统零入口(S4 后无 typed 工具兜底)。实测全绿是因为 debug 裸跑恰好同目录。修复:org2-pm 进 `externalBin` sidecar(版本锁定,与"首启下载"类 sidecar 政策区分开),prepare-sidecars.cjs 接入 tauri:dev/tauri:build/fast-build/release CI 三平台;fast-build 复验 bundle 内 `Contents/MacOS/org2-pm context` 出合法 envelope。

## OPEN(非本 PR,已记录/挂单)

- **session memory side query 钉死 claude-haiku-4.5**:账号无此 model 时提取失败并弹 toast → 已挂单(fallback 到账号可用 model)
- **`gemini_cli` 缺席 `CliAgentTypeSchema`**:sidebar 翻页含 6 月 gemini_cli 会话行时 RPC output validation 失败 → 已挂后台任务修
- **云端删除后本地无 tombstone → 升级重推复活**:boot-1 将当日 16:49Z 云端删除的 2 行 `deleted_at` 复活(机制=本地行仍在、full re-push 重断言;已知"无 tombstone 不可证伪缺席"类;非 737 触发,737 窗口内仅因升级重锚定显形)
- **Projects-channel JWT 过期恢复慢**:多 GoTrueClient 告警 + 过期后至多约一个刷新周期不推;自愈但值得并入 token 单一持有者清理
- UNCOVERED:S3 envelope 卡片的渲染态视觉断言(store/transcript 已证,视觉未截图);`--schedule-cron` 真机排程触发未跑

## Sub-item 与 Discussion 实测(2026-08-07 深夜,真机·真 Opus)

围绕 sub-item 与 Discussion 机制(`--parent`/`--stage`、"Post exactly ONE comment per run"、turn-end fallback、mention 副作用纪律)落地并实测三轮:

- **机械面**:`work create --parent` / `work note --standalone` / `work list --standalone` 补齐(cli_e2e 覆盖 parent 链接与 note 落 comments)
- **纪律面**:CLI brief 恢复拆分判据("more than one independently completable step")+ 恰好一条回执(outcome 不 process)+ blocked 转移;linked-work-item context 增 ⚠️ 交付强制块("Chat replies are conversation, not delivery")
- **实测轮次**:WI-0016(无强制块)=agent 全量产出丢聊天、零 CLI 调用 → 强制块后 WI-0017=body 填 381 字 + 恰好一条 `[progress]` 回执(Discussion UI 渲染验证);WI-0018=**自主拆 3 子项**(WI-0019/20/21 各 600-900 字内容,audit 8 条全带 agent:os)+ 父项闭环总览 + 恰好一条回执
- **Gap(挂单)**:详情页无 Sub-items 区块,parent 关系仅在库中,agent 只能在父 body 手写引用

## 探针清理

`WI-0013` 已在云端打 tombstone(v2, deleted_at 2026-08-07T20:50:30Z),两实例经拉取收敛删除(见任务日志)。隔离 e2e home 与 wdio shard homes 为一次性沙箱已删。真机演示数据 `WI-0015`(rail 探针)与 `WI-0017`~`WI-0021`(纪律探针,bfa7b134 org)留作用户查看,自行处置。
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"ok": false,
"error": {
"code": "ACTOR_REQUIRED",
"message": "No actor resolved: pass --actor or set ORGII_ACTOR (actors are never inferred from OS username or git owner)",
"message": "No actor resolved: pass --actor <kind:id> or set ORGII_ACTOR (actors are never inferred from OS username or git owner)",
"retryable": false,
"details": {
"missing": ["actor"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"ok": false,
"error": {
"code": "IDEMPOTENCY_CONFLICT",
"message": "Idempotency key 'session_abc:complete' was already used with a different canonical request body",
"message": "Idempotency key 'session_abc:complete' was already used with a different canonical request",
"retryable": false,
"details": {
"idempotencyKey": "session_abc:complete",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"ok": false,
"error": {
"code": "INVALID_TRANSITION",
"message": "completed -> in_progress is not allowed; in_progress is only entered via work.claim or blocked -> in_progress",
"message": "completed -> in_progress is not an allowed transition",
"retryable": false,
"details": {
"from": "completed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"ok": false,
"error": {
"code": "PROJECT_MODE_REQUIRED",
"message": "work.claim is a WorkItem mutation; current mode is 'build'. Switch the session to Project mode or pass --mode project",
"message": "work.claim is a WorkItem/Routine mutation; current mode is 'build'. Switch the session to Project mode or pass --mode project",
"retryable": false,
"details": {
"operation": "work.claim",
Expand Down
16 changes: 8 additions & 8 deletions docs/orgtrack-pm-protocol/parity-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
每个入口必须经过同一 Context resolver 与同一 application command 层。空格 =
未落地;落地 phase 在括号内标注后打 ✓;任何长期空格需要书面理由。

| entry point | context resolver | actor 解析 | auth/capability 交集 | idempotency | OCC (expected-revision) | audit event | outbox | pm_change_seq bump |
| ----------------- | ---------------- | ---------- | -------------------- | ----------- | ----------------------- | ----------- | ------ | ------------------ |
| CLI (`org2-pm`) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) |
| Tauri commands | (P2a) | (P2a) | (P2a) | (P2a) | (P2a) | (P2a) | (P2a) | (P2a) |
| Routine scheduler | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) |
| Provider adapter | (P6) | (P6) | (P6) | (P6) | (P6) | (P6) | (P6) | (P6) |
| hooks | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) |
| tests/E2E helpers | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) |
| entry point | context resolver | actor 解析 | auth/capability 交集 | idempotency | OCC (expected-revision) | audit event | outbox | pm_change_seq bump |
| ----------------- | ---------------- | ---------- | -------------------- | ------------------------------------- | ----------------------- | ---------------------------------------------------- | ------ | ------------------ |
| CLI (`org2-pm`) | (P3) | (P3) | (P3) | (P3) ✓ create/claim/transition/invoke | (P3) ✓ claim/transition | (P3) | (P3) | (P3) |
| Tauri commands | (P2a) | (P2a) | (P2a) | (P2a) | (P2a) | (P2a) ✓ create/patch/transition/delete/restore/write | (P2a) | (P2a) ✓ |
| Routine scheduler | (P5) | (P5) | (P5) | (P5) ✓ plan-time invoke key | (P5) | (P5) ✓ invoke/suppressed_fire | (P5) | (P5) |
| Provider adapter | (P6) | (P6) | (P6) | (P6) | (P6) | (P6) | (P6) | (P6) |
| hooks | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) | (P5) |
| tests/E2E helpers | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) | (P3) |

规则:

Expand Down
Loading
Loading