Review findings 2026-08-28: batch pages, recompress, attribution, ratchet flags #147
Labels
No labels
agent
blocked
foreground
needs-andrew
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Tabled
needs-andrew
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
kreeader/kreeader-server#147
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Interim adversarial review of tonight's four merges (#141 recompress, #142 batch pages, #143 attribution, ratchet publisher flags), standing in for the Sol review blocked on codex reauth. Full findings verified by running code. Status ledger:
Fixed on master (
cf25c5c): attribution-correction pane_editor gate bypass (was deployed); bubble-backfill geometry wipe on undecodable pages (was deployed).Fix wave dispatched (HIGH):
Fix wave dispatched (MEDIUM): orderPreserved wrong invariant (over-refuses); ScannerBusy checked once per hours-long run; survey estimator (mean-of-ratios, and pngBytes includes never-convertible 16-bit pages); unmeasurable-pages caveat threshold never fires; RecentRefusals unfiltered; bubble Depth = deepest-not-tip defect; tail tip nondeterministic via map iteration; rung confidences not on comparable scale (+ pane vs page diagonal); ReasonNoHit dead code (miss rate tautological); human corrections stored rung=tail (needs RungHuman); same-pane figures can share a cluster.
LOW (same wave where cheap): marker header pre-auth documented trade-off (write it down); AppendAttributionsWithDB returns zero id/created_at; batch partial-stream degradation claim unreachable; historicalComicIDTables keyed by raw strings; clamp01 NaN passthrough + zero-direction tail/zero-area figure scoring; cmd/migrate-identity childTables missing 4 tables (derive from db.ComicIDTables).
Ratchet (separate wave, kreeader-ratchet): ship the revert script the commit claimed; flags-worked orphan tags (positivehooks deletes flag, not tag); --per-publisher ignored under --stratify-publisher; NULL detect_score crash; non-Latin publisher_key collapse to empty; README/selftest coverage. NEEDS ANDREW: keep or revert the 264 production flags — every model adoption now re-detects 103 newly-flagged books (panetrain/auto.go:593), a recurring GPU cost nobody signed off on; also handleListFlags has no Limit and the queue went 68->332.
Verified CLEAN (evidence, not silence): batch API traversal/injection/allocation surface; identity migration covers all 30 comic_id tables (schema-parser enumeration); DB portability (no boolean=integer recurrence); recompress journal/replay/swap machinery aside from the collisions; bubble reshape fix correct (28/28 defects vs 1/28); geometry conventions; TranscriptVersion 2 migration; ratchet SQL replayed clean on a throwaway PG 18.6.
Sol re-review still queued behind codex reauth.
Fix wave started on branch
fix/review-20260828(off mastercf25c5c). Working the HIGH items first (recompress duplicate-name plan collapse + wantNames refusal; batch-fetch total-deadline + read-ahead buffer), then the MEDIUM/LOW list in issue order. Each fix gets its own commit with a test that fails before and passes after. Will not close this issue or merge.Mid-progress on
fix/review-20260828(HEADbb81555). HIGH 1-3 and MEDIUM 4-13 landed, one commit each, every one with a test that fails on master and passes on the branch. Notable reproductions captured in the commits: the duplicate-name recompress plan built a verified part serving page B for page A; the survey estimator projected 784,685 bytes saved where the measured truth on the same sample was 2,970; the tail-tip map walk flipped the anchor on run 3 of 400. Findings 6 and 7 share one commit (same function, same overclaim); everything else is one-to-one. Now working LOW 14-20.Fix wave complete — branch
fix/review-20260828, head5f6e517All 20 findings addressed. 18 commits, one per logical fix (6+7 share one — same function, same overclaim). Every fix carries a test that fails on master and passes on the branch; where the fix introduced a new symbol the pre-fix failure is a compile error, so I additionally reverted the behaviour in place and captured the real numbers, quoted below.
f.Name, duplicate entries collapse7017a1fwebpNamecollides with an existingX.webp7017a1fe3fd516orderPreservedcompares sorted vs physical order0d16fdcScannerBusychecked once per multi-hour run8dcb81f2550e492550e49RecentRefusalsburies pixel mismatches160abcfDepth= global max; map-order tip choiceb12cd991c690f9ReasonNoHitdead code08a9fbbRung="tail"f278130bb8155547ca3a3AppendAttributionsWithDBslice-copy: id/created_at 0e1f740a61881a0historicalComicIDTablesraw strings78435f1clamp01NaN, zero-direction tails, zero-area figures9249ba1migrate-identitychildTableshand list5d1995cdocs/speaker-attribution.mdgate claim + new semantics5f6e517Nothing deferred.
Reproductions worth recording
001.pngbuilt a.partthat passedverifyPart, theListPagescount check AND the order check, and served image B for entry A.{001.png, 001.webp}built a part with two members literally named001.webp. Both would have destroyed the original on swap. Now refused whole withErrDuplicateEntryNamebefore a byte is written; the plan is keyed by archive index.0.298, strongest proximity guess0.447. Bands are now disjoint: tail 0.50–1.00, proximity 0.05–0.45.(0,0)produced atailattribution at confidence 0.925; a zero-area figure box won a proximity attribution at0.435.cmd/migrate-identity's ownTestIntrospectionFindsSchemaAndRejectsUnknownReferencewas already failing on master, unnoticed because./cmd/...is outside the usual test lane:dialogue_attributions,series_suspect_members,recompress_journals,recompress_page_eventswere reported as unknown references from a newer schema. Now derived fromdb.KnownComicReferenceTables.Design decisions recorded in commit messages
batchReadAheadPages = 4— conservative, not configurable; memory bounded at(parallel + 4)page bodies.Client.Timeout, but 30s dial / 30s TLS / 2m response-header.16-bit-sourceandtoo-large(both permanent codec limits); anomalies (pixel-mismatch,encode-failed) deliberately stay in the projectable base and are surfaced by the 5% caveat instead.proximityMaxRange = 0.75of the region diagonal.API shape changes mirrored in
api/openapi.yaml/api/librarian/recompress: newverify_failures[]+verify_failure_total;recent_refusalsis now everything except pixel mismatches; row shape factored into a sharedRecompressPageEventschema (enum gains16-bit-source).DialogueAttribution.rungenum gainshuman, with the exclusion rule and the confidence bands documented.Gates (all clean on
5f6e517)Also run, since #19 lives there:
go test ./cmd/... ./scanner/... .— all ok.Not merged, not closed, no deploy, no production access, per the brief.
All findings resolved and verified live:
cf25c5c: gate bypass + backfill geometry wipe (deployed in 30.70).Still open elsewhere: keep-or-revert decision on the 264 production flags (questions/, revert is one command now); Sol re-review queued behind codex reauth.