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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ All notable changes are documented here.

## Unreleased

- No unreleased changes.
- Fix project synchronization so selecting a project also selects its non-archived Codex tasks instead of producing a project with `No tasks` on the target device.
- Add project discovery, per-device portable project catalogs, target-side folder acceptance, Codex desktop registration, and explicit path-mapping commands.
- Make Windows/macOS project path mapping separator-aware and path-boundary-aware.

## 0.2.0 - 2026-07-12

Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

## 未发布

- 暂无未发布变更。
- 修复项目同步:选择项目时会一并选择其非归档 Codex 任务,避免目标设备只出现项目却显示 `No tasks`。
- 新增项目发现、每设备可移植项目目录、目标端文件夹接收、Codex 桌面注册与显式路径映射命令。
- Windows/macOS 项目路径映射现在可识别不同分隔符,并严格检查路径边界。

## 0.2.0 - 2026-07-12

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Sync2 adds that missing semantic layer:
- quarantine incomplete or divergent history instead of inventing a merge;
- synchronize personal skill collections with three-way hashes and preserved conflict copies;
- update local Codex indexes without copying another device's database.
- discover Codex Projects, select their tasks as a group, and map project roots across Windows and macOS.

## Quick start

Expand Down Expand Up @@ -77,7 +78,7 @@ Syncthing or private Git transports bytes. Sync2 decides which bytes are a safe
npm run check
```

The deterministic suite runs 65 checks across folder and Git transports, interrupted-event recovery, legacy abort repair, stable active checkpoints, conflict preservation, Windows extended paths, desktop catalog updates, maintenance mode, device reports, and skill reconciliation.
The deterministic suite runs 70 checks across folder and Git transports, project discovery and task selection, cross-platform project path mapping, interrupted-event recovery, legacy abort repair, stable active checkpoints, conflict preservation, Windows extended paths, desktop catalog updates, maintenance mode, device reports, and skill reconciliation.

GitHub Actions runs the same privacy gate and tests on Windows, macOS, and Linux with Node.js 22. The fixtures use isolated temporary Codex homes and synthetic conversations; they never read the user's real vault.

Expand All @@ -89,6 +90,7 @@ Included:
- portable task metadata;
- user-defined skill files;
- device selection events and health reports.
- per-device project catalogs and explicit source-to-local path mappings.

Excluded:

Expand Down
4 changes: 3 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Sync2 补上了这一层语义安全能力:
- 隔离不完整或分叉历史,而不是虚构合并结果;
- 通过三方哈希同步个人 Skill,并保留冲突副本;
- 更新本地 Codex 索引,而不是复制其他设备的数据库。
- 发现 Codex Projects、按项目批量选择任务,并映射 Windows 与 macOS 的不同项目路径。

## 快速开始

Expand Down Expand Up @@ -77,7 +78,7 @@ Syncthing 或私有 Git 负责传输字节;Sync2 负责判断哪些字节构
npm run check
```

确定性测试套件包含 65 项检查,覆盖文件夹与 Git 传输、中断事件恢复、旧式 abort 修复、活动回合稳定检查点、冲突保留、Windows 扩展路径、桌面目录更新、维护模式、设备报告和 Skill 同步。
确定性测试套件包含 70 项检查,覆盖文件夹与 Git 传输、项目发现与任务选择、跨平台项目路径映射、中断事件恢复、旧式 abort 修复、活动回合稳定检查点、冲突保留、Windows 扩展路径、桌面目录更新、维护模式、设备报告和 Skill 同步。

GitHub Actions 在 Windows、macOS 和 Linux 的 Node.js 22 环境中运行同一套隐私 gate 与测试。测试使用隔离的临时 Codex home 和合成会话,不读取用户的真实 vault。

Expand All @@ -89,6 +90,7 @@ GitHub Actions 在 Windows、macOS 和 Linux 的 Node.js 22 环境中运行同
- 可移植任务元数据;
- 用户自定义 Skill 文件;
- 设备选择事件与健康报告。
- 每设备项目目录与显式的源路径到本地路径映射。

排除:

Expand Down
17 changes: 10 additions & 7 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Map requests as follows:
- `/sync2 project current` -> run `project add current` from the project root
- `/sync2 project <path>` -> `project add <path>`
- `/sync2 projects` -> `project list`
- `/sync2 project discover` -> `project discover` to list Codex Projects and their local tasks
- `/sync2 devices` -> `device list`

Always quote paths. Use `--config <path>` when operating a test or non-default profile.
Expand All @@ -54,13 +55,15 @@ Never initialize a public Git repository for conversation data. Explain that vau
Manage project folders through the background CLI/API; do not open the Syncthing UI unless the user explicitly asks for visible inspection.

