Skip to content

feat: Anchor-drift auto-invalidation for code_verified claims #90

Description

@divo12

What to build

Automatically demote code_verified claims when their code anchors stop
resolving. Greplica already detects drift via greplica graph audit anchors
(tree-sitter file#symbol resolution), but detection is read-only — a claim
whose anchored symbol was renamed, moved, or deleted stays labeled
code_verified and keeps surfacing in graph context as verified truth. This
wires the existing detector to a write action so stale claims are demoted to
truth: unknown (non-destructively) with an invalidation event recorded. The
check is deterministic — the compiler is the judge, no LLM needed.

Acceptance criteria

  • Opt-in path (e.g. greplica graph audit anchors --invalidate) demotes
    drifted code_verified claims to truth: unknown via the existing
    supersession model (history preserved, nothing deleted).
  • Each demotion records an invalidation event: broken anchor, resolver
    status, and the memory-commit / git_commit_sha where it drifted.
  • Default graph audit anchors stays report-only (no behavior change without
    the flag); unsupported_language anchors are never auto-demoted.
  • graph context no longer returns demoted claims as code_verified.
  • Deterministic test: apply a claim anchored to fixture#oldSymbol, rename
    the symbol, assert the claim becomes unknown + event recorded + original
    retained in history.

Blocked by

None - can start immediately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions