Skip to content

fix: cora full-scan majors — torn header, incumbent escapes, redaction families - #115

Merged
ajianaz merged 1 commit into
developfrom
fix/cora-scan-majors
Sep 22, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/cora-scan-majors

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

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):

  • storage.rs (E11: Secret redaction — scrub secrets from transcript before provider calls #23, torn header bricks the session) — open() now reads the header with read_until(b'\n') and, when the header JSON is complete but its newline is missing (crash mid-header-write), fails explicitly with Corrupt("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 and create_with() recreates the session. Second-round cora review caught my first cut (good_bytes=0 still returned Ok with a live writer) — replaced with the explicit-error contract.
  • evals/replay (chore: add .cora.yaml review config and document cora workflow #30, incumbent extractor drops escapes) — the manual string-literal parser skipped \\x sequences, 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.
  • evals/tier2/run.py (feat: delete_file tool (Destructive risk) — complete CRUD file capability #31, redaction gaps) — secret families extended: GitHub ghs_/ghu_/ghr_ (with gh[poshur]_), GitLab glpat-, Slack xoxa-, AWS AKIA… ids; redact_line() stub helper kept in sync. Verified: all new families stub out with zero leakage, prose untouched, JSONL still parses.
  • CODE_OF_CONDUCT.md — said "Uteke" in three places (copy-paste); now tole.

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)

  • New regression test torn_header_fails_open_and_create_with_recovers: builds the REAL fixture (header bytes minus newline), asserts open() fails with the torn-header error, then asserts delete + create_with() recovery end-to-end.
  • Replay: rebuilt scorer, live run over the trace corpus — incumbent avg 1.0 (extraction unchanged for the current prompt, escape handling future-proofed).
  • Redaction: synthetic session with one token of each NEW family — zero leakage, family stubs present, prose intact, JSONL parses.
  • Full workspace suites green; mobile (--no-default-features) green; cargo clippy --workspace --all-targets -- -D warnings clean; cora review on this diff: No issues found (after the second-round fix above).

…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.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 48141f2 into develop Sep 22, 2026
16 checks passed
@ajianaz
ajianaz deleted the fix/cora-scan-majors branch September 22, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant