fix(knowledge): stabilize skipped connector documents

Merged
WA
2mo ago
+27-2

Summary

  • reuse the same replacement rule for listing-time and hydration-time skipped documents
  • persist a rediscovered skip when the existing row is already a content-less failed placeholder
  • keep last-known-good indexed content unless a connector explicitly declares the skip authoritative
  • preserve every existing retry path, including same-hash placeholder hydration

Production evidence

A production GitHub sync reported previously recorded binary placeholders as source failures after the ingestion hardening rollout. Trigger traces showed successful listing and processing dispatch, while persisted state showed the reported failures were existing binary placeholders rather than GitHub API or child-processing failures. The hydration path rediscovered an intentional binary skip but, unlike the equivalent listing-time path, treated the content-less existing row as an unverified indexed refresh.

Why this is minimal

The correction extracts the existing skip-replacement predicate and reuses it after deferred hydration. Existing content-less placeholders continue to rehydrate so providers with weak or absent modification metadata can recover. A rediscovered intentional skip is persisted and counted as docsSkipped; indexed last-known-good content is still retained unless the connector opts into authoritative replacement. No provider-specific suppression, retry change, or alert filtering is added.

Validation

  • 45 connector/sync test files, 1,416 tests passed
  • monorepo lint passed (one unrelated pre-existing unused suppression warning)
  • monorepo type-check passed (26 tasks)
  • all 33 repository audits passed
  • block registry audit passed
  • agent-stream docs and skills generators were idempotent

No schema or migration changes.