Skip to content

fix(core): use atomic write for debug dumps, fix broken rustdoc links - #6336

Merged
bug-ops merged 1 commit into
mainfrom
fix/6327-6329-dump-race-rustdoc-link
Jul 16, 2026
Merged

fix(core): use atomic write for debug dumps, fix broken rustdoc links#6336
bug-ops merged 1 commit into
mainfrom
fix/6327-6329-dump-race-rustdoc-link

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • DebugDumper::write/write_sync (crates/zeph-core/src/debug_dump/mod.rs) now use zeph_common::fs_secure::atomic_write_private (write-to-.tmp-then-rename) instead of the non-atomic write_private (open-truncate then write_all). The target path never becomes visible until the fully-flushed content is renamed into place, closing the window where the read_request_dump test helper could observe an empty file mid-write under parallel nextest execution (~1 in 5-7 runs).
  • Fixed the rustdoc::broken_intra_doc_links gate failure in provider_factory.rs: spawn_cocoon_health_checks's doc comment referenced [TaskSupervisor::snapshot] without TaskSupervisor being in scope in this file — now a fully-qualified [zeph_common::TaskSupervisor::snapshot] link. The same doc comment also linked to two private helpers from a public function's docs, triggering private_intra_doc_links; both are now plain inline code spans.

Closes #6327
Closes #6329

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 13869 passed, 0 failed
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean
  • RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps -p zeph-core --features "candle,classifiers,cocoon,index,metal,mock,profiling,scheduler,sqlite,sysinfo" — clean
  • cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler" — all passed
  • gitleaks protect --staged --no-banner --redact — no leaks
  • Reproduced the original debug_dump: read_request_dump test helper races non-atomic write_private, flaky under parallel load #6327 flaky repro command 7 times in a row with zero failures (89/89 tests passed each run)

@github-actions github-actions Bot added bug Something isn't working size/S Small PR (11-50 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate and removed size/S Small PR (11-50 lines) labels Jul 16, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 16, 2026 19:53
@bug-ops
bug-ops force-pushed the fix/6327-6329-dump-race-rustdoc-link branch from b8fde58 to 063dc33 Compare July 16, 2026 19:54
@github-actions github-actions Bot added the size/S Small PR (11-50 lines) label Jul 16, 2026
Switch DebugDumper::write/write_sync from the non-atomic
write_private to atomic_write_private (write-to-.tmp-then-rename),
closing a race where read_request_dump could observe an empty file
mid-write under parallel test execution.

Fix a broken rustdoc intra-doc link to TaskSupervisor::snapshot in
provider_factory.rs (TaskSupervisor was not in scope in this file)
and de-link two private-item references that triggered
private_intra_doc_links warnings.

Closes #6327
Closes #6329
@bug-ops
bug-ops force-pushed the fix/6327-6329-dump-race-rustdoc-link branch from 063dc33 to dfacf4b Compare July 16, 2026 20:18
@bug-ops
bug-ops merged commit f924fdf into main Jul 16, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6327-6329-dump-race-rustdoc-link branch July 16, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

1 participant