fix: audit remediation Wave 3 — M-1, MED/LOW sweep, ingest robustness + D-1 close-out #14
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/audit-wave-3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wave 3 of audit remediation — completes the audit + the live migration
Stacked on
fix/audit-wave-2; the diff is the Wave-3 commits. Closes theremaining MED/LOW findings, the schema-migration gap, and finalises the F-15
re-validation (D-1) on the migrated corpus. Full suite: 340 passing, ruff +
mypy clean.
Schema / migration (M-1)
schema.sqlis now fully idempotent; newcodex migrateapplies it via aprivileged
MIGRATION_DATABASE_URL(the app role is DML-only) and reportsInsufficientPrivilegehelpfully. Documented in README +.env.example.infra/reingest_canonical_ids.shmigration helper with a preflight thataborts before
TRUNCATEif the schema isn't ready (it had wiped-then-failed).Correctness / robustness
5-gram match (no substring bleed) · R-9 cross-ref injection protects LaTeX
math · R-8 coverage-map gaps are opt-in (
--topic) · R-2 ref-list filterexcludes theorem labels · C-12/C-13 no-op DB call removed / mark order fixed.
papers.bibkeyUNIQUE collision with an a/b/c suffix instead of failing —
2305.10988collided with
2310.17529(both →BobenkoLutz2023).Security
SecretStr· S-2 constant-time MCP token compare· C-3
wiki_readreturns real cited bibkeys.Sources / CLI
titles + JSON warning · U-4/C-9 wire
graph cocited/discover recommend.Accepted (documented, no code change)
limitation) · C-14/U-2 doc clarifications (sparse not wired; cite-boost tie-breaker).
D-1 — F-15 re-validated on the migrated corpus
Live re-ingest onto canonical bare ids: 29/29 papers bare (
url_form_ids=0),C-1 leaked=0, both verified against the Jetson DB. Graph re-measured: 489 nodes /
590 edges / 472 dangling / 5.4 % spread. Pinkall/Polthier 1993 now resolves to
its DOI and is the rank-1 in-KB hub; Bobenko/Springborn 2007 holds rank 7 —
GO re-affirmed. ADR-F15 spike table updated with before/after numbers.
🤖 Generated with Claude Code
- C-6: the content-5-gram check used 'gram in src' on space-joined strings, so the first/last gram token could match a prefix/suffix of a longer chunk word ('set' inside 'subset'). Both gram and chunk are now space-padded, so a match requires whole-token alignment. Regression test added. - R-2: the reference-list filter's author pattern ('Surname, I.') also matched 'Theorem A.'/'Lemma B.', so theorem-dense chunks could be dropped as a bibliography. The pattern now excludes common math-structure words. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>