Skip to content

perf(session): bound cold mirror polling - #1637

Draft
ohdearquant wants to merge 1 commit into
mainfrom
codex/session-mirror-cold-poll
Draft

perf(session): bound cold mirror polling#1637
ohdearquant wants to merge 1 commit into
mainfrom
codex/session-mirror-cold-poll

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

AI-assisted contribution: Codex prepared this change and PR description.

Summary

  • replace repeated recursive metadata walks with a cached directory/file index and hard round-robin ceilings of 64 directory probes and 256 cold-file probes per tick
  • keep recently active files on the hot path, transition unchanged files to cold polling after two probes and five minutes (or 30 probes without usable timestamps), and prioritize cold files when their parent directory changes
  • retain a bounded global cold sweep so appends are still discovered on filesystems that do not update parent-directory metadata
  • preserve source candidates across overlapping and nested configured roots, continue to the next provider parser after a no-progress result, and retain pinned source identity through directory removal and recreation
  • add regressions for probe ceilings, cold transitions, parent invalidation, timestamp fallbacks, missing-root appearance, overlapping providers, divergent size limits, and nested-root churn

Closes #1512.

Test plan

  • cargo test --manifest-path crates/Cargo.toml --workspace
  • cargo check --manifest-path crates/Cargo.toml --workspace
  • cargo clippy --manifest-path crates/Cargo.toml --workspace --all-targets -- -D warnings
  • cargo fmt --manifest-path crates/Cargo.toml --all -- --check
  • RUSTDOCFLAGS=-Dwarnings cargo doc --manifest-path crates/Cargo.toml --workspace --no-deps

All five gates passed against reviewed SHA 6bad171d4a3fa3fa41dee6eb3ab5d5788bca3b55 on unchanged main base a152ead3e577b8c01b03024687fdb66d94a00cac before this draft was opened.

ADR

  • amend ADR-080 with the bounded polling/index lifecycle, no-progress provider fallback, and pinned-root churn contracts

AI-assisted contribution checklist

  • Every claim in this PR description matches the actual diff
  • Any agent-authored comment / PR body starts with an attribution line
  • Per-tick filesystem work is explicitly bounded
  • Existing cursor, error, source-parser, and missing-root semantics remain covered

Out of scope

  • changing mirrored session or event identity
  • adding new export providers or watch-service dependencies
  • relying on parent-directory timestamps as the only append signal

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.

Avoid repeated metadata probes for cold session-mirror files

1 participant