- 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>
- Ingestion stores the job and its input before processing (migration adds
jobs.payload). Default: processed in the request (201/200); "async": true
answers 202 and the worker publishes it. Interrupted jobs (5 min lease) and
internal errors are retried by the worker, at most 3 attempts; other
failures wait for POST /jobs/:id/retry. Permission is re-checked at
processing time. Claims are conditional updates; publishing and the job
update share one transaction, so retries and duplicate submissions never
publish duplicate chunks (FR-016, NFR-002, AC-12)
- core/lib.Jobs.asp shared by the controller and scripts/embed.asp (actions
jobs, worker)
- Fix: a DAL call resets Err, so multi-statement transactions could lose an
early failure and commit a partial write (seen as a duplicate document under
concurrent ingests). Database_Class records the first error in an open
transaction and CommitTransaction rolls back and raises
- Tests: phase3-jobs.sh (41) with tests/fixtures/job_state.asp; all nine
suites pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ApiLearningController: POST/GET /sessions/:id/events, POST /learn, GET /candidates[/:id],
POST /candidates/:id/review (verify permission, no self-approval without admin, stale
revision proposals 409, duplicates reuse the memory), GET /memories/:id/sources (evidence
the caller cannot read is shown without its id), POST /feedback.
- core/lib.Learning.asp: evidence validation and pinning, shared memory writes, telemetry.
Recall, search and context record the query_id they return and each result revision.
- Migration for experiences, learning_candidates, evidence_links, retrieval_queries,
retrieval_results and feedback; forget and provision purge remove the linked rows.
- Readiness reports degraded plus the embedding backlog; embed-worker container retries
pending items every 30 s.
- tests/phase3-learning.sh (85 checks); OpenAPI, README and AGENTS.md updated.
- scripts/kb.sh: use this repo's own knowledge base (keys in git-ignored .amk.env).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docker-compose: ollama (nomic-embed-text) and qdrant services.
- core/lib.Embeddings.asp: Ollama and Qdrant clients, embedding_index
bookkeeping (pending/indexed/failed/delete with model, dimensions and
revision), Ranker_Class with reciprocal rank fusion of lexical and vector
ranks. Falls back to lexical with a warning when the provider is off/down.
- Write paths mark rows inside their transaction and index after commit
without failing the write; forget, purge and new document revisions remove
points. scripts\embed.cmd status|run|reindex catches up or rebuilds.
- /recall, /search and /context use the shared ranker and report strategy.
- Lexical queries drop common English stopwords; fix AscW sign so characters
U+8000..U+FFFF are kept as word characters.
- Migration create_embedding_index_table; tests/phase3-semantic.sh (30
checks); OpenAPI, README and AGENTS.md updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds ApiDocumentsController, core/lib.Search.asp (class-based chunker, FTS5 indexing),
POST /recall and /memories/:id/verifications, the documents/search migration, purge
coverage for the new tables, OpenAPI spec and tests/phase2-api.sh.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two reversible migrations: tenants/principals/api_keys/namespaces/
access_grants, then memory_types/memories/memory_revisions/
idempotency_keys/sessions/checkpoints/audit_events. Verification is
per revision. Document migrator one-per-process quirk in AGENTS.md.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>