Skip to content

fix(skills): stop OS sidecars marking an untouched skill as modified - #11471

Merged
brennanb2025 merged 5 commits into
mainfrom
brennanb2025/skill-scan-ignores-os-metadata
Jul 30, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
brennanb2025/skill-scan-ignores-os-metadata

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A skill folder that the user never touched can be reported as modified. Package
identity compares a live user directory against a tree read from a clean
checkout
, so anything the OS deposits on its own counts as drift:

  • One Finder visit writes .DS_Store. It sorts before SKILL.md (. = 0x2E <
    S = 0x53), so it takes index 0 in the index-aligned snapshot comparison and
    shifts every real file down a slot.
  • Copying a skill through a filesystem that cannot hold macOS metadata inline
    leaves ._SKILL.md sidecars.

The copy then reads unrecognized, is surfaced as "may be modified — Remove
it"
, and is left out of the update. Running the update cannot clear it either:
the updater compares its lock against the source and never reads disk, so it
correctly reports "up to date" and writes nothing.

Also a build break

This is not hypothetical on the generator side. A stray sidecar in a working tree
makes generate-skill-bundle-manifest.mjs declare the committed artifacts stale:

Generated skill artifacts are stale:
resources/skills/current-manifest.json
resources/skills/snapshot-registry.json

So pnpm lint currently fails for any developer who has opened skills/ in
Finder. Verified by counterfactual.

Change

Ignore OS-authored entry names on both sides of the comparison — the scanner
and the manifest generator — so neither can introduce content no install could
match. In the scanner the skip happens before the case-fold map and before
lstat, so a sidecar can neither manufacture a case collision nor fail the whole
package by being unreadable. observedGitTreeSha therefore also comes out clean,
which keeps the updater-lock trust path working.

Scope

Deliberately narrow:

  • Only OS-authored names. Tolerating unexpected files in general would let an
    injected payload ride along beside a clean SKILL.md. These names are safe
    precisely because an official SKILL.md never references them, so no agent can
    be routed into one.
  • Mode bits untouched. That would weaken identity for real scripts.

This fixes one trigger, not the whole class — a genuinely modified or foreign copy
still reads unrecognized. That is intended here.

Verification

  • 185 tests pass across src/main/skills/ plus the generator suite; typecheck and
    pnpm lint (including verify:skill-bundle-manifest) green.
  • New tests confirmed non-vacuous: with the fix disabled, only the three new
    tests go red and the rest keep passing.
  • Fixtures cover a sidecar that sorts before SKILL.md and one nested inside a
    subdirectory, since the misalignment is positional.
  • Guard tests in the other direction: an edited SKILL.md and a non-metadata
    payload.sh both still fail closed.
  • Committed artifacts unchanged — no manifest churn.

Manual validation (Electron, real app)

Isolated HOME with a single global copy whose SKILL.md is byte-identical to the bundled
manifest, plus provider symlinks and a real v3 updater lock — then one .DS_Store dropped
beside it, exactly as a Finder visit would.

Both runs were confirmed against the same folder on disk before the UI was read, so the
build is the only variable:

origin/main    ->  unrecognized  canonical-copy
this branch    ->  current       canonical-copy

Before (origin/main) — amber Review skill on the nav item and the skill card, over a
folder whose only difference from pristine is a file the OS wrote:

before

After (this branch) — green Up to date, no nav badge:

after

The nav label reads Review skill rather than Needs attention because #11413 renamed that
state. The permissions warning is the isolated dev HOME lacking the Computer Use helper
app — unrelated to the badge under test and identical on both sides.

Package identity compared a live user directory against a tree read from a
clean checkout, so anything the OS deposited counted as drift. One Finder
visit writes .DS_Store, which sorts before SKILL.md and misaligns the
index-aligned snapshot comparison — the copy became 'unrecognized', was
reported as "may be modified... Remove it", and left out of the update.
Running the update could not clear it either: the updater compares its lock
to the source and never reads disk, so it correctly reports "up to date"
and writes nothing.

Ignore OS-authored names on both sides of the comparison. The generator
half is not hypothetical: a stray sidecar in a working tree made the
committed artifacts read as stale, failing lint for that developer.

Scoped to OS-authored names only. Tolerating unexpected files in general
would let an injected payload ride along beside a clean SKILL.md; these are
safe because an official SKILL.md never references them, so no agent can be
routed into one. Mode bits are deliberately untouched — that would weaken
identity for real scripts.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cefd3bf0-19a6-4738-b5e7-16aef64dcb11

