Skip to content

fix: stale hook entries no longer trip the supply-chain alarm on upgrade#51

Merged
arzafran merged 1 commit into
mainfrom
fix/50-stale-hook-audit
Jun 10, 2026
Merged

fix: stale hook entries no longer trip the supply-chain alarm on upgrade#51
arzafran merged 1 commit into
mainfrom
fix/50-stale-hook-audit

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

When cc-settings renames or removes a hook script, upgrading users were left with orphaned entries in their settings.json that bun run audit:hooks flagged as SUSPICIOUS — the supply-chain alarm cried wolf on every legitimate upgrade (one real install showed 6 false suspicious findings after the tool-cadence merge). This makes upgrades clean themselves up and teaches the auditor the difference between a leftover and an actual dropped payload.

Fixes #50

Summary

  • src/lib/settings-merge.ts: parallelmax-nudge.ts, review-queue-nudge.ts, track-tldr.ts, tldr-stats.ts added to DEPRECATED_COMMAND_PATTERNS — the existing prune path drops them (and accumulated duplicates) on the next setup.sh run
  • src/lib/audit-hooks.ts: new stale severity. Shipped-pattern command whose script is absent from disk → stale (warn, "re-run setup.sh", exit 0). File exists but isn't in the manifest → still suspicious (exit 1) — that's the real dropped-payload shape, and the signal is now sharper
  • verify-hooks.ts SessionStart banner only triggers on suspicious, unchanged by stale findings
  • SECURITY.md severity taxonomy updated

Test Plan

  • bun test — 520 pass (new: merge prunes renamed-hook groups + duplicates; stale vs dropped-payload classification; stale doesn't flip hasSuspicious)
  • bun run typecheck / bun run lint

Hook renames left orphaned entries in upgraders' settings.json that
audit:hooks flagged as SUSPICIOUS (exit 1) — a cry-wolf supply-chain alarm
on every legitimate upgrade.

- settings-merge: add parallelmax-nudge, review-queue-nudge, track-tldr,
  tldr-stats to DEPRECATED_COMMAND_PATTERNS so the merge prunes them
- audit-hooks: new 'stale' severity — shipped-pattern command whose script no
  longer exists on disk warns and suggests re-running setup.sh; 'suspicious'
  (exit 1) is reserved for files that exist but aren't in the manifest
  (actual dropped-payload shape)
- SECURITY.md taxonomy updated; tests for both layers
@arzafran arzafran merged commit dbd62cb into main Jun 10, 2026
15 checks passed
@arzafran arzafran deleted the fix/50-stale-hook-audit branch June 10, 2026 18:07
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.

Hook rename leaves stale settings.json entry that audit:hooks flags as suspicious for upgraders

1 participant