- 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>
- POST /ingestions accepts format "html": Html_ToMarkdown (core/lib.HtmlAdapter.asp)
drops scripts, styles, comments and navigation, keeps headings, lists, tables and
code blocks, decodes entities; title defaults to the page <title>. The job payload
and the stored document only ever hold Markdown; the response reports source_format.
- Nothing a page references is fetched. PDF is out of scope on this runtime (ADR-013).
- tests/phase4-html.sh (30 checks); kb.sh ingest picks html for .html/.htm files.
- AGENTS.md gotcha: the Windows checkout is case-insensitive, so a new lib.Html.asp
overwrote the framework's lib.HTML.asp (caught before commit and restored).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST /consolidations (ApiLearningController.Consolidate) with
core/lib.Consolidation.asp: deterministic word-overlap grouping (Jaccard,
>= 2 shared words, frequent words ignored), drafts built from the
experiences' own text, optional "propose" filing candidates that cite
the experiences; no duplicate proposals (ADR-012, AC-16).
- kb.sh: session, event, consolidate [propose].
- tests/phase3-consolidation.sh (42 checks); OpenAPI, README, AGENTS.md,
acceptance report and decisions updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ApiAdminController: GET /me; GET|POST /namespaces; GET|POST /principals,
GET|PATCH /principals/:id, POST /principals/:id/keys, DELETE /keys/:id;
GET|POST /grants, DELETE /grants/:id.
- Authorization from namespace grants (ADR-011): admin allows granting and
creating below; inherit needs inheriting admin; managing another
principal's keys/status needs admin over all of its grants, so a key
never widens the caller's access. Keys shown once, no-store.
- tests/admin-api.sh (91 checks incl. escalation and isolation attempts).
- OpenAPI, README, AGENTS.md, acceptance report updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests/retrieval-benchmark.sh: fixed corpus (30 memories, one handbook),
56 labelled queries (exact, paraphrase, none), hit@5 / MRR@10 / false
positive rate with semantic retrieval and with the provider stopped;
thresholds stored in tests/benchmark/fixtures.json (AC-04).
Hybrid: exact hit@5 1.00, paraphrase hit@5 0.875 (lexical 0.125),
no false positives, MRR 0.745 vs 0.420.
- docs/acceptance.md: AC-01..AC-18 mapped to automated checks and manual
verification, latest evidence, and what is not tested.
- docs/decisions.md: ADR-001..010 for the choices made in phases 1-3.
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>
- 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>
On the 2-vCPU production VM a small ingest after a large import hit the 60 s
script timeout: the write committed, but post-commit indexing kept embedding
the tenant's backlog while Ollama was busy, so the client saw an error.
- Provider/store calls in web requests wait at most EmbeddingTimeoutMs (10 s);
recall/search/context fall back to lexical instead of stalling
- Emb_AfterWrite stops starting batches after EmbeddingWriteBudgetMs (8 s) and
leaves rows pending (no attempt used) for the embed-worker
- The CLI worker (scripts/embed.asp) still waits up to 60 s per call
- .gitignore: all .amk*.env files (production and local KB settings)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One JSON access-log line per API response (request id, action, status,
duration, tenant/principal; never bodies, queries or keys); ApiAccessLog
setting turns it off
- A caller's X-Request-Id (8-64 safe chars) is kept for correlation
- GET /api/v1/metrics: Prometheus text with request counters and a latency
histogram per action, plus memory/candidate/job/embedding/retrieval/feedback
counts; needs AMK_METRICS_TOKEN (compose .env), 404 while unset
- scripts/ops.sh: migrate/provision/embed/backup/verify/restore on Linux
- AGENTS.md: the knowledge base lives on the production server; the local
container is for tests only
- Tests: observability.sh (25); all eight suites pass
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>
Ranker_Class.ApplyFeedback scales each candidate's score by the tenant's ratings of its
current revision (x1.1 per useful up to 5, x0.9 per not_useful up to 5, x0.5 per
incorrect/harmful up to 3) and re-sorts. Recall and search results carry feedback
counts; all three endpoints warn when results were demoted. A corrected memory starts
without feedback. tests/phase3-learning.sh: 93 checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Router_Class.Resolve falls back to ErrorController.MethodNotAllowed when the path is
routed for other methods; ErrorController answers /api/... without the layout in the
API error format. Tests: phase1 (79 checks) and phase3-learning assert 405.
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>
- ApiContextController: token-budgeted task briefing. Constraints are loaded by
scope and required (422 context_budget_exceeded when they do not fit);
working state from the session checkpoint, preferences, disputed items as
conflicts, lexical decisions/lessons/knowledge and reference passages,
optional unverified items; deduplicated by content, trust-labelled.
- Api_Utf8Decode, JsonLite and the API generator template flag code points
above U+FFFF (ChrW fails on the pinned AxonASP build, surrogate pairs come
out as CESU-8); Api_ReadBody answers 422 unsupported_character. Fixes the
signed hex parse of \u escapes in JsonLite.
- Pin the AxonASP image by digest.
- tests/phase3-context.sh (60 checks); phase1 UTF-8 checks updated (74).
- 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>
- docker-compose.yml mounts the repo at /opt/axonasp/site and serves
public/ via SERVER_WEB_ROOT so gen.cmd/migrate.cmd work
- AGENTS.md/README.md: drop deploy/ references, add include-order,
Eval/Execute, call-site binding and single-line If gotchas
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Add docker-compose.yml serving public/ on 8801 (mounts core, app, db)
- Include mvc.asp last in autoload_core so class methods can see
GetRouter()/Flash()
- Dispatch controllers through per-controller Invoke + <Name>_Invoke
(GetRef) entry points instead of runtime Eval/Execute, which doubled
output and bound a shared call site to the first controller
- Update generateController.vbs and Api.tpl.asp to emit Invoke
- Ignore UPSTREAM-TODO.txt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>