Skip to content

fix(sync): flag shared skills folders whose mode or naming differ - #499

Merged
runkids merged 14 commits into
mainfrom
runkids/fix-498-shared-folder-conflict
Oct 9, 2026
Merged

runkids merged 14 commits into
mainfrom
runkids/fix-498-shared-folder-conflict

Conversation

@runkids

@runkids runkids commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Two targets that sync skills into one folder with different target_naming or mode undo each other on every sync, but only include/exclude differences counted as a conflict, so sync and doctor showed the generic shared-path hint instead of the "each sync undoes the other" warning.

  • sameSkillsSettings (internal/config/path_overlap.go) now also compares the effective mode and target naming, so an unset value equals the default it resolves to and isn't reported.
  • The global default mode isn't carried on the target, so SkillsFolderConflicts takes it from its three callers (sync hint, doctor, dashboard sync/diff).
  • Two targets that both resolve to symlink mode never conflict: symlink links the whole folder to the source and reads neither target naming nor include/exclude. This also stops the existing false warning for symlink targets that differ only in filters (from Codex review, then widened in a /simplify pass).
  • The warning says "different settings" instead of "different filters"; English docs, the built-in skill reference, UI locales and the ko/ja/zh-Hant/zh-Hans docs are updated to match.

Dashboard

  • Sync page: the folder-conflict notice lists only the settings that differ (sync mode, naming, filters) for each target, and links to the target page of the one to change.
  • Target page: when the draft mode, naming or filters differ from another target writing the same skills folder, a note under that control says so, with a button to use the other target's value. The targets API gains skillsSharedWith, built from the same folder normalisation as the conflict check, so the UI doesn't re-implement it.
  • The symlink mode hint now says filters and naming don't apply.

This PR carries Release-As: 0.25.4 (in eabe5fb), so the next release is 0.25.4.

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)

Linked Issue

Closes #498

Checklist

  • I've read CONTRIBUTING.md
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Verification

  • Ran /simplify and a two-axis code review (standards, spec) on the branch; fixes are in 8a24ff9, no open findings.
  • New cases in internal/config/path_overlap_test.go (naming differs, mode differs, unset vs explicit default) failed before the fix and pass after.
  • make check passes in the devcontainer image.
  • Not run: UI vitest. The UI change is the locale strings and one expected string in SyncPage.test.tsx.
  • The online subdir install test failure is fixed by test(install): install the subdir test skill from this repo #500, now merged into this branch.
  • UI: vitest 637/637, eslint, pnpm build; screenshots checked against the approved design (Clean light).

Two targets writing one skills folder with different target_naming or
mode undo each other on every sync (flat links vs standard names, merge
vs copy), but only include/exclude were compared, so sync and doctor
fell back to the generic shared-path hint.

Compare the effective mode and target naming too, so an unset value
equals the default it resolves to. The global default mode is not
carried on the target, so SkillsFolderConflicts takes it from its three
callers. The warning now says "different settings" instead of "different
filters".

