Skip to content

Delphi v3: Rust CLI, workspaces live in Delphi - #7

Draft
bracyw wants to merge 17 commits into
mainfrom
claude/delphi-diff-workspace-sync-obb5rq
Draft

bracyw wants to merge 17 commits into
mainfrom
claude/delphi-diff-workspace-sync-obb5rq

Conversation

@bracyw

@bracyw bracyw commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This replaces the bash CLI with a Rust CLI (cargo install --path .) and a new model: workspaces are folders inside Delphi, fully built out and committed on main. Spec: docs/design.md. Goals: docs/goals.md. Diagram: docs/delphi-flow.png, with its editable .drawio alongside.

  • Workspace folders: each lives at context/<scope>/workspaces/<name>/. Its workspace.yml lists links (a shared source mapped to a path in the folder), an optional instructions: list (used to generate CLAUDE.md), and repos. Every other file in the folder belongs to that workspace alone.
  • delphi sync: compares each shared file against main. A change on one side, whether the source or any linked copy, is written to the source and every copy. Two different edits to the same file are reported as a conflict. Sync runs on propose, CI checks it on every PR, and CI re-runs it on main after merges.
  • Checkouts: a sparse clone of just one folder on branch ws/<user>/<name>. Delphi's root files are never checked out.
  • Comparisons: all against main using plain git (diff, diff --upstream, refresh).
  • Commands, now one flat list: create, list, checkout, open, refresh, diff, propose, status, mv, sync, check, setup.
  • Removed:
    • v1/v2 machinery: the compile step, the lock file, the generated refs, line-level and per-file routing, .skill specs, copy entries, moves.tsv, layouts/.
    • The bash CLI.
  • Content migration:
    • argos-dev is now a workspace folder.
    • commit and to-tickets became shared skills that argos-dev links in.
    • pr-body.md is linked into both PR skills.

History on this branch

  1. Bash → Rust port that matched the bash behaviour, verified by tests comparing both.
  2. v2 (mapped workspaces): design, implementation, review, simplify.
  3. v3 (workspaces live in Delphi): design, implementation, a review that fixed six bugs, simplify.

Testing

  • cargo test: 23 end-to-end tests pass, run against a sandbox with a bare origin and a stubbed gh. They cover sync (fan-out in both directions, adding and deleting files in linked folders, conflicts, new links, generated CLAUDE.md, idempotence), checkout, refresh, diff, propose followed by merge and refresh in another workspace, status, create, list, mv, check, setup, offline use, and the CI sync script.
  • cargo clippy -D warnings, cargo fmt --check, and delphi check plus delphi sync --check on the real repo are all clean.

Notes for reviewers

  • Existing workspaces: recreate them with delphi checkout <name>.
  • CI: .github/workflows/delphi.yml. The PR job is read-only. The main-sync job has write access and commits as github-actions[bot].
  • Racing merges: if two merges race on main and leave copies different, the source's version wins.
  • Possible cuts (left in place for now): the numbered checkout picker, the --offline flag, the doubled push protection, and redundant meta fields.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Cargo crate at the repo root (binary: delphi, dep: anyhow). Same commands,
files, refs and outputs; still shells out to git and gh. Repo root comes from
DELPHI_ROOT, the current directory, or the path saved by 'delphi setup'.
Integration tests run bash and Rust on the same sandbox and compare outputs.
The bash CLI stays in place until the port is adopted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Every compiled file is a 1:1 copy of one source; layouts choose per entry
between sync (linked: refresh updates, propose sends back) and copy (yours
after the first copy), plus an optional assembled instruction file and the
layout's own files/. Adds 'workspace diff [--upstream]' and shared-source
tags. Removes line-level routing, .skill specs, MCP assembly, the
interactive layout picker, and the bash CLI. Migrates argos-dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Copies follow block moves; layout new and files/ dests go through path
checks; check validates moves.tsv paths; diff warns about uncommitted
edits. A file entry may now sit inside a directory entry's dest when the
directory's source has nothing there; argos-dev syncs whole skill folders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Shared git/capture/worktree helpers, typed lock rows and routing results,
smaller route/workspace functions, dead v1 leftovers removed. No behavior
changes covered by tests or the spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Workspace folders under context/<scope>/workspaces/<name>/ with
workspace.yml (instructions, links, repos), fully materialized on main.
'delphi sync' reconciles links per file against main; checkouts are
non-cone sparse clones of one folder on ws/<user>/<name>; flattened
commands (create, list, checkout, open, refresh, diff, propose, status,
mv, sync, check, setup); CI runs check + sync --check on PRs and syncs
main after merges. Removes compile, lock, generated refs, routing, copy
entries, moves.tsv, and layouts. Migrates argos-dev. Replaces the flow
diagram with the v3 version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Propose uses one merged base so reverts of shared edits propagate;
status 'ahead' counts only unpushed own commits; sync reads the owner
exec bit like git; workspace.yml can't be a link dest; link sources
can't contain workspace folders; CI splits a read-only check job from
the main-sync job and tolerates a moved main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Single fetch/commit/worktree helpers, typed provenance fields, one
dispatch table, named steps in checkout/propose/sync; mv no longer shells
out to date. CLAUDE.md module list and Cargo description match v3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
@bracyw bracyw changed the title Delphi v2: Rust CLI with mapped workspaces Delphi v3: Rust CLI, workspaces live in Delphi Sep 26, 2026
@bracyw
bracyw marked this pull request as draft September 26, 2026 18:26
Moves commit, to-tickets, and the base/workspace instruction parts under
software/application-software/argos; argos-dev links nothing outside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
blocks/docs/skills/settings entries are linked (<source> [-> <dest>]) with
per-key default dests; mcp fragments generate .mcp.json like instructions
generate CLAUDE.md. Replaces links:. check enforces each entry sits under
its key's directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
A skill folder may hold skill.yml (name, description, body: blocks);
delphi sync generates its SKILL.md, and a hand edit is a conflict.
argos-dev's open-pr/update-pr include their own block plus the shared
pr-body.md instead of linking the block into each skill folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
…routing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FaADA545v1Fw4im5hHFoTq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants