feat(miner): synthesize deny-hook rules from blocker history (#4522) - #4525
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4525 +/- ##
=======================================
Coverage 94.04% 94.04%
=======================================
Files 422 422
Lines 37600 37600
Branches 13736 13736
=======================================
Hits 35362 35362
Misses 1583 1583
Partials 655 655 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-10 00:02:05 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Closes #4522
Summary
packages/gittensory-miner/lib/deny-hook-synthesis.js: derive proposal-only deny-hook rules from a repo's blocker-code + changed-path history, shaped to matchDEFAULT_DENY_RULES(matcher,pathPattern,reason).initDenyHookSynthesisStore()for refreshable local SQLite persistence with an explicit proposed → approved gate — synthesized rules never block tool calls until approved; unapproved proposals merge nowhere.resolveEffectiveDenyRules()to mergeDEFAULT_DENY_RULES+ approved synthesized rules for maintainer: PreToolUse-hook-enforced house rules (deny even under bypassPermissions) #2343's PreToolUse consumption surface.Companion to #2343 (enforce a rule list) — this issue owns automatic derivation + audit trail; #2343 owns live hook wiring.
Scope
N blocks touching path X→**/pathdeny rule)approvedproposals affectresolveEffectiveDenyRules.github/workflows/**, etc.)Test plan
test/unit/miner-deny-hook-synthesis.test.ts— synthesis shape, default fallback, approved merge blocks matching writes, store refresh preserves approvalnpm run build:minernpm run test:cigreennpm audit --audit-level=moderatecleanValidation
Changed files
packages/gittensory-miner/lib/deny-hook-synthesis.jspackages/gittensory-miner/lib/deny-hook-synthesis.d.tspackages/gittensory-miner/package.jsontest/unit/miner-deny-hook-synthesis.test.ts