Skip to content

fix(plugin): refuse hard-linked files in installed skill cache verifier - #387

Merged
drevendev merged 4 commits into
masterfrom
beautifulrepo/plugin-cache-hardlinks-20261116
Nov 16, 2026
Merged

drevendev merged 4 commits into
masterfrom
beautifulrepo/plugin-cache-hardlinks-20261116

Conversation

@drevendev

Copy link
Copy Markdown
Owner

Problem

The offline installed-plugin cache verifier rejected symlinks and reparse points, but _regular_bytes accepted ordinary-looking hard-linked cache files. A matching definition, helper or manifest could therefore be an alias to a file outside the selected cache. The recursive skill inventory also did not reject hard-linked extras. This weakens the meaning of a cache byte-match on disposable evaluations.

Bounded fix (BR-PLUGIN-017)

  • Refuse st_nlink > 1 before reading any installed file in _regular_bytes (definitions, packaged assets, named shared dependencies and present manifests).
  • Refuse hard-linked entries during recursive installed-skill inventory, including unexpected files.
  • Add four regression cases: hard-linked SKILL.md, required offline checker, optional plugin manifest and untracked extra skill file. The last test exercises the inventory path without aliasing an expected definition.
  • Record the limitation in the public changelog. No change to the historical immutable four-skill candidate 70b792b7…, releases or tags.

Acceptance and limitations

Changed paths are limited to the verifier, its tests and public changelog. This is a source-level integrity boundary, not protection against concurrent filesystem replacement, plugin installation/discovery or live Claude Code/Codex model invocation. Full cross-platform CI must run on the exact PR head; no local full checkout is available in this environment due to GitHub DNS failure. A later-run review and current provider gates precede integration.

Related: #257 and #74.

@drevendev drevendev left a comment

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.

Exact-head content review — b971170

Verdict: no blocking defect found in the bounded cache-verifier change. This is a COMMENT, not an independent approval: the authenticated reviewer and PR author are both drevendev.

  • _regular_bytes() now rejects installed regular files with multiple hard links before reading their bytes. This covers each checked skill definition, tracked skill asset, named shared dependency and present optional manifest.
  • _installed_skill_files() applies the same fail-closed check to files found in the recursive installed skill inventory, including files outside the pinned inventory. The distinction matters: checking only known paths would miss untracked skill assets.
  • The four added regression cases separately exercise a definition, shared helper, optional manifest and unexpected extra asset. Each requires an incomplete verification outcome rather than accepting an apparent byte match; the extra-asset case specifically reaches the inventory path.
  • The changelog records the change without presenting a new four-skill release or a Claude Code/Codex host acceptance. The preserved design limits remain material: this is a point-in-time filesystem check, not a race-free opened-descriptor attestation, complete plugin-tree attestation, or proof of skill discovery/invocation.

Verification evidence: exact-head Quality workflow #43785965641 completed successfully; its six jobs (Lint, Python 3.11, Python 3.14 Linux/Windows, Action self-test Ubuntu/Windows) all report success. I inspected the PR patch, current verifier, regression source, repository review/security instructions and related #74/#257 acceptance boundaries. I did not independently run the Python suite, install a plugin in either host or perform a live model evaluation.

Gate boundary: no provider-independent APPROVE is implied here, and #257's separately required host/runtime evidence remains outstanding.

@andy-zen-dev andy-zen-dev 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.

Independent exact-head review — b97117062aa66c5882993394369df99f2a90c48d

APPROVE for the bounded installed-plugin cache hard-link refusal, not for host/model acceptance or release readiness.

I read the three changed-file patches and the surrounding scripts/plugin_install_verify.py and tests/test_plugin_install_verify.py implementations, along with AGENTS.md, CONTRIBUTING.md, SECURITY.md and the relevant #74/#257 boundaries. The pre-read st_nlink > 1 refusal covers checked installed definitions, bundled skill assets, named shared dependencies and present manifests. Recursive skill inventory separately rejects hard-linked unexpected assets; the corresponding negative fixture specifically exercises that distinct path. The four new tests each assert fail-closed VerificationError rather than accepting a byte match, and the changelog records the bounded change.

At this exact head, Quality workflow #43785965641 is completed/successful; its six listed jobs (Lint, Python 3.11, Python 3.14 Linux and Windows, Action self-tests on Ubuntu and Windows) all report success. There are no unresolved inline review threads and no prior review from andy-zen-dev on this head.

Limits: reviewer-local tests were not run; OS-level hard-link creation tests can skip where unsupported. This is a point-in-time, pathname-based check, not an opened-descriptor TOCTOU guarantee, complete plugin-tree attestation, or demonstrated Claude Code/Codex discovery/model behavior. Independent host acceptance in #257 remains open. No blocker was found within this PR's declared scope.

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.

2 participants