|
| 1 | +# Changelog — 2026-04-26 |
| 2 | + |
| 3 | +This changelog records the April 26, 2026 quality and reliability wave. |
| 4 | +Focus areas: concurrency safety, test coverage, ablation study for publication, |
| 5 | +dependency hygiene, legacy module cleanup, and paper v7. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Bug Fixes |
| 10 | + |
| 11 | +### Session Race Condition (Critical) |
| 12 | +- **File**: `inference/codette_server.py` |
| 13 | +- **Problem**: `_get_active_session()` was called three separate times during |
| 14 | + one request (lines ~1098, ~1384, ~1572). A concurrent `/api/new_session` |
| 15 | + call between those reads could swap the global session, causing one request |
| 16 | + to read context from session A but write metrics to session B. |
| 17 | +- **Fix**: Session captured once (`session = _get_active_session()`) at the |
| 18 | + top of request processing and reused throughout. The three duplicate calls |
| 19 | + were removed. |
| 20 | + |
| 21 | +### Model Load Hang (High) |
| 22 | +- **File**: `inference/codette_server.py` |
| 23 | +- **Problem**: If the GGUF model path did not exist, the server would start |
| 24 | + successfully but hang indefinitely on the first request (lazy-load blocked |
| 25 | + waiting for a model that could never load). No error was surfaced to the UI. |
| 26 | +- **Fix**: |
| 27 | + 1. Path existence check added before attempting load — returns a clear error |
| 28 | + message immediately if the file is missing. |
| 29 | + 2. `ThreadPoolExecutor` with a 5-minute timeout wraps the `CodetteOrchestrator` |
| 30 | + constructor — a corrupted or stalled GGUF now raises `RuntimeError` instead |
| 31 | + of hanging forever. |
| 32 | + |
| 33 | +### Bare `except:` in Hallucination Guard |
| 34 | +- **File**: `reasoning_forge/hallucination_guard.py:242` |
| 35 | +- **Problem**: `except:` (no exception type) silently caught `KeyboardInterrupt` |
| 36 | + and `SystemExit` in addition to real parse errors. |
| 37 | +- **Fix**: Narrowed to `except (ValueError, AttributeError, IndexError)`. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Concurrency Hardening |
| 42 | + |
| 43 | +### SQLite WAL Mode + Write Lock |
| 44 | +- **File**: `reasoning_forge/unified_memory.py` |
| 45 | +- **Changes**: |
| 46 | + - Enabled `PRAGMA journal_mode=WAL` on database open — readers no longer |
| 47 | + block writers and writers no longer block readers under concurrent load. |
| 48 | + - Set `PRAGMA synchronous=NORMAL` for a safe balance of durability vs speed. |
| 49 | + - Added `threading.Lock` (`self._write_lock`) wrapping all write operations |
| 50 | + (`store()`, `mark_success()`) — prevents concurrent writes from producing |
| 51 | + corrupted rows when multiple worker threads fire simultaneously. |
| 52 | + - Added `import threading` (was missing). |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## Code Cleanup |
| 57 | + |
| 58 | +### Removed Orphaned Memory Kernel |
| 59 | +- **File removed**: `reasoning_forge/memory_kernel_local.py` |
| 60 | +- A 150-line stripped-down duplicate of `memory_kernel.py`. Zero imports |
| 61 | + anywhere in the live codebase. `memory_kernel.py` (410 lines, with disk |
| 62 | + persistence, `EthicalAnchor`, type hints) is the canonical file. |
| 63 | + |
| 64 | +### Fixed and Archived Legacy Entry Point |
| 65 | +- **File fixed**: `consciousness/universal_reasoning.py` |
| 66 | + → **Moved to**: `archive/consciousness/universal_reasoning.py` |
| 67 | +- This was an old standalone Azure Bot Framework entry point that predated |
| 68 | + the current server architecture. Fixed before archiving: |
| 69 | + - Removed unused `botbuilder` and `dialog_helper` imports (Azure Bot |
| 70 | + Framework, no longer in the system). |
| 71 | + - Replaced missing `perspectives` module with compatibility shims mapping |
| 72 | + old `*Perspective` API → current `reasoning_forge/agents/*Agent` classes. |
| 73 | + - `destroy_sensitive_data()` now overwrites bytearray data before `del` |
| 74 | + (reduces memory exposure window; Python strings are immutable so |
| 75 | + full zero-fill is not possible). |
| 76 | + - Hardcoded `https://api.example.com/data` URL made configurable via |
| 77 | + `config['real_time_data_url']`. |
| 78 | + - Added deprecation header documenting why the file is archived and where |
| 79 | + current equivalents live. |
| 80 | + |
| 81 | +### Documented Code7eCQURE "Quantum" Framing |
| 82 | +- **File**: `reasoning_forge/code7e_cqure.py` |
| 83 | +- Added module-level docstring clarifying that "quantum" is a **metaphor** |
| 84 | + for stochastic multi-perspective reasoning, not quantum computing. |
| 85 | +- Mechanism: named perspective functions apply labeled prefix transforms; |
| 86 | + `random()` and `random.choice()` simulate epistemic uncertainty and |
| 87 | + superposition of outcomes. |
| 88 | +- Added inline comments on `quantum_spiderweb()` and `quantum_superposition()`. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## New Features |
| 93 | + |
| 94 | +### Ablation Study Runner |
| 95 | +- **File**: `benchmarks/ablation_study.py` |
| 96 | +- `AblationRunner` class runs 5 experimental conditions, each disabling |
| 97 | + exactly one component from the full system: |
| 98 | + - `full` — all components active (baseline) |
| 99 | + - `no_memory` — cocoon recall disabled |
| 100 | + - `no_ethical` — ethical dimension weight zeroed |
| 101 | + - `no_sycophancy` — sycophancy guard pass skipped |
| 102 | + - `single_agent` — single perspective only (worst-case baseline) |
| 103 | +- Reports mean composite score, drop from full, Cohen's d, and p-value per |
| 104 | + condition — ready for inclusion in the paper's ablation section. |
| 105 | +- Saves JSON results to `benchmarks/results/ablation_results.json`. |
| 106 | +- Run with: `python benchmarks/ablation_study.py` |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## Test Coverage |
| 111 | + |
| 112 | +### New: `tests/test_aegis.py` |
| 113 | +Covers the full AEGIS ethical governance API: |
| 114 | +- `evaluate()` — benign content passes, harmful content vetoed, all keys present |
| 115 | +- Framework count (6 frameworks verified) |
| 116 | +- EMA eta updates across multiple calls |
| 117 | +- Veto count and total evaluation tracking |
| 118 | +- `quick_check()` — safe content passes, harmful patterns blocked |
| 119 | +- `alignment_trend()` — trend after benign vs. mixed inputs |
| 120 | +- `to_dict()` / `from_dict()` serialization round-trip |
| 121 | +- `get_state()` summary structure |
| 122 | + |
| 123 | +### New: `tests/test_cocoon_synthesizer.py` |
| 124 | +Covers the CocoonSynthesizer meta-cognitive engine: |
| 125 | +- `extract_patterns()` — cross-domain detection, single-domain produces no |
| 126 | + cross-domain patterns, empty input, field structure validation |
| 127 | +- `forge_strategy()` — returns `ReasoningStrategy`, references source patterns, |
| 128 | + default strategy on empty input, strategy history growth |
| 129 | +- `apply_and_compare()` — returns `StrategyComparison`, improvement delta, |
| 130 | + readable output, dict serialization |
| 131 | +- `run_full_synthesis()` — standalone mode, valuation context embedding, |
| 132 | + with live `UnifiedMemory` (temp DB) |
| 133 | + |
| 134 | +### New: `tests/test_web_research.py` |
| 135 | +Covers web research safety and fetch behaviour: |
| 136 | +- `_is_safe_url()` — blocks localhost, loopback IPv4/v6, private ranges |
| 137 | + (10.x, 192.168.x, 172.16.x), link-local (169.254.x), file/ftp schemes, |
| 138 | + empty string, missing hostname |
| 139 | +- `fetch_url_text()` — unsafe URL returns empty, safe URL returns text, |
| 140 | + network error returns empty, output capped at `max_chars` |
| 141 | +- `search_web()` — empty/whitespace query, network error, timeout (all mocked) |
| 142 | +- `query_requests_web_research()` — edge cases: lookup phrasing, vague short |
| 143 | + query, internal reflection phrasing |
| 144 | +- `query_benefits_from_web_research()` — current events, price queries, static |
| 145 | + knowledge (no benefit), personal questions, recent release queries |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +## Dependencies |
| 150 | + |
| 151 | +### `requirements.txt` — Version Pins Added |
| 152 | +- Added upper-bound version constraints to all packages to prevent silent |
| 153 | + breaking changes from major version bumps: |
| 154 | + - `torch>=2.1.0,<3.0.0` (PyTorch 3.x not yet validated) |
| 155 | + - `transformers>=4.40.0,<5.0.0` |
| 156 | + - `peft>=0.10.0,<1.0.0` |
| 157 | + - `numpy>=1.24.0,<2.0.0` |
| 158 | + - etc. |
| 159 | +- Added missing core dependencies: `llama-cpp-python`, `trl`, `datasets`, |
| 160 | + `accelerate`, `huggingface-hub`, `aiohttp`. |
| 161 | +- Removed bloated/unused deps that were only needed by the archived |
| 162 | + `universal_reasoning.py`: `botbuilder`, `speech_recognition`, `PIL`, |
| 163 | + `nltk`, `numba`, `dataclasses-json`. |
| 164 | +- Added comments clarifying which deps are optional (Gradio = demo only, |
| 165 | + vaderSentiment = legacy module only). |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## .gitignore Updates |
| 170 | + |
| 171 | +Added: |
| 172 | +- `.claude/settings.local.json` — machine-specific Claude IDE settings |
| 173 | +- `demo/outputs/*.mp4` — large demo recordings |
| 174 | +- `*.mp4` — any video files |
| 175 | + |
| 176 | +--- |
| 177 | + |
| 178 | +## Paper |
| 179 | + |
| 180 | +- Added `paper/codette_paper_v7.tex` — updated paper with rebuttal changes |
| 181 | +- Added `paper/rebuttal_changes.tex` — point-by-point rebuttal document |
| 182 | +- Added `paper/tables/` — 10 formatted result tables |
| 183 | +- Added `paper/codette_kaggle_notebook.ipynb` — Kaggle submission notebook |
| 184 | +- Added `paper/kaggle_writeup.md` — Kaggle competition writeup |
| 185 | +- Added `paper/benchmark_tasks/` — 17 individual benchmark task notebooks |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +## Commits This Wave |
| 190 | + |
| 191 | +| Hash | Message | |
| 192 | +|------|---------| |
| 193 | +| `601d128` | Add benchmark results, paper v7, new reasoning modules, and training pipeline updates | |
| 194 | +| `7bcd33d` | Fix session race, model load hang, SQLite concurrency, and add ablation study | |
| 195 | +| `2fd8aed` | Fix and archive universal_reasoning.py; patch bare except; update .gitignore | |
| 196 | +| *(this wave)* | Tests, README, CHANGELOG, requirements pins | |
0 commit comments