@ancleto/spec 0.11.0 → 0.11.1
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/agents/orchestrator.md +1 -1
- package/agents/reviewer.md +1 -1
- package/agents/spec-writer.md +1 -1
- package/package.json +1 -1
- package/src/cli/index.js +1 -1
- package/src/core/memory/engine.js +12 -4
package/agents/orchestrator.md
CHANGED
package/agents/reviewer.md
CHANGED
package/agents/spec-writer.md
CHANGED
package/package.json
CHANGED
package/src/cli/index.js
CHANGED
|
@@ -2029,7 +2029,7 @@ async function memoryListCmd(flags) {
|
|
|
2029
2029
|
return
|
|
2030
2030
|
}
|
|
2031
2031
|
for (const n of nodes) {
|
|
2032
|
-
console.log(` [${n.type}/${n.scope}${n.status === 'active' ? '' : '/' + n.status}] ${n.memory_key}`)
|
|
2032
|
+
console.log(` [${n.type}/${n.scope}${n.status === 'active' ? '' : '/' + n.status}] ${n.memory_key} (${n.source})`)
|
|
2033
2033
|
console.log(` ${n.content}`)
|
|
2034
2034
|
}
|
|
2035
2035
|
console.log(`ancleto: ${nodes.length} nodo(s)`)
|
|
@@ -182,6 +182,14 @@ function buildEngine(db) {
|
|
|
182
182
|
return []
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
// Procedencia de escritura (runtime-owned, solo auditoria): `source` se resuelve
|
|
186
|
+
// exclusivamente desde `context.source || 'runtime'` y NUNCA desde `input` (un
|
|
187
|
+
// `source` forjado en los args del caller se ignora, igual que `id`/`status`/
|
|
188
|
+
// `confidence`). Vocabulario: `mcp:ancleto-memory` (tools MCP), `cli:import`
|
|
189
|
+
// (import del CLI), `runtime` (default programatico), `agent:<rol>` (solo si el
|
|
190
|
+
// runtime confiable lo provee, nunca el caller). Frontera: la procedencia es
|
|
191
|
+
// descriptiva; el motor NO la usa para autorizar ni denegar escrituras (sin
|
|
192
|
+
// canal de identidad autenticado no hay enforcement).
|
|
185
193
|
function recordNode(input, context = {}) {
|
|
186
194
|
const memory_key = String(input.memory_key || '').trim()
|
|
187
195
|
const type = input.type
|
|
@@ -232,11 +240,11 @@ function buildEngine(db) {
|
|
|
232
240
|
}
|
|
233
241
|
const clause = where.length ? `WHERE ${where.join(' AND ')}` : ''
|
|
234
242
|
const rows = db.prepare(
|
|
235
|
-
`SELECT ${PUBLIC_COLUMNS}, status FROM memory_nodes n ${clause}
|
|
243
|
+
`SELECT ${PUBLIC_COLUMNS}, n.source, status FROM memory_nodes n ${clause}
|
|
236
244
|
ORDER BY CASE n.scope WHEN 'task' THEN 0 WHEN 'feature' THEN 1 WHEN 'project' THEN 2 ELSE 9 END,
|
|
237
245
|
n.created_at DESC, n.rowid DESC`
|
|
238
246
|
).all(...params)
|
|
239
|
-
return rows.map((r) => ({ ...publicNode(r), status: r.status }))
|
|
247
|
+
return rows.map((r) => ({ ...publicNode(r), source: r.source, status: r.status }))
|
|
240
248
|
}
|
|
241
249
|
|
|
242
250
|
// Devuelve los nodos activos en el formato de export. Sanitiza paths
|
|
@@ -294,7 +302,7 @@ function buildEngine(db) {
|
|
|
294
302
|
insertNode.run(
|
|
295
303
|
newId, memory_key, entry.type, entry.scope,
|
|
296
304
|
String(entry.content), String(entry.justification || ''),
|
|
297
|
-
'import', 1, entry.createdAt
|
|
305
|
+
'cli:import', 1, entry.createdAt
|
|
298
306
|
)
|
|
299
307
|
summary.updated++
|
|
300
308
|
} else {
|
|
@@ -311,7 +319,7 @@ function buildEngine(db) {
|
|
|
311
319
|
insertNode.run(
|
|
312
320
|
randomUUID(), memory_key, entry.type, entry.scope,
|
|
313
321
|
String(entry.content), String(entry.justification || ''),
|
|
314
|
-
'import', 1, entry.createdAt
|
|
322
|
+
'cli:import', 1, entry.createdAt
|
|
315
323
|
)
|
|
316
324
|
summary.inserted++
|
|
317
325
|
}
|