feat(revisions): input digests, strict freshness and candidate planning (#1014) - #1063
Merged
Merged
Conversation
… planning (#1014) Extends the revisions service with revision_input_digests (design.md Decision 2's per-pair input-digest table), is_fresh (the strict freshness rule, never findings._is_stale's lenient None-means-unchanged rule), and plan_revisions (the zero-LLM served/to_judge split over read_decision_vectors and the Phase A plan_revision_candidates leaf).
This was referenced Sep 29, 2026
Merged
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.
Summary
PR 9 of the
decision-revision-detectorchain, which is Phase B slice P5b (stacked-to-main). It adds the planning half ofsrc/openkos/application/revisions.py:revision_input_digests: the digests a revision finding is keyed by, meaning each Decision's body plus every Source it reaches (sources-of:rows).is_fresh: strict freshness. A stored finding is served only when every input digest, the judge prompt version andinclude_confidentialall match the latest stored row. An unreadable input, or a missing orNonedigest, is never "unchanged".plan_revisions: builds candidates with the pureplan_revision_candidatesleaf over the stored vectors (EMBEDDING_SIMILARITY_THRESHOLD), then splits them into served (fresh findings from the P3 store, zero LLM calls) and to judge. The effects:event_dateedit re-judges only the pairs reaching that Source;findings.dbis probed before any connection is opened, so a read never creates the store. The whole-bundle text snapshot is extracted into_bundle_text_snapshotand shared withresolve_decision_dates, as a behavior-preserving refactor.Size exception
size:exception. About 870 authored lines, mostly fixture-heavy tests that build a realvectors.dbandfindings.db. The owner authorized finishing Phase B autonomously, taking the recommended option; this is the same call as #1059 and #1061.Related issue
Refs #1014
Type of change
feat— new featureHow was this tested?
AttributeError) on all 12 new tests; the 11 P5a tests stayed green.sources-ofordinals; a weakened latest-row check; weakened strict digest equality; a disabledfreshflag; theis_freshcall removed from the serve/judge split.plan_revisions. Only the unit test that computes the sha256 independently catches it, which is why that test exists.ruff check .,ruff format --check .andmypy .are clean;pytest --cov6857 passed (97.02%);evals/run_self_tests.py43 of 43.Checklist
ruff,mypy,pytest).