Skip to content

Tolerate hydration count drift in status estimates - #2146

Draft
Tyrie Vella (tyrielv) wants to merge 4 commits into
microsoft:masterfrom
tyrielv:tyrielv/hydration-count-drift
Draft

Tyrie Vella (tyrielv) wants to merge 4 commits into
microsoft:masterfrom
tyrielv:tyrielv/hydration-count-drift

Conversation

@tyrielv

Copy link
Copy Markdown
Contributor

Problem and Context

Hydration status adds placeholder and modified-path counts, then compares those sums with index-based totals. These counts describe different populations. New paths and retained folders after branch switches can exceed the current totals without a calculation failure. The CLI and cached response currently reject those results.

This draft depends on #2144. The initial diff includes the parent commits because the parent source branch exists only in a fork. After #2144 merges, this PR can retain only the follow-up change.

Changes

  • Accept complete, nonnegative observations even when their sums exceed the current totals. Keep incomplete sources, negative counts, cancellation, and exceptions unavailable.
  • Share count acceptance and estimated display across the summary, cached response, CLI, and hook-linked code. Cap only the display at 100%, identify excess counts, and display n/a when a positive sum has no denominator.
  • Preserve raw counts, denominator sources, signed differences, and positive excess in structured diagnostics. Use 64-bit sums without changing count populations, wire count fields, database records, or the circuit-breaker failure policy.
  • Keep cached status requests free of new calculations or repository scans. Preserve the existing hook and cache lookup budgets.
  • Add unit tests for excess counts, zero denominators, unavailable sources, arithmetic boundaries, protocol compatibility, and the shared hook behavior.
  • Add functional tests that switch between different folder populations and retain an obsolete placeholder folder with an untracked file. The tests distinguish that folder from a clean removed folder, verify cached and forced-fallback status, and verify repeated cache reuse.
  • Document estimate semantics, source completeness, client compatibility, and the existing disk-reader limitations.

…back

Record typed count availability, partial observations, validation failures, and phase outcomes. Correlate health commands with cached and fallback calculations through explicit payload identifiers and a compatible IPC extension. Keep count semantics and wait behavior unchanged.

Add unit and functional tests for the diagnostic contract, serialization, and compatibility.

Assisted-by: GPT-6.1 Sol

Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
…t tests

Preserve cached summaries and circuit-breaker counts when configuration reads fail. Preserve cancellation policy while recording cancellation origin. Separate command outcome from calculation outcome and name the heartbeat cache-state point sample explicitly.

Pin IPC state integers and add regression tests for source-loader orchestration, failed phases, worker timeouts, cache snapshots, real command paths, and collector payloads.

Assisted-by: GPT-6.1 Sol

Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Poll the structured cache state before checking disabled and available results. Filesystem background readiness does not guarantee that the hydration refresh passed its backoff. Keep the deadline bounded and retain the final completion record on failure.

Add functional test cases with zero-second and five-second cache backoff. Keep product behavior unchanged.

Assisted-by: GPT-6.1 Sol

Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Accept complete nonnegative observations across different count populations. Share estimated display and preserve raw diagnostics without changing database records or cache lookup budgets.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
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