fix(aviso-contexto): hardening sobre #303 — la PROCEDENCIA no miente en override inválido - #311
Merged
Merged
Conversation
…ts anti-regresión Construye sobre #303 (reconciliación con /context + histéresis). Dos entregas: 1. Bug latente hallado y arreglado: la auto-justificación de la PROCEDENCIA del techo decía "override DELIBERADO" con solo mirar si CLAUDE_AUTOCOMPACT_PCT_OVERRIDE estaba NO-vacía. Un override INVÁLIDO (typo `70%`, out-of-range `150`, espacios) caía a PCT=92 pero el mensaje lo vendía como "=92 (override DELIBERADO de Jordi, NO un bug — créele)" → la feature de confianza MINTIENDO sobre un valor que el usuario nunca fijó. Fix: flag PCT_SRC distingue el override VÁLIDO del default; la PROCEDENCIA solo cita "DELIBERADO" cuando el override fue válido, si no dice (default). 2. Tests anti-regresión de #303 que DISCRIMINAN (fallan contra pre-#303, pasan contra el actual; verificado forense contra `git show 5224aaa^`): - Bug1 (denominador/confabulación): repro del reporte de campo 673K/1M@70% (banda 3) y el escenario ~66% de ventana (banda 2) — el aviso LIDERA con el % de la VENTANA (verificable con /context) + anti-confabulación, no solo el % del auto-compact. - Bug2 (histéresis anti-spam): aleteo de tokens en el borde de banda (655K↔680K con techo 700K, margen 14K) NO re-emite; solo un compact real (<651K) re-arma. - Procedencia honesta: override inválido→(default), válido→DELIBERADO. Robustez verificada (sin cambio): fail-safe ante stdin no-JSON/vacío y líneas de transcript malformadas (fromjson? las salta); PCT nunca queda unbound bajo set -u. 690 PASS · 0 FAIL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
unjordi
force-pushed
the
fix/aviso-contexto-hardening
branch
from
August 8, 2026 21:28
60f8e8c to
c0cd986
Compare
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.
Endurece el hook CONSTRUYENDO sobre #303 (ya en develop). Dos cosas:
5224aaa^, pasan contra el actual): denominador/confabulación (lidera con % de ventana + anti-confabulación) e histéresis (aleteo dentro del margen NO re-emite; un compact real SÍ re-arma).70%,150, con espacios) caía a PCT=92 pero el mensaje lo vendía como "=92 (override DELIBERADO de Jordi, NO un bug — créele)": la feature de confianza MINTIENDO sobre un valor que el usuario nunca fijó. Fix: flagPCT_SRCdistingue override válido del default; solo cita "DELIBERADO" si fue válido, si no dice "(default)".Reportado sin tocar (no-reachable):
freewnegativo solo con ctx≥1M (el CLI auto-compactaría antes). Confirmado robusto: div-por-cero en CEILING/WINDOW, fail-safe de jq, default 92.690 PASS · 0 FAIL (+8). Solo mensaje/PROCEDENCIA + tests; no toca la medición.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com