fix(laws): v4.2.1 — AD (Codex GPT-5.5) follow-up#85
Merged
Conversation
Read-only adversarial review with Codex GPT-5.5 caught 4 real issues the Sonnet swarms and the earlier adversarial pass missed. All evaluated as real, not fluff. Fixed: - [P1] load_laws() crashed all of SessionStart on a malformed laws-meta.json (uncaught AttributeError on a non-dict schema). Now tolerant at every level; a SessionStart hook must never crash. Regression tests added. - [P1] impact.archive retention: v4.1.0 count-based keep=5 could delete chunks <90d, contradicting the "never deleted" contract; DESIGN-V4 §7 mandates 90-day. Switched to 90-day age-based pruning; reconciled the stale comments. Docs/tests: - test_session_start.sh: laws-meta robustness (malformed -> no crash) + tier split. - FEATURES.md caught up (v4.1/v4.2/v4.2.1 version-history rows, date, archive wording). Codex confirmed correct (untouched): injector .txt filter, guard w/o laws/, principle default, manual_swap_promote project-instinct search. Full suite green (39/39). Deployed v4.2.0 -> v4.2.1 and verified live. 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
Tras mergear v4.2.0, AD read-only con Codex GPT-5.5 sobre v4.1/v4.2 para cazar lo que los enjambres Sonnet + el contra-análisis previo pasaron por alto. Los 4 hallazgos evaluados como reales (no paja) y corregidos con enjambre supervisado.
Fixed
laws-meta.jsonmalformado:load_laws()solo capturabaFileNotFoundError/JSONDecodeError/OSError; unlawsno-dict o un valor no-dict lanzabaAttributeErrorno capturado → moría toda la inyección (leyes, EOD, avisos). Ahora tolerante a cualquier forma malformada (degrada aprinciple,except Exceptionde respaldo). Un hook de SessionStart no puede petar jamás.impact.archiveviolaba el contrato "never deleted": elkeep=5por conteo de v4.1.0 podía borrar chunks <90d.DESIGN-V4 §7decide "techo de retención 90 días". Cambiado a poda por edad de 90 días (IMPACT_ARCHIVE_KEEP_DAYS,_pruneDirByAge); comentarios "never deleted" reconciliados.Docs/tests
test_session_start.sh: robustez de laws-meta (malformado → no crash) + split por tier + retrocompat (4→9 tests).FEATURES.mdal día: filas v4.1.0/v4.2.0/v4.2.1, fecha, wording de impact.archive.Confirmado correcto por el AD (no tocado)
Injector filtra solo
.txt; guard no crashea sinlaws/; ley sin meta →principle;manual_swap_promotebusca instincts de proyecto.Verificación
Suite completa 39/39 verde. Desplegado v4.2.0→v4.2.1 y verificado en vivo (meta malformado → exit 0).
🤖 Generated with Claude Code