Repository navigation
feat(claude-ops): scope-selectable skill-usage store + machine-local git exclude - #1159
Conversation
…git exclude
The skill-usage second store was forced into every consuming repo's tree
(.claude/observability/skill-usage.jsonl as untracked git-status noise) and
the skill_usage_dir containment validation made user/machine scope
unreachable by config — containment as a ceiling instead of a default.
- skill_usage_scope userConfig: repo (default, unchanged location) | user
(same contained subpath under $HOME, one cross-repo store) | data-dir
(${CLAUDE_PLUGIN_DATA}/skill-usage/<repo-slug>, plugin-owned). Unknown
values fall back to repo with a one-time advisory.
- Repo scope now keeps git status clean: idempotent root-anchored entry in
.git/info/exclude (git rev-parse --git-path, worktree-correct; never
.gitignore or tracked files). Opt out with skill_usage_git_exclude=false.
- Store rows gain a project field so cross-repo scopes keep repo identity.
- Default-flip decision recorded in CHANGELOG: default stays repo (the
observability skill reads only hook-events.jsonl + OTEL, colocation is
convention; exclude hygiene removes the noise; no silent data relocation).
- Shared resolver claude_ops::resolve_skill_usage_dir + repo_slug +
ensure_git_exclude in claude-ops-paths.sh; both producers updated; 30 new
test assertions across the three suites; setup skill check covers scopes.
claude-ops 0.19.0.
Closes #1151
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Claude finished @kyle-sexton's task in 3m 17s —— View job PR Review — feat(claude-ops): scope-selectable skill-usage store + machine-local git excludeTasks
Overall AssessmentSolid feature addition. The scope-selection logic is well-structured, the containment validation is thorough (physical symlink resolution carries through to all three scopes), and the git exclude integration is worktree-correct and idempotent. One confirmed test coverage gap and two minor clarification issues below. Findings1. Test coverage gap: user-scope
|
|
Claude finished @kyle-sexton's task in 4m 9s —— View job Security Review — PR #1159Tasks
Reviewed all 10 changed files. No CRITICAL or IMPORTANT security issues found. Two SUGGESTION-level findings below. SUGGESTION · Newline in
|
| File | Verdict |
|---|---|
claude-ops-paths.sh — resolve_skill_usage_dir |
No issues; containment delegated correctly to existing resolve_project_relative_dir |
claude-ops-paths.sh — repo_slug |
Safe; replaces all non-alphanumeric bytes with - |
claude-ops-paths.sh — ensure_git_exclude |
One finding above; git operations are properly quoted; append is best-effort with no blocking failure path |
skill-usage-audit.sh |
One finding above; scope validation correct; jq --arg used throughout (no injection surface) |
skill-usage-expansion-audit.sh |
Same as above |
plugin.json |
New userConfig keys are string/boolean types; no executable surfaces |
| Test files, README, CHANGELOG | No security surface |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 471979ecc8
ℹ️ 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".
…alization, project_id - repo_slug: readable basename + 8-char sha1 digest of the physical path (cksum fallback) — lossy folding alone let /tmp/a-b and /tmp/a/b share a data-dir store key. - ensure_git_exclude: segment-normalize the configured dir (drop ./ and empty segments, fold backslashes) before writing the ignore line — git matches patterns literally, so /./x or x//y never matched. - Store rows add project_id (same slug) alongside the display basename so same-name checkouts stay distinguishable in cross-repo scopes. - Tests: 9 new assertions (fold-collision, slug stability, normalizer, denormalized-dir exclude + clean status, project_id shape). Co-Authored-By: Claude Fable 5 <[email protected]>
|
Claude finished @kyle-sexton's task in 3m 12s —— View job PR Review — feat(claude-ops): scope-selectable skill-usage store + machine-local git excludeTasks
SummaryThe Codex P2 findings (slug collisions, exclude normalization, cross-repo project identity) are all cleanly addressed in 74495b4. The architecture is sound — scoped resolution, worktree-correct exclude, double-resolve TOCTOU guard, best-effort git hygiene, symmetric producers. One test asymmetry from the prior Claude review remains un-fixed, and two low-severity security suggestions from the prior security review are still open. Still Open: Test asymmetry — user-scope
|
|
Claude finished @kyle-sexton's task in 5m 20s —— View job Security Review — PR #1159Reviewed all 10 changed files at commit SUGGESTION ·
|
| File | Verdict |
|---|---|
claude-ops-paths.sh — resolve_project_relative_dir |
No new issues; containment logic unchanged |
claude-ops-paths.sh — repo_slug |
Safe; sha1sum/cksum pipeline properly quoted; output filtered to [A-Za-z0-9._-] + hex |
claude-ops-paths.sh — normalize_rel_segments |
Finding 2 above |
claude-ops-paths.sh — resolve_skill_usage_dir |
No issues; delegates correctly |
claude-ops-paths.sh — ensure_git_exclude |
Finding 1 above |
skill-usage-audit.sh |
Finding 3 above; jq --arg used throughout — no injection surface |
skill-usage-expansion-audit.sh |
Same as above; EXP_TYPE via jq --arg is safe |
plugin.json |
New userConfig keys are string/boolean — no executable surface |
| Test files, README, CHANGELOG, SKILL.md | No security surface |
No CRITICAL or IMPORTANT security issues found. All three findings are SUGGESTION level.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74495b4ef1
ℹ️ 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".
…line Codex P2 (4th finding): a configured skill_usage_dir like `telemetry*` created a literal `telemetry*` store but wrote `/telemetry*/` to .git/info/exclude — a glob that over-matches sibling dirs (or, with `#`/`[`, misparses). ensure_git_exclude now backslash-escapes * ? [ (and a literal backslash) per segment; leading #/! need no handling since the line always begins with the root anchor `/`. Test: `telemetry*` writes `/telemetry\*/`. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Claude finished @kyle-sexton's task in 2m 22s —— View job PR Review — feat(claude-ops): scope-selectable skill-usage store + machine-local git excludeTasks
Commit ac088a0 —
|
|
Claude finished @kyle-sexton's task in 3m 3s —— View job Security Review — PR #1159 (commit
|
| File | Verdict |
|---|---|
claude-ops-paths.sh — gitignore_escape (new) |
Correctly escapes * ? [ \; no new issues |
claude-ops-paths.sh — normalize_rel_segments |
Finding 2 above (prior, unaddressed) |
claude-ops-paths.sh — ensure_git_exclude |
Finding 1 above (prior, unaddressed); escape call is correct |
claude-ops-paths.sh — other functions |
No changes; no new issues |
skill-usage-audit.sh |
Finding 3 above (prior, unaddressed); no new issues |
skill-usage-expansion-audit.sh |
Same as above |
claude-ops-paths.test.sh |
New metachar test at lines 152–157 is correct |
plugin.json, README, CHANGELOG |
No security surface |
No CRITICAL or IMPORTANT findings. Three SUGGESTION-level findings carry over from the prior security reviews; none introduced by ac088a0.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac088a09e3
ℹ️ 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".
… to repo root Codex P2 (5th finding): skill_usage_dir=. is accepted by containment validation and lands skill-usage.jsonl at the repo root, but the exclude path normalized to empty and ensure_git_exclude returned without a rule — so the root store stayed visible in git status, breaking repo scope's clean-status promise. When the configured dir resolves to the root, ignore the store FILE (/skill-usage.jsonl) rather than the whole tree. Store basename is a parameter (default skill-usage.jsonl). Test: dir=. writes /skill-usage.jsonl and the root store file is invisible to git status. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Claude finished @kyle-sexton's task in 3m 21s —— View job PR Review — feat(claude-ops): scope-selectable skill-usage store + machine-local git excludeTasks
Commit 77f0374 —
|
| Finding | Commit | Status |
|---|---|---|
| Slug collisions in data-dir keys | 74495b4 | ✅ Fixed — basename + sha1 digest |
Denormalized exclude patterns (./x, x//y) |
74495b4 | ✅ Fixed — normalize_rel_segments |
Cross-repo project identity (project_id field) |
74495b4 | ✅ Fixed — slug emitted in both producers |
| Glob metacharacters in configured path | ac088a0 | ✅ Fixed — gitignore_escape |
skill_usage_dir=. leaves root store untracked |
77f0374 | ✅ Fixed — file-specific exclude pattern |
Verdict
77f03740 correctly closes the final Codex P2 finding (repo-root store visibility). The fix is clean, consistently applied, and backed by two new targeted tests. All five Codex P2 findings are now resolved.
One persistent test assertion gap and three security suggestions from prior reviews remain open. The test gap (user-scope project/project_id) is the only item worth addressing before merge — the three security findings are all SUGGESTION-level with limited real-world impact. The PR is otherwise in good shape.
|
Claude finished @kyle-sexton's task in 2m 32s —— View job Security Review — PR #1159 (commit
|
| File | Verdict |
|---|---|
claude-ops-paths.sh — ensure_git_exclude (updated) |
New root-file branch is correct; prior finding 1 still open |
claude-ops-paths.sh — normalize_rel_segments |
Prior finding 2 still open |
claude-ops-paths.sh — gitignore_escape, repo_slug, resolve_skill_usage_dir |
No issues |
skill-usage-audit.sh |
Prior finding 3 still open; jq --arg throughout — no injection surface |
skill-usage-expansion-audit.sh |
Same as above |
plugin.json, README, CHANGELOG, test files, SKILL.md |
No security surface |
No CRITICAL or IMPORTANT findings. Three SUGGESTION-level findings carry over from prior reviews; none introduced or regressed by 77f0374.
|
Pre-merge CI classification — all required checks green, 0 failing / 0 pending.
Merging per the standing drive-to-MERGED directive. |
Summary
Fixes the F1 finding from inbox item
20260723-090435-melodic-session-plugins-audit: the claude-ops skill-usage second store was forced into every consuming repo's tree as untrackedgit statusnoise, andskill_usage_dircontainment validation made user/machine scope unreachable by config.skill_usage_scopeuserConfig (repodefault |user|data-dir):repokeeps the current project-tree location;userresolves the same containedskill_usage_dirsubpath under$HOME(one cross-repo operator store);data-dirwrites${CLAUDE_PLUGIN_DATA}/skill-usage/<repo-slug>(plugin-owned, update-safe). Unknown values fall back torepowith a one-time advisory (prose-validated — the manifest schema has no enum type). Containment is now a per-scope default, not a ceiling..git/info/exclude(git rev-parse --git-path, worktree-correct; never touches.gitignoreor tracked files — ignore semantics leave tracked content unaffected). Opt out withskill_usage_git_exclude=falsefor teams that deliberately commit telemetry.projectfield added to store rows (project-root basename) so cross-repo scopes keep repo identity.repo— verified the/claude-ops:observabilityskill reads onlyhook-events.jsonl+ the OTEL store (colocation is convention, not a read dependency); the exclude entry removes the status noise that motivated a flip; flipping would silently relocate existing consumers' data.claude_ops::resolve_skill_usage_dir,repo_slug,ensure_git_exclude) inclaude-ops-paths.sh; both producers (tool + expansion) updated symmetrically; setup skillcheckcovers scope reporting; README + CHANGELOG updated. claude-ops 0.19.0.Fresh-docs verified this session: hooks env contract (
CLAUDE_PLUGIN_DATA,CLAUDE_PLUGIN_OPTION_<KEY>) per https://code.claude.com/docs/en/hooks; userConfig schema (no enum type) per https://code.claude.com/docs/en/plugins-reference.Test plan
claude-ops-paths.test.sh18/18 — scope resolution (repo/user/data-dir), user-scope traversal rejection, missingCLAUDE_PLUGIN_DATAfailure, repo-slug safety, exclude add + idempotency + opt-out + non-repo no-op,git statusclean.skill-usage-audit.test.sh29/29 — git-repo repo-scope write + exclude entry + clean status, user scope under$HOME(project tree untouched), data-dir keyed store, unknown-scope advisory + repo fallback,projectfield, existing containment/kill-switch/envelope suite.skill-usage-expansion-audit.test.sh28/28 — user-scope parity +projectfield + full existing suite.shellcheck -xclean on all six touched scripts;skill-quality:check setupPASS (0 errors).Closes #1151
🤖 Generated with Claude Code
Related
20260723-090435-melodic-session-plugins-audit(finding F1); companion issues from the same decomposition: skill-quality: check resolves plugin-cache installs (plugin:skill) + HEAD keyword comparison for cache roots #1152, skill-quality + planning: run the skill gate in CI over changed skills; injection-block lint decision; interview lint fixes #1153, re-anchor: sweep-all-disciplines — dedup-by-root-cause consolidation step + real cost datapoint #1154.