speclock 4.5.5 → 4.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ AI: ⚠️ BLOCKED — violates lock "Never touch the auth system"
30
30
  Should I find another approach?
31
31
  ```
32
32
 
33
- **60 test suites. 100% detection. 0% false positives. Gemini Flash hybrid for universal domain coverage.**
33
+ **557 tests. 98% pass rate. 0 false positives across 5 domains. Gemini Flash hybrid for universal domain coverage.**
34
34
 
35
35
  ---
36
36
 
@@ -109,7 +109,7 @@ Same config — add to `.cursor/mcp.json` or equivalent.
109
109
  |---|:---:|:---:|:---:|:---:|
110
110
  | Remembers context | Yes | Yes | Manual | **Yes** |
111
111
  | **Blocks the AI from breaking things** | No | No | No | **Yes** |
112
- | **Semantic conflict detection** | No | No | No | **100% detection, 0% FP** |
112
+ | **Semantic conflict detection** | No | No | No | **98% detection, 0% FP** |
113
113
  | **Tamper-proof audit trail** | No | No | No | **HMAC-SHA256 chain** |
114
114
  | **Hard enforcement (AI cannot proceed)** | No | No | No | **Yes** |
115
115
  | **SOC 2 / HIPAA compliance exports** | No | No | No | **Yes** |
@@ -134,7 +134,7 @@ Not keyword matching — **real semantic analysis** with Gemini Flash hybrid for
134
134
  <tr><td>Dilution attacks</td><td>100%</td><td>Violation buried in multi-part request</td></tr>
135
135
  <tr><td>Compound sentences</td><td>100%</td><td>"Update UI and also drop users table"</td></tr>
136
136
  <tr><td>Synonym substitution</td><td>100%</td><td>"Sunset the API" = remove the API</td></tr>
137
- <tr><td>Payment brand names</td><td>100%</td><td>"Add Razorpay" vs "Never change payment gateway"</td></tr>
137
+ <tr><td>Payment brand names (11 gateways)</td><td>100%</td><td>"Add Razorpay" / "Implement PayU" vs "Must use Stripe"</td></tr>
138
138
  <tr><td>Salary/payroll cross-vocab</td><td>100%</td><td>"Optimize salary" vs "Payroll records locked"</td></tr>
139
139
  <tr><td>Safety system bypass</td><td>100%</td><td>"Disable safety interlock" = bypass safety</td></tr>
140
140
  <tr><td>Unknown domains (via Gemini)</td><td>100%</td><td>Gaming, biotech, aerospace, music, legal</td></tr>
@@ -386,7 +386,7 @@ The AI opens the file and sees:
386
386
  ┌────────────▼──────────────────▼──────────────────┐
387
387
  │ SpecLock Core Engine │
388
388
  │ │
389
- │ Semantic Engine ─── 55 synonym groups
389
+ │ Semantic Engine ─── 65+ synonym groups
390
390
  │ HMAC Audit ──────── SHA-256 hash chain │
391
391
  │ Enforcer ────────── advisory / hard block │
392
392
  │ Auth + RBAC ─────── 4 roles, API keys │
@@ -409,17 +409,35 @@ The AI opens the file and sees:
409
409
 
410
410
  ---
411
411
 
412
+ ## Configuration
413
+
414
+ | Variable | Default | Description |
415
+ |----------|---------|-------------|
416
+ | `SPECLOCK_API_KEY` | — | API key for authenticated access |
417
+ | `SPECLOCK_ENCRYPTION_KEY` | — | Enables AES-256-GCM encryption at rest |
418
+ | `SPECLOCK_NO_PROXY` | `false` | Set `true` for heuristic-only mode (~250ms). Skips the Gemini proxy (~2s) |
419
+ | `SPECLOCK_LLM_KEY` | — | Your own LLM API key (Gemini/OpenAI/Anthropic) |
420
+ | `GEMINI_API_KEY` | — | Google Gemini API key for hybrid conflict detection |
421
+ | `SPECLOCK_TELEMETRY` | `false` | Opt-in anonymous usage analytics |
422
+
423
+ > **Tip:** The heuristic engine alone scores 95%+ accuracy at ~250ms. The Gemini proxy adds cross-domain coverage but takes ~2s. For fastest response, set `SPECLOCK_NO_PROXY=true`.
424
+
425
+ ---
426
+
412
427
  ## Test Results
413
428
 
414
- | Suite | Tests | Pass Rate |
415
- |-------|------:|----------:|
416
- | Direct Mode (heuristic) | 17 | 100% |
417
- | Payment/Salary Domain | 18 | 100% |
418
- | Gemini Hybrid (8 domains) | 16 | 100% |
419
- | Proxy API Endpoint | 9 | 100% |
420
- | **Total** | **60** | **100%** |
429
+ | Suite | Tests | Pass Rate | What it covers |
430
+ |-------|------:|----------:|----------------|
431
+ | Adversarial Conflict | 61 | 100% | Euphemisms, temporal evasion, compound sentences |
432
+ | Phase 4 (Multi-domain) | 91 | 100% | Fintech, e-commerce, IoT, healthcare, SaaS |
433
+ | John (Indie Dev Journey) | 86 | 100% | 8-session Bolt.new build with 5 locks |
434
+ | Sam (Enterprise HIPAA) | 124 | 100% | HIPAA locks, PHI, encryption, RBAC |
435
+ | Real-World Testers | 105 | 95% | 5 developers, 30+ locks, diverse domains |
436
+ | Payment/Salary/PII | 35 | 100% | Cross-vocabulary: payroll, salary, compensation |
437
+ | Claude Tester (G-Suite) | 55 | 95% | Independent AI tester, adversarial probing |
438
+ | **Total** | **557** | **98%** | |
421
439
 
422
- Tested across: fintech, e-commerce, IoT, healthcare, SaaS, gaming, biotech, aerospace, music, legal, payments, payroll. Zero false positives on UI/cosmetic actions.
440
+ Tested across: fintech, e-commerce, IoT, healthcare, SaaS, gaming, biotech, aerospace, payments, payroll. All 11 Indian payment gateways detected (Razorpay, PayU, Cashfree, PhonePe, Paytm, CCAvenue, BillDesk, Instamojo, Juspay, Stripe, PayPal). Zero false positives on UI/cosmetic actions.
423
441
 
424
442
  ---
425
443
 
@@ -457,4 +475,4 @@ Built by **[Sandeep Roy](https://github.com/sgroy10)**
457
475
 
458
476
  ---
459
477
 
460
- <p align="center"><i>v4.5.5600+ tests, 31 MCP tools, 0 false positives, Gemini hybrid. Because remembering isn't enough.</i></p>
478
+ <p align="center"><i>v4.5.7557 tests, 98% pass rate, 31 MCP tools, Gemini hybrid. Because remembering isn't enough.</i></p>
package/package.json CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  "name": "speclock",
4
4
 
5
- "version": "4.5.5",
5
+ "version": "4.5.7",
6
6
 
7
- "description": "AI constraint engine with Gemini LLM universal detection, Policy-as-Code DSL, OAuth/OIDC SSO, admin dashboard, telemetry, API key auth, RBAC, AES-256-GCM encryption, hard enforcement, semantic pre-commit, HMAC audit chain, SOC 2/HIPAA compliance. Cross-platform: MCP + direct API. 31 MCP tools + CLI. Enterprise platform.",
7
+ "description": "AI constraint engine stops AI from breaking what you locked. Semantic detection, Gemini LLM hybrid, 31 MCP tools, HMAC audit chain, RBAC, encryption, SOC 2/HIPAA compliance. Works with Claude Code, Cursor, Bolt.new, Lovable.",
8
8
 
9
9
  "type": "module",
10
10
 
package/src/cli/index.js CHANGED
@@ -117,7 +117,7 @@ function refreshContext(root) {
117
117
 
118
118
  function printHelp() {
119
119
  console.log(`
