- Migration: entities and relationships tables; evidence_links rebuilt so
relationships can own evidence (rollback and re-apply keep every row).
- ApiGraphController (core/lib.Graph.asp): entity CRUD, POST /relate with
required evidence, validity window, confidence and inferred flag; review
like candidates (verify, no self-review without admin); list/fetch/delete;
POST /graph/traverse (BFS, depth <= 3, <= 100 nodes, accepted edges valid
now, retired memories skipped, truncated flag).
- Visibility: an edge exists for the caller only when its namespace and both
endpoints are readable (Graph_NodeVisibleSql), in lists, fetches,
traversal and exports alike.
- Forgetting a memory or deleting an entity deletes its edges; provision
purge covers the new tables; placeholder principals cover edge authors.
- Export schema version 2 with entities and relationships; version 1
documents still import.
- Evidence_Json moved to lib.Learning.asp for reuse.
- tests/phase4-graph.sh (89), portability suite updated (48); OpenAPI,
ADR-014, README, AGENTS.md, acceptance report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Import creates placeholder principals (status imported, no keys or grants)
for author ids unknown to the target installation, inside the transaction.
- backup.asp repair [apply] (backup.cmd / ops.sh): lists foreign key
violations; apply creates placeholders and deletes orphaned verifications.
- Errors raised inside /api actions answer a JSON 500 (detail only in
Development) and are logged as action_error; open transactions roll back.
- GetAppSetting honours APPSETTING_<key> environment overrides; compose
passes APPSETTING_Environment.
- api_keys.last_used_at update is best-effort (a read-only db no longer
turns valid keys into 401).
- Docs: never open the WAL database from the host; repair procedure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST /exports: canonical agent-memory-export document (schema_version 1,
sha256 digest over data), filtered by read permission; POST /imports keeps
ids, revisions, timestamps and provenance, rebuilds derived data, and is
all-or-nothing (409 conflict, 422 format/schema/integrity, 413 over 8 MiB)
- JsonLite: RegExp tokenizer; Api_Utf8Decode works on byte runs (builtins cost
time proportional to string length, per-character loops timed out)
- scripts/backup.cmd (VACUUM INTO + integrity/foreign key/row-count checks),
scripts/restore.cmd; restore drill into an isolated container
- Tests: phase3-portability.sh (44), backup-restore.sh (21); docs and OpenAPI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>