v0.7.2: Merkle provenance audit + RCE flake fix — TDD

audit-node exposes memory-object lineage (type, hash, scope, version).
/audit <node-id> TUI command. /audit verify deferred.

Fixed RCE test flake: assemble-config-section used getf on
non-plist cascade entries. Wrapped in handler-case. Also fixed
~/ format directive escape. Core reason: 35/35. Core: 81/81.
This commit is contained in:
2026-05-08 18:03:24 -04:00
parent df09ac321d
commit 11c43f76fa
7 changed files with 95 additions and 12 deletions

View File

@@ -405,6 +405,18 @@ Restores memory state from a previously saved snapshot file. Called during boot
(progn (log-message "REDO: No snapshots to redo") nil)))
#+end_src
** Merkle Audit
#+begin_src lisp
(defun audit-node (node-id)
"Return audit info for a memory object by ID."
(let ((obj (memory-object-get node-id)))
(when obj
(list :id node-id :type (memory-object-type obj)
:version (memory-object-version obj)
:hash (or (memory-object-hash obj) "(none)")
:scope (memory-object-scope obj)))))
#+end_src
* Test Suite
Verifies that the Merkle hash is deterministic and consistent across independent AST ingestions.
#+begin_src lisp
@@ -515,4 +527,19 @@ Verifies that the Merkle hash is deterministic and consistent across independent
(progn (setf passepartout::*undo-stack* nil)
(is (null (passepartout::undo))))
(setf passepartout::*undo-stack* orig-undo))))
(test test-audit-node-found
"Contract v0.7.2: audit-node returns info for existing object."
(clrhash passepartout::*memory-store*)
(setf (gethash "audit-1" passepartout::*memory-store*)
(passepartout::make-memory-object :id "audit-1" :type :HEADLINE
:version 1 :hash "abc123" :scope :memex))
(let ((info (passepartout::audit-node "audit-1")))
(is (not (null info)))
(is (eq :HEADLINE (getf info :type)))
(is (string= "abc123" (getf info :hash)))))
(test test-audit-node-not-found
"Contract v0.7.2: audit-node returns nil for nonexistent id."
(is (null (passepartout::audit-node "nonexistent-xxxx"))))
#+end_src