📥 Commits

Reviewing files that changed from the base of the PR and between 17a943b and c4ad18e.

📒 Files selected for processing (1)
  • .gitignore

📝 Walkthrough

Walkthrough

Common OS-authored metadata filenames and AppleDouble sidecars are now detected case-insensitively. Manifest collection and skill package observation skip matching plain files while continuing to process directories, links, and unexpected files according to existing guards. Tests cover scanner consistency, package identity matching, modified content, metadata-named directories and links, and freshness inventory status after sidecar creation.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and the testing checklist. Add the missing template sections, include the testing checklist, and summarize the AI review, security audit, and any platform-specific notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: ignoring OS sidecars so untouched skills no longer look modified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment on lines +33 to +40
const OS_METADATA_FILE_NAMES = new Set(['.ds_store', 'thumbs.db', 'ehthumbs.db', 'desktop.ini'])

export function isOsMetadataSkillEntryName(name: string): boolean {
const folded = name.toLocaleLowerCase('en-US')
// AppleDouble sidecars ('._SKILL.md') appear whenever a skill is copied through a
// filesystem that cannot hold macOS metadata inline.
return OS_METADATA_FILE_NAMES.has(folded) || folded.startsWith('._')
}

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 Duplicated logic with no shared source

isOsMetadataSkillEntryName is defined identically in config/scripts/generate-skill-bundle-manifest.mjs (lines 134–137) with only a comment tying them together. If a future contributor adds a new OS metadata name to one file and misses the other — e.g. adds 'zone.identifier' for Windows ADS files to the scanner but not the generator — the generator will bake that name into the committed manifest as real content, the scanner will then silently skip it on disk, and the two sides of the identity comparison will diverge. The resulting mismatch is the exact bug this PR fixes, just re-introduced for the new category. Since the generator is a .mjs script and the scanner is compiled TypeScript, they can't trivially share a module, but even a small shared JSON or .js file listing the known names would make the set an explicit artefact rather than two independent copies that must be kept in step manually.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR fixes a false-positive "skill may be modified" report caused by OS-deposited files (.DS_Store, AppleDouble ._* sidecars, Thumbs.db, etc.) appearing in a user's skill directory. Because the snapshot comparison is index-aligned after a lexicographic sort, .DS_Store (which sorts before S) shifted every real file down a slot and made an untouched install look unrecognised. It also fixes a build break where those same files in the working tree caused generate-skill-bundle-manifest.mjs to declare committed artifacts stale.

  • Introduces isOsMetadataSkillEntryName in skill-package-identity.ts (exported so the generator test can cross-verify) and applies it in observeSkillPackage before the case-fold map; the skip is gated on lstat().isFile() so directories or symlinks wearing OS metadata names still reach the existing guards.
  • Mirrors the same predicate and file-only guard in generate-skill-bundle-manifest.mjs, and moves lstat to before the skip decision so the symlink/special-file guards can reuse the already-computed stat.
  • Adds ._*, ehthumbs.db, and desktop.ini to .gitignore to prevent the files from being accidentally committed in the first place.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped to skipping well-known OS-authored names, and the skip is guarded by an lstat type check so directories and symlinks still reach existing security guards unchanged.

