Skip to content

CR-LIC-03a: HARD node-cap enforcement — the wall now bites - #237

Merged
harishquantamix merged 1 commit into
masterfrom
cr-lic-03a-hard-node-cap-public
Jul 27, 2026
Merged

harishquantamix merged 1 commit into
masterfrom
cr-lic-03a-hard-node-cap-public

Conversation

@quantamixsol

Copy link
Copy Markdown
Owner

Public cherry-pick of private-merged #313. This is the repo whose wheel ships to PyPI, so the hard cap only reaches users once it lands here.

What

The node-cap goes from WARN-only to a HARD block:

  • meter.py: NodeCapExceeded + enforcement_enabled() (ON BY DEFAULT; GRAQLE_ENFORCE_CAPS opt-OUT only) + UsageMeter.enforce() (blocks only enforced+capped+AT_CAP+grace-elapsed; unlimited exempt; record() never raises; _store preserves cap_first_hit_at across HWM writes).
  • scan.py: PRE-WRITE gate before _write_with_lock at both chokepoints — a real block PREVENTS growth past cap (not cosmetic). Reads never blocked.

Invariants

Reads never blocked · unlimited tiers exempt · enforced ON by default · grace window · HWM + grace-stamp anti-dodge. Honest limit: local .graqle/meter.json resettable by deletion (server-side accounting later).

Verified

Diff vs public master is self-contained CR-LIC-03a (no unrelated drift). Both files parse; 48 enforcement + 277 licensing/scan tests pass on the public branch.

Sentinel

graq_reason pass 1 BLOCK (cosmetic-enforcement: graph written before the block) → pre-write gate fix → pass 2 APPROVE 88% 0-BLOCKER.

Scope

Own version lane — NOT the concurrent 0.81.0 release. No version/release files touched. ADR-245 records all decisions.

🤖 Generated with Claude Code

Public cherry-pick of private-merged #313. This is the repo whose wheel ships to
PyPI, so the hard cap only reaches users once it lands here.

The node-cap goes from WARN-only to a HARD block:
- meter.py: NodeCapExceeded + enforcement_enabled() (ON BY DEFAULT; GRAQLE_ENFORCE_CAPS
  is opt-OUT only) + UsageMeter.enforce() (blocks only enforced+capped+AT_CAP+grace-
  elapsed; unlimited exempt; record() never raises; _store preserves cap_first_hit_at).
- scan.py: PRE-WRITE gate before _write_with_lock at both chokepoints — a real block
  PREVENTS growth past cap (not cosmetic). Reads never blocked.

Sentinel APPROVE 88% 0-BLOCKER (pass 1 caught cosmetic-enforcement, fixed via pre-write
gate). 277 licensing+scan tests pass. Own version lane — NOT the concurrent 0.81.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🛡️ GraQle PR Guardian

💥 Blast Radius: 3 modules affected

Module Files Changed Risk Level Impact Radius
graqle 2 🟡 T2 2
tests 1 🟢 T1 1

Total blast radius: 3


🏛️ Governance Verdict

⚠️ WARN

  • T2: Advisory warnings detected. Review recommended.

🔍 SHACL Violations

No SHACL violations detected.


🔐 Approval Requirements

This PR requires approval from: T2

  • A Senior Engineer or above must approve.

Approval requirement NOT yet satisfied.


Metric Value
Blast Radius 3
Files Analyzed 3
Blocked 0
SHACL Violations 0
Verdict WARN

🔬 Powered by GraQle PR Guardian v0.1.0 · Scan completed 2026-07-26T21:36:45.834304+00:00

@harishquantamix
harishquantamix merged commit b78dca9 into master Jul 27, 2026
19 of 20 checks passed
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