Reuse immutable JSON validation proofs without weakening publication checks

This commit is contained in:
2026-11-10 15:08:19 +08:00
parent 104ef3942f
commit 697716ee89
3 changed files with 65 additions and 2 deletions
+7
View File
@@ -855,3 +855,10 @@ step. The existing recursive codec still checks nested mutability and depth, so
mutable values and external Maps are re-read. This is an encoding cache, not a
second state table; recovery JSON order, formats and journal checks remain the
same. Replacing a table gets a new entry view and leaves prior images unchanged.
JSON validation can reuse a successful proof for transitively immutable data
properties. A WeakMap stores subtree height so a cached value still obeys the
caller's depth bound. Shallow freezing, accessors, mutable descendants and
unproven array methods keep the original validation path; optional reflection
failures only disable proof reuse. Component/schema validators are still called,
and document ownership, endpoints and topology are still checked on publication.