Paper #2 DOI: 10.5281/zenodo.24607074

Codebase Memory That Learns in 1 Millisecond and Sleeps at Night

When a coding agent edits one file, it can quietly break an untouched file across the repository. Omen stores hidden rules inside its own weights, learns new rules in 1 ms without retraining, and prunes outdated contracts during nightly sleep.

22s overview: hidden cross-file break, stale note false alarms, 1 ms Instant-CLS write, and nightly REM pruning 1080p · silent loop
80-file app map

3 untouched files flagged

checkout/discount.ts

        

Why coding agents break untouched files

In Warden-S1, 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 the diff.

Most teams patch this by stuffing old bug notes into every prompt (RAG). Three problems hit immediately: prompts grow almost 7x longer, keyword search misses differently worded edits, and old bug notes keep firing false alarms long after a refactor fixes the issue.

Fast daytime memory + nightly sleep

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:

Controlled benchmark results (80 files)

Tested across 3 random seeds on GhostLocus-Bench v2 (60 cross-file rule families across FastAPI, Hono, Pydantic, Vite, and Zod; 80 candidate files; 260 held-out test edits):

Method Ghost R@1 Alarm AUROC Stale FPR Wake Latency Extra Tokens
Zero-Shot Base 5.0% 0.448 50.0% 38.4 ms 0
Append-Only RAG 26.4% 0.617 37.8% 115.0 ms +747
Naive SFT Replay 91.4% 0.718 36.1% 71.0 ms 0
Omen + Bio-REM (Ours) 97.5% 0.906 0.6% 67.0 ms 0
Four-arm comparison and latency-AUROC Pareto frontier on GhostLocus-Bench v2 showing Arm D Bio-REM reaching 97.5% Ghost R@1 and 0.6% stale false positives at 67 ms.
Four-arm 3-seed comparison across 80 files: Omen Bio-REM reaches 97.5% Ghost R@1 and 0.6% stale false positives at 67 ms with zero extra prompt tokens, outperforming +747-token RAG by +71.1 pp.
Stage-2 REM selective pruning dynamics showing stale false positives dropping from 64% to 0.6% while active contract recall stays at 97.5%.
Nightly REM Stage-2 pruning drops stale false alarms from 64% down to 0.6% while keeping all 40 active repository contracts intact (zero catastrophic forgetting).
24-hour continuous stream results comparing Instant-CLS against RAG, nightly-only REM, and online SGD across daytime writes, refactors, and post-sleep reset.
24-hour stream: daytime fast weights reach 100% recall in 1 ms and drop stale false alarms to 1.7% in 2.7 ms after a refactor, before nightly sleep resets them to zero.

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 layers, tested on public multi-hop and long-memory benchmarks.

Artifacts and citation

Paper #2 extends Warden-S1 (DOI: 10.5281/zenodo.24494405). The technical paper (PDF, Zenodo DOI), the 8 MB model weights (DevMortimer/Omen-REM-0.6B), and the GhostLocus-Bench v2 evaluation dataset (Hugging Face) are released under Apache-2.0.

@misc{gapac2026omenrem,
  author       = {Gapac, Ryan Joshua Z.},
  title        = {Omen, Instant-CLS \& REM-Engram: Dual-Timescale Codebase Memory for Coding Agents},
  year         = {2026},
  month        = nov,
  doi          = {10.5281/zenodo.24607074},
  url          = {https://doi.org/10.5281/zenodo.24607074}
}

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 to scan git diff before pushing, teach new cross-file rules live in ~1 ms, and run nightly consolidation:

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:

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"])