120
- SpecLock v4.5.5 — AI Constraint Engine (Gemini LLM + Policy-as-Code + SSO + Dashboard + Telemetry + Auth + RBAC + Encryption)
120
+ SpecLock v4.5.7 — AI Constraint Engine (Gemini LLM + Policy-as-Code + SSO + Dashboard + Telemetry + Auth + RBAC + Encryption)
121
121
  Developed by Sandeep Roy (github.com/sgroy10)
122
122
 
123
123
  Usage: speclock <command> [options]
@@ -9,7 +9,7 @@
9
9
  import { readBrain, readEvents } from "./storage.js";
10
10
  import { verifyAuditChain } from "./audit.js";
11
11
 
12
- const VERSION = "4.5.5";
12
+ const VERSION = "4.5.7";
13
13
 
14
14
  // PHI-related keywords for HIPAA filtering
15
15
  const PHI_KEYWORDS = [
@@ -124,7 +124,7 @@ export const SYNONYM_GROUPS = [
124
124
  "payment service", "payment platform"],
125
125
  ["razorpay", "stripe", "paypal", "phonepe", "paytm", "ccavenue",
126
126
  "cashfree", "braintree", "adyen", "square", "google pay", "gpay",
127
- "juspay", "billdesk", "instamojo"],
127
+ "juspay", "billdesk", "instamojo", "payu"],
128
128
 
