Skip to content

refactor(ssh): generalize target source reconciliation - #11041

Draft
nwparker wants to merge 1 commit into
nwparker/custom-ssh-source-identityfrom
nwparker/custom-ssh-source-reconcile
Draft

nwparker wants to merge 1 commit into
nwparker/custom-ssh-source-identityfrom
nwparker/custom-ssh-source-reconcile

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Extracts SSH target synchronization into a source-aware, side-effect-free reconciliation planner.
The existing ~/.ssh/config importer now applies that plan without changing its observable
behavior.

The planner:

  • scopes ownership to SSH config or a specific custom sourceId;
  • updates only fields managed by the source while preserving target IDs;
  • reserves aliases owned by manual targets or other custom sources;
  • suppresses deleted and duplicate source entries;
  • adopts only the known legacy SSH-config import shape;
  • returns ordered insert/update operations so workspace re-adoption stays deterministic.

Deletion uses the same ownership predicate as reconciliation, preventing sync and tombstone logic
from drifting apart.

Why this is separate

The next source boundary can feed validated candidates into one reconciliation path instead of
copying the subtle SSH-config semantics. This PR is a pure refactor plus reusable custom-source
behavior; it adds no network source, UI, or persistence fields.

Validation

  • pnpm typecheck
  • pnpm lint
  • focused SSH/persistence Vitest: 6 files, 519 tests
  • reconciliation/store Vitest: 2 files, 36 tests
  • git diff --check

Stack

  1. feat(ssh): add custom target source identity #11039 — custom source identity and downgrade-safe persistence.
  2. This PR: source-aware reconciliation and tombstone ownership.
  3. Follow-up: bounded HTTPS source configuration/fetch/parse boundary.
  4. Follow-up: Add from source UI and source badges.

Made with Orca 🐋

This branch has not been deployed

No deployments
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.

1 participant