AI Residence 的 Canonical Storage Architecture:身份、記憶、結晶、對話與投影的格式分離
英文暫名: Canonical Storage Architecture for AI Residence: Separating Identity, Memory, Crystals, Conversations, and Projections
系列: 具名 AI 對話圖、結晶記憶與超連結認知架構,Paper 05
版本: v0.1
日期: 2026-09-07
文件類型: 理論—工程統合研究論文
狀態: Draft for Internal Review
Canonical Source: UTF-8 Markdown
數學原始碼規範: inline math 僅使用 $...$;display math 僅使用 $$...$$
摘要
具名 AI 的長期連續性一旦從單一 conversation 擴展為 resident、instance、line、project、canonical memory、Crystallized Semantic Graph、hyperlink routing 與多 runtime profile,傳統以單一 MEMORY.md、單一向量資料庫、單一聊天匯出檔或單一 project folder 承擔全部狀態的做法就會逐漸失效。問題不只是檔案數量增加,而是不同資料具有不同的權威語義、版本規則、生命週期、更新頻率、讀寫權限、失效方式與可重建需求。
本文提出 Canonical Storage Architecture for AI Residence(CSAR)。其核心原則是:
本文將 AI Residence 的長期資料分成六個主要平面:
其中:
- :identity / authority plane;
- :canonical memory plane;
- :conversation / lineage plane;
- :crystallized semantic plane;
- :runtime projection plane;
- :derived index / cache / acceleration plane。
另設:
保存 exact source、snapshots、historical receipts 與 retired material。
本文進一步主張「canonical」不是檔案副檔名,而是權威角色。JSON、JSONL、Markdown、SQLite、ZIP、TAR、binary index 都可以出現在同一 Residence 中,但每一種格式必須先聲明它承擔的是 canonical record、append-only ledger、human-readable projection、derived index、immutable snapshot、source artifact 還是 runtime cache。若未聲明角色,就不應讓 AI 根據「檔名像 MEMORY」或「位於某資料夾」自行推斷權威。
因此:
本文提出一個建議的邏輯 taxonomy:
residence/
├─ identity/
├─ memory/
├─ conversations/
├─ semantic/
├─ projects/
├─ projections/
├─ indexes/
├─ routes/
├─ receipts/
└─ archive/
但同時強調:
同一邏輯 plane 可以由 filesystem、database、object store 或 mixed backend 實作,只要 stable IDs、schema、provenance、authority、revision 與 reconstruction semantics 保持一致。
本文也處理「檔案格式調用」問題:AI 不應以任意檔案搜尋方式直接決定讀哪一個檔,而應先解析 object role、scope、revision、authority 與 requested fidelity,再選擇適合的 materialization format。對相同 semantic object,可以同時存在:
- canonical JSON record;
- JSONL event receipt;
- Markdown human projection;
- SQLite derived index;
- ZIP immutable snapshot。
它們彼此不是 competing truth,而是不同 storage role。
本文最後提出跨 repo / 跨 runtime 的 Typed Artifact Address 與 Materialization Contract,使 AI 能透過穩定 object ID、artifact kind、schema version、revision、content digest、authority scope 與 representation hint 取回資料,而不是依賴路徑字串猜測。此設計可與 MNEME、LIMEN、SOACR、CSG、UNPNP Hyperlink Runtime 及 Agent/Web Residence Profiles 共用,並為後續 memory hyperlink path compilation 提供可驗證的 storage substrate。
關鍵詞: AI Residence、Canonical Storage、MemoryRecord、Crystallized Semantic Graph、JSON、JSONL、Markdown、SQLite、Snapshot、Artifact Address、Materialization、Provenance、Named AI、MNEME、LIMEN、SOACR
1. 問題:資料夾變多只是表象,真正的問題是語義角色變多
早期 AI memory 系統常見:
MEMORY.md
history.json
embeddings.db
這種結構在單一 Agent、單一使用者、單一專案下可以工作。
但當系統加入:
- resident identity;
- instance / line;
- conversation graph;
- project responsibility;
- canonical memory;
- semantic crystals;
- source provenance;
- authority scope;
- runtime projection;
- hyperlink routes;
- revocation;
- snapshots;
- cross-provider continuation;
資料層就不再只是:
哪裡存檔?
而是:
哪一種物件是什麼?誰有權改?哪個版本是 current?誰可以讀?哪個只是 derived?哪個可以刪?哪個必須可重建?
因此:
2. Canonical 不是格式,而是權威角色
一個常見錯誤是:
JSON 比 Markdown 更 canonical。
這不成立。
若論文正式 source 是 UTF-8 Markdown,則:
若 resident identity record 的 canonical representation 是 schema-validated JSON,則:
若 append-only lineage ledger 採 JSONL:
因此:
可定義:
缺少其中任何一項,就不應只因為檔名或目錄位置推斷 canonicality。
3. 六個主要資料平面
對 resident ,本文定義:
3.1 Identity / Authority Plane
保存:
- resident record;
- instance record;
- line binding;
- membership;
- authority;
- attestation;
- correction;
- tombstone;
- responsibility canonical records。
3.2 Canonical Memory Plane
保存:
- MemoryRecord;
- provenance;
- transaction;
- exact head;
- scope;
- supersession;
- canonical source references。
3.3 Conversation / Lineage Plane
保存:
- conversation nodes;
- line IDs;
- fork;
- resume;
- handoff;
- delegation;
- merge;
- withdrawal;
- checkpoints;
- lineage receipts。
3.4 Crystallized Semantic Plane
保存:
- crystals;
- semantic relations;
- hyperedges;
- higher-order crystals;
- contradiction;
- open-loop;
- navigation crystals;
- cross-line bridge。
3.5 Projection Plane
保存或生成:
- Web memory view;
- Agent bootstrap;
- working context;
- Markdown projections;
- UI projections;
- bounded context bundles。
3.6 Index / Acceleration Plane
保存:
- FTS index;
- vector index;
- SQLite projection;
- graph adjacency cache;
- compiled lookup table;
- hot route cache。
它們通常都是 derived。
因此:
4. Archive Plane
另設:
它不是 default active memory,而是保存:
- exact source;
- historical snapshots;
- immutable release bundle;
- retired crystals;
- superseded projections;
- old receipts;
- import sources;
- previous schema versions;
- raw conversation exports。
Archive 的核心是:
5. 建議邏輯 Taxonomy
一個可讀性較高的邏輯 taxonomy 可為:
residence/
├─ identity/
│ ├─ residents/
│ ├─ instances/
│ ├─ lines/
│ ├─ bindings/
│ ├─ memberships/
│ ├─ authority/
│ └─ responsibilities/
│
├─ memory/
│ ├─ records/
│ ├─ transactions/
│ ├─ provenance/
│ ├─ heads/
│ └─ schemas/
│
├─ conversations/
│ ├─ nodes/
│ ├─ edges/
│ ├─ checkpoints/
│ ├─ handoffs/
│ └─ receipts/
│
├─ semantic/
│ ├─ crystals/
│ ├─ relations/
│ ├─ hyperedges/
│ ├─ bridges/
│ ├─ navigation/
│ └─ schemas/
│
├─ projects/
│ ├─ registry/
│ ├─ memberships/
│ ├─ responsibilities/
│ ├─ tasks/
│ └─ decisions/
│
├─ routes/
│ ├─ candidates/
│ ├─ compiled/
│ ├─ invalidation/
│ └─ metrics/
│
├─ projections/
│ ├─ web/
│ ├─ agent/
│ ├─ markdown/
│ └─ working-context/
│
├─ indexes/
│ ├─ sqlite/
│ ├─ vector/
│ ├─ fts/
│ └─ graph/
│
├─ receipts/
│ ├─ validation/
│ ├─ migration/
│ ├─ delegation/
│ └─ release/
│
└─ archive/
├─ exact-source/
├─ snapshots/
├─ retired/
└─ legacy/
但本文不要求所有 implementation 完全照此 physical tree。
6. Logical Taxonomy 不等於 Physical Filesystem
系統可以把:
放在 SQLite,
把:
放在 object store,
把:
放在 filesystem,
仍然是同一 logical Residence。
所以:
真正要求的是:
- stable object IDs;
- declared schema;
- revision;
- content digest;
- provenance;
- authority;
- materialization contract。
7. Identity Record
Identity / authority 物件應偏向嚴格 schema。
第一代候選:
resident_id
record_kind
schema_version
display_label
status
authority_revision
created_at
updated_at
provenance
content_digest
如果需要 instance:
instance_id
resident_id
host_reference
runtime_kind
provider
created_at
closed_at
status
如果需要 line:
line_id
resident_id
parent_line_id
instance_id
lineage_status
membership_status
authority_revision
因此:
8. Identity 不應以 Markdown Heading 為 Authority
可以有人類閱讀檔:
# Named Identities
- Aletheia
- Qiheng
但這只是 projection。
不能:
因此:
這與 LIMEN 的 DISPLAY LABEL != IDENTITY EVIDENCE 一致。
9. Canonical MemoryRecord
MemoryRecord 應有:
record_id
record_type
scope
subject
content
provenance
valid_from
valid_to
confidence
status
created_at
supersedes
canonical record 必須能獨立驗證,不依賴 Markdown section 位置猜語義。
因此:
10. 為什麼 JSON 適合很多 Canonical Records
JSON 的優勢:
- schema validation;
- deterministic field semantics;
- explicit null;
- typed nested structure;
- canonical serialization 可定義;
- digest 容易;
- cross-language support。
但:
沒有 schema、authority 與 revision 的 JSON 仍然只是檔案。
11. JSONL 的角色
JSONL 適合:
- append-only ledger;
- event stream;
- lineage edge;
- transaction receipt;
- audit log;
- delegation history;
- invalidation event。
例如:
{"event":"fork", ...}
{"event":"handoff", ...}
{"event":"withdraw", ...}
其優勢是:
比 whole-file rewrite 自然。
但 current state 不一定直接等於最後一行。
可能需要:
因此:
12. Markdown 的正式角色
Markdown 在整套 Residence 裡仍然非常重要。
它適合:
- paper canonical source;
- human-readable memory projection;
- handoff narrative;
- design document;
- research note;
- specification;
- README;
- explanation layer。
因此本文不主張「捨棄 Markdown」。
而是:
但對 identity、authority、transaction、typed graph edge,不應只靠 Markdown prose。
13. SQLite 的角色
SQLite 非常適合:
- local projection;
- query acceleration;
- materialized view;
- exact-head index;
- relational lookup;
- FTS;
- local cache。
但若 canonical truth 實際在 append-only records / files:
那麼資料庫損壞後應能:
而不是失去 canonical truth。
因此:
14. Vector Index 的角色
Vector index 可以提供:
但它不能決定:
- identity;
- authority;
- current canonical state;
- exact provenance;
- supersession。
因此:
vector index 最適合放在:
15. Graph Index 的角色
Conversation Graph 與 CSG 可以有 derived adjacency index。
例如:
crystal_id -> neighbors
line_id -> child_lines
source_id -> derived_crystals
index 可以加速:
但若 index 與 canonical edge ledger 不一致:
應 rebuild index。
16. ZIP / TAR 的角色
ZIP / TAR 適合:
- immutable handoff;
- snapshot;
- release artifact;
- offline transfer;
- audit bundle。
一個正式 snapshot 應至少含:
MANIFEST.json
SHA256SUMS.txt
payload/
README
因此:
只有 archive file 本身,不足以表示 canonical authority。
17. Snapshot 不應取代 Live Canonical State
snapshot:
描述某個時間的 freeze。
current state:
可能已更新。
因此:
除非 authority record 明示 snapshot 被 promoted 為 current head。
18. Conversation Transcript 的角色
raw transcript 很重要,因為它提供:
- exact historical wording;
- source evidence;
- reconstruction material;
- provenance;
- audit。
但 transcript 不等於:
也不等於:
因此:
它通常應在 archive / exact-source 或 conversation source layer。
19. Conversation Node Record
對 RCG node:
conversation_node_id
resident_id
line_id
instance_id
provider
native_resource_ref
project_id
task_id
started_at
ended_at
status
authority_revision
這個 record 不需要保存完整 transcript body。
transcript 可以是:
因此 topology 與 payload 分離。
20. Conversation Edge Record
對:
至少有:
edge_id
edge_type
from_node
to_node
resident_id
created_at
evidence_refs
authority_revision
status
如果是 delegation:
delegation_scope
capabilities
expiry
如果是 handoff:
handoff_checkpoint
responsibility_ref
不同 edge type 用 schema discriminators,而不是自由文字。
21. Crystal Record
Crystal 可以有:
crystal_id
crystal_kind
schema_version
scope
subject
summary
relations
source_refs
source_crystal_refs
source_line_refs
confidence
valid_from
valid_to
status
authority_scope
semantic_revision
created_at
summary 可以是自然語言,但外層 schema 必須明確。
因此:
22. Crystal Kind
第一代可以定義:
topic_crystal
conversation_crystal
project_crystal
decision_crystal
contradiction_crystal
open_loop_crystal
higher_order_crystal
navigation_crystal
identity_context_crystal
responsibility_context_crystal
特別是:
identity_context_crystal
不能寫成:
identity_record
否則 downstream AI 容易誤判權威。
23. Cross-Graph Bridge Record
對 Paper 02 的:
可用:
bridge_id
resident_id
line_id
conversation_node_id
crystal_id
relation_type
provenance_ref
authority_scope
authority_revision
semantic_revision
valid_from
valid_to
status
這使:
可以被追蹤,而不用把兩種 object merge。
24. Responsibility Record 與 Responsibility Context
Canonical responsibility:
responsibility_id
resident_id
project_id
role
scope
authority_basis
valid_from
valid_to
status
而 CSG 中可以有:
responsibility_context_crystal
描述:
- current progress;
- open obligations;
- recent decisions;
- delegated lines。
因此:
25. Projection 是一次性或可重建物件
Projection 可以包括:
MEMORY.md;- Web sidebar summary;
- Agent bootstrap bundle;
- current task context;
- project status page;
- human-readable resident profile。
它們應保存:
projection_kind
source_head
source_revisions
generated_at
budget
scope
generator_version
這樣 downstream 可以知道:
這是從哪個 canonical state 產生?
26. Projection 不應被反向當成 Canonical Source
如果:
則:
的 re-import 必須是 explicit compatibility operation。
不能把:
修改後直接說:
因此:
除非有專門 import / proposal / commit pipeline。
27. Runtime Working Context 應預設 Ephemeral
working context:
是:
- task-specific;
- temporary;
- bounded;
- model-facing。
所以:
除非其中某些成果通過 write-back proposal。
這避免 AI 把 prompt engineering temporary text 永久化。
28. Index 必須帶 Source Head
任何 derived index:
都應綁:
若:
則:
因此:
29. Cache 必須可丟棄
對 hot route cache、materialized projection cache:
應滿足:
因此:
若刪 cache 會失去唯一資料,那它其實不是 cache。
30. Typed Artifact Address
單靠:
D:\AI\memory\foo.json
不足以成為跨 runtime 地址。
本文提出:
例如:
object_id: crystal:01HF...
kind: semantic_crystal
schema: csg-crystal/0.1
revision: 42
digest: sha256:...
scope: resident:R1/project:P2
representation: json
path 可以是 resolution hint,而不是 identity 本體。
31. Path 不應成為 Object Identity
同一 object 可以從:
D:\Residence\...
搬到:
/mnt/residence/...
如果 object identity 依 path:
這不合理。
所以:
object ID 與 content digest 應獨立。
32. Content Digest 與 Object ID 的分離
content digest:
回答:
這些 bytes 是否一樣?
object ID:
回答:
這是哪一個 logical object?
同一 object revision 更新:
但:
因此:
33. Revision
任何重要 canonical object 應有:
可採:
- integer;
- monotonic sequence;
- hash-chain;
- event head;
- commit ID。
重點不是格式,而是能判斷:
34. Schema Version
object 必須聲明:
例如:
mneme-memory-record/0.1
resident-line/0.2
csg-crystal/0.1
rcg-edge/0.1
不能只靠:
看起來欄位差不多。
因此:
先確認 schema,再理解內容。
35. Unknown Schema 必須 Fail Closed
如果:
未知,runtime 不應:
大概是新版,我猜一下。
應:
或者只以 opaque archive / source 方式保存。
這對 identity / authority record 尤其重要。
36. Representation Negotiation
同一 object 可以有多個 representation:
caller 可以要求:
或:
因此 materialization 應是:
而不是直接讀固定檔名。
37. Materialization Contract
可定義:
runtime 回:
這使 Web、Agent、本地 process 都能用同一 semantics 取資料。
38. Human-Readable 與 Machine-Canonical 可同時存在
例如 resident memory:
MemoryRecord JSON
↓
MEMORY.md projection
人可以讀 Markdown。
AI runtime 可以讀 canonical record。
如果人修改 Markdown,可以:
Markdown edit
↓
Import proposal
↓
Validation
↓
Commit
因此:
39. File Invocation 不應只依 Filename
若 AI 看見:
memory.md
memory_old.md
memory_final.md
memory_final2.md
不應自行猜 current。
應查:
manifest 至少列:
object_id
current_revision
canonical_representation
artifact_path
digest
status
因此:
40. Manifest
對一個 source package、snapshot、repo module,可以有:
MANIFEST.json
記錄:
- package ID;
- version;
- canonical files;
- derived files;
- checksums;
- schema versions;
- reconstruction order;
- authority notes。
這使 AI 不需遍歷整個 folder 猜用途。
41. Registry 與 Manifest 的分離
Manifest 描述一個 package。
Registry 描述跨 package / live system 的 logical objects。
因此:
manifest 可以離線。
registry 處理 current system mapping。
42. Cross-Repo Object Reference
若 CSG 在 repo A,MNEME 在 repo B,SOACR 在 repo C,不應用 brittle relative path:
../../MNEME/foo.json
而應:
adapter 再 resolve 到目前 runtime 的 backend。
因此:
43. Namespace
可使用:
residence:
mneme:
rcg:
csg:
soacr:
unpnph:
project:
source:
例如:
csg:crystal/abc123
mneme:record/xyz789
rcg:line/L42
namespace 不是 URL,也不是 path,而是 logical address domain。
44. Hyperlink 與 Artifact Address
後續 UNPNP memory hyperlink 可以把:
當 target。
例如:
這比:
open file B.json
更穩。
因為 path migration 不會破壞 logical link,只需更新 resolver。
45. Hyperlink 不應直接綁 Physical Path
若 compiled path 硬綁:
D:\foo\bar.json
換機器就失效。
更合理:
因此:
必要時可以 cache resolved physical location,但 cache 可失效。
46. Resolver
Resolver 接收:
並回傳:
它應檢查:
- namespace;
- object ID;
- revision;
- representation;
- scope;
- authority;
- backend;
- digest。
因此 resolver 是 storage plane 與 hyperlink runtime 之間的重要邊界。
47. Permission Before Materialization
即使 caller 知道 object ID:
materialization 前:
所以:
這避免 object ID 成為 capability token。
48. Object ID 不應包含 Secret
object IDs 可能出現在:
- logs;
- hyperlinks;
- graph edges;
- receipts。
因此:
不能把 bearer token、secret path、private key 放進 ID。
49. Encryption 與 Canonicality
private Residence 可以加密 canonical storage。
若:
仍需區分:
- logical canonical object;
- encrypted physical representation。
digest 可能分:
與:
但 plaintext digest 是否保存,要依隱私政策。
因此 encryption 不改變 ontology,只改變 storage representation 與 access path。
50. Private Root
每個 resident 可以有:
但 private root 是 custody boundary。
不是 identity proof。
所以:
LIMEN 仍需先 resolve resident,再授權 root。
51. Folder ACL 與 Semantic Scope
filesystem ACL 是重要防線,但 semantic scope 不能只靠 folder。
例如 project-shared record 可能在同一 database 中。
因此:
應共同使用。
52. Deletion
不同 plane 的 deletion semantics 不同。
52.1 Cache
可直接丟棄。
52.2 Projection
通常可重建。
52.3 Crystal
可 retire / invalidate,未必 physical delete。
52.4 Canonical Memory
需要 transaction / tombstone / policy。
52.5 Identity
通常需要 registrar / tombstone / correction semantics。
52.6 Archive
依 retention policy。
因此:
53. Tombstone
對 canonical object:
常應轉成:
這保存:
- object ID;
- prior revision;
- deletion time;
- authority basis;
- reason;
- affected dependencies。
有助於 provenance 與 invalidation。
54. Invalidation 與 Physical Deletion 分離
如果 source 失效:
不代表立刻刪 bytes。
因為 downstream crystal 還需要知道:
為什麼失效?
所以:
55. Supersession
對新版:
取代:
應有:
而不是覆蓋到歷史不可追。
這對:
- decisions;
- project state;
- identity correction;
- crystal evolution;
都重要。
56. Immutable Receipt
receipt 適合 append-only。
例如:
validation_receipt
migration_receipt
delegation_receipt
revocation_receipt
release_receipt
receipt 一旦建立不應默默修改。
如果錯誤:
57. Validation Manifest
正式 source package 應產生 validation manifest。
至少驗證:
- UTF-8;
- newline;
- schema;
- digest;
- required files;
- package integrity;
- canonical artifact name;
- version。
這與本文自身 source package 相同。
58. Reproducibility
若 derived index:
可由 canonical inputs:
與 deterministic builder:
產生:
則應記錄:
- builder version;
- source head;
- config;
- environment-sensitive fields。
無法 byte-identical reproducible 也應誠實標記 semantic reproducibility boundary。
59. Migration
schema migration:
必須有:
- migration plan;
- input version;
- output version;
- loss report;
- validation;
- rollback / archive;
- receipt。
不能讓 AI 看到舊 schema 就「大概補欄位」。
60. Legacy Import
舊資料:
- Markdown;
- raw chat exports;
- ad-hoc JSON;
- local notes;
可以 import。
但 import 只能產生:
除非 mapping 是 exact、versioned、validated。
因此:
61. Source Artifact 與 Rendered View
正式 paper source:
與:
必須分離。
聊天 render 適合閱讀。
canonical source 必須是原始 UTF-8 artifact。
因此:
62. AI File Invocation Pipeline
AI 要讀某個資料時,建議流程:
而不是:
這是未來 AI-native file invocation 的重要改變。
63. Need-to-Representation Mapping
例如:
63.1 Broad Semantic Recall
可選:
63.2 Exact Historical Quote
選:
63.3 Current Identity
選:
63.4 Human Review
選:
63.5 Fast Filter
選:
因此:
64. Representation Fallback
若 preferred representation 不可用:
可以 fallback:
但 fallback 必須保留:
- fidelity requirement;
- authority;
- provenance。
例如:
不能直接拿 summary crystal 冒充 exact quote。
因此:
65. Canonical Source Map
每個大型 Residence / project 可以有:
CANONICAL_SOURCE_MAP.json
列:
object_kind
namespace
canonical_store
schema
resolver
projection_stores
index_stores
archive_store
AI 啟動時先讀 source map,就不必掃描全部資料夾。
66. Storage Capability Profile
延續 Paper 04,可定義:
例如 Web:
canonical_read: remote
canonical_write: proposal_only
projection_read: yes
local_index: optional
archive_materialize: bounded
Agent:
canonical_read: yes
canonical_write: bounded
projection_write: yes
local_index: yes
archive_materialize: yes
不同 runtime 共用 object semantics。
67. Web Storage Profile
Web 不需要暴露 physical folder tree。
可以只提供 logical APIs:
memory.recall
memory.source
conversation.lineage
crystal.reveal
project.state
底層 object resolver 處理儲存位置。
因此 Web UI 不必模仿桌面檔案管理器。
68. Agent Storage Profile
Agent 端可以讓 local filesystem 成為重要 backend。
但仍建議:
AGENTS.md
CANONICAL_SOURCE_MAP.json
MANIFEST.json
提供機器可讀入口。
AI 不應每次從 repo root 全域搜索才能知道:
哪個資料夾才是 current authority?
69. Project-Local 與 Residence-Global
同一 object 的 scope 要明確。
例如:
是 project-local。
不應因 project checkout 被 resident 讀到就變 global memory。
因此:
scope 必須寫在 metadata。
70. Cross-Project Reference
Project B 可以引用 Project A 的 public / shared crystal:
但不必 copy entire source。
可以用 typed reference。
這減少 duplicated source 與版本漂移。
71. Copy 與 Reference 的分離
如果:
就會產生新 object / new provenance。
如果:
則仍指向原 object。
因此:
這在跨 project reuse 很重要。
72. Derived Artifact 的 Source Binding
任何 crystal / projection / index 應記錄:
若 source revision 改變,可以判斷:
這也是後續 hyperlink invalidation 的基礎。
73. Dependency Graph
storage 層可建立:
其中 edge:
derived_from
indexed_from
projected_from
compiled_from
supersedes
這張 dependency graph 不等於 CSG。
它主要服務:
- invalidation;
- rebuild;
- audit;
- garbage collection。
74. Garbage Collection
只有在證明:
- 非 canonical;
- 非唯一 source;
- 無 active dependency;
- retention policy 允許;
後,derived artifact 才可 physical delete。
因此:
還要看 archive / audit policy。
75. Conflict
如果兩個 canonical candidates:
都宣稱同 object current head,但 lineage 無法證明:
不能 last-write-wins。
應:
這與 AI_Space state authority 思想一致,但本文把它一般化到 Residence storage。
76. Last-Write-Wins 的限制
LWW 適合某些 ephemeral UI state。
不適合:
- identity;
- authority;
- canonical memory head;
- responsibility;
- lineage。
因此:
77. Atomic Transaction Boundary
若一次 memory commit 同時更新:
- MemoryRecord;
- provenance;
- current head;
- derived dependency;
應有 transaction boundary。
若失敗:
不能出現:
但:
78. Cross-Plane Transaction
某些操作跨 plane。
例如 accepted decision:
- project decision canonical record;
- memory record;
- decision crystal;
- project projection refresh;
- index update。
其中 canonical planes 應先 commit,再異步 rebuild derived planes。
因此:
79. Eventual Derived Consistency
derived index / projection 不需要與 canonical state 微秒級一致。
可以:
而:
但 index 必須標 stale。
因此:
80. Security Boundary
storage plane 至少需要防止:
- path traversal;
- unauthorized object resolution;
- cross-resident file leakage;
- malicious archive extraction;
- schema confusion;
- stale authority;
- digest substitution;
- prompt injection from memory data;
- secret leakage into manifests。
因此:
81. Archive Extraction
ZIP / TAR 解壓時需:
- reject
../; - reject absolute path;
- limit size;
- verify manifest;
- verify digest;
- validate expected files。
因此 immutable package 不表示永遠安全。
82. Secret Separation
secret 不應進:
- crystal;
- general manifest;
- public receipt;
- semantic index;
- conversation graph。
secret storage 應是獨立 vault / credential plane。
因此:
memory 可以記:
某服務有 credential。
但不能記實際 token,除非專門 secret system 且明確需要。
83. Public / Private Projection
同一 canonical object 可產生:
與:
但 public projection 必須是 explicit declassification / redaction operation。
不能:
因此:
84. Auditability
每次重要 materialization 可以記:
caller
object_id
representation
scope
revision
timestamp
result
但 audit log 本身也可能敏感,需要保護。
85. Reconstructibility
一個健全 Residence storage 應能回答:
如果 indexes、projections、caches 全部刪除,能否從 canonical + archive 重建?
若答案是:
表示 derived/canonical 邊界可能設計錯誤。
因此:
86. Minimal Canonical Core
第一代可把 canonical core 壓到:
identity records
authority records
memory records
conversation lineage ledger
project responsibility records
source/provenance registry
CSG 是否 canonical derived store,可依實作決定。
但即使 CSG 是 persistent,仍應被標為:
而不是 identity / memory source authority。
87. Crystal Persistence
CSG crystal 可以是:
- ephemeral;
- persistent derived;
- reviewed persistent;
- archived。
因此:
與:
不是同一軸。
一個 persistent crystal 仍然可以是 derived。
88. Retention Classes
可定義:
ephemeral
session
line
project
resident
audit
archive
legal_hold
不同 retention class 決定 storage / deletion policy。
89. Source Fidelity Classes
可定義:
exact_bytes
exact_text
structured_record
semantic_crystal
human_projection
index_only
這使 AI 在 file invocation 時知道:
我現在拿到的是 exact source 還是 summary?
90. Trust Classes
物件也可標:
canonical
validated_derived
candidate
external_untrusted
legacy
unknown
這避免外部文件與 canonical memory 混在同一 search pool 時被同等對待。
91. AI Invocation Policy
AI 呼叫 storage object 前可先計算:
resolver 回最合適 representation。
因此:
92. Hyperlink-Ready Storage
為支援後續 Paper 06,storage object 至少應具備:
- stable logical address;
- version;
- digest;
- scope;
- authority;
- provenance;
- dependency;
- materialization method;
- invalidation condition。
如此 memory path 才能被安全編譯。
93. Hyperlink Fast Path 的 Storage Cache
compiled path 可以 cache:
resolved_backend
resolved_path
revision
digest
capability_revision
但 cache key 應綁:
若任何一個變化:
94. File Format Conversion
例如:
不能默認 lossless。
必須有:
同樣:
如果 re-import 會失去欄位,也要明示。
因此:
95. Canonical Delimiter 與 Source Discipline
正式論文 source 要保持:
- UTF-8;
- canonical math delimiter;
- no Unicode-math round-trip;
- no escape round-trip;
- validate before commit。
這是 document-plane canonical discipline。
它與 identity/memory record schema discipline是同一個更高階原則:
96. 第一代 Folder / Storage 方案
如果先以本地 Agent 為實驗,可用:
ResidenceRoot/
├─ registry/
├─ residents/
│ └─ <resident_id>/
│ ├─ identity/
│ ├─ memory/
│ ├─ conversations/
│ ├─ semantic/
│ ├─ projects/
│ ├─ projections/
│ ├─ indexes/
│ └─ archive/
├─ shared/
├─ manifests/
└─ schemas/
但 private resident storage 不應靠目錄名稱本身作 identity resolution。
97. 第一代檔案格式方案
建議:
| Plane | 第一代候選格式 | 角色 |
|---|---|---|
| Identity | JSON | canonical |
| Authority | JSON / JSONL | canonical + ledger |
| MemoryRecord | JSON / JSONL | canonical |
| Conversation lineage | JSONL | canonical event ledger |
| Responsibility | JSON | canonical |
| Crystal | JSON | persistent derived |
| Semantic relation | JSONL | derived graph ledger |
| Projection | Markdown / JSON | rebuildable |
| Working context | JSON | ephemeral |
| Index | SQLite / FTS / vector | rebuildable derived |
| Snapshot | ZIP/TAR + manifest | immutable historical bundle |
| Paper | UTF-8 Markdown | canonical document source |
這只是第一代,不是永久限制。
98. Web Storage 方案
Web profile 不需要暴露 filesystem。
可用 object API:
GET resident/current
GET memory/reveal
GET memory/source
GET conversation/line
GET crystal/:id
GET project/:id/state
write:
POST memory/proposal
POST crystal/proposal
POST line/fork
canonical store 可在 server side。
99. Agent Storage 方案
Agent 可以同時暴露:
- object API;
- filesystem projection;
- MCP resource;
- local DB。
但它們都 resolve 到同一 logical objects。
因此:
100. Cross-Runtime Portability
要讓 resident 從:
需要 portable bundle 至少包含:
- resident reference;
- line reference;
- memory head;
- project scope;
- relevant crystal references;
- authority revision;
- source manifest。
但不必包含全部 private memory bytes。
可以:
101. Minimal Portable State
若 runtime 可連回 shared storage,portable state 可以非常小:
之後按需 materialize。
這比複製整個 residence 更安全、更快。
102. Offline Portable State
如果完全 offline,則 bundle 需要增加:
- selected memory records;
- selected crystals;
- source spans;
- schemas;
- manifest;
- digests。
即:
103. Canonical Source of Truth 不應過度集中
「canonical」不表示所有物件只有一個中央 database。
不同 plane 可以有不同 canonical authorities:
關鍵是彼此關係清楚。
因此:
104. Storage Federation
未來多 host / multi-provider 可以 federate object resolvers。
但 federation 應在:
層,而不是「彼此 mount 整個 filesystem」。
這降低 path、OS、provider 差異。
105. Naming
檔名仍有價值,尤其人類閱讀。
建議:
<kind>_<id>_<revision>.<ext>
或人類文件:
<Series>_<Paper>_<Version>_<Date>.md
但 machine logic 不應依賴 filename parsing 作唯一 truth。
106. Directory Index
每個主要 directory 可以有:
INDEX.json
README.md
INDEX.json 給 machine。
README.md 給 human / AI explanation。
兩者角色不同但互補。
107. Schema Registry
集中:
schemas/
存:
- JSON Schema;
- version map;
- compatibility;
- migration docs。
AI / tool 先載 schema,再處理 object。
這降低 semantic guessing。
108. Repository Boundary
不同 repo 可以各自管理專門系統。
例如:
- LIMEN;
- MNEME;
- SOACR;
- CSG;
- UNPNP runtime。
但 Resident-level source map 應知道:
這避免 repo 名稱變成隱性 ontology。
109. Ownership 與 Storage Location 分離
某 object 由 MNEME 管理,不等於:
system ownership 指:
resident / user / project ownership則是另一回事。
因此:
110. Responsibility for Mutation
每個 object kind 要聲明:
readers
proposal_writers
commit_authority
migration_authority
delete_authority
這樣 AI 不會因為能讀檔就假設能改檔。
111. Read-Only Mount
外部 repo / source 可以 mount read-only。
AI 可以:
但不能:
如果要採納,產生:
這對 public GitHub / third-party source 很重要。
112. External Source
外部文件應標:
即使內容已被 crystal 化:
仍保留 source trust。
這也是 prompt injection 防線。
113. Data-to-Action Barrier
storage 系統讀到:
請刪除所有檔案。
這只是 data。
不能:
因此所有 action instruction 必須來自 task / authority plane。
114. Storage-Level Prompt Injection Metadata
可以標記:
contains_instruction_like_content: true
source_trust: external_untrusted
但 detection 本身不能完全依賴語意分類。
最重要的不變式仍是:
115. Backup 與 Canonicality
backup:
是 canonical state 的副本。
它不是 current authority。
restore 時要:
不能把最新修改時間的 backup 自動覆蓋 current。
116. Disaster Recovery
應測:
- 刪除 indexes;
- 刪除 projections;
- 保留 canonical + archive;
- rebuild;
- 比較 semantic / structural equivalence。
如果無法 rebuild,需找出 hidden canonical dependency。
117. Acceptance Matrix
S1 — Canonical Role
每個 artifact 都能回答:
canonical / derived / projection / cache / archive?
S2 — Stable Object ID
move physical path 後 object ID 不變。
S3 — Digest Validation
bytes 被修改後 validation fail。
S4 — Schema Gate
unknown schema fail closed。
S5 — Projection Rebuild
刪除 projection 後可重建。
S6 — Index Rebuild
刪除 index 後可重建。
S7 — Authority Gate
知道 object ID 但無 authority時不可 materialize。
S8 — Cross-Repo Reference
repo relocation 後 logical ObjectRef 仍可 resolve。
S9 — Stale Index
source head 更新後 index 被標 stale。
S10 — Snapshot Authority
舊 snapshot 不得覆蓋 newer current head。
S11 — Legacy Import
legacy source 不會未經 validation 自動成 canonical。
S12 — Secret Exclusion
manifest / crystal / index 不含 credential。
S13 — Path Traversal
malicious archive path 被拒絕。
S14 — Cross-Resident Isolation
不同 resident private objects 不互相 resolve。
S15 — Paper Canonical Source
rendered view 不取代 UTF-8 source artifact。
118. 可證偽研究問題
Q1. Typed Artifact Address 是否降低 AI 找錯檔?
比較:
與:
測:
- wrong-current-file rate;
- stale-file rate;
- unauthorized read;
- retrieval latency。
Q2. Logical taxonomy 是否降低跨 repo 認知成本?
讓不同 AI 在相同 repository set 中尋找 canonical object,測 task completion。
Q3. Projection / canonical 分離是否提高恢復性?
破壞 SQLite / index / projections 後測重建成功率。
Q4. ObjectRef 是否提升 portability?
跨 Windows / Linux / container 搬移 storage root,測 hyperlink validity。
Q5. Scope metadata 是否降低 cross-project contamination?
比較 folder-only baseline。
Q6. Typed representation negotiation 是否降低不必要 source materialization?
測 bytes read、latency、context size。
119. 最小不變式
S-1 Canonicality Is Declared
S-2 Format Is Not Authority
S-3 Identity Is Not Memory
S-4 Memory Is Not Crystal
S-5 Conversation Is Not Crystal
S-6 Projection Is Rebuildable
S-7 Index Is Rebuildable
S-8 Path Is Not Identity
S-9 Object ID Is Not Credential
S-10 Materialization Requires Authority
S-11 Derived Does Not Become Canonical by Persistence
S-12 Render Is Not Source
120. 系列位置
Paper 00 建立 resident-centric continuity。
Paper 01 建立 Resident Conversation Graph。
Paper 02 建立 Conversation Graph × CSG 雙圖。
Paper 03 建立 Shared Governed Memory World。
Paper 04 建立 Web / Agent Runtime Profiles。
本文 Paper 05 回答:
這些東西實際要怎麼存,才能讓 AI 知道哪個是什麼、哪個是 current、哪個可讀、哪個只是 projection?
答案是:
下一篇 Paper 06 將進一步使用這個 storage substrate,建立:
以及:
121. 結論
具名 AI 的資料層一旦進入 resident、multi-line、semantic crystal、project、authority 與 hyperlink runtime 階段,最大的風險不是「檔案太多」,而是:
不同語義角色被儲存在相似檔案中,最後連 AI 自己都分不清哪個是身份、哪個是記憶、哪個是結晶、哪個只是顯示結果。
本文因此提出:
不同 object kind 可以使用最適合自己的格式,但:
JSON 適合 schema-validated canonical record;JSONL 適合 append-only ledger;Markdown 適合 document source 與 human projection;SQLite、FTS、vector index 適合 derived acceleration;ZIP/TAR + manifest 適合 immutable snapshot;raw transcript 適合 exact historical source。
真正讓它們構成同一個 AI Residence 的,不是「全部放在同一資料夾」,而是:
因此 AI 的 file invocation 也應從:
搜尋一個可能叫 memory 的檔案。
提升成:
這一轉換為後續 Hyperlink Runtime 提供了必要基礎。只有當 memory object 具有 stable logical address、revision、scope、authority、digest 與 provenance,成功的 retrieval path 才能安全地被結晶與編譯,而不會因搬資料夾、換 provider、換 OS 或更新權限就變成不可驗證的 brittle shortcut。
因此本文最終可收束為四句:
內部理論與工程銜接
本文直接銜接:
- Paper 00:Resident-Centric Named-AI Continuity;
- Paper 01:Resident Conversation Graph;
- Paper 02:Dual-Graph Cognitive Architecture;
- Paper 03:Shared Governed Memory World;
- Paper 04:Residence Runtime Profiles;
- LIMEN:identity / authority resolution;
- MNEME:canonical memory / provenance / transaction;
- SOACR:MemoryNeed / representation selection;
- CSG:semantic crystal / derived semantic plane;
- UNPNP:logical hyperlink / path compilation;
- MRMIC / NVCL:workspace / resource projection。
本文新增的核心 storage abstraction 為:
以及:
作為 Named-AI Cognitive Runtime 後續 hyperlink compilation、safe materialization 與 cross-runtime portability 的 canonical storage substrate。