git:20260820.1cddfe2 to git:20260914.8205252
1 added, 1 removed. Audit A to A.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
description: "AI rules for com.example.service.InventoryService"
- globs: ["**/InventoryService.java"]
+ globs: **/InventoryService.java
alwaysApply: false
---
<!-- VIBETAGS-START -->
# Rules for InventoryService
## Context & Focus
- **Focus**: Maintain inventory consistency across concurrent requests. All stock updates must be atomic.
- **Avoid**: Non-atomic read-modify-write sequences, unsynchronized shared state
### Rules for field customerId
- **Rule**: Never log or expose runtime values of this element.
- **Reason**: Customer identifiers linked to purchase history — PII under GDPR
### Rules for method releaseReservation
- **Sensitivity**: High
- **Note**: Must be called as the exact inverse of reserveStock. Pair changes to both methods together.
### Rules for method reserveStock
- **Sensitivity**: Critical
- **Note**: Reservation logic handles concurrent requests via optimistic locking. Took 18 months to get right under high load — do not refactor without running the full concurrency test suite.
## Performance Constraints
- **Rule**: Optimal complexity required. O(n^2) is forbidden on hot paths.
### Rules for method bulkRestock
- **Constraint**: Must process 10 000 SKU updates/second. O(n) acceptable; O(n log n) only if unavoidable; O(n²) is forbidden.
### Rules for method getAvailableStock
- **Constraint**: O(1) lookup required. Must complete in <2ms p99. No database calls permitted; reads from in-memory cache only.
### Rules for method sendLowStockAlert
- **Flag**: 'inventory.push-alerts.enabled' (default: false)
- **Rule**: This code is gated behind a feature flag. Preserve the flag check. Never assume the flag is always active.
<!-- VIBETAGS-END -->