Repository navigation
fix(skills): stop OS sidecars marking an untouched skill as modified - #11471
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCommon 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)
✅ Passed checks (4 passed)
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. Comment |
| 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('._') | ||
| } |
There was a problem hiding this comment.
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 SummaryThis PR fixes a false-positive "skill may be modified" report caused by OS-deposited files (
Confidence Score: 5/5Safe 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.
|
| 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]
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.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/skills/skill-package-identity.ts (1)
21-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCondense 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
📒 Files selected for processing (5)
config/scripts/generate-skill-bundle-manifest.mjsconfig/scripts/generate-skill-bundle-manifest.test.mjssrc/main/skills/skill-freshness-inventory.test.tssrc/main/skills/skill-package-identity.test.tssrc/main/skills/skill-package-identity.ts
| if (isOsMetadataSkillEntryName(entry.name)) { | ||
| const sidecarStat = await lstat(absolutePath).catch(() => null) | ||
| if (!sidecarStat || sidecarStat.isFile()) { | ||
| continue |
There was a problem hiding this comment.
🔒 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.
| *.stackdump | ||
| .DS_Store | ||
| ._* | ||
| Thumbs.db | ||
| ehthumbs.db | ||
| desktop.ini |
There was a problem hiding this comment.
🗄️ 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 -vRepository: 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 -200Repository: 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:
- 1: https://tortoisegit.org/docs/tortoisegit/tgit-dug-ignore.html
- 2: https://git-scm.com/docs/git-config/2.14.6
- 3: https://github.com/git/git/blob/e9019fca/Documentation/config/core.adoc
- 4: https://stackoverflow.com/questions/52369109/git-core-ignorecase-false-in-mac-os-x
- 5: https://stackoverflow.com/questions/72082376/case-sensitive-files-and-folders-in-local-git-repository-in-mac
- 6: https://josephvoss.com/post/git-case-sensitive/
- 7: https://devzone.tools/tools/gitignore-generator/windows
- 8: https://zenn.dev/rayfiyo/articles/20250226-global_gitignore?locale=en
- 9: https://git-scm.com/docs/git-check-ignore
- 10: https://git-scm.com/docs/git-check-ignore/2.6.7
- 11: https://git-scm.com/docs/gitignore
🌐 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:
- 1: https://github.com/git/git/blob/master/Documentation/config/core.adoc
- 2: https://github.com/git/git/blob/e9019fca/Documentation/config/core.adoc
- 3: https://code.googlesource.com/git/+/refs/tags/v2.33.8/Documentation/config/core.txt
- 4: https://git-scm.com/docs/git-config/2.14.6
- 5: https://www.spinics.net/lists/git/msg142104.html
- 6: http://public-inbox.org/git/20100830145220.GI2315@burratino/t/
- 7: https://public-inbox.org/git/[email protected]/T/
- 8: https://public-inbox.org/git/[email protected]/T/
🌐 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:
- 1: https://github.com/git/git/blob/master/Documentation/config/core.adoc
- 2: https://github.com/git/git/blob/e9019fca/Documentation/config/core.adoc
- 3: https://git-scm.com/docs/git-config/2.14.6
- 4: https://kinsta.com/blog/gitignore-not-working/
- 5: http://public-inbox.org/git/[email protected]/
- 6: https://public-inbox.org/git/0207df477b402bacf5792a6c9cb410e924501b27.1281985411.git.j6t@kdbg.org/T/
- 7: https://stackoverflow.com/questions/11116636/how-do-i-ignore-file-extensions-in-git-regardless-of-case
- 8: https://stackoverflow.com/questions/71023441/git-ignore-case-sensitive-folder-names
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.
…an-ignores-os-metadata
…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.
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:
.DS_Store. It sorts beforeSKILL.md(.= 0x2E <S= 0x53), so it takes index 0 in the index-aligned snapshot comparison andshifts every real file down a slot.
leaves
._SKILL.mdsidecars.The copy then reads
unrecognized, is surfaced as "may be modified — Removeit", 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.mjsdeclare the committed artifacts stale:So
pnpm lintcurrently fails for any developer who has openedskills/inFinder. 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 wholepackage by being unreadable.
observedGitTreeShatherefore also comes out clean,which keeps the updater-lock trust path working.
Scope
Deliberately narrow:
injected payload ride along beside a clean
SKILL.md. These names are safeprecisely because an official
SKILL.mdnever references them, so no agent canbe routed into one.
This fixes one trigger, not the whole class — a genuinely modified or foreign copy
still reads
unrecognized. That is intended here.Verification
src/main/skills/plus the generator suite; typecheck andpnpm lint(includingverify:skill-bundle-manifest) green.tests go red and the rest keep passing.
SKILL.mdand one nested inside asubdirectory, since the misalignment is positional.
SKILL.mdand a non-metadatapayload.shboth still fail closed.Manual validation (Electron, real app)
Isolated
HOMEwith a single global copy whoseSKILL.mdis byte-identical to the bundledmanifest, plus provider symlinks and a real v3 updater lock — then one
.DS_Storedroppedbeside 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:
Before (
origin/main) — amberReview skillon the nav item and the skill card, over afolder whose only difference from pristine is a file the OS wrote:
After (this branch) — green
Up to date, no nav badge:The nav label reads
Review skillrather thanNeeds attentionbecause #11413 renamed thatstate. The permissions warning is the isolated dev
HOMElacking the Computer Use helperapp — unrelated to the badge under test and identical on both sides.