Reconcile Codex Sidebars
Reconcile the shared Codex task catalogue with Desktop's local project metadata,
then migrate that reviewed grouping into synchronized App Server projects.
Keep every live operation read-only until the user has reviewed the proposed
archives, assignments, projects, sections, and ordering.
Workflow
- Read contracts.md and confirm that the installed
Codex contracts still match. Stop before mutation if they differ.
- Run
scripts/reconcile.py inventory. Save detailed output only in an ignored
private directory.
- Read unmatched thread context through supported App Server
thread/read
calls. Classify durable, intentionally projectless, duplicate, and completed
coordinator/worker threads. Never infer throwaway status from age alone.
- Present exact proposed archives and destinations. Archive only after explicit
approval, using App Server
thread/archive; verify each thread is recoverable
with an archived thread/list query.
- Create a private JSON spec from
references/spec.example.json. Prefer thread
IDs for explicit rules; use title plus cwd only when the ID is unavailable.
- Run
build-plan, then audit-plan. Require zero missing, zero overlap, zero
invalid projects, and alphabetical project/per-project thread orders.
- Show the user the counts and named project changes without exposing private
IDs. Obtain approval to apply and restart Desktop.
- On macOS, run
arm-macos-restart; ask the user to quit Codex normally. The
one-shot writes a backup, rejects stale state, atomically applies the plan,
verifies it, and relaunches Codex. Never edit state while Desktop runs.
If the user changes direction before quitting, run disarm-macos-restart.
- After relaunch, run
check-macos-restart and verify-state. Follow
recovery.md if a check fails.
- Run
scripts/sync_projects.py build-plan into the ignored private
directory. Confirm every local project maps to one App Server project,
every active task is classified, and the proposed project order is
alphabetical.
- Run
sync_projects.py apply-plan. It updates membership through
thread/metadata/update, orders projects through project/move, rolls back
partial assignment writes on failure, and verifies the server result.
- Run
sync_projects.py verify, inspect Desktop, then ask the user to refresh
and confirm iPhone Remote. App Server verification proves the shared project
state; only the user can prove the final mobile rendering.
For later reconciliation runs, preserve Pinned as an overlay, ignore tasks
that have since been archived, and adopt reviewed tasks already placed in a
project-named synchronized section as App Server project assignments when
Desktop's local project metadata has not yet caught up. New unsectioned tasks
still require classification.
Commands
Run python3 scripts/reconcile.py --help for all options. Typical private flow:
python3 scripts/reconcile.py inventory --output /private/inventory.json
python3 scripts/reconcile.py build-plan \
--spec /private/spec.json --output /private/plan.json
python3 scripts/reconcile.py audit-plan --plan /private/plan.json
python3 scripts/reconcile.py arm-macos-restart --plan /private/plan.json
python3 scripts/sync_projects.py build-plan \
--output /private/project-plan.json
python3 scripts/sync_projects.py apply-plan \
--plan /private/project-plan.json \
--receipt /private/project-receipt.json
python3 scripts/sync_projects.py verify \
--plan /private/project-plan.json
Use --threads-json only for synthetic tests or an intentional offline audit.
Never commit inventory, spec, plan, receipt, backup, or transcript data.
Safety invariants
- Use App Server for thread listing, reading, archive, and restore operations.
- Treat Desktop project assignments and ordering as versioned local state.
- Treat App Server projects and
Thread.projectId as the synchronized
cross-client grouping. Custom thread sections are optional presentation and
must not be represented as project synchronization.
- Sort App Server projects with
project/move; keep Desktop's local project
order aligned for the legacy presentation layer.
- Refuse direct Desktop JSON mutation while Desktop is running. Apply
synchronized project membership only through App Server methods.
- Refuse stale plans and plans with unmatched or ambiguous active threads.
- Back up before replacement; write and fsync a temporary file; replace
atomically; verify only owned sidebar fields after relaunch.
- Preserve explicitly projectless threads and archived assignments unless the
user explicitly changes them.
- Do not move or rename workspaces merely because a sidebar assignment changes.
- Keep Remote verification distinct from Desktop metadata verification.
1---2name: reconcile-codex-sidebars3description: Audit and safely reconcile Codex Desktop projects and threads with the catalogue used by Codex Remote on iPhone. Use when Desktop and Remote show different thread groupings, projects or threads appear missing, project assignments need repair, throwaway threads need recoverable archival, or the Desktop project and per-project thread order should be alphabetical.4---56# Reconcile Codex Sidebars78Reconcile the shared Codex task catalogue with Desktop's local project metadata,9then migrate that reviewed grouping into synchronized App Server projects.10Keep every live operation read-only until the user has reviewed the proposed11archives, assignments, projects, sections, and ordering.1213## Workflow14151. Read [contracts.md](references/contracts.md) and confirm that the installed16 Codex contracts still match. Stop before mutation if they differ.172. Run `scripts/reconcile.py inventory`. Save detailed output only in an ignored18 private directory.193. Read unmatched thread context through supported App Server `thread/read`20 calls. Classify durable, intentionally projectless, duplicate, and completed21 coordinator/worker threads. Never infer throwaway status from age alone.224. Present exact proposed archives and destinations. Archive only after explicit23 approval, using App Server `thread/archive`; verify each thread is recoverable24 with an archived `thread/list` query.255. Create a private JSON spec from `references/spec.example.json`. Prefer thread26 IDs for explicit rules; use title plus cwd only when the ID is unavailable.276. Run `build-plan`, then `audit-plan`. Require zero missing, zero overlap, zero28 invalid projects, and alphabetical project/per-project thread orders.297. Show the user the counts and named project changes without exposing private30 IDs. Obtain approval to apply and restart Desktop.318. On macOS, run `arm-macos-restart`; ask the user to quit Codex normally. The32 one-shot writes a backup, rejects stale state, atomically applies the plan,33 verifies it, and relaunches Codex. Never edit state while Desktop runs.34 If the user changes direction before quitting, run `disarm-macos-restart`.359. After relaunch, run `check-macos-restart` and `verify-state`. Follow36 [recovery.md](references/recovery.md) if a check fails.3710. Run `scripts/sync_projects.py build-plan` into the ignored private38 directory. Confirm every local project maps to one App Server project,39 every active task is classified, and the proposed project order is40 alphabetical.4111. Run `sync_projects.py apply-plan`. It updates membership through42 `thread/metadata/update`, orders projects through `project/move`, rolls back43 partial assignment writes on failure, and verifies the server result.4412. Run `sync_projects.py verify`, inspect Desktop, then ask the user to refresh45 and confirm iPhone Remote. App Server verification proves the shared project46 state; only the user can prove the final mobile rendering.4748For later reconciliation runs, preserve `Pinned` as an overlay, ignore tasks49that have since been archived, and adopt reviewed tasks already placed in a50project-named synchronized section as App Server project assignments when51Desktop's local project metadata has not yet caught up. New unsectioned tasks52still require classification.5354## Commands5556Run `python3 scripts/reconcile.py --help` for all options. Typical private flow:5758```bash59python3 scripts/reconcile.py inventory --output /private/inventory.json60python3 scripts/reconcile.py build-plan \61 --spec /private/spec.json --output /private/plan.json62python3 scripts/reconcile.py audit-plan --plan /private/plan.json63python3 scripts/reconcile.py arm-macos-restart --plan /private/plan.json64python3 scripts/sync_projects.py build-plan \65 --output /private/project-plan.json66python3 scripts/sync_projects.py apply-plan \67 --plan /private/project-plan.json \68 --receipt /private/project-receipt.json69python3 scripts/sync_projects.py verify \70 --plan /private/project-plan.json71```7273Use `--threads-json` only for synthetic tests or an intentional offline audit.74Never commit inventory, spec, plan, receipt, backup, or transcript data.7576## Safety invariants7778- Use App Server for thread listing, reading, archive, and restore operations.79- Treat Desktop project assignments and ordering as versioned local state.80- Treat App Server projects and `Thread.projectId` as the synchronized81 cross-client grouping. Custom thread sections are optional presentation and82 must not be represented as project synchronization.83- Sort App Server projects with `project/move`; keep Desktop's local project84 order aligned for the legacy presentation layer.85- Refuse direct Desktop JSON mutation while Desktop is running. Apply86 synchronized project membership only through App Server methods.87- Refuse stale plans and plans with unmatched or ambiguous active threads.88- Back up before replacement; write and fsync a temporary file; replace89 atomically; verify only owned sidebar fields after relaunch.90- Preserve explicitly projectless threads and archived assignments unless the91 user explicitly changes them.92- Do not move or rename workspaces merely because a sidebar assignment changes.93- Keep Remote verification distinct from Desktop metadata verification.