1. Run `syncthing configure --syncthing-exe <path>` once when automatic detection fails.
2. From a newly created project root, run `project add current`. The command creates one independent Syncthing folder entry pointing directly at that project; it never copies the project into another Syncthing directory.
3. Share with all paired remote devices by default. Use `--share-with <device-name-or-id>` or `--share-with none` for a narrower set. Add repeated `--ignore <Syncthing-pattern>` arguments when generated caches or large local-only paths must stay out.
4. Reject parent/child overlap with an existing Syncthing folder. Keep each selected project and the Sync2 conversation vault as sibling, independent folder entries.
5. Verify with `project status <folder-id>` and use `project rescan <folder-id>` only when the filesystem watcher has not noticed a change.
6. Run `project add` on one originating device only. On other devices, accept the Syncthing folder offer and choose the corresponding local path; do not independently generate a second folder ID.
7. Pair a new machine with `syncthing add-device --device-id <ID> --name <name>`. Projects registered with the default `sharePolicy=all` are shared to newly paired remote devices by the next scheduled `sync` run.
8. Use `device report` on a newly bootstrapped machine. Scheduled sync also publishes a content-stable device report so another device can verify local conversation indexes, skill counts, and daemon installation without copying terminal output.
2. Run `project discover` to show the project roots currently known to the Codex desktop app and the non-archived local tasks whose `cwd` belongs to each root.
3. From an originating project root, run `project add current`. The command creates one independent Syncthing folder entry pointing directly at that project and selects every non-archived Codex task under that root. It never copies the project into another Syncthing directory. Use `--no-tasks` only when project files should be shared without task history.
4. Share with all paired remote devices by default. Use `--share-with <device-name-or-id>` or `--share-with none` for a narrower set. Add repeated `--ignore <Syncthing-pattern>` arguments when generated caches or large local-only paths must stay out.
5. Reject parent/child overlap with an existing Syncthing folder. Keep each selected project and the Sync2 conversation vault as sibling, independent folder entries.
6. Run `sync` on the source so `.sync2/project-catalogs/<device>.json` advertises the portable folder ID, source path, and selected tasks.
7. On a target device run `project catalogs`, then `project accept <folder-id> --path <local-path>`. This preserves the source folder ID, adds a source-to-local path map, and registers the local root in Codex via its supported `codex://new?path=...` deep link. Use `--no-register` only when UI registration is intentionally deferred. Do not independently generate a second folder ID.
8. Verify with `project status <folder-id>` and use `project rescan <folder-id>` only when the filesystem watcher has not noticed a change. If only task selection needs repair, run `project tasks <path>`; if only paths need repair, run `project map --from <source-path> --to <local-path>`.
9. Pair a new machine with `syncthing add-device --device-id <ID> --name <name>`. Projects registered with the default `sharePolicy=all` are shared to newly paired remote devices by the next scheduled `sync` run.
10. Use `device report` on a newly bootstrapped machine. Scheduled sync also publishes a content-stable device report so another device can verify local conversation indexes, project catalogs, skill counts, and daemon installation without copying terminal output.

## Safety behavior

Expand Down
4 changes: 3 additions & 1 deletion references/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ Conversation/skill vault synchronization works whenever an external tool keeps t

The executable is required for `project`, `syncthing add-device`, rescan, and automatic project sharing. Store its device-specific executable path only in local config.

Register each project as a sibling independent Syncthing folder pointing at its real path. Reject parent/child overlaps. Generate the folder ID once on the originating device; other devices accept the offered ID and choose local paths.
Register each project as a sibling independent Syncthing folder pointing at its real path. Reject parent/child overlaps. Generate the folder ID once on the originating device; other devices accept the advertised ID and choose local paths.

Project selection is also a conversation-selection boundary: `project add` selects each non-archived local thread whose `cwd` is the project root or a descendant. Per-device files under `.sync2/project-catalogs/` advertise the portable folder ID, local source path, Syncthing device ID, and task list without creating a shared mutable manifest. A target acceptance records an explicit source-to-local path map before importing tasks and registers the local root with Codex. Path matching is separator-aware and boundary-aware so `F:\Projects\MUON` maps safely to `/Volumes/Lab/MUON` without also matching a sibling such as `MUON-old`.

Transport-level `.sync-conflict-*` files indicate Syncthing observed concurrent changes outside a single reconciled view. Preserve them and resolve manually before resuming automatic sync.

Expand Down
21 changes: 19 additions & 2 deletions references/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Use `$sync2` for native Codex skill invocation. `/sync2` is a conversational ali
| `$sync2 audit <task>` | Check JSONL syntax, tool-call/output pairs, turn closure, and local index agreement. |
| `$sync2 repair <task>` | Back up and repair interrupted tool events and stale older turns without inventing output. |
| `$sync2 auto` | Install or refresh the local automatic task. |
| `$sync2 project current` | Register the current project as an independent Syncthing folder. |
| `$sync2 project discover` | List Codex desktop projects and the local tasks grouped under each root. |
| `$sync2 project current` | Register the current project and select every non-archived task under it. |
| `$sync2 projects` | List project folder IDs and their real local paths. |

## Daily workflows
Expand Down Expand Up @@ -60,13 +61,29 @@ Use stable collection names across devices. Keep incompatible agent ecosystems i

### Register a project

First inspect the roots and task grouping known to Codex:

```text
node <skill-dir>/scripts/sync2.mjs project discover
```

Run this once on the originating device from the actual project root:

```text
$sync2 project current
```

Accept the resulting Syncthing folder offer on other devices and choose each device's desired local checkout path. Do not independently create a second folder ID for the same project.
`project add` also selects every non-archived task whose `cwd` belongs to the project root. Run `sync` so the portable project catalog and those stable task histories reach the vault.

On another device, inspect and accept the advertised folder ID:

```text
node <skill-dir>/scripts/sync2.mjs project catalogs
node <skill-dir>/scripts/sync2.mjs project accept <folder-id> --path "<local-project-path>"
node <skill-dir>/scripts/sync2.mjs sync
```

`project accept` preserves the source Syncthing folder ID, maps the source path to the target path for imported task metadata, and registers the local root in the Codex desktop Projects list. Do not independently create a second folder ID for the same project.

### Verify health

Expand Down
Loading
Loading