speclock 3.5.3 → 4.0.0
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/core/compliance.js +1 -1
- package/src/core/conflict.js +55 -3
- package/src/core/engine.js +10 -0
- package/src/core/lock-author.js +478 -0
- package/src/core/memory.js +12 -3
- package/src/core/semantics.js +777 -39
- package/src/mcp/http-server.js +1 -1
- package/src/mcp/server.js +14 -4
package/src/mcp/http-server.js
CHANGED
|
@@ -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.
|
|
94
|
+
const VERSION = "3.5.4";
|
|
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.
|
|
103
|
+
const VERSION = "3.5.4";
|
|
104
104
|
const AUTHOR = "Sandeep Roy";
|
|
105
105
|
|
|
106
106
|
const server = new McpServer(
|
|
@@ -220,10 +220,15 @@ server.tool(
|
|
|
220
220
|
.describe("Who created this lock"),
|
|
221
221
|
},
|
|
222
222
|
async ({ text, tags, source }) => {
|
|
223
|
-
const { lockId } = addLock(PROJECT_ROOT, text, tags, source);
|
|
223
|
+
const { lockId, rewritten, rewriteReason } = addLock(PROJECT_ROOT, text, tags, source);
|
|
224
|
+
|
|
225
|
+
// Read the stored lock to get the normalized text
|
|
226
|
+
const brain = readBrain(PROJECT_ROOT);
|
|
227
|
+
const storedLock = brain?.specLock?.items?.find(l => l.id === lockId);
|
|
228
|
+
const storedText = storedLock?.text || text;
|
|
224
229
|
|
|
225
230
|
// Auto-guard related files
|
|
226
|
-
const guardResult = autoGuardRelatedFiles(PROJECT_ROOT,
|
|
231
|
+
const guardResult = autoGuardRelatedFiles(PROJECT_ROOT, storedText);
|
|
227
232
|
const guardMsg = guardResult.guarded.length > 0
|
|
228
233
|
? `\nAuto-guarded ${guardResult.guarded.length} file(s): ${guardResult.guarded.join(", ")}`
|
|
229
234
|
: "";
|
|
@@ -231,9 +236,14 @@ server.tool(
|
|
|
231
236
|
// Sync active locks to package.json
|
|
232
237
|
syncLocksToPackageJson(PROJECT_ROOT);
|
|
233
238
|
|
|
239
|
+
// Report rewrite if it happened
|
|
240
|
+
const rewriteMsg = rewritten
|
|
241
|
+
? `\n\nSmart Lock Authoring: Rewritten for accuracy.\n Original: "${text}"\n Stored as: "${storedText}"\n Reason: ${rewriteReason}`
|
|
242
|
+
: "";
|
|
243
|
+
|
|
234
244
|
return {
|
|
235
245
|
content: [
|
|
236
|
-
{ type: "text", text: `Lock added (${lockId}): "${
|
|
246
|
+
{ type: "text", text: `Lock added (${lockId}): "${storedText}"${guardMsg}${rewriteMsg}` },
|
|
237
247
|
],
|
|
238
248
|
};
|
|
239
249
|
}
|