Skip to content

feat(core-link): carry a Core-validated path so a Project can be moved after it is created #104

Description

@qcentic-dev

Split out of #98 / PR #103, which closed the half-save it caused but not the underlying gap.

What is missing

A Project's path is set by op: "create" and no project mutation op carries one afterwards. CoreLinkProjectMutation has rename, pin, settings, archive and now appearance — none of them a path. So a Core-owned Project's folder is immutable for the lifetime of the row.

What PR #103 did about it

Made the UI honest rather than pretending otherwise. The Edit-project dialog disables the Working directory field and drops Browse… for a Core-owned project (pathIsImmutable in ProjectDialog.tsx), and the missing-path dialog's advice branches on ownership — "point the project at its new location from Edit project" is only offered where the Panel owns the row. Recorded in ADR 0022.

That stops the silent discard. It does not give the operator the thing they wanted.

Why it matters

The case is real and not rare: a project folder gets moved or renamed on the Core, and the Panel's only remedy today is remove the project and add it again at the new path — which, because archive cascades, takes every Session under it with it. An operator loses their session history to fix a typo in a directory name.

The shape it probably wants

A path op on CoreLinkProjectMutation, validated Core-side by the existing validateProjectPath (absolute, resolvable, not a file) exactly as create already validates it — the Panel has no standing to judge a VM path — with its own project:pathChanged event kind, per the pin / settings / appearance precedent. Protocol minor bump; no migration (the column exists).

Open questions for whoever picks this up:

  1. What happens to running Sessions under the project? Their PTYs have the old path as cwd. Refuse the move while any Session is live, or allow it and let existing PTYs keep the old cwd until they exit?
  2. Worktrees and per-Session state keyed on the old path — is anything else on the Core storing a derived path that would need moving with it?
  3. Does the missing-path dialog become the natural home for this? That is where an operator actually is when they discover the folder moved, and it already has the project in hand.

Acceptance

  • Editing a Core-owned Project's Working directory works, and an invalid path comes back as the Core's own error rather than a Panel-side guess.
  • Every Panel watching that Core converges on the new path, including after reconnect (event replay).
  • Panel-local projects keep their current PATCH behaviour.
  • The pathIsImmutable gate and the ownership-branched missing-path copy from fix(core-link): edit and remove a Core-owned Project through the Core that owns it #103 come back out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions