Skip to content

fix: address codex-review P2 findings (upload race, compare dupes, annotated clip) - #154

Merged
iret77 merged 1 commit into
mainfrom
fix/codex-review-p2s
Aug 2, 2026
Merged

fix: address codex-review P2 findings (upload race, compare dupes, annotated clip)#154
iret77 merged 1 commit into
mainfrom
fix/codex-review-p2s

Conversation

@iret77

@iret77 iret77 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Behebt die drei P2-Findings aus dem Codex-Review des Feature-Batches (keine Blocker, keine Security-Lücken — aber echte Korrektheits-Bugs, vor dem Release gefixt).

  1. Upload-No-Clobber-Race — die Upload-Schreibpfade nutzten exists()-Check + clobberndes rename/os.replace; ein zwischen Check und Write angelegtes File konnte trotz „never overwrite"-Zusage überschrieben werden. Ersetzt durch atomares Hard-Link-into-place (fsutil::write_new in Rust, os.link in Python), das mit „already exists" fehlschlägt statt zu clobbern. Beide Bridges.
  2. compare-Duplicate-Valuesvalidate_spec ließ zwei Varianten mit gleichem value durch; die kollidieren als keyed-{#each}-Key und als zurückgegebenes selected. Wird jetzt vor dem Render abgelehnt (deckt native + remote über den Companion-Validator ab).
  3. annotated_image clippt statt skaliertmax_height lag nur auf der overflow:hidden-Stage, nicht auf dem <img>; das Bild wurde abgeschnitten und Klicks unten normalisierten auf ein falsches y. max_height liegt jetzt auf dem Bild → das ganze Bild skaliert in die Stage, Koordinaten stimmen.

Neue Tests: fsutil::write_new No-Clobber, compare Dup-Value-Validierung (+ bestehende Python-Upload-No-Clobber-Tests decken den Python-Pfad).

Lokal grün: cargo test 162 · clippy clean · svelte-check 0 Fehler · vite build · pytest 52. Kein Versions-Bump (bleibt 0.8.3), CHANGELOG [Unreleased] → ### Fixed.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…notated clip)

- upload: atomic no-clobber write (fsutil::write_new / os.link) instead of
  exists()-then-rename/replace, closing the TOCTOU where a concurrently
  created file could be overwritten despite the never-overwrite contract.
  Both the Rust companion and the Python bridge.
- compare: validate_spec now rejects duplicate variant 'value's, which
  otherwise collide as the keyed-{#each} key and the returned 'selected'
  (covers native + remote via the companion validator).
- annotated_image: apply max_height to the <img> so the whole image scales
  into the stage instead of being clipped by the overflow-hidden stage —
  clicks near the visible bottom no longer normalize to the wrong y.

Adds fsutil write_new no-clobber test + compare dup-value validation tests.
@iret77
iret77 merged commit 20ef49a into main Aug 2, 2026
5 checks passed
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