The fix is minimal and deliberate: it touches only the entry-filtering path and only for a known, closed set of OS metadata names. Both sides of the identity comparison are updated together and cross-verified by a test that imports the scanner's predicate directly. Guard tests confirm edited skills and injected payloads still fail closed. No existing guard is weakened and no data flows through an unverified path.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/main/skills/skill-package-identity.ts Adds isOsMetadataSkillEntryName predicate and applies it in observeSkillPackage before the case-fold map; lstat guard correctly limits the skip to plain files so directories and symlinks wearing OS metadata names still flow through to the existing guards.
config/scripts/generate-skill-bundle-manifest.mjs Mirrors the scanner's OS metadata predicate and moves lstat to before the case-fold map; the skip is file-only so directories/symlinks still hit the existing guards. The lstat is not wrapped in a try/catch (unlike the scanner), which is appropriate for a build-time tool.
src/main/skills/skill-package-identity.test.ts Adds three new tests: OS sidecars (including a pre-SKILL.md sorted .DS_Store) produce the same observation as a pristine directory; directories/symlinks wearing OS metadata names are still tracked; genuinely modified or payload-bearing copies still fail closed.
config/scripts/generate-skill-bundle-manifest.test.mjs Adds four tests including a cross-verification test that imports observeSkillPackage directly and asserts both walkers skip exactly the same name set, guarding against the asymmetric-skip failure mode described in the previous review.
src/main/skills/skill-freshness-inventory.test.ts Adds an end-to-end test that places a .DS_Store (which sorts before SKILL.md) beside an otherwise pristine install and verifies up-to-date with a mismatching lock hash, proving the identity fix alone carries the result.
.gitignore Adds ._*, ehthumbs.db, and desktop.ini to gitignore alongside .DS_Store; comment ties this to the runtime predicate to keep the two in step.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Directory entry from opendir/readdir] --> B{isOsMetadataSkillEntryName?}
    B -- No --> E[Proceed: path escape check, case-fold map]
    B -- Yes --> C[lstat the entry]
    C --> D{Type?}
    D -- plain file --> SKIP[Skip — OS-authored, ignore]
    D -- vanished / lstat error\nscanner only --> SKIP
    D -- directory --> E
    D -- symlink --> E
    E --> F{Case collision?}
    F -- collision --> ERR1[throw case-collision]
    F -- no collision --> G[lstat for real processing\ngenerator reuses pre-computed stat]
    G --> H{fileStat type}
    H -- symlink --> ERR2[throw skill-package-link]
    H -- directory --> I[recurse into subdirectory]
    H -- plain file --> J[read bytes, compute digest & git-blob-sha]
    H -- special file --> ERR3[throw skill-package-special-file]
Loading

Reviews (5): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

… name

The name-only skip dropped any entry matching an OS metadata name, so a
directory named .DS_Store or ._scripts took its whole subtree out of
identity and a symlink wearing one stopped tripping the link guard — a
skill hiding either read as pristine. The OS writes these as plain files
only, so the entry type decides, still ahead of the case-fold map.

Also compares both walkers over the same fixture: an asymmetric skip is
worse than none, since one side would bake in content the other can
never observe.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/skills/skill-package-identity.ts (1)

21-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Condense this rationale comment.

Keep the plain-file-only invariant; move the extended incident narrative to PR documentation or tests. As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cec1425-abc7-48a6-a36d-c61bb4815b24

📥 Commits

Reviewing files that changed from the base of the PR and between 7915778 and d29865d.

📒 Files selected for processing (5)
  • config/scripts/generate-skill-bundle-manifest.mjs
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • src/main/skills/skill-freshness-inventory.test.ts
  • src/main/skills/skill-package-identity.test.ts
  • src/main/skills/skill-package-identity.ts

