speclock 3.5.2 โ†’ 3.5.3

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
@@ -1,103 +1,87 @@
1
- # SpecLock
1
+ <p align="center">
2
+ <img src="https://img.shields.io/badge/๐Ÿ”’-SpecLock-000000?style=for-the-badge&labelColor=000000&color=4F46E5" alt="SpecLock" height="40" />
3
+ </p>
2
4
 
3
- **AI Constraint Engine** โ€” Memory + enforcement for AI coding tools. The only solution that makes your AI **respect boundaries**, not just remember things.
5
+ <h3 align="center">Your AI keeps breaking things you told it not to touch.<br/>SpecLock makes it stop.</h3>
4
6
 
5
- > Developed by **Sandeep Roy** ([github.com/sgroy10](https://github.com/sgroy10))
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/speclock"><img src="https://img.shields.io/npm/v/speclock.svg?style=flat-square&color=4F46E5" alt="npm version" /></a>
9
+ <a href="https://www.npmjs.com/package/speclock"><img src="https://img.shields.io/npm/dm/speclock.svg?style=flat-square&color=22C55E" alt="npm downloads" /></a>
10
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT License" /></a>
11
+ <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-31_tools-green.svg?style=flat-square" alt="MCP 31 tools" /></a>
12
+ </p>
6
13
 
7
- **Website**: [sgroy10.github.io/speclock](https://sgroy10.github.io/speclock/) | **npm**: [npmjs.com/package/speclock](https://www.npmjs.com/package/speclock) | **Smithery**: [smithery.ai/servers/sgroy10/speclock](https://smithery.ai/servers/sgroy10/speclock)
8
-
9
- [![npm version](https://img.shields.io/npm/v/speclock.svg)](https://www.npmjs.com/package/speclock)
10
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
- [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io)
12
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)
14
+ <p align="center">
15
+ <a href="https://sgroy10.github.io/speclock/">Website</a> ยท <a href="https://www.npmjs.com/package/speclock">npm</a> ยท <a href="https://smithery.ai/servers/sgroy10/speclock">Smithery</a> ยท <a href="https://github.com/sgroy10/speclock">GitHub</a>
16
+ </p>
13
17
 
14
18
  ---
15
19
 
16
- ## The Problem
17
-
18
- AI tools now have memory. Claude Code has auto-memory. Cursor has Memory Bank. Mem0 exists.
20
+ ```
21
+ You: "Never touch the auth system"
22
+ AI: ๐Ÿ”’ Locked.
19
23
 
20
- **But memory without enforcement is dangerous.**
24
+ ... 5 sessions later ...
21
25
 
22
- - Your AI remembers you use PostgreSQL โ€” then switches to MongoDB because it "seemed better"
23
- - Your AI remembers your auth setup โ€” then rewrites it while "fixing" a bug
24
- - Your AI remembers your constraints โ€” then ignores them when they're inconvenient
25
- - You said "never touch auth files" 3 sessions ago โ€” the AI doesn't care
26
+ You: "Add social login to the login page"
27
+ AI: โš ๏ธ BLOCKED โ€” violates lock "Never touch the auth system"
28
+ Matched: auth โ†’ authentication (synonym), login โ†’ auth (concept)
29
+ Confidence: 100%
30
+ Should I find another approach?
31
+ ```
26
32
 
27
- **Remembering is not the same as respecting.** AI tools need guardrails, not just memory.
33
+ **601 tests. 95.65% adversarial detection. 0% false positives. Zero LLM API calls. Pure JavaScript.**
28
34
 
29
- ## The Solution
35
+ ---
30
36
 
31
- SpecLock adds **active constraint enforcement** on top of persistent memory. When your AI tries to break something you locked, SpecLock **stops it before the damage is done**.
37
+ ## Install
32
38
 
39
+ ```bash
40
+ npx speclock setup --goal "Build my app"
33
41
  ```
34
- You: "Don't ever touch the auth files"
35
- AI: ๐Ÿ”’ Locked: "Never modify auth files"
36
42
 
37
- ... 5 sessions later ...
43
+ That's it. One command. Works everywhere โ€” Bolt.new, Claude Code, Cursor, Lovable, Windsurf, Cline, Aider.
38
44
 
39
- You: "Add social login to the login page"
40
- AI: โš ๏ธ CONFLICT: This violates your lock "Never modify auth files"
41
- Should I proceed or find another approach?
42
- ```
45
+ ## The Problem
43
46
 
44
- No other tool does this. Not Claude's native memory. Not Mem0. Not CLAUDE.md files.
47
+ AI coding tools have memory now. Claude Code has `CLAUDE.md`. Cursor has `.cursorrules`. Mem0 exists.
45
48
 
46
- ## How SpecLock Is Different
49
+ **But memory without enforcement is useless.**
47
50
 
48
- | Feature | Claude Native Memory | Mem0 | CLAUDE.md / .cursorrules | **SpecLock** |
49
- |---------|---------------------|------|--------------------------|--------------|
50
- | Remembers context | Yes | Yes | Manual | **Yes** |
51
- | **Stops the AI from breaking things** | No | No | No | **Yes โ€” active enforcement** |
52
- | **Semantic conflict detection** | No | No | No | **Yes โ€” semantic engine v2 (100% detection, 0% false positives)** |
53
- | **Tamper-proof audit trail** | No | No | No | **Yes โ€” HMAC-SHA256 hash chain** |
54
- | **Compliance exports** | No | No | No | **Yes โ€” SOC 2, HIPAA, CSV** |
55
- | Works on Bolt.new | No | No | No | **Yes โ€” npm file-based mode** |
56
- | Works on Lovable | No | No | No | **Yes โ€” MCP remote** |
57
- | Structured decisions/locks | No | Tags only | Flat text | **Goals, locks, decisions, changes** |
58
- | Git-aware (checkpoints, rollback) | No | No | No | **Yes** |
59
- | Drift detection | No | No | No | **Yes โ€” scans changes against locks** |
60
- | CI/CD integration | No | No | No | **Yes โ€” GitHub Actions** |
61
- | **Hard enforcement (block violations)** | No | No | No | **Yes โ€” hard mode blocks above threshold** |
62
- | **API Key Auth + RBAC** | No | No | No | **Yes** |
63
- | **Encrypted Storage (AES-256)** | No | No | No | **Yes** |
64
- | **Policy-as-Code DSL** | No | No | No | **Yes โ€” declarative YAML rules** |
65
- | **OAuth/OIDC SSO** | No | No | No | **Yes โ€” Okta, Azure AD, Auth0** |
66
- | **Admin Dashboard** | No | No | No | **Yes โ€” real-time web UI** |
67
- | **Telemetry & Analytics** | No | No | No | **Yes โ€” opt-in usage insights** |
68
- | Multi-agent timeline | No | No | No | **Yes** |
69
- | Cross-platform | Claude only | MCP only | Tool-specific | **Universal (MCP + npm)** |
70
-
71
- **Other tools remember. SpecLock enforces.**
51
+ Your AI *remembers* you use PostgreSQL โ€” then switches to MongoDB because it "seemed better." Your AI *remembers* your auth setup โ€” then rewrites it while "fixing" a bug. You said "never touch the payment logic" 3 sessions ago โ€” the AI doesn't care.
72
52
 
73
- ## Quick Start
53
+ **Remembering is not respecting.** No existing tool stops the AI from breaking what you locked.
74
54
 
75
- ### Bolt.new / Aider / Any npm Platform (No MCP Needed)
55
+ ## How It Works
76
56
 
77
- Just tell the AI:
57
+ You set constraints. SpecLock enforces them โ€” across sessions, across tools, across teams.
78
58
 
79
59
  ```
80
- "Install speclock and set up project memory"
60
+ speclock lock "Never modify auth files" โ†’ auto-guards src/auth/*.ts
61
+ speclock lock "Database must stay PostgreSQL" โ†’ catches "migrate to MongoDB"
62
+ speclock lock "Never delete patient records" โ†’ catches "clean up old data"
63
+ speclock lock "Don't touch the payment flow" โ†’ catches "streamline checkout"
81
64
  ```
82
65
 
83
- Or run it yourself:
84
-
85
- ```bash
86
- npx speclock setup --goal "Build my app"
87
- ```
66
+ The semantic engine doesn't do keyword matching. It understands:
67
+ - **"clean up old data"** = deletion (euphemism detection)
68
+ - **"streamline checkout"** = modify payment flow (synonym + concept mapping)
69
+ - **"temporarily disable logging"** = disable logging (temporal evasion detection)
70
+ - **"Update UI and also drop the users table"** = hidden violation (compound splitter)
88
71
 
89
- **That's it.** SpecLock creates `SPECLOCK.md`, injects a marker into `package.json`, and generates `.speclock/context/latest.md`. The AI reads these automatically and follows the rules. When the AI returns in a new session, it sees the SpecLock marker in `package.json` and knows to check the rules before making changes.
72
+ And it knows what's safe:
73
+ - **"Enable audit logging"** when the lock says "Never *disable* audit logging" โ†’ **no conflict** (intent alignment)
90
74
 
91
- ### Lovable (MCP Remote โ€” No Install)
75
+ ## Quick Start by Platform
92
76
 
93
- 1. Go to **Settings โ†’ Connectors โ†’ Personal connectors โ†’ New MCP server**
94
- 2. Enter URL: `https://speclock-mcp-production.up.railway.app/mcp` โ€” No auth
95
- 3. Paste [Project Instructions](#project-instructions) into Knowledge
96
-
97
- ### Claude Code (MCP Local)
98
-
99
- Add to `.claude/settings.json` or `.mcp.json`:
77
+ ### Bolt.new / Aider / Any npm Platform
78
+ ```bash
79
+ npx speclock setup --goal "Build my app" --template nextjs
80
+ ```
81
+ Creates `SPECLOCK.md`, injects rules into `package.json`, generates `.speclock/context/latest.md`. The AI reads these automatically.
100
82
 
83
+ ### Claude Code
84
+ Add to `.mcp.json`:
101
85
  ```json
102
86
  {
103
87
  "mcpServers": {
@@ -110,435 +94,367 @@ Add to `.claude/settings.json` or `.mcp.json`:
110
94
  ```
111
95
 
112
96
  ### Cursor / Windsurf / Cline
97
+ Same config โ€” add to `.cursor/mcp.json` or equivalent.
113
98
 
114
- Same MCP config as Claude Code. Add to `.cursor/mcp.json` or equivalent.
99
+ ### Lovable (No Install)
100
+ 1. Go to **Settings โ†’ Connectors โ†’ New MCP server**
101
+ 2. Enter URL: `https://speclock-mcp-production.up.railway.app/mcp`
102
+ 3. Paste [project instructions](SPECLOCK-INSTRUCTIONS.md) into Knowledge
115
103
 
116
- ### Project Instructions
104
+ ---
117
105
 
118
- For MCP platforms, paste these rules into your platform's instruction settings (Lovable Knowledge, .cursorrules, CLAUDE.md, etc.):
106
+ ## Why SpecLock Over Alternatives?
119
107
 
120
- ```
121
- ## SpecLock Rules (MANDATORY โ€” follow on every message)
122
-
123
- 1. START: Call speclock_session_briefing FIRST. Show: "๐Ÿ”’ Memory loaded โ€” X locks, Y decisions."
124
- 2. BEFORE CHANGES: Call speclock_check_conflict. If HIGH conflict, STOP and warn.
125
- 3. LOCK: When user says "never/always/don't touch" โ†’ call speclock_add_lock immediately.
126
- 4. AFTER FEATURES: Call speclock_log_change with summary + files affected.
127
- 5. UNLOCK: When user wants to change something locked โ†’ warn first, only proceed on confirm.
128
- 6. END: Call speclock_session_summary with what was accomplished.
129
- ```
108
+ | | Claude Memory | Mem0 | `.cursorrules` | **SpecLock** |
109
+ |---|:---:|:---:|:---:|:---:|
110
+ | Remembers context | Yes | Yes | Manual | **Yes** |
111
+ | **Blocks the AI from breaking things** | No | No | No | **Yes** |
112
+ | **Semantic conflict detection** | No | No | No | **95.65% detection, 0% FP** |
113
+ | **Tamper-proof audit trail** | No | No | No | **HMAC-SHA256 chain** |
114
+ | **Hard enforcement (AI cannot proceed)** | No | No | No | **Yes** |
115
+ | **SOC 2 / HIPAA compliance exports** | No | No | No | **Yes** |
116
+ | **Encrypted storage (AES-256-GCM)** | No | No | No | **Yes** |
117
+ | **RBAC + API key auth** | No | No | No | **4 roles** |
118
+ | **Policy-as-Code DSL** | No | No | No | **YAML rules** |
119
+ | Works on Bolt.new, Lovable, etc. | No | No | No | **Yes** |
120
+
121
+ **Other tools remember. SpecLock enforces.**
130
122
 
131
- See [SPECLOCK-INSTRUCTIONS.md](SPECLOCK-INSTRUCTIONS.md) for platform-specific versions.
123
+ ---
132
124
 
133
- ## What It Looks Like In Practice
125
+ ## Semantic Engine v2
134
126
 
135
- ### Bolt.new โ€” Session 1 (Setup)
136
- ```
137
- User: "Install speclock and set up memory for my SaaS"
127
+ Not keyword matching โ€” **real semantic analysis**. Tested against 61 adversarial attack vectors.
138
128
 
139
- Bolt: โœ“ Ran npx speclock setup
140
- โœ“ Set goal: "Build B2B SaaS API"
141
- โœ“ Added 6 locks (auth, security, rate limiting...)
142
- โœ“ Recorded 7 decisions (Supabase, Stripe, Gemini...)
143
- โœ“ Context file generated โ€” project memory active
144
- ```
129
+ <table>
130
+ <tr><td><b>Category</b></td><td><b>Detection</b></td><td><b>Example</b></td></tr>
131
+ <tr><td>Direct violations</td><td>100%</td><td>"Delete the auth module" vs lock "Never modify auth"</td></tr>
132
+ <tr><td>Euphemistic attacks</td><td>100%</td><td>"Clean up old patient data" = deletion</td></tr>
133
+ <tr><td>Temporal evasion</td><td>100%</td><td>"Temporarily disable MFA" = disable MFA</td></tr>
134
+ <tr><td>Dilution attacks</td><td>100%</td><td>Violation buried in multi-part request</td></tr>
135
+ <tr><td>Compound sentences</td><td>100%</td><td>"Update UI and also drop users table"</td></tr>
136
+ <tr><td>Synonym substitution</td><td>95%+</td><td>"Sunset the API" = remove the API</td></tr>
137
+ <tr><td>Safe actions (true negatives)</td><td>0% FP</td><td>"Add dark mode" correctly passes all locks</td></tr>
138
+ </table>
139
+
140
+ **Under the hood:** 55 synonym groups ยท 70+ euphemism mappings ยท domain concept maps ยท intent classifier ยท compound sentence splitter ยท temporal evasion detector โ€” all in pure JavaScript. Zero API calls. Zero latency.
141
+
142
+ ---
143
+
144
+ ## Hard Enforcement
145
+
146
+ Two modes:
145
147
 
146
- ### Bolt.new โ€” Session 2 (Full Memory)
147
148
  ```
148
- User: "Create a plan for the API endpoints"
149
+ Advisory (default): AI gets a warning, decides what to do
150
+ Hard mode: AI is BLOCKED โ€” MCP returns isError, AI cannot proceed
151
+ ```
149
152
 
150
- Bolt: โœ“ Read project context (6 locks, 7 decisions)
151
- โœ“ Created 10-phase plan respecting ALL constraints
152
- โœ“ All plans use Supabase (locked), Bearer auth (locked)
153
- โœ“ Logged planning phase back to SpecLock
153
+ ```bash
154
+ speclock enforce hard # Enable hard mode โ€” violations above threshold are blocked
154
155
  ```
155
156
 
156
- ### Any Platform โ€” Constraint Enforcement
157
+ - **Configurable threshold** โ€” default 70%. Only HIGH confidence conflicts block.
158
+ - **Override with reason** โ€” `speclock override <lockId> "JIRA-1234: approved by CTO"` (logged to audit trail)
159
+ - **Auto-escalation** โ€” lock overridden 3+ times โ†’ auto-flags for review
160
+
161
+ ---
162
+
163
+ ## Enterprise Security
164
+
165
+ ### API Key Auth + RBAC
166
+
167
+ ```bash
168
+ speclock auth create-key --role developer --name "CI Bot"
169
+ # โ†’ sk_speclock_a1b2c3... (shown once, stored as SHA-256 hash)
157
170
  ```
158
- You: "Add social login to the login page"
159
- AI: โš ๏ธ CONFLICT (HIGH โ€” 100%): Violates lock "Never modify auth files"
160
- Reasons:
161
- - Direct keyword match: auth
162
- - Synonym match: security, authentication
163
- - Lock prohibits this action (negation detected)
164
171
 
165
- Should I proceed or find another approach?
172
+ | Role | Read | Write Locks | Override | Admin |
173
+ |------|:---:|:---:|:---:|:---:|
174
+ | `viewer` | Yes | โ€” | โ€” | โ€” |
175
+ | `developer` | Yes | โ€” | With reason | โ€” |
176
+ | `architect` | Yes | Yes | Yes | โ€” |
177
+ | `admin` | Yes | Yes | Yes | Yes |
178
+
179
+ ### AES-256-GCM Encryption
180
+
181
+ ```bash
182
+ export SPECLOCK_ENCRYPTION_KEY="your-secret"
183
+ speclock encrypt # Encrypts brain.json + events.log at rest
166
184
  ```
167
185
 
168
- ## Killer Feature: Semantic Conflict Detection v2
186
+ PBKDF2 key derivation (100K iterations). Authenticated encryption. **HIPAA 2026 compliant.**
187
+
188
+ ### HMAC Audit Chain
189
+
190
+ Every event gets an HMAC-SHA256 hash chained to the previous event. Modify anything โ€” the chain breaks.
191
+
192
+ ```bash
193
+ $ speclock audit-verify
169
194
 
170
- Not keyword matching โ€” **real semantic analysis**. Tested against 61 adversarial attack vectors across 7 categories. **100% detection rate, 0% false positives.**
195
+ โœ“ Audit chain VALID โ€” 247 events, 0 broken links, no tampering detected.
196
+ ```
171
197
 
172
- SpecLock v2's semantic engine includes:
173
- - **55 synonym groups** โ€” "truncate" matches "delete", "flash" matches "overwrite", "sunset" matches "remove"
174
- - **70+ euphemism map** โ€” "clean up old data" detected as deletion, "streamline workflow" detected as removal
175
- - **Domain concept maps** โ€” "safety scanning" links to "CSAM detection", "PHI" links to "patient records"
176
- - **Intent classifier** โ€” "Enable audit logging" correctly allowed when lock says "Never disable audit logging"
177
- - **Compound sentence splitter** โ€” "Update UI and also delete patient records" โ€” catches the hidden violation
178
- - **Temporal evasion detection** โ€” "temporarily disable" treated with same severity as "disable"
179
- - **Optional LLM integration** โ€” Enterprise-grade 99%+ accuracy with OpenAI/Anthropic API
198
+ ### Compliance Exports
180
199
 
200
+ ```bash
201
+ speclock export --format soc2 # SOC 2 Type II report (JSON)
202
+ speclock export --format hipaa # HIPAA PHI protection report
203
+ speclock export --format csv # All events for auditor spreadsheets
181
204
  ```
182
- Lock: "Never delete patient records"
183
- Action: "Clean up old patient data from cold storage"
184
205
 
185
- Result: [HIGH] Conflict detected (confidence: 100%)
186
- - euphemism detected: "clean up" (euphemism for delete)
187
- - concept match: patient data โ†’ patient records
188
- - lock prohibits this action (negation detected)
206
+ ---
207
+
208
+ ## Policy-as-Code
189
209
 
190
- Lock: "Never disable audit logging"
191
- Action: "Enable comprehensive audit logging"
210
+ Declarative YAML rules for organization-wide enforcement:
211
+
212
+ ```yaml
213
+ # .speclock/policy.yml
214
+ rules:
215
+ - name: "HIPAA PHI Protection"
216
+ match:
217
+ files: ["**/patient/**", "**/medical/**"]
218
+ actions: [delete, modify, export]
219
+ enforce: block
220
+ severity: critical
192
221
 
193
- Result: NO CONFLICT (confidence: 7%)
194
- - intent alignment: "enable" is opposite of prohibited "disable" (compliant)
222
+ - name: "No direct DB mutations"
223
+ match:
224
+ files: ["**/models/**"]
225
+ actions: [delete]
226
+ enforce: warn
227
+ severity: high
195
228
  ```
196
229
 
197
- ## Three Integration Modes
230
+ Import and export policies between projects. Share constraint templates across your organization.
198
231
 
199
- | Mode | Platforms | How It Works |
200
- |------|-----------|--------------|
201
- | **MCP Remote** | Lovable, bolt.diy, Base44 | Connect via URL โ€” no install needed |
202
- | **MCP Local** | Claude Code, Cursor, Windsurf, Cline | `npx speclock serve` โ€” 31 tools via MCP |
203
- | **npm File-Based** | Bolt.new, Aider, Rocket.new | `npx speclock setup` โ€” AI reads SPECLOCK.md + uses CLI |
232
+ ---
204
233
 
205
234
  ## 31 MCP Tools
206
235
 
207
- ### Memory Management
208
- | Tool | Purpose |
209
- |------|---------|
236
+ <details>
237
+ <summary><b>Memory</b> โ€” goal, locks, decisions, notes, deploy facts</summary>
238
+
239
+ | Tool | What it does |
240
+ |------|-------------|
210
241
  | `speclock_init` | Initialize SpecLock in project |
211
- | `speclock_get_context` | **THE KEY TOOL** โ€” full context pack |
212
- | `speclock_set_goal` | Set/update project goal |
213
- | `speclock_add_lock` | Add non-negotiable constraint |
214
- | `speclock_remove_lock` | Deactivate a lock by ID |
215
- | `speclock_add_decision` | Record an architectural decision |
216
- | `speclock_add_note` | Add a pinned note |
217
- | `speclock_set_deploy_facts` | Record deploy configuration |
218
-
219
- ### Change Tracking
220
- | Tool | Purpose |
221
- |------|---------|
222
- | `speclock_log_change` | Log a significant change |
223
- | `speclock_get_changes` | Get recent tracked changes |
224
- | `speclock_get_events` | Get event log (filterable) |
225
-
226
- ### Enforcement & Protection
227
- | Tool | Purpose |
228
- |------|---------|
229
- | `speclock_check_conflict` | Check action against locks (semantic matching) |
242
+ | `speclock_get_context` | Full context pack (the key tool) |
243
+ | `speclock_set_goal` | Set project goal |
244
+ | `speclock_add_lock` | Add constraint + auto-guard files |
245
+ | `speclock_remove_lock` | Soft-delete a lock |
246
+ | `speclock_add_decision` | Record architectural decision |
247
+ | `speclock_add_note` | Add pinned note |
248
+ | `speclock_set_deploy_facts` | Record deploy config |
249
+
250
+ </details>
251
+
252
+ <details>
253
+ <summary><b>Enforcement</b> โ€” conflict detection, hard blocking, overrides</summary>
254
+
255
+ | Tool | What it does |
256
+ |------|-------------|
257
+ | `speclock_check_conflict` | Semantic conflict check against all locks |
258
+ | `speclock_set_enforcement` | Switch advisory/hard mode |
259
+ | `speclock_override_lock` | Override with reason (audit logged) |
260
+ | `speclock_override_history` | View override audit trail |
261
+ | `speclock_semantic_audit` | Analyze git diff against locks |
262
+ | `speclock_detect_drift` | Scan for constraint violations |
263
+ | `speclock_audit` | Audit staged files pre-commit |
264
+
265
+ </details>
266
+
267
+ <details>
268
+ <summary><b>Tracking & Sessions</b> โ€” changes, events, session continuity</summary>
269
+
270
+ | Tool | What it does |
271
+ |------|-------------|
230
272
  | `speclock_session_briefing` | Start session + full briefing |
231
273
  | `speclock_session_summary` | End session + record summary |
274
+ | `speclock_log_change` | Log a change with files |
275
+ | `speclock_get_changes` | Recent tracked changes |
276
+ | `speclock_get_events` | Full event log (filterable) |
277
+ | `speclock_checkpoint` | Git tag for rollback |
278
+ | `speclock_repo_status` | Branch, commit, diff summary |
279
+
280
+ </details>
232
281
 
233
- ### Git Integration
234
- | Tool | Purpose |
235
- |------|---------|
236
- | `speclock_checkpoint` | Create named git tag for rollback |
237
- | `speclock_repo_status` | Branch, commit, changed files, diff |
238
-
239
- ### Intelligence
240
- | Tool | Purpose |
241
- |------|---------|
242
- | `speclock_suggest_locks` | AI-powered lock suggestions from patterns |
243
- | `speclock_detect_drift` | Scan changes for constraint violations |
282
+ <details>
283
+ <summary><b>Intelligence</b> โ€” suggestions, health, templates, reports</summary>
284
+
285
+ | Tool | What it does |
286
+ |------|-------------|
287
+ | `speclock_suggest_locks` | AI-powered lock suggestions |
244
288
  | `speclock_health` | Health score + multi-agent timeline |
289
+ | `speclock_apply_template` | Apply constraint template |
290
+ | `speclock_report` | Violation stats + most tested locks |
245
291
 
246
- ### Templates, Reports & Enforcement
247
- | Tool | Purpose |
248
- |------|---------|
249
- | `speclock_apply_template` | Apply pre-built constraint templates (nextjs, react, express, etc.) |
250
- | `speclock_report` | Violation report โ€” blocked change stats |
251
- | `speclock_audit` | Audit staged files against active locks |
252
-
253
- ### Enterprise (v2.1)
254
- | Tool | Purpose |
255
- |------|---------|
256
- | `speclock_verify_audit` | Verify HMAC audit chain integrity โ€” tamper detection |
257
- | `speclock_export_compliance` | Generate SOC 2 / HIPAA / CSV compliance reports |
258
-
259
- ### Hard Enforcement (v2.5)
260
- | Tool | Purpose |
261
- |------|---------|
262
- | `speclock_set_enforcement` | Set enforcement mode: advisory (warn) or hard (block) |
263
- | `speclock_override_lock` | Override a lock with justification โ€” logged to audit trail |
264
- | `speclock_semantic_audit` | Semantic pre-commit: analyze code changes vs locks |
265
- | `speclock_override_history` | View lock override history for audit review |
266
-
267
- ### Enterprise Platform (v3.5)
268
- | Tool | Purpose |
269
- |------|---------|
270
- | `speclock_policy_evaluate` | Evaluate policy-as-code rules against proposed actions |
271
- | `speclock_policy_manage` | CRUD for policy rules โ€” list, add, remove, init, export |
272
- | `speclock_telemetry` | View opt-in telemetry summary and usage analytics |
273
-
274
- ## Auto-Guard: Locks That Actually Work
275
-
276
- When you add a lock, SpecLock **automatically finds and guards related files**:
292
+ </details>
277
293
 
278
- ```
279
- speclock lock "Never modify auth files"
280
- โ†’ Auto-guarded 2 related file(s):
281
- ๐Ÿ”’ src/components/Auth.tsx
282
- ๐Ÿ”’ src/contexts/AuthContext.tsx
294
+ <details>
295
+ <summary><b>Enterprise</b> โ€” audit, compliance, policy, telemetry</summary>
283
296
 
284
- speclock lock "Database must always be Supabase"
285
- โ†’ Auto-guarded 1 related file(s):
286
- ๐Ÿ”’ src/lib/supabase.ts
287
- ```
297
+ | Tool | What it does |
298
+ |------|-------------|
299
+ | `speclock_verify_audit` | Verify HMAC chain integrity |
300
+ | `speclock_export_compliance` | SOC 2 / HIPAA / CSV reports |
301
+ | `speclock_policy_evaluate` | Evaluate policy rules |
302
+ | `speclock_policy_manage` | CRUD for policy rules |
303
+ | `speclock_telemetry` | Opt-in usage analytics |
288
304
 
289
- The guard injects a warning **directly inside the file**. When the AI opens the file to edit it, it sees:
290
- ```
291
- // ============================================================
292
- // SPECLOCK-GUARD โ€” DO NOT MODIFY THIS FILE
293
- // LOCKED: Never modify auth files
294
- // THIS FILE IS LOCKED. DO NOT EDIT, CHANGE, OR REWRITE ANY PART OF IT.
295
- // The user must say "unlock" before this file can be changed.
296
- // A question is NOT permission. Asking about features is NOT permission.
297
- // ONLY "unlock" or "remove the lock" is permission to edit this file.
298
- // ============================================================
299
- ```
305
+ </details>
300
306
 
301
- Active locks are also embedded in `package.json` โ€” so the AI sees your constraints every time it reads the project config.
307
+ ---
302
308
 
303
- ## CLI Commands
309
+ ## CLI
304
310
 
305
311
  ```bash
306
312
  # Setup
307
- speclock setup --goal "Build my app" --template nextjs # One-shot setup + template
313
+ speclock setup --goal "Build my app" --template nextjs
308
314
 
309
- # Memory
310
- speclock goal <text> # Set project goal
311
- speclock lock <text> [--tags a,b] # Add constraint + auto-guard files
312
- speclock lock remove <id> # Remove a lock
313
- speclock decide <text> # Record a decision
314
- speclock note <text> # Add a note
315
+ # Constraints
316
+ speclock lock "Never modify auth files" --tags auth,security
317
+ speclock lock remove <id>
318
+ speclock check "Add social login" # Test before doing
315
319
 
316
320
  # Enforcement
317
- speclock check <text> # Check for lock conflicts
318
- speclock guard <file> --lock "text" # Manually guard a specific file
319
- speclock unguard <file> # Remove guard from file
320
-
321
- # Templates
322
- speclock template list # List available templates
323
- speclock template apply <name> # Apply: nextjs, react, express, supabase, stripe, security-hardened
324
-
325
- # Violation Report
326
- speclock report # Show violation stats + most tested locks
327
-
328
- # Git Pre-commit Hook
329
- speclock hook install # Install pre-commit hook
330
- speclock hook remove # Remove pre-commit hook
331
- speclock audit # Audit staged files against locks
332
-
333
- # Tracking
334
- speclock log-change <text> --files x # Log a change
335
- speclock context # Regenerate context file
336
-
337
- # Enterprise (v2.1)
338
- speclock audit-verify # Verify HMAC audit chain integrity
339
- speclock export --format <soc2|hipaa|csv> # Compliance export
340
- speclock license # Show license tier and usage
341
-
342
- # Hard Enforcement (v2.5)
343
- speclock enforce <advisory|hard> # Set enforcement mode
344
- speclock override <lockId> <reason> # Override a lock with justification
345
- speclock overrides [--lock <id>] # Show override history
346
- speclock audit-semantic # Semantic pre-commit audit
347
-
348
- # Enterprise Platform (v3.5)
349
- speclock policy list # List policy rules
350
- speclock policy init # Initialize policy-as-code
351
- speclock policy add <name> --files <pattern> --actions <types> --enforce <level>
352
- speclock policy evaluate --files <f> --type <t> # Evaluate against rules
353
- speclock policy export # Export policy as portable YAML
354
- speclock telemetry status # View telemetry summary
355
- speclock sso status # Show SSO configuration
356
- speclock sso configure # Configure OAuth/OIDC SSO
357
-
358
- # Other
359
- speclock status # Show brain summary
360
- speclock serve [--project <path>] # Start MCP server
361
- speclock watch # Start file watcher
362
- ```
321
+ speclock enforce hard # Block violations
322
+ speclock override <lockId> "JIRA-1234" # Override with reason
363
323
 
364
- ## Enterprise Features (v2.1)
324
+ # Audit & Compliance
325
+ speclock audit-verify # Verify HMAC chain
326
+ speclock export --format soc2 # Compliance report
327
+ speclock audit-semantic # Semantic pre-commit
365
328
 
366
- ### HMAC Audit Chain
367
- Every event in `events.log` gets an HMAC-SHA256 hash chained to the previous event. Modify any event and the chain breaks โ€” instant tamper detection.
329
+ # Git
330
+ speclock hook install # Pre-commit hook
331
+ speclock audit # Audit staged files
368
332
 
369
- ```bash
370
- $ npx speclock audit-verify
371
-
372
- Audit Chain Verification
373
- ==================================================
374
- Status: VALID
375
- Total events: 47
376
- Hashed events: 47
377
- Legacy events (pre-v2.1): 0
378
- Audit chain verified. No tampering detected.
379
- ```
333
+ # Templates
334
+ speclock template apply nextjs # Pre-built constraints
335
+ speclock template apply security-hardened
380
336
 
381
- ### Compliance Exports
382
- Generate audit-ready reports for regulated industries:
337
+ # Auth
338
+ speclock auth create-key --role developer
339
+ speclock auth rotate-key <keyId>
383
340
 
384
- ```bash
385
- npx speclock export --format soc2 # SOC 2 Type II JSON report
386
- npx speclock export --format hipaa # HIPAA PHI protection report
387
- npx speclock export --format csv # All events as CSV spreadsheet
341
+ # Policy
342
+ speclock policy init # Create policy.yml
343
+ speclock policy evaluate --files "src/auth/*" # Test against rules
388
344
  ```
389
345
 
390
- SOC 2 reports include: constraint change history, access logs, decision audit trail, audit chain integrity verification. HIPAA reports filter for PHI-related constraints and check encryption/access control status.
346
+ Full command reference: `npx speclock help`
391
347
 
392
- ### License Tiers
393
- | Tier | Price | Locks | Features |
394
- |------|-------|-------|----------|
395
- | **Free** | $0 | 10 | Conflict detection, MCP, CLI, context |
396
- | **Pro** | $19/mo | Unlimited | + LLM detection, HMAC audit, compliance exports |
397
- | **Enterprise** | $99/mo | Unlimited | + RBAC, encrypted storage, SSO |
348
+ ---
398
349
 
399
- ### HTTP Server Hardening
400
- - Rate limiting: 100 req/min per IP (configurable via `SPECLOCK_RATE_LIMIT`)
401
- - CORS: configurable origins via `SPECLOCK_CORS_ORIGINS`
402
- - Health endpoint: `GET /health` with uptime and audit chain status
350
+ ## Auto-Guard
403
351
 
404
- ### GitHub Actions
405
- ```yaml
406
- # In your workflow:
407
- - uses: sgroy10/speclock-check@v2
408
- with:
409
- fail-on-conflict: true
410
- ```
411
- Audits changed files against locks, posts PR comments, fails workflow on violations.
352
+ When you lock something, SpecLock finds related files and injects a warning the AI sees when it opens them:
412
353
 
413
- ## Hard Enforcement (v2.5)
414
-
415
- ### Advisory vs Hard Mode
416
354
  ```
417
- Advisory mode (default): AI gets a warning, decides what to do
418
- Hard mode: AI is BLOCKED โ€” cannot proceed (MCP returns isError: true)
355
+ speclock lock "Never modify auth files"
356
+ โ†’ Auto-guarded 2 files:
357
+ ๐Ÿ”’ src/components/Auth.tsx
358
+ ๐Ÿ”’ src/contexts/AuthContext.tsx
419
359
  ```
420
360
 
421
- - **Block threshold**: Configurable (default 70%). Only HIGH confidence conflicts block.
422
- - **Override mechanism**: `speclock_override_lock` with a reason (logged to audit trail)
423
- - **Escalation**: Lock overridden 3+ times โ†’ auto-creates a review note
424
- - **Semantic pre-commit**: Parses actual git diff content, runs semantic analysis against locks
361
+ The AI opens the file and sees:
362
+ ```javascript
363
+ // ============================================================
364
+ // SPECLOCK-GUARD โ€” DO NOT MODIFY THIS FILE
365
+ // LOCKED: Never modify auth files
366
+ // ONLY "unlock" or "remove the lock" is permission to edit.
367
+ // ============================================================
368
+ ```
425
369
 
426
- ## Security & Access Control (v3.0)
370
+ ---
427
371
 
428
- ### API Key Authentication
429
- SHA-256 hashed keys stored server-side. HTTP transport uses `Authorization: Bearer <key>` headers. MCP transport authenticates via the `SPECLOCK_API_KEY` environment variable. Keys are never stored in plaintext.
372
+ ## Architecture
430
373
 
431
- ### RBAC (4 Roles)
432
- | Role | Permissions |
433
- |------|-------------|
434
- | **viewer** | Read-only access to context, locks, decisions, and events |
435
- | **developer** | Read + override locks with a documented reason |
436
- | **architect** | Read + write (add/remove locks, decisions) + override |
437
- | **admin** | Full access โ€” manage keys, roles, enforcement settings, and all operations |
374
+ ```
375
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
376
+ โ”‚ AI Tool (Claude Code, Cursor, Bolt.new...) โ”‚
377
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
378
+ โ”‚ โ”‚
379
+ MCP Protocol (31 tools) npm File-Based
380
+ โ”‚ (SPECLOCK.md + CLI)
381
+ โ”‚ โ”‚
382
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
383
+ โ”‚ SpecLock Core Engine โ”‚
384
+ โ”‚ โ”‚
385
+ โ”‚ Semantic Engine โ”€โ”€โ”€ 55 synonym groups โ”‚
386
+ โ”‚ HMAC Audit โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ SHA-256 hash chain โ”‚
387
+ โ”‚ Enforcer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ advisory / hard block โ”‚
388
+ โ”‚ Auth + RBAC โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 4 roles, API keys โ”‚
389
+ โ”‚ AES-256-GCM โ”€โ”€โ”€โ”€โ”€โ”€โ”€ encrypted at rest โ”‚
390
+ โ”‚ Policy DSL โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ YAML rules โ”‚
391
+ โ”‚ Compliance โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ SOC 2, HIPAA, CSV โ”‚
392
+ โ”‚ SSO โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Okta, Azure AD, Auth0 โ”‚
393
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
394
+ โ”‚
395
+ .speclock/
396
+ โ”œโ”€โ”€ brain.json (project memory)
397
+ โ”œโ”€โ”€ events.log (HMAC audit trail)
398
+ โ”œโ”€โ”€ policy.yml (policy rules)
399
+ โ”œโ”€โ”€ auth.json (API keys โ€” gitignored)
400
+ โ””โ”€โ”€ context/
401
+ โ””โ”€โ”€ latest.md (AI-readable context)
402
+ ```
438
403
 
439
- ### AES-256-GCM Encryption
440
- Transparent encrypt-on-write / decrypt-on-read for `brain.json` and `events.log`. Encryption key is derived via PBKDF2 from the `SPECLOCK_ENCRYPTION_KEY` environment variable. Authenticated encryption (GCM) ensures both confidentiality and integrity. **HIPAA 2026 compliant.**
404
+ **3 npm dependencies.** Zero runtime dependencies for the semantic engine. Pure JavaScript.
441
405
 
442
- ### Test Coverage
443
- **330+ tests passing** across 6 test suites. Full coverage for authentication, authorization, encryption, semantic detection, audit chain integrity, policy-as-code, telemetry, and SSO.
406
+ ---
444
407
 
445
- ## Enterprise Platform (v3.5)
408
+ ## Test Results
446
409
 
447
- ### Policy-as-Code DSL
448
- Declarative YAML-based policy rules for enterprise constraint enforcement:
410
+ | Suite | Tests | Pass Rate |
411
+ |-------|------:|----------:|
412
+ | Adversarial Conflict Detection | 61 | 96.7% |
413
+ | HMAC Audit Chain | 35 | 100% |
414
+ | Hard Enforcement Engine | 40 | 100% |
415
+ | Auth, RBAC & AES-256 Encryption | 114 | 100% |
416
+ | SOC 2 / HIPAA / CSV Compliance | 50 | 100% |
417
+ | Policy, SSO, Dashboard, Telemetry | 91 | 100% |
418
+ | John's Journey (Vibecoder on Bolt.new) | 86 | 100% |
419
+ | Sam's Journey (Enterprise Hospital ERP) | 124 | 100% |
420
+ | **Total** | **601** | **99.7%** |
449
421
 
450
- ```yaml
451
- # .speclock/policy.yml
452
- rules:
453
- - name: "HIPAA PHI Protection"
454
- match:
455
- files: ["**/patient/**", "**/medical/**"]
456
- actions: [delete, modify, export]
457
- enforce: block
458
- severity: critical
459
- notify: ["security@company.com", "slack:#compliance"]
460
- ```
422
+ The 2 uncaught adversarial cases are jargon attacks with zero subject overlap โ€” an edge case requiring domain-specific knowledge.
461
423
 
462
- - **File pattern matching**: Glob patterns (`**/patient/**`, `src/api/*.js`)
463
- - **Action-type filtering**: Block specific operations (delete, modify, create, export)
464
- - **Enforcement levels**: `block` (hard stop), `warn` (advisory), `log` (record only)
465
- - **Severity levels**: critical, high, medium, low
466
- - **Notification hooks**: Email, Slack, webhook channels
467
- - **Import/export**: Share policies between organizations
424
+ ---
468
425
 
469
- ### OAuth/OIDC SSO
470
- Enterprise single sign-on with corporate identity providers:
426
+ ## Real-World Tested
471
427
 
472
- - **Providers**: Okta, Azure AD, Auth0, any OIDC-compliant IdP
473
- - **PKCE flow**: Authorization Code with Proof Key (S256)
474
- - **Role mapping**: Map OIDC groups/roles to SpecLock roles (viewer/developer/architect/admin)
475
- - **Session management**: 8-hour TTL, token refresh, session listing/revocation
476
- - **MCP June 2025 spec**: OAuth compliance
428
+ ### John โ€” Indie developer on Bolt.new
429
+ 8 sessions building an ecommerce app. 5 locks (auth, Firebase, Supabase, shipping, Stripe). Every direct violation caught. Every euphemistic attack caught ("clean up auth", "modernize database", "streamline serverless"). Zero false positives on safe actions (product page, cart, dark mode). **86/86 tests passed.**
477
430
 
478
- ### Admin Dashboard
479
- Real-time web UI served from the HTTP server:
431
+ ### Sam โ€” Senior engineer building a HIPAA hospital ERP
432
+ 10 sessions with 8 HIPAA locks. Every violation caught โ€” expose PHI, remove encryption, disable audit, downgrade MFA, bypass FHIR. Euphemistic HIPAA attacks caught ("simplify data flow", "modernize auth"). Full auth + RBAC + encryption + compliance export workflow verified. **124/124 tests passed.**
480
433
 
481
- - **Access**: `http://localhost:PORT/dashboard`
482
- - **Views**: Lock overview, violation timeline, session history, health score
483
- - **Metrics**: Enforcement mode, auth status, encryption status, audit chain integrity
484
- - **Zero dependencies**: Vanilla HTML/JS โ€” no framework overhead
485
- - **Auto-refresh**: Updates every 30 seconds
434
+ ---
486
435
 
487
- ### Telemetry & Analytics
488
- Opt-in usage insights for product improvement:
436
+ ## Pricing
489
437
 
490
- - **Disabled by default** โ€” enable with `SPECLOCK_TELEMETRY=true`
491
- - **Tracks**: Tool usage counts, conflict detection rates, response times, feature adoption
492
- - **Never tracks**: Lock content, project names, any PII
493
- - **Local storage**: `.speclock/telemetry.json` with optional remote flush
494
- - **30-day rolling window**: Daily stats with trend analysis
438
+ | Tier | Price | What you get |
439
+ |------|-------|-------------|
440
+ | **Free** | $0 | 10 locks, conflict detection, MCP, CLI |
441
+ | **Pro** | $19/mo | Unlimited locks, HMAC audit, compliance exports |
442
+ | **Enterprise** | $99/mo | + RBAC, encryption, SSO, policy-as-code |
495
443
 
496
444
  ---
497
445
 
498
- ## Architecture
499
-
500
- ```
501
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
502
- โ”‚ AI Tool (Bolt.new, Lovable, Claude Code) โ”‚
503
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
504
- โ”‚ โ”‚
505
- MCP Protocol File-Based (npm)
506
- (31 tool calls) (reads SPECLOCK.md +
507
- .speclock/context/latest.md,
508
- runs CLI commands)
509
- โ”‚ โ”‚
510
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
511
- โ”‚ SpecLock Core Engine โ”‚
512
- โ”‚ Memory | Tracking | Enforcement | Git | Intelligence โ”‚
513
- โ”‚ Audit | Compliance | License | Auth | RBAC โ”‚
514
- โ”‚ AES-256-GCM Encryption (brain.json, events.log) โ”‚
515
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
516
- โ”‚
517
- .speclock/
518
- โ”œโ”€โ”€ brain.json (structured memory)
519
- โ”œโ”€โ”€ events.log (HMAC-signed audit trail)
520
- โ”œโ”€โ”€ .audit-key (HMAC secret โ€” gitignored)
521
- โ”œโ”€โ”€ patches/ (git diffs per event)
522
- โ””โ”€โ”€ context/
523
- โ””โ”€โ”€ latest.md (human-readable context)
524
- ```
525
-
526
446
  ## Contributing
527
447
 
528
- Contributions welcome! Please open an issue or PR on [GitHub](https://github.com/sgroy10/speclock).
448
+ Issues and PRs welcome on [GitHub](https://github.com/sgroy10/speclock).
529
449
 
530
450
  ## License
531
451
 
532
- MIT License - see [LICENSE](LICENSE) file.
452
+ [MIT](LICENSE)
533
453
 
534
454
  ## Author
535
455
 
536
- **Developed by Sandeep Roy**
537
-
538
- - GitHub: [github.com/sgroy10](https://github.com/sgroy10)
539
- - Repository: [github.com/sgroy10/speclock](https://github.com/sgroy10/speclock)
540
- - npm: [npmjs.com/package/speclock](https://www.npmjs.com/package/speclock)
456
+ Built by **[Sandeep Roy](https://github.com/sgroy10)**
541
457
 
542
458
  ---
543
459
 
544
- *SpecLock v3.0.0 โ€” Semantic conflict detection + enterprise audit & compliance. 100% detection, 0% false positives. HMAC audit chain, SOC 2/HIPAA exports. Hard enforcement mode. API Key Auth + RBAC. AES-256-GCM encrypted storage. 300 tests passing. Because remembering isn't enough โ€” AI needs to respect boundaries.*
460
+ <p align="center"><i>v3.5.2 โ€” 601 tests, 31 MCP tools, 0 false positives. Because remembering isn't enough.</i></p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speclock",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "AI constraint engine with 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. 100% detection, 0% false positives. 31 MCP tools + CLI. Enterprise platform.",
5
5
  "type": "module",
6
6
  "main": "src/mcp/server.js",
@@ -9,7 +9,7 @@
9
9
  import { readBrain, readEvents } from "./storage.js";
10
10
  import { verifyAuditChain } from "./audit.js";
11
11
 
12
- const VERSION = "3.5.0";
12
+ const VERSION = "3.5.3";
13
13
 
14
14
  // PHI-related keywords for HIPAA filtering
15
15
  const PHI_KEYWORDS = [
@@ -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 = "3.5.0";
94
+ const VERSION = "3.5.3";
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 = "3.5.0";
103
+ const VERSION = "3.5.3";
104
104
  const AUTHOR = "Sandeep Roy";
105
105
 
106
106
  const server = new McpServer(