feat: freshness engine Phase 4 — re-verify handoff - #5
Merged
Merged
Conversation
claimsNeedingReverify derives the worklist — current claims drift-demoted to truth:unknown and not yet rewritten — from readGraphView + invalidation events. A claim drops out for free once superseded by a fresh one.
Worker drains the re-verify worklist per active repo (gated by autoHealDrift, capped at 3/cycle) and runs the platform agent with a prompt to re-verify each claim against current code. Extract shared runMemoryAgent (reused by the memory-update path); drop now-dead safePathSegment.
There was a problem hiding this comment.
1 issue found across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
A reverifyWorklist/requireRepo error on one repo (e.g. greplica not installed there) aborted the whole re-verify pass. Wrap each repo in try/catch and log the narrowed error, matching the heal pass's best-effort isolation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase 4 (final slice) of the freshness engine: the background heal demotes drifted
code_verifiedclaims totruth: unknown; this hands those to an agent to re-verify and rewrite. Completes the loop: detect → surface → demote → re-verify.How (ponytail: no queue table)
The re-verify worklist is a query, not a table.
claimsNeedingReverify(repoId, limit)derives it from existing state — current claims that were drift-demoted totruth: unknown(viareadGraphView+listInvalidationEvents). A claim drops out for free once an agent supersedes it with a freshcode_verifiedone. This drops thereverify_queuetable + 4 repo methods + txn-enqueue wiring the original design sketched (~80 LOC).service.reverifyWorklist(input, limit)— thin wrapper over the repository query.reverifyPrompt(claims, proposalPath)— pure prompt builder naming each claim + its anchors.runReverifyPass(runner, cwd, claims)— hands the worklist to the existing platform agent runner; empty worklist → no spawn.session.autoHealDrift, capped at 3/cycle.runMemoryAgent(memory-update + reverify both use it); removed now-deadsafePathSegment.Test plan
npm testgreen across all 9 suites (incl. the feat: freshness engine — keep code_verified claims honest as code changes Autoloops/greplica#96check-anchor-driftregression);tsc --noEmitclean.check-freshness-background.js: worklist returns demoted claims / excludes a manually-createdunknownclaim / respects the limit; prompt names the claim + anchor + "re-verify";runReverifyPasshands the worklist to a fake runner; empty worklist → no agent spawn.Ponytail deferrals (marked in-code)
reverifyLimit = 3hardcoded — config only if repos diverge.readGraphView— swap to one SQL join only if the graph grows.Scope
Phase 4 only. Stacks on
feat/anchor-drift-invalidation(Phases 1–3 merged).Summary by cubic
Adds Phase 4 of the freshness engine: the worker re-verifies drift‑demoted claims by handing them to the platform agent. The worklist is derived from existing state (no queue), capped at 3 per repo per cycle, and completes the detect → surface → demote → re-verify loop.
New Features
claimsNeedingReverify(repoId, limit)and servicereverifyWorklist(...); respects a per-pass limit.Bug Fixes
reverifyWorklistfailures) no longer abort the pass — logfreshness_reverify_errorand continue.Written for commit e94fae9. Summary will update on new commits.