Skip to content

Make provider import state converge safely#163

Draft
luca-ctx wants to merge 4 commits into
mainfrom
ctx/import-state-resilience
Draft

Make provider import state converge safely#163
luca-ctx wants to merge 4 commits into
mainfrom
ctx/import-state-resilience

Conversation

@luca-ctx

@luca-ctx luca-ctx commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • persist convergent provider import outcomes and parser revisions
  • fence inventory, completion, and missing-path transitions with a durable per-source generation
  • keep transient I/O failures retryable while deterministic record rejection converges
  • repair legacy failed rows and completed rows whose materialized session is missing

Why

Provider import state could previously remain ambiguous after mixed rejection, parser changes, or overlapping source scans. An older in-flight scan could also report against a newer observation. This change makes every durable result conditional on the exact current source observation without rewriting unchanged catalog rows.

Validation

  • cargo test -p ctx-history-store catalog::tests (34 passed)
  • cargo test -p ctx-history-store schema::tests (29 passed)
  • cargo test -p ctx-history-capture codex (44 passed, 1 ignored manual benchmark)
  • cargo test -p ctx-history-capture retained_existing_content
  • cargo test -p ctx commands::import::native::tests (8 passed)
  • cargo test -p ctx --test native_provider_rejections (16 passed)
  • cargo clippy -p ctx-history-store -p ctx-history-capture -p ctx --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • two independent adversarial review passes; all findings resolved or assigned to the separate write-pressure PR as preexisting scope

This is the first PR in a stacked import-indexing resilience series. It is ready for CI and review, but will be held from merge until the combined stack passes cross-platform and real-corpus validation.

@luca-ctx
luca-ctx marked this pull request as ready for review July 14, 2026 00:33
@luca-ctx
luca-ctx force-pushed the ctx/import-state-resilience branch from 4636b39 to 273b431 Compare July 14, 2026 07:23
@luca-ctx
luca-ctx force-pushed the ctx/import-state-resilience branch from 273b431 to 89a7e1b Compare July 15, 2026 03:31
@luca-ctx
luca-ctx marked this pull request as draft July 17, 2026 18:28
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