Fixes #498
The warning now reads "different settings", but the explanatory prose
around it in the doctor and common-errors pages still described the
conflict as include/exclude filters only. Name mode and target_naming
there as well, in English and the four translated doc sets.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T17:51:11.064666Z 697af5c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06a0d36536

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/config/path_overlap.go Outdated
return sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude)
func sameSkillsSettings(a, b ResourceTargetConfig, defaultMode string) bool {
return effectiveMode(a.Mode, defaultMode) == effectiveMode(b.Mode, defaultMode) &&
EffectiveTargetNaming(a.TargetNaming) == EffectiveTargetNaming(b.TargetNaming) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore target naming when both targets use symlink mode

When two targets sharing a path both resolve to symlink mode but specify different target_naming values, this comparison reports a folder conflict and the CLI/dashboard recommends disabling one target. In symlink mode, SyncSkillTarget delegates to SyncTarget, which links the entire target path to the source and never uses TargetNaming, so these settings cannot undo each other; compare naming only for modes where individual skill names are material.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 588d29c. sameSkillsSettings now compares target naming only when the shared mode isn't symlink, since symlink mode links the whole folder and never uses skill names. Covered by TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming (one target with explicit symlink, the other inheriting it from the global default).

Codex review on #499: two targets on one folder that both resolve to
symlink mode were reported as a conflict when their target_naming
differed. Symlink mode links the whole folder to the source and never
uses per-skill names, so the naming cannot make them undo each other.
Compare naming only when the shared mode is not symlink.
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 588d29c79d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target <name> --path <dir>`.

When the targets sharing a path have different `include` or `exclude` filters, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target:
When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming`, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exempt symlink naming from the conflict docs

When both shared targets resolve to symlink, differing target_naming values do not produce a conflict: the fresh evidence in this revision is the mode != "symlink" guard in internal/config/path_overlap.go:165-169, because symlink mode links the whole source folder. This sentence, along with the mirrored sync, troubleshooting, and localized documentation, still claims that any target_naming difference leaves the folder unsettled and triggers a warning, which can lead users to disable a valid target; qualify the naming rule for non-symlink modes.

AGENTS.md reference: AGENTS.md:L15-L15

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7e6649f. The doctor, sync and troubleshooting pages, their ko/ja/zh-Hant/zh-Hans translations, and the SkillsFolderConflicts doc comment now say target naming only matters outside symlink mode. Docs-only; the behavior is covered by TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming from 588d29c.

Codex review on #499: after 588d29c the conflict check skips
target_naming when the shared mode is symlink, but the doctor, sync and
troubleshooting pages (and their translations) still said any naming
difference makes shared targets undo each other. That could lead users
to turn off a valid symlink target, so qualify the rule.
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e6649f2c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes}

**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters. Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them:
**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder). Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the filter-only troubleshooting advice

When the warning is caused solely by different mode or target_naming values, the later advice that giving both targets the same filters resolves it is false, and this paragraph's explanation about one target removing what the other filters out does not describe that case either. Update the English and mirrored localized troubleshooting text to say that every relevant setting must agree (or one target must stop syncing), otherwise users following the advertised alternative will keep seeing the same conflict.

AGENTS.md reference: AGENTS.md:L15-L15

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 549d4d8. The troubleshooting cause now says each sync undoes the other target's work (adding or removing filtered skills, renaming entries, or switching links and copies), the alternative fix says the targets need the same filters, mode and target naming, and the doctor page uses the same wording. Applied to English and the ko/ja/zh-Hant/zh-Hans pages. Docs-only.

Codex review on #499: the troubleshooting and doctor pages explained the
conflict as one target adding what the other filters out, and offered
"give both targets the same filters" as a fix. When the conflict comes
from mode or target naming, that fix does nothing and the explanation
doesn't match what happens (entries renamed, links swapped for copies).
Describe the conflict as each sync undoing the other's work and say all
three settings must agree, in English and the four translations.
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 549d4d8927

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A /simplify pass on #499 found the symlink exception too narrow: symlink
mode links the whole folder to the source and reads neither target naming
nor include/exclude, yet two symlink targets with different filters were
still reported as undoing each other. State the rule once (same symlink
mode means same folder contents) instead of exempting only naming, and
resolve the mode with cmp.Or like sync's isSymlinkMode rather than a
local copy of the sync package's resolver. Docs now say none of these
settings matter in symlink mode.
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 8a24ff9211

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The target page needs to know which other targets write to the same
skills folder to warn when an unsaved mode or naming change would make
their syncs undo each other. Re-implementing the server's folder
normalisation (home expansion, path cleaning) in TypeScript would drift
from config.SkillsFolderConflicts, so the targets API now returns
skillsSharedWith, built from the same skillsFolder helper.
The notice said two targets sync into one folder "with different
settings" but not which ones, so users could not tell what to change
(mode, naming or filters) to keep both. Under the existing sentence and
stop buttons it now lists only the settings that differ as a small grid,
keep target first, with a link to the target page to change them.
Symlink targets show n/a for naming and filters, matching the server rule
that those settings do not apply there. The names-as-links sentence is
shared with the target page's reader notes.
…older

