--- title: "Omen, Instant-CLS & REM-Engram: Why Coding Agents Need Both Fast Hippocampal Memory and Nightly Sleep" author: "Ryan Joshua Z. Gapac" orcid: "0009-0004-2591-0219" date: "2026-11-28" series: "System-One & Bio-Memory Research Series (Paper #2)" doi: "10.5281/zenodo.24607074" benchmark: "https://huggingface.co/datasets/DevMortimer/GhostLocus-Bench" pdf: "https://ryanjoshuagapac.com/papers/omen-rem-paper.pdf" extends_doi: "10.5281/zenodo.24494405" status: "published" --- # Omen, Instant-CLS & REM-Engram: Why Coding Agents Need Both Fast Hippocampal Memory and Nightly Sleep - **Interactive Studio:** [ryanjoshuagapac.com/writing/omen-rem](https://ryanjoshuagapac.com/writing/omen-rem) - **Paper (PDF):** [omen-rem-paper.pdf](https://ryanjoshuagapac.com/papers/omen-rem-paper.pdf) - **Zenodo DOI:** [10.5281/zenodo.24607074](https://doi.org/10.5281/zenodo.24607074) - **Model Weights (HF):** [DevMortimer/Omen-REM-0.6B](https://huggingface.co/DevMortimer/Omen-REM-0.6B) - **Benchmark:** [DevMortimer/GhostLocus-Bench](https://huggingface.co/datasets/DevMortimer/GhostLocus-Bench) In [Warden-S1](https://doi.org/10.5281/zenodo.24494405) (`DOI: 10.5281/zenodo.24494405`), a local 415 MB model watched a single coding session to catch mistakes as they happened. Over several days, a different failure shows up: an agent edits file `A`, passes every local test, and quietly breaks an untouched file `B` whose name never appears in `git diff`. Most teams patch this by stuffing old bug notes into every prompt (RAG). Three problems hit immediately: 1. **Prompt bloat:** Prepending old logs makes prompts nearly `7x` longer (`+747` extra tokens) and slows checks down (`115 ms` vs `67 ms`). 2. **Keyword misses:** When a new edit triggers an old bug without repeating the same words, keyword retrieval misses the untouched file (`26.4%` Top-1 recall across `80` files). 3. **Stale false alarms:** After a refactor fixes an old rule, old bug notes stay in the index and keep firing false alarms (`37.8%` to `57.2%`). Training rules into weights overnight removes prompt bloat, but leaves you blind whenever a rule changes mid-day. Omen splits memory across two timescales so updates land in milliseconds and old rules clear out cleanly: ## Fast Daytime Memory + Nightly Sleep - **Fast check (`67 ms`, `0` extra prompt tokens):** One forward pass of `Qwen3-0.6B` plus an `8 MB` adapter predicts which untouched files are at risk, with no text generation. - **Instant daytime learning (`1.04 ms`, no retraining):** A closed-form linear update (Sherman-Morrison) writes a new cross-file rule into a `0.63 MB` fast-weight matrix, lifting mid-day recall from `0%` to **`100%`**. - **Instant daytime forgetting (`2.71 ms`, no retraining):** When a refactor retires an old rule, orthogonal projection (thin QR) erases just that rule without hurting active rules. Stale false alarms drop from `71.7%` to **`1.7%`** while keeping **`98.9%`** of active rules intact. - **Nightly sleep and reset (`< 5 min`):** Overnight, a short consolidation pass folds surviving daytime rules into the `8 MB` adapter, suppresses retired ones, and resets the fast daytime matrix back to zero. ## Controlled Benchmark Results (`80` Files) Tested across `3` seeds (`42, 137, 2026`) on `GhostLocus-Bench v2` (`60` cross-file rule families across `FastAPI`, `Hono`, `Pydantic`, `Vite`, `Zod`; `80` candidate files; `260` held-out test edits): - **Nightly consolidated Omen:** `97.5%` Top-1 recall on untouched broken files (`99.2%` Top-3), `0.906` alarm AUROC, and `0.6%` stale false alarms (`+71.1 pp` recall and `-37.2 pp` false alarms vs RAG). - **24-hour continuous stream:** `100%` mid-day recall (`1.04 ms`), `1.7%` post-refactor false alarms (`2.71 ms`, `98.9%` retention), and `94.7%` Top-1 / `2.2%` stale false alarms after overnight reset (`0` extra prompt tokens). ## Honest Limits and What Comes Next (v2) This paper is a controlled proof of the math, not a general replacement for RAG. The current checkpoint predicts risk and untouched filenames over an 80-file catalog; it does not yet store freeform documentation or change what a coding LLM generates directly. Next in **Omen v2**: lifting this same 1 ms null-space write, orthogonal unlearning, and nightly reset loop out of a classifier head and directly into generative transformer weights, tested on public multi-hop and long-memory benchmarks (`MQuAKE-Remastered`, `LongMemEval`, and `HumanEval+` retention). ## How to Use Omen Omen runs locally on any Git repository with zero cloud API keys and zero extra prompt tokens. ### 1. Pre-commit or PR check on any Git repo (`omen_cli.py`) Download the standalone CLI from [DevMortimer/Omen-REM-0.6B](https://huggingface.co/DevMortimer/Omen-REM-0.6B) to scan `git diff` before pushing, teach new cross-file rules live in ~1 ms, and run nightly consolidation: ```bash pip install torch transformers peft safetensors huggingface_hub curl -sLO https://huggingface.co/DevMortimer/Omen-REM-0.6B/raw/main/omen_cli.py python omen_cli.py check # scans git diff (~67 ms), lists risky files python omen_cli.py learn HEAD # learns a new rule in ~1 ms (Instant-CLS) python omen_cli.py sleep --days 7 # nightly Bio-REM + prunes refactored rules ``` ### 2. Embed in Python or CI PR bots Score any raw pull-request diff string directly in Python without modifying your main coding agent prompt: ```python from omen_cli import OmenMemory omen = OmenMemory.from_pretrained("DevMortimer/Omen-REM-0.6B") result = omen.check_diff(pr_diff_text, top_k=3) if result["alarm_prob"] >= 0.5: print("Check untouched files:", result["top_ghost_files"]) ``` *Invented by Ryan Joshua Z. Gapac (ORCID: 0009-0004-2591-0219). Released under Apache-2.0 with NOTICE attribution. Paper #2 DOI: `10.5281/zenodo.24607074`. Model Weights: `DevMortimer/Omen-REM-0.6B`. Benchmark: `DevMortimer/GhostLocus-Bench`. Prior series work: Warden-S1 (`10.5281/zenodo.24494405`).*