Repository navigation
fix: cora full-scan majors — torn header, incumbent escapes, redaction families - #115
Merged
Merged
Conversation
…n families Full cora scan on develop @116461c found 3 MAJORs; all fixed: - #23 storage: a header line persisted WITHOUT its trailing newline (crash mid-header-write) parsed fine and open() handed back a live append writer — the next append glued a body line onto the newline-less header and bricked the session. open() now fails explicitly with a Corrupt error naming the recovery path (create_with()); regression test drives the real fixture (header bytes minus newline) through fail-open + recreate. - #30 evals/replay: the incumbent-prompt extractor skipped escape sequences instead of decoding them (\n, \t, \", \\ vanished; \<newline> continuations mishandled), so the replay corpus would drift from the runtime prompt the moment the default prompt gains any escape. Decodes now follow Rust string-literal semantics; verified live: incumbent still scores 1.0 on the trace corpus. - #31 evals/tier2 redaction: extends the secret families to GitHub ghs_/ghu_/ghr_ + GitLab glpat- + Slack xoxa- + AWS AKIA ids, with the stub helper kept in sync; verified all new families stub out with zero leakage and prose untouched. Also: CODE_OF_CONDUCT.md still said 'Uteke' — de-vestigialized to tole.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What (description of the change)
Fixes the 3 MAJOR findings from the full cora scan on develop @116461c (plus one identity copy-paste the scan surfaced as a minor):
open()now reads the header withread_until(b'\n')and, when the header JSON is complete but its newline is missing (crash mid-header-write), fails explicitly withCorrupt("torn header …; recreate the session with create_with()"). Previously it parsed the header, handed back a live append writer, and the next append glued a body line onto the newline-less header — bricking every subsequent open. Recovery contract: the torn file holds zero recoverable data; the host deletes it andcreate_with()recreates the session. Second-round cora review caught my first cut (good_bytes=0 still returnedOkwith a live writer) — replaced with the explicit-error contract.\\xsequences, so\n,\t,\",\\silently vanished from the extracted incumbent prompt and\<newline>continuations were mishandled. Escape handling now follows Rust string-literal semantics (decode + continuation whitespace strip). Live-verified: incumbent still scores 1.0 on the trace corpus.ghs_/ghu_/ghr_(withgh[poshur]_), GitLabglpat-, Slackxoxa-, AWSAKIA…ids;redact_line()stub helper kept in sync. Verified: all new families stub out with zero leakage, prose untouched, JSONL still parses.Why (the problem you're solving)
Post-merge hygiene for today's feature burst (#108, #112, #113, #114): the full-codebase scan sees whole-file classes that per-PR diff reviews miss — this is the pre-tag discipline from the v0.3.0 release applied on develop. Each MAJOR is a real defect (durable-session brick class, eval-corpus integrity, secret leakage surface), each verified with a targeted test or live check.
Testing (how you verified this works)
torn_header_fails_open_and_create_with_recovers: builds the REAL fixture (header bytes minus newline), assertsopen()fails with the torn-header error, then asserts delete +create_with()recovery end-to-end.--no-default-features) green;cargo clippy --workspace --all-targets -- -D warningsclean;cora reviewon this diff: No issues found (after the second-round fix above).