Changing sync mode or naming on a target whose skills folder another
target also writes silently set up the conflict that the Sync page only
reported after saving. The target page now compares the draft with each
sharing target and, under the control that causes it, says the other
target's value and offers "Use <value> like <target>". Nothing shows when
both resolve to symlink or the draft matches. The symlink mode copy now
also says naming does not apply there.
Code review of the target-page warning found the new targets API field
only had a unit test on the config helper. The handler is what the UI
reads, so check that it names targets writing the same skills folder and
leaves out one that writes elsewhere.

Release-As: 0.25.4
…unkids/skillshare into runkids/fix-498-shared-folder-conflict
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3437a0a8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +169 to +171
const modeClash = agent ? undefined : sharing.find((o) => o.mode !== draft.mode);
// Symlink links the whole folder, so naming only matters once the modes agree on something else.
const namingClash = modeClash ? undefined : sharing.find((o) => o.targetNaming !== draft.naming);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep warning when shared filters still differ

When shared targets have the same mode and naming but different include or exclude values—or after the user uses this page to resolve an initial mode mismatch—both clash checks return undefined, so the target page implies that the conflict is resolved even though SkillsFolderConflicts will still report it and subsequent syncs can prune one another's entries. Compare the draft filters with every shared target and surface the mismatch alongside the filter controls.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dd3cc06. The target page now compares the draft include/exclude with every target sharing the skills folder (skipped in symlink mode and while a mode clash is already shown) and puts a note under the filters with a button that copies the other target's filters. Covered by the new "warns under the filters when only they differ" test in TargetDetailPage.test.tsx; vitest 638/638, eslint, tsc, pnpm build and make check pass.

Codex review on #499: when two targets on one skills folder agreed on
mode and naming but had different include/exclude, the target page showed
no note, so it looked settled while the Sync page still reported the
conflict and each sync kept pruning the other's entries. Compare the
draft filters with every target sharing the folder (outside symlink mode,
which ignores them) and offer to copy the other target's filters.
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd3cc06e2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target <name> --path <dir>`.

When the targets sharing a path have different `include` or `exclude` filters, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target:
When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (none of these matter in `symlink` mode, which links the whole folder), each sync redoes the folder the way one target wants and undoes the other's work, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit the symlink exemption to per-skill settings

When one target uses symlink and the other uses merge or copy, their mode difference still produces a conflict: sameSkillsSettings compares the effective modes before applying the symlink exemption. The fresh evidence after the prior documentation fix is this new all-inclusive parenthetical, which says that mode also does not matter and may lead users to disregard a warning; clarify here and in the mirrored sync, troubleshooting, and localized pages that only filters and target naming are irrelevant when both targets use symlink mode.

AGENTS.md reference: AGENTS.md:L15-L15

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 697af5c. The doctor, sync and troubleshooting pages and their ko/ja/zh-Hant/zh-Hans copies now say filters and naming don't matter when both targets use symlink mode, so a symlink target next to a merge or copy one still reads as a conflict. Docs-only; docs-check passes.

Codex review on #499: the conflict pages said "none of these matter in
symlink mode", which reads as if a symlink target and a merge or copy
target on one folder were fine too. Mode still conflicts there; only
filters and naming stop mattering when both targets use symlink.
@runkids

runkids commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 697af5ce3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@runkids
runkids merged commit 5e3840e into main Oct 9, 2026
8 checks passed
@runkids
runkids deleted the runkids/fix-498-shared-folder-conflict branch October 9, 2026 01:45
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.

fix(sync): targets sharing a skills folder with different naming or mode aren't reported as a conflict

1 participant