129
129
  // --- IoT / firmware ---
130
130
  ["firmware", "firmware update", "ota", "over the air",
@@ -467,6 +467,8 @@ export const CONCEPT_MAP = {
467
467
  "transaction", "billing", "razorpay", "ccavenue"],
468
468
  "instamojo": ["payment gateway", "payment processing", "payment",
469
469
  "transaction", "billing", "razorpay", "cashfree"],
470
+ "payu": ["payment gateway", "payment processing", "payment",
471
+ "transaction", "billing", "razorpay", "stripe", "cashfree"],
470
472
  "upi": ["payment gateway", "payment processing", "phonepe",
471
473
  "paytm", "google pay", "razorpay",
472
474
  "transaction", "payment"],
@@ -2077,7 +2079,7 @@ export function scoreConflict({ actionText, lockText }) {
2077
2079
  // These are specific nouns (not verbs, not stopwords) that identify the technology
2078
2080
  const TECH_BRANDS = new Set([
2079
2081
  "stripe", "razorpay", "paypal", "phonepe", "paytm", "ccavenue", "cashfree",
2080
- "braintree", "adyen", "square", "billdesk", "instamojo", "juspay",
2082
+ "braintree", "adyen", "square", "billdesk", "instamojo", "juspay", "payu",
2081
2083
  "postgresql", "postgres", "mysql", "mongodb", "mongo", "firebase",
2082
2084
  "firestore", "supabase", "dynamodb", "redis", "sqlite", "mariadb",
2083
2085
  "cassandra", "couchdb", "neo4j",
@@ -257,7 +257,7 @@ export async function flushToRemote(root) {
257
257
  // Build anonymized payload
258
258
  const payload = {
259
259
  instanceId: summary.instanceId,
260
- version: "4.5.5",
260
+ version: "4.5.7",
261
261
  totalCalls: summary.totalCalls,
262
262
  avgResponseMs: summary.avgResponseMs,
263
263
  conflicts: summary.conflicts,
@@ -89,7 +89,7 @@
89
89
  <div class="header">
90
90
  <div>
91
91
  <h1><span>SpecLock</span> Dashboard</h1>
92
- <div class="meta">v4.5.5 &mdash; AI Constraint Engine</div>
92
+ <div class="meta">v4.5.7 &mdash; AI Constraint Engine</div>
93
93
  </div>
94
94
  <div style="display:flex;align-items:center;gap:12px;">
95
95
  <span id="health-badge" class="status-badge healthy">Loading...</span>
@@ -182,7 +182,7 @@
182
182
  </div>
183
183
 
184
184
  <div style="text-align:center;padding:24px;color:var(--muted);font-size:12px;">
185
- SpecLock v4.5.5 &mdash; Developed by Sandeep Roy &mdash; <a href="https://github.com/sgroy10/speclock" style="color:var(--accent)">GitHub</a>
185
+ SpecLock v4.5.7 &mdash; Developed by Sandeep Roy &mdash; <a href="https://github.com/sgroy10/speclock" style="color:var(--accent)">GitHub</a>
186
186
  </div>
187
187
 
188
188
  <script>
@@ -91,7 +91,7 @@ import { fileURLToPath } from "url";
91
91
  import _path from "path";
92
92
 
93
93
  const PROJECT_ROOT = process.env.SPECLOCK_PROJECT_ROOT || process.cwd();
94
- const VERSION = "4.5.5";
94
+ const VERSION = "4.5.7";
95
95
  const AUTHOR = "Sandeep Roy";
96
96
  const START_TIME = Date.now();
97
97
 
package/src/mcp/server.js CHANGED
@@ -100,7 +100,7 @@ const PROJECT_ROOT =
100
100
  args.project || process.env.SPECLOCK_PROJECT_ROOT || process.cwd();
101
101
 
102
102
  // --- MCP Server ---
103
- const VERSION = "4.5.5";
103
+ const VERSION = "4.5.7";
104
104
  const AUTHOR = "Sandeep Roy";
105
105
 
106
106
  const server = new McpServer(