-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
feat: add config-health — runtime config integrity monitoring #2496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
YuhaoLin2005
wants to merge
3
commits into
affaan-m:main
Choose a base branch
from
YuhaoLin2005:feat/config-health
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−0
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
704ff78
feat: add config-health — runtime config integrity monitoring
YuhaoLin2005 79b0e34
fix: add When to Activate, How It Works, Examples sections per codera…
YuhaoLin2005 db78a1a
fix: clarify boundary naming + add install merge warning per coderabb…
YuhaoLin2005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| name: config-health | ||
| description: Runtime configuration integrity monitoring for Claude Code. Detects config drift, rule staleness, and hook wiring gaps during sessions. Complements delivery-gate (session-end hard block) with session-duration soft monitoring. | ||
| metadata: | ||
| origin: ECC | ||
| --- | ||
|
|
||
| # Config Health — Runtime Configuration Integrity Monitor | ||
|
|
||
| A real-time monitoring layer for Claude Code configuration integrity. While delivery-gate blocks bad output at session end, config-health catches config problems during the session — when they're still cheap to fix. | ||
|
|
||
| ## Why | ||
|
|
||
| delivery-gate (Stop hook) checks whether work is complete. But by the time the Stop hook fires, subtle config problems have already affected the entire session. Config-health monitors during the session — when problems are cheap to fix. | ||
|
|
||
| Together: config-health = process layer (soft monitoring). delivery-gate = output layer (hard blocking). Defense in depth. | ||
|
|
||
| ## What It Monitors | ||
|
|
||
| 1. Config Rule Health (SessionStart): scans rules, checks hook wiring, detects dead rules | ||
| 2. Hook Wiring Audit (PreToolUse): verifies scripts exist and are wired before high-risk calls | ||
| 3. Guard Script Staleness: checks maintenance windows of guard scripts | ||
|
|
||
| ## Install | ||
|
|
||
| ```json | ||
| { | ||
| "hooks": { | ||
| "SessionStart": [{ | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
| "hooks": [{"type": "command", "command": "python3 ~/.claude/scripts/config-health.py --startup", "timeout": 5000}] | ||
| }], | ||
| "PreToolUse": [{ | ||
| "matcher": "Edit|Write", | ||
| "hooks": [{"type": "command", "command": "python3 ~/.claude/scripts/config-health.py --pretool", "timeout": 3000}] | ||
| }] | ||
| } | ||
| } | ||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| ## Integration With delivery-gate | ||
|
|
||
| Session Start → config-health scans rules/hooks (soft warnings, never blocks) | ||
| Session Work → config-health monitors wiring (PreToolUse guard) | ||
| Session End → delivery-gate verifies capture/disk (hard block, exit 2) | ||
|
|
||
| Boundary: "Can this be fixed retroactively?" Config drift = yes → warn. Missing growth-log = no → block. | ||
|
|
||
| ## Design Principles | ||
|
|
||
| 1. Never block on process monitoring | ||
| 2. Check what delivery-gate can't | ||
| 3. Zero false positives on hook wiring | ||
| 4. Organic growth — each channel added when a failure mode was observed | ||
|
|
||
| ## Files | ||
|
|
||
| | File | Purpose | Hook | | ||
| |------|---------|------| | ||
| | scripts/config-health.py | Rule health, hook audit, staleness | SessionStart + PreToolUse | | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.