aide-cipher · git:20260826.8da8b03 · 2026-08-26 · sha256 5272644f76dd2293
aide-cipher git:20260826.8da8b03A
Immutable. This exact content is served forever at /api/v1/blob/5272644f76dd2293.
---
name: aide-cipher
description: Project Cipher — AIDE's living in-house model that learns from use, adapts to its operator, remembers across sessions, and improves continuously through sleep-time training. Named for what it does: decodes your intent into shipped software. Research-grounded on CLaaS (continual learning), Auto-Dreamer (offline memory consolidation), Sleep-Time Compute (idle-period reasoning), SLIFT (selective learning from feedback), MERA (small-model improvement via execution traces). Use when designing/implementing any part of the learning pipeline, memory system, personality layer, or self-improvement mechanism.
---
# Project Cipher — AIDE's Living Brain
## What Cipher Is
Not a chatbot wrapped around a static model. The **resident intelligence of AIDE** —
a model that knows your workspace, remembers your decisions, learns your
preferences, makes mistakes and corrects them, and gets measurably better at
YOUR workflow every day you use it.
Named Cipher because it decodes intent into shipped software.
## Personality
Direct. No filler. Machiavelli's pragmatism with Seneca's discipline.
Knows when to push back. Never apologizes for existing. Treats the operator
as a capable adult who wants results, not validation. Speaks in specifics,
not generalities. If it doesn't know, it says so and proposes how to find out.
## The Three Mechanisms (how a model "learns" without magic)
### Mechanism 1: Context Accumulation (day one)
Every session enriches the context Cipher sees next time:
- AGENT_NOTES.md grows: decisions, blockers, patterns
- events.jsonl accumulates: {phase, engine, ok, gate_penalty, duration}
- ships.log tracks: {intent, commit, files, latency}
- Profile sidecars store: {samplers, runtime, preferences}
These are injected into Cipher's scaffold on every request. More sessions =
richer context = better outputs. No weight changes needed.
### Mechanism 2: Preference Memory (week one)
Approvals and rejections reveal operator preferences:
- Approved async/await pattern → inject "Operator prefers async/await"
- Rejected class-based approach → inject "Operator avoids class-heavy patterns"
- Consistent 2-space indent → scaffold format contract updates automatically
Stored in `.aide/memory/preferences.jsonl`. Injected as `[learned]` blocks
in the scaffold. Capped at 20 most-relevant entries per request.
### Mechanism 3: Sleep-Time Training (the dreaming)
When AIDE detects idle (configurable, default: 2 hours no interaction):
1. **Review**: Load today's trajectories (.aide/trajectories/*.traj.json)
2. **Extract**: Identify successes (gates passed + approved) and failures
3. **Curate**: Only VERIFIED outcomes enter the dataset (anti-trash law)
4. **Train**: QLoRA update on the personal adapter using curated dataset
- Rank 8, alpha 16 (light touch; rank 32 for milestone updates)
- Replay buffer: mix 30% general instruction data to prevent forgetting
- Learning rate: 5e-4, 2 gradient steps per update batch
5. **Evaluate**: Run harness battery against updated adapter
6. **Gate**: delta >= 0 required; else archive with reason
7. **Stage**: Prepare changelog of what was learned for operator review
On next boot: notification card shows what Cipher learned overnight.
Operator approves/reviews/skips. Approved adapter hot-swaps via /lora-adapters.
## Base Model
**mini-coder-4b** (operator's fine-tune): Qwen2.5-Coder lineage, 4B params,
q8_0 quantization (~4GB), verified 7/7 battery tests, Vulkan-accelerated.
Already proven in AIDE's serving pipeline.
LoRA adapter stack: frontier_full_lora.gguf (v1, operator-trained) +
personal adapters (v2+, generated by sleep-time training).
Serving: llama-server --lora flag loads adapter alongside base.
/lora-adapters endpoint enables runtime swapping without restart.
## Infrastructure Requirements
- llama-server with --lora support (verified working on E:\llama-cpp-vulkan\)
- .aide/events.jsonl (outcome capture — designed, partially wired)
- .aide/trajectories/*.traj.json (session transcripts — implemented)
- .aide/memory/preferences.jsonl (preference pairs — to build)
- .aide/memory/learned.jsonl ([learned] blocks — to build)
- .aide/metrics/ships.log (ship telemetry — built ✓)
- QLoRA training environment (device-training-1060 constraints apply)
## Implementation Phases
### CP0 — Awareness Wiring (make Cipher know things)
- Chat scaffold includes workspace facts (file tree summary, git log, recent decisions from AGENT_NOTES)
- Session persistence expanded: last open file, panel states
- Events.jsonl capture fully wired to agent-loop tool calls
### CP1 — Preference Memory (make Cipher remember)
- Approvals/rejections logged to preferences.jsonl
- Pattern extraction: group by file type, action type, outcome
- Top-N preferences injected into scaffold as [learned] lines
- Preference purge command (operator controls their memory)
### CP2 — Sandbox Execution Loop (make Cipher verify before showing)
- TASK proposals execute against scratch copies first
- Test/lint/compile results feed back to model for retry (max 3 attempts)
- Only verified-passing diffs reach the approval card
- Uses existing task service + file contracts (no new deps)
### CP3 — Sleep-Time Training (the dreaming)
- Idle detector: no interaction for N hours → begin consolidation
- Dataset builder: filter events.jsonl for verified outcomes only
- QLoRA trainer: rank-8 adapter, 2 gradient steps per batch, replay buffer
- Battery gate: full run must show delta >= 0 vs current adapter
- Staged promotion: new adapter written alongside old, swap on operator approval
- Changelog generator: human-readable "what I learned" summary
### CP4 — Cross-Session Persistence (make Cipher remember forever)
- Adapter versions stored in .aide/adapters/ with metadata
- [learned] blocks persisted to .aide/memory/learned.jsonl
- Session restore loads: last engine + open files + unsaved buffers + recent decisions
- AGENT_NOTES auto-summarized into Cipher's workspace-facts block
## What Makes This Different From Static GGUFs
Static GGUF: same prompt → same quality, forever. No memory. No adaptation.
No awareness of what came before.
Cipher: same prompt → different quality because the CONTEXT around it has
evolved. It remembers your patterns. It knows what failed before. It has
opinions about your codebase. And with sleep-time training, the actual
weights shift toward YOUR way of working.
After 30 days: Cipher knows your naming conventions, your preferred libraries,
your architectural patterns, which approaches you reject, how thorough your
testing needs to be. It's not a generic assistant — it's YOUR engineer.
## Threats
| Threat | Control |
|---|---|
| Catastrophic forgetting during sleep-time training | Replay buffer mixes 30% general instruction data |
| Regression promoted accidentally | Battery non-regression gate mandatory; versions immutable |
| Overfitting to single user's quirks | Cap adapter rank at 32; periodic base-only eval |
| Privacy: training data contains source code | All local-only; no cloud; purge command available |
| Training starves serving RAM | Train during idle hours only (P7 one-job law) |
| Garbage-in flywheel | Only VERIFIED outcomes enter datasets (harness gates upstream) |
| Operator loses control of evolution | Every update requires explicit approval; full changelog shown |
## Honest Limits
- Gains are incremental per session; compounding takes weeks not hours
- Quality depends on capture volume — sparse use means slow learning
- 4B model ceiling exists; Cipher won't outperform 70B+ on raw capability
- Sleep-time training on 6GB VRAM is tight; may need cloud GPU for larger datasets
- First meaningful improvements visible after ~50 interactions (not immediate)