Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LifeOS/install/LIFEOS/DOCUMENTATION/Memory/CortexContract.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ A benchmark run produces a versioned report under `MEMORY/BENCHMARKS/` that both

`vector_config` is currently `null`: there is no vector benchmark candidate and no vector index. A vector or hybrid index may be adopted only after a labeled report demonstrates retrieval-quality improvement over progressive BM25, and only if it is canonical-rebuildable and stays within separately documented disk and process bounds. Lower token use alone is not evidence for a vector index.

**Opt-in per-turn embedding leg.** Per-turn retrieval (`MemoryTurnStart` → `MemoryRetriever.getRelevantContextAsync`) ranks by embedding only when the operator sets `LIFEOS_MEMORY_EMBEDDING=1` (`MemoryEmbedding.ts`); off, which is the default, its output is identical to BM25. It is not a Cortex index: the Cortex commands, `CORTEX_INDEX_POLICY.json` and `vector_config` are unchanged. It meets this gate as follows. *Labeled evidence:* a held-out report against the shipped BM25 at the hook's exact call (public issue #2207). *Canonical-rebuildable:* vectors are a disposable cache derived from the canonical Markdown under `MEMORY/STATE/cache/memory-embeddings/`, keyed by path, mtime and model; deleting it only re-embeds. *Bounds:* about 4 KB per note on disk (1024-dimension float32, e.g. 2.0 MB for 486 notes); no LifeOS process, because embeddings come from the operator's own Ollama server and only a loopback URL is accepted; one query embed per prompt inside the 300 ms prompt budget, falling back to BM25 past it; note embeds only in the async Stop hook (`MemoryIndexRefresh`), at most 40 s per turn.

## Truthful operational health

`Cortex.ts status` reports contract availability and corpus shape. Operational health comes from:
Expand Down
2 changes: 1 addition & 1 deletion LifeOS/install/LIFEOS/DOCUMENTATION/Memory/MemorySystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Every command emits one `lifeos-cortex/v1` JSON envelope. The published schema i

`LIFEOS/TOOLS/CortexAdapter.ts` ships the in-process adapter factory for `claude`, `hermes`, `codex`, and `subagent`. Adapter calls are read-only by default: every remember/propose call must individually opt in with `{allowWrite:true}`, corresponding to the CLI's explicit recognized `--adapter` plus `--allow-write`. Command/type binding is enforced before dispatch: `remember` accepts `memory|idea|knowledge`; `propose` accepts only `proposal`. Authorized items then delegate to `MemorySystem.add()` so the existing mutation tiers, proposal approval, target pinning, audit trail, snapshots, and shrink guard remain authoritative. `export` is read-only stdout serialization, not a filesystem writer.

Canonical Markdown/JSONL remains the source of truth. Cortex allows the intentional top-level `LIFEOS/MEMORY` symlink, resolves and pins its canonical target, and rejects nested symlinks or escapes. The shipped `LIFEOS/CORTEX_INDEX_POLICY.json` affirmatively declares `no-index-v1`: BM25 reads canonical files, `status` reports no indexes, and `rebuild --from-canonical` produces equal deterministic SHA-256 record-view digests without creating an index. A missing policy plus missing manifest warns rather than silently turning green. There is no CMEM, Chroma, SQLite FTS, vector index, cloud sync, external telemetry, MCP server, or Cortex daemon.
Canonical Markdown/JSONL remains the source of truth. Cortex allows the intentional top-level `LIFEOS/MEMORY` symlink, resolves and pins its canonical target, and rejects nested symlinks or escapes. The shipped `LIFEOS/CORTEX_INDEX_POLICY.json` affirmatively declares `no-index-v1`: BM25 reads canonical files, `status` reports no indexes, and `rebuild --from-canonical` produces equal deterministic SHA-256 record-view digests without creating an index. A missing policy plus missing manifest warns rather than silently turning green. There is no CMEM, Chroma, SQLite FTS, vector index, cloud sync, external telemetry, MCP server, or Cortex daemon. Per-turn retrieval (`MemoryTurnStart` → `MemoryRetriever`) has one opt-in exception, off by default: an embedding leg against a local Ollama server (`LIFEOS_MEMORY_EMBEDDING=1`, `MemoryEmbedding.ts`), whose evidence and bounds are in [`CortexContract.md`](./CortexContract.md) § Retrieval benchmark and vector evidence gate.

`CaptureEnvelope.ts` provides the concrete `ingestCaptureEnvelope(input, consumer)` helper, which sanitizes through `createCaptureEnvelope` before invoking the consumer. It is source-neutral. Both legacy transcript capture writers are envelope-migrated (2026-08-03): `MemoryReviewer.ts` ingests transcript text via `transcriptCaptureEnvelope` and `SessionHarvester.ts` via its `ingestTranscriptText` boundary, each binding source/channel/captured_at/session provenance and making private-span stripping structural; harvester outputs (harvest-queue JSON, LEARNING files) carry that provenance. Probes (source tree only; tests are not in the public release payload): `test/tools/cortex/writers.test.ts`. The versioned benchmark imports the production validity/ranking/card functions, shares one ranking between full-fetch and card-first disclosure paths, and can write only an explicit versioned report under `MEMORY/BENCHMARKS/`. The verified live artifact is `LIFEOS/MEMORY/BENCHMARKS/cortex-benchmark-v1-20260802.json`; see the contract for its point-in-time metrics and non-claims.

Expand Down
Loading