Skip to content

Detect and guard against stale watch/index-writer version skew #4

Description

@amazon7737

Context

A previously observed operational failure allowed a resident kleos watch process from an older binary to rewrite index.json in an older shape, causing newer PR reverse-lookup fields to disappear. The current recovery is a manual daemon restart after upgrading.

Acceptance criteria

  • Define a backward-compatible writer compatibility signal for the resident watch/index path.
  • Detect an incompatible or stale index writer before newer fields can disappear silently, and emit an actionable English message.
  • Add a synthetic regression test that models an old-shape rewrite after a newer index has been produced.
  • Preserve schema-v1 read compatibility and existing incremental indexing behavior.
  • Document the detected condition and safe recovery path.
  • Do not terminate user processes automatically or rewrite private archive content destructively.
  • Pass targeted race tests and the repository-wide validation suite.

First safe step

Write a synthetic compatibility test that reproduces the field-loss sequence without touching a real archive or daemon.

Non-goals

  • Process termination, deployment, or service-manager integration.
  • Publishing archive data or inspecting real user sessions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1: high priorityloopx-readyReady for autonomous LoopX intake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions