fix(audit): v4.1.0 — cortex audit hardening - #83
Merged
Conversation
Multi-agent read-only audit of the live system surfaced 34 verified findings (6 refuted). This lands the engine fixes; live-data hygiene applied separately. Fixed (P1): - session-start.py: inject full law text (cap 1000c), not just the first line - session-learner.js: tombstone gate matches by trigger vs proposals-history - reflexes: re-enable python3-bypass-write-tool; harden bash-cat-use-read regex - storage-rotation.js: cross-day-tracker prunes past 1.5x threshold despite 24h gate Added (P2): - storage-rotation.js: stale .lock/.bak cleanup, impact.archive keep=5, timeline rotation - distill_engine.py: prune_instinct_tracking() + reap_stale_nudge_state() + CLI - session-learner.js: dup-trigger dedup, $HOME->~ paths, head+tail sampling - injector-engine.js: token budget 8000->12000 + visible warning, per-reflex domains filter Rejected as misdiagnoses (see CHANGELOG): moving scope:global instincts to project dirs; lowering NUDGE_MAX_CONF (breaks law promotion); tightening dedup (reverted). Full suite green (test pair + all module suites). Deployed locally via install.sh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Origen
Auditoría multi-agente read-only del sistema Cortex vivo (workflow
cortex-audit, 50 agentes, verificación adversarial). 40 hallazgos brutos → 34 confirmados / 6 refutados. Este PR aterriza los fixes de motor; la higiene de datos vivos se aplicó por separado en~/.claude/cortex(no versionado).Fixed (P1)
session-start.py:load_laws()inyectaba solo la 1ª línea de cada ley (split('\n')[0]), perdiendo checklists/exclusiones multilínea. Ahora inyecta el texto completo (cap 1000c).session-learner.js: el tombstone gate ahora descarta proposals cuyo trigger (no solo id) ya figura comorejectedenproposals-history.jsonl→ el backlog deja de reciclar basura.python3-bypass-write-tool(seguridad, estaba disabled); endurecido el regex debash-cat-use-readcon negative-lookahead (pipes/heredocs).storage-rotation.js:cross-day-tracker.jsonlse poda al superar 1.5× su umbral aunque el gate de 24h no haya vencido.Added (P2)
storage-rotation.js: limpieza de.lock/.bak>30d, retenciónimpact.archive/(keep 5), rotaciónlog/timeline.jsonl(keep 1000).distill_engine.py:prune_instinct_tracking()+reap_stale_nudge_state()enganchados al pipeline de maintain + subcomandos CLI.session-learner.js: dedup de trigger duplicado, normalización$HOME→~, sampling head+tail (en vez de corte duro a 200c).injector-engine.js: presupuesto de sesión 8000→12000 con warning visible (antes silencioso), filtro opcionaldomainspor reflex (no-op si ausente).Rechazado como falso positivo (criterio de coordinación, ver CHANGELOG)
scope: globala dirs de proyecto — el audit confundióproject_id(procedencia) conscope(targeting). Son patrones cross-project trigger-gated; se quedan globales.NUDGE_MAX_CONF0.99→0.80 — haría inalcanzableconf≥0.95para la auto-promoción a ley. El problema real (cementado) lo resuelvereap_stale_nudge_state.gap>0.10daba comportamiento incoherente (mantenía un instinct de baja confianza si el gap era grande). Revertido.Verificación
test_security9/9,test_dream_cycle40/40) + todos los módulos tocados (distill46/6,session_learner60,storage51,injector29/13,session_start4) +run_all.shexit 0, cero suites con fallo.install.sh(v4.0.0→v4.1.0) y verificado end-to-end.🤖 Generated with Claude Code