Comment on lines +200 to +203
if (isOsMetadataSkillEntryName(entry.name)) {
const sidecarStat = await lstat(absolutePath).catch(() => null)
if (!sidecarStat || sidecarStat.isFile()) {
continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Fail closed when the metadata entry type cannot be verified.

Line 201 suppresses every lstat failure, so an inaccessible or raced metadata-named directory/link is skipped as though it were a plain sidecar. That violates the plain-file-only exemption and differs from config/scripts/generate-skill-bundle-manifest.mjs Line 150, which fails on the same condition. Suppress only confirmed disappearance (for example, ENOENT) and propagate other errors; add coverage for this path.

Both skill-identity walkers ignore these names, but .gitignore covered only
.DS_Store and Thumbs.db — so a stray ._SKILL.md showed as untracked and
`git add -A` could commit it. That is the one way the two walkers can
disagree: the disk walker skips such a file while the git-tree producer
(collectGitPackageFiles, used by the unreferenced --rebuild-from-tags path)
does not, so a committed sidecar would make released history and observation
describe different content.

Ignoring them keeps that asymmetry unreachable rather than adding a second
skip to the released-history path, which is load-bearing and provably never
sees one today: no committed sidecar exists on any ref.

Nothing tracked matches the new patterns.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e809becd-34eb-4075-bf62-edbb60a21d25

📥 Commits

Reviewing files that changed from the base of the PR and between d29865d and 17a943b.

📒 Files selected for processing (1)
  • .gitignore

Comment thread .gitignore
Comment on lines 50 to +55
*.stackdump
.DS_Store
._*
Thumbs.db
ehthumbs.db
desktop.ini

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

printf '%s\n' '.DS_STORE' 'THUMBS.DB' 'Desktop.ini' 'EHTHUMBS.DB' 'foo.STACKDUMP' |
  git check-ignore --no-index --stdin -v

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .gitignore relevant lines =="
sed -n '1,90p' .gitignore

echo
echo "== Git check-ignore with exact and variant files in a temp worktree =="
tmp="$(mktemp -d)"
cd "$tmp"
git init -q .
cat > .gitignore <<'EOF'
*.stackdump
.DS_Store
._*
Thumbs.db
ehthumbs.db
desktop.ini
EOF
mkdir -p sub
printf '%s\n' '.DS_STORE' 'THUMBS.db' 'desktop.ini' 'Desktop.ini' 'Desktop.INI' 'Thumbs.db' 'THUMBS.DB' 'ehthumbs.db' 'foo.stackdump' 'foo.STACKDUMP' | xargs -r touch
printf '%s\n' .gitignore '*stackdump' '.DS_Store' '._*' 'Thumbs.db' 'ehthumbs.db' 'desktop.ini' > expect
cat expect
echo "== ignored files =="
git ls-files -i -c
echo "== check-ignore results =="
git ls-files -i -c | while IFS= read -r f; do
  printf '%s: ' "$f"
  git check-ignore -v -- "$f" || true
done
rm -rf "$tmp"

echo
echo "== Locate scanner/identity walker ignore behavior =="
rg -n "stackdump|DS_Store|Thumbs|ehthumbs|desktop|case-insensitive|ignore|workspace|repository|skill identity" -S . --glob '!*.log' --glob '!node_modules/**' | head -200

Repository: stablyai/orca

Length of output: 2110


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp="$(mktemp -d)"
cd "$tmp"
git init -q .
cat > .gitignore <<'EOF'
*.stackdump
.DS_Store
._*
Thumbs.db
ehthumbs.db
desktop.ini
EOF
mkdir -p sub
printf '%s\n' '.DS_Store' '.DS_STORE' 'THUMBS.db' 'desktop.ini' 'Desktop.ini' 'Desktop.INI' 'Thumbs.db' 'THUMBS.DB' 'ehthumbs.db' 'EHTHUMBS.DB' 'foo.stackdump' 'foo.STACKDUMP' | xargs -r touch

echo "== ignore status via ls-files --ignored =="
git ls-files -i -c --exclude-standard

echo
echo "== check-ignore results =="
git ls-files -i -c | while IFS= read -r f; do
  printf '%s: ' "$f"
  git check-ignore -v -- "$f" || true
done

echo
echo "== git ignore pattern casing from docs in sandbox =="
git check-ignore -v .DS_Store
git check-ignore -v .DS_STORE
git check-ignore -v Thumbs.db
git check-ignore -v THUMBS.db
git check-ignore -v Desktop.ini
git check-ignore -v desktop.ini
rm -rf "$tmp"

Repository: stablyai/orca

Length of output: 279


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp="$(mktemp -d)"
cd "$tmp"
git init -q .
cat > .gitignore <<'EOF'
*.stackdump
.DS_Store
._*
Thumbs.db
ehthumbs.db
desktop.ini
EOF
mkdir -p sub
printf '%s\n' '.DS_Store' '.DS_STORE' 'THUMBS.db' 'desktop.ini' 'Desktop.ini' 'Desktop.INI' 'Thumbs.db' 'THUMBS.DB' 'ehthumbs.db' 'EHTHUMBS.DB' 'foo.stackdump' 'foo.STACKDUMP' | xargs -r touch

git ls-files -i -c --exclude-standard

printf '\ncheck-ignore results:\n'
git ls-files -i -c | while IFS= read -r f; do
  printf '%s: ' "$f"
  git check-ignore -v -- "$f" || true
done

printf '\nstandalone variant checks:\n'
for p in .DS_Store .DS_STORE Thumbs.db THUMBS.db desktop.ini Desktop.ini foo.stackdump foo.STACKDUMP; do
  printf '%s: ' "$p"
  git check-ignore -v -- "$p" || true
done

rm -rf "$tmp"

Repository: stablyai/orca

Length of output: 231


🌐 Web query:

Git check-ignore pattern case sensitive .gitignore macOS Desktop.ini Thumbs.db

💡 Result:

In Git,.gitignore patterns are generally treated as case-sensitive [1]. However, the actual behavior when using git check-ignore or when Git processes files depends heavily on your operating system's filesystem and your Git configuration (core.ignoreCase) [2][3][4]. On macOS, the default filesystem (APFS) is case-insensitive (though case-preserving) [5][3][6]. Because of this, Git typically defaults to core.ignoreCase = true [2][3]. This configuration tells Git to treat files as equivalent regardless of their casing (e.g., Thumbs.db and thumbs.db are seen as the same file) to prevent conflicts on the filesystem [2][3]. For patterns like Desktop.ini and Thumbs.db: - Because these patterns are technically case-sensitive in Git's internal matching [1], a pattern of Thumbs.db will not match thumbs.db if Git is enforcing strict matching. - To ensure these files are ignored regardless of how they are capitalized on your system, it is standard practice to use explicit patterns that cover common variations [7][8]. Recommended practice: Use square brackets in your.gitignore to match both uppercase and lowercase versions of these system files [1][7]: [Tt]humbs.db [Dd]esktop.ini You can verify which files are being ignored (and which pattern is responsible) by running: git check-ignore -v This command will tell you exactly which line of which ignore file is causing a path to be ignored [9][10]. If a file is not being ignored as expected, check if it has already been added to the Git index;.gitignore patterns only apply to files that are not already being tracked by Git [11]. If you need to stop tracking a file that is already in your repository, you must remove it using git rm --cached [11].

Citations:


🌐 Web query:

"core.ignorecase" ".gitignore" case-insensitive patterns Git documentation

💡 Result:

The configuration variable core.ignoreCase is an internal Git setting used to enable workarounds for filesystems that are not case-sensitive, such as APFS (macOS), NTFS (Windows), and FAT [1][2][3]. When enabled (set to true), Git treats different case variations of the same file path as the same entity (e.g., it will recognize that "makefile" and "Makefile" refer to the same file) [1][4]. Regarding its impact on.gitignore, when core.ignoreCase is set to true, Git's pattern-matching engine is designed to honor this setting during file exclusion checks [5][6][7]. This means that.gitignore patterns will be matched against file paths in a case-insensitive manner [6][7]. However, users should be aware of the following: 1. Automatic Detection: By default, Git attempts to probe and automatically set core.ignoreCase to true during git init or git clone if the underlying filesystem is detected as case-insensitive [1][4]. Modifying this value manually is generally discouraged unless necessary, as it can lead to unexpected behavior if the configuration does not match the actual filesystem's behavior [1][2]. 2. Pattern Matching Limitations: While core.ignoreCase enables case-insensitive matching for paths, the underlying matching mechanism (wildmatch) still requires standard globbing rules to be followed [8]. Some users have noted that complex patterns, particularly those involving character classes (e.g., [AB]), may still exhibit behavior that depends on the specific implementation of the character range, and they often require lowercase characters to function as expected across different platforms [8]. In summary, enabling core.ignoreCase=true allows.gitignore patterns to match files regardless of their case, making it easier to manage exclusions on case-insensitive filesystems without needing to manually account for every possible case variation [5][7].

Citations:


🌐 Web query:

"core.ignorecase" "gitignore" "case sensitive" Git documentation git-check-ignore

💡 Result:

The configuration variable core.ignoreCase is an internal Git setting that enables workarounds for filesystems that are not case-sensitive, such as APFS, HFS+, FAT, and NTFS [1][2]. Its primary purpose is to allow Git to treat differently capitalized versions of the same file path as the same object (e.g., treating "makefile" and "Makefile" as identical) [1][3]. Regarding its impact on.gitignore and path matching: 1. Case Sensitivity of.gitignore: By default,.gitignore patterns are case-sensitive [4]. Git does not automatically ignore case in.gitignore patterns simply because you are on a case-insensitive filesystem or have core.ignoreCase set to true [5][6]. 2. Interaction with core.ignoreCase: While there have been long-standing discussions in the Git community about extending core.ignoreCase to affect ignore patterns, it is not a universal behavior [5][6]. Git generally treats paths in.gitignore as literal matches. If you need case-insensitive matching for specific files or folders, the standard approach is to use character class globbing in your.gitignore, such as *.[jJ][pP][gG] or [Tt][Ee][Ss][Tt]/ [7][6]. 3. git-check-ignore: The git-check-ignore command respects the configuration of your repository [8]. If core.ignoreCase is true, Git's internal handling of path comparisons during the check may be affected, but it does not change the fundamental case-sensitive nature of the patterns defined within the.gitignore file itself [8][6]. Git automatically probes the filesystem during git-init or git-clone and sets core.ignoreCase to true if the filesystem is detected to be case-insensitive [1][3]. Modifying this setting manually is generally discouraged unless necessary to correct Git's automatic detection, as it can lead to unexpected behavior in how Git tracks files [1][2].

Citations:


Make the Git ignore rules cover supported OS metadata casing.

.gitignore patterns are case-sensitive, so variants like THUMBS.DB, Desktop.ini, or .DS_STORE may fail git check-ignore on case-sensitive worktrees unless the supported case variants are explicitly added or regex-compatible character classes are used. Add a regression test under core.ignoreCase=false for the scanner-specified metadata name casing.

The previous wording claimed these names cannot be committed, which
overstates what .gitignore provides: `git add -f` and `git apply --index`
both bypass it, so a cherry-pick, rebase or fork branch already carrying a
sidecar is unaffected. That clause was load-bearing — it was the stated
reason for leaving the released-history producer unhardened — so it should
not read as a structural guarantee.

Also fixes the producer count (three, not two: two disk walkers plus the
git-tree producer, which does not skip) and says plain file, since the skip
is isFile()-gated so a directory or link wearing the name is still walked.
@brennanb2025
brennanb2025 merged commit 49cfbf0 into main Jul 30, 2026
79 of 81 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/skill-scan-ignores-os-metadata branch July 30, 2026 20:20
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#11471)

* fix(skills): stop OS sidecars marking an untouched skill as modified

Package identity compared a live user directory against a tree read from a
clean checkout, so anything the OS deposited counted as drift. One Finder
visit writes .DS_Store, which sorts before SKILL.md and misaligns the
index-aligned snapshot comparison — the copy became 'unrecognized', was
reported as "may be modified... Remove it", and left out of the update.
Running the update could not clear it either: the updater compares its lock
to the source and never reads disk, so it correctly reports "up to date"
and writes nothing.

Ignore OS-authored names on both sides of the comparison. The generator
half is not hypothetical: a stray sidecar in a working tree made the
committed artifacts read as stale, failing lint for that developer.

Scoped to OS-authored names only. Tolerating unexpected files in general
would let an injected payload ride along beside a clean SKILL.md; these are
safe because an official SKILL.md never references them, so no agent can be
routed into one. Mode bits are deliberately untouched — that would weaken
identity for real scripts.

* fix(skills): keep guarding a directory or link wearing an OS metadata name

The name-only skip dropped any entry matching an OS metadata name, so a
directory named .DS_Store or ._scripts took its whole subtree out of
identity and a symlink wearing one stopped tripping the link guard — a
skill hiding either read as pristine. The OS writes these as plain files
only, so the entry type decides, still ahead of the case-fold map.

Also compares both walkers over the same fixture: an asymmetric skip is
worse than none, since one side would bake in content the other can
never observe.

* chore: ignore the OS metadata names skill identity already skips

Both skill-identity walkers ignore these names, but .gitignore covered only
.DS_Store and Thumbs.db — so a stray ._SKILL.md showed as untracked and
`git add -A` could commit it. That is the one way the two walkers can
disagree: the disk walker skips such a file while the git-tree producer
(collectGitPackageFiles, used by the unreferenced --rebuild-from-tags path)
does not, so a committed sidecar would make released history and observation
describe different content.

Ignoring them keeps that asymmetry unreachable rather than adding a second
skip to the released-history path, which is load-bearing and provably never
sees one today: no committed sidecar exists on any ref.

Nothing tracked matches the new patterns.

* chore: correct the skill-identity ignore comment

The previous wording claimed these names cannot be committed, which
overstates what .gitignore provides: `git add -f` and `git apply --index`
both bypass it, so a cherry-pick, rebase or fork branch already carrying a
sidecar is unaffected. That clause was load-bearing — it was the stated
reason for leaving the released-history producer unhardened — so it should
not read as a structural guarantee.

Also fixes the producer count (three, not two: two disk walkers plus the
git-tree producer, which does not skip) and says plain file, since the skip
is isFile()-gated so a directory or link wearing the name is still walked.
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