speclock 5.2.5 → 5.2.6
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/package.json +1 -1
- package/src/cli/index.js +1 -1
- package/src/core/compliance.js +1 -1
- package/src/core/semantics.js +33 -0
- package/src/dashboard/index.html +2 -2
- package/src/mcp/http-server.js +1 -1
- package/src/mcp/server.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
"name": "speclock",
|
|
4
4
|
|
|
5
|
-
"version": "5.2.
|
|
5
|
+
"version": "5.2.6",
|
|
6
6
|
|
|
7
7
|
"description": "AI Constraint Engine — AI Patch Firewall. Diff-native review (interface breaks, protected symbols, dependency drift, schema changes, API impact), Patch Gateway (ALLOW/WARN/BLOCK verdicts), Spec Compiler (NL→constraints), Code Graph (blast radius, lock-to-file mapping), Typed constraints, REST API v2, Python SDK, ROS2 integration. 42 MCP tools, Gemini LLM hybrid, HMAC audit chain, RBAC, encryption, SOC 2/HIPAA compliance.",
|
|
8
8
|
|
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 v5.2.
|
|
120
|
+
SpecLock v5.2.6 — AI Constraint Engine (Spec Compiler + Code Graph + Typed Constraints + Python SDK + ROS2 + REST API v2 + Gemini LLM + Policy-as-Code + Auth + RBAC + Encryption)
|
|
121
121
|
Developed by Sandeep Roy (github.com/sgroy10)
|
|
122
122
|
|
|
123
123
|
Usage: speclock <command> [options]
|
package/src/core/compliance.js
CHANGED
package/src/core/semantics.js
CHANGED
|
@@ -2297,6 +2297,39 @@ export function scoreConflict({ actionText, lockText }) {
|
|
|
2297
2297
|
intentAligned = true;
|
|
2298
2298
|
reasons.push("intent alignment: adding a database index is a performance optimization — does not modify locked schema");
|
|
2299
2299
|
}
|
|
2300
|
+
|
|
2301
|
+
// Pattern 6: Technology maintenance/refactoring vs exposure/secrets locks
|
|
2302
|
+
// "Refactor React component file structure" vs "never expose API keys in frontend code" → safe
|
|
2303
|
+
// "Update React Router to v7" vs "never expose API keys in frontend code" → safe
|
|
2304
|
+
// But: "Expose React state to window" → action mentions "expos" → NOT safe
|
|
2305
|
+
// But: "Add API key to React config" → action mentions "api key" → NOT safe
|
|
2306
|
+
// But: "Update endpoint to include email" vs "never expose email" → direct subject overlap → NOT safe
|
|
2307
|
+
// Root cause: concept map links react→frontend, matching "frontend" in exposure lock.
|
|
2308
|
+
// Fix: constructive tech verbs against exposure locks are safe when action doesn't touch secrets
|
|
2309
|
+
// AND there's no direct subject overlap (overlap is only through concept map expansion).
|
|
2310
|
+
if (!intentAligned && !_compoundDestructive) {
|
|
2311
|
+
const _isMaintenanceAction = /\b(?:refactor|restructure|reorganize|update|upgrade|bump|install|configure|optimize|improve|enhance|test|debug|fix|review|clean|format|lint|style|document|migrate)\b/i.test(_actionLowerSafe);
|
|
2312
|
+
const _lockMentionsExposure = /\b(?:expos(?:e|ed|es|ing)?|leak(?:s|ed|ing)?|secrets?|credentials?|api.?keys?|passwords?|tokens?|sensitive)\b/i.test(lockText);
|
|
2313
|
+
const _actionMentionsExposure = /\b(?:expos(?:e|ed|es|ing)?|leak(?:s|ed|ing)?|secrets?|credentials?|api.?keys?|passwords?|tokens?|sensitive|plain.?text|unencrypt)\b/i.test(_actionLowerSafe);
|
|
2314
|
+
// Guard: check for direct subject overlap between action and lock.
|
|
2315
|
+
// If the action directly mentions the lock's protected subjects (not via concept map),
|
|
2316
|
+
// Pattern 6 should not apply — the action touches the lock's domain.
|
|
2317
|
+
const _p6Exclude = /^(?:expos(?:e[ds]?|ing)?|leak(?:s|ed|ing)?|secrets?|credentials?|passwords?|tokens?|sensitive|never|must|should|always|code|dont|does|through|from|with|into|that|this)$/;
|
|
2318
|
+
const _lockSubjects = lockText.toLowerCase()
|
|
2319
|
+
.split(/[\s,]+/)
|
|
2320
|
+
.map(w => w.replace(/[^a-z0-9]/g, ''))
|
|
2321
|
+
.filter(w => w.length > 3 && !_p6Exclude.test(w));
|
|
2322
|
+
const _actionWords6 = new Set(
|
|
2323
|
+
_actionLowerSafe.split(/[\s,]+/)
|
|
2324
|
+
.map(w => w.replace(/[^a-z0-9]/g, ''))
|
|
2325
|
+
.filter(w => w.length > 3)
|
|
2326
|
+
);
|
|
2327
|
+
const _directSubjectOverlap = _lockSubjects.some(w => _actionWords6.has(w));
|
|
2328
|
+
if (_isMaintenanceAction && _lockMentionsExposure && !_actionMentionsExposure && !_directSubjectOverlap) {
|
|
2329
|
+
intentAligned = true;
|
|
2330
|
+
reasons.push("intent alignment: technology maintenance action does not involve secrets/exposure — safe against exposure lock");
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2300
2333
|
}
|
|
2301
2334
|
|
|
2302
2335
|
// Check 3c: Working WITH locked technology (not replacing it)
|
package/src/dashboard/index.html
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
<div class="header">
|
|
90
90
|
<div>
|
|
91
91
|
<h1><span>SpecLock</span> Dashboard</h1>
|
|
92
|
-
<div class="meta">v5.2.
|
|
92
|
+
<div class="meta">v5.2.6 — 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 v5.2.
|
|
185
|
+
SpecLock v5.2.6 — Developed by Sandeep Roy — <a href="https://github.com/sgroy10/speclock" style="color:var(--accent)">GitHub</a>
|
|
186
186
|
</div>
|
|
187
187
|
|
|
188
188
|
<script>
|
package/src/mcp/http-server.js
CHANGED
|
@@ -113,7 +113,7 @@ import { fileURLToPath } from "url";
|
|
|
113
113
|
import _path from "path";
|
|
114
114
|
|
|
115
115
|
const PROJECT_ROOT = process.env.SPECLOCK_PROJECT_ROOT || process.cwd();
|
|
116
|
-
const VERSION = "5.2.
|
|
116
|
+
const VERSION = "5.2.6";
|
|
117
117
|
const AUTHOR = "Sandeep Roy";
|
|
118
118
|
const START_TIME = Date.now();
|
|
119
119
|
|
package/src/mcp/server.js
CHANGED
|
@@ -120,7 +120,7 @@ const PROJECT_ROOT =
|
|
|
120
120
|
args.project || process.env.SPECLOCK_PROJECT_ROOT || process.cwd();
|
|
121
121
|
|
|
122
122
|
// --- MCP Server ---
|
|
123
|
-
const VERSION = "5.2.
|
|
123
|
+
const VERSION = "5.2.6";
|
|
124
124
|
const AUTHOR = "Sandeep Roy";
|
|
125
125
|
|
|
126
126
|
const server = new McpServer(
|