Repository navigation
Conversation
Encode typed scalar tuples as fixed-size equality keys and derive complete canonical index definitions before use. Repair existing accepted-credential indexes on startup, including partial entries and incorrect compound definitions, without dropping named databases. Keep recovery state in Seeker, retry only missing schemas, and make permanent failures visible. Bound scheduler work, tolerate deletion during repair, and isolate credential query semantics from exchange queries. Add real LMDB regressions for key boundaries, interrupted recovery, optional attributes, and query error behavior. Validation: 38 focused tests pass in the pre-publication run; 77 distinct affected cases passed across earlier runs. Ruff and diff checks pass. The existing persistent-state test_agency, full-suite execution, and remote CI remain unqualified.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #472 +/- ##
==========================================
+ Coverage 88.73% 88.77% +0.03%
==========================================
Files 27 28 +1
Lines 6056 6253 +197
==========================================
+ Hits 5374 5551 +177
- Misses 682 702 +20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kentbull
marked this pull request as draft
November 5, 2026 20:32
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.
Addresses #470.
Problem
Seeker can accept a credential into Reger and then fail to make it fully searchable:
Seeker.index()/unindex()build keys with"".join(values). Numeric attribute values raiseTypeError, and compound keys lose field boundaries (("ab", "c")and("a", "bc")collide).generateIndexes()creates issuee-bearing compound definitions for issuee-less schemas, and absent optional attributes cause path-resolution failures.SeekerDoercatches every exception and requeues the same cue forever, repeating deterministic failures on every scheduler turn.Resulting behavior
Typed equality keys. Index, unindex, compound, and equality lookups use one codec,
tupleKey. It frames each scalar with a type tag and length, then hashes the tuple with SHA-256, giving a fixed 64-character key that stays under LMDB's key limit even for long compound strings. Strings, integers, and finite floats are separate domains, so1,1.0, and"1"are different keys. Signed zero is normalized. Booleans, containers, and non-finite floats are rejected before any entry is written.Canonical definitions. Index definitions are derived completely from the schema before installation, and each indexing attempt re-derives them. A nonempty
schIdxis not treated as a completion marker. Issuer/schema and issuee/schema compound paths are corrected. Issuee-less schemas get no issuee-bearing definitions, and absent optional attributes get no entries.Startup reconciliation. On Agent startup,
Seeker.startRepair()walks accepted credentials fromReger.schms. For each SAID it removes entries from the union of the old and corrected definitions, then rebuilds them. The pass is idempotent and yields in bounded batches:SeekerDoerruns up to 128 repair steps per turn. It rechecks acceptance after each yield, so deletions during repair are handled. Unused definition metadata is removed, but physical LMDB named databases are never dropped. If reconciliation is interrupted, it runs again on the next start.Recovery state owned by Seeker. Only
MissingSchemaErrorenters pending recovery. Seeker checks one pending schema per turn and re-indexes only when that schema is available. Deterministic and unexpected failures are logged once and are not requeued. The credentials stay accepted in Reger.Query behavior.
IndexNotReadyError) while reconciliation is running or recorded failures mean results may be incomplete. The description lists a bounded sample of the affected SAIDs and error types.UnsupportedQueryError).CredentialCursorspecialization holds credential-specific behavior.ExnSeekerand exchange queries keep their existing key representation and behavior.Shared exceptions live in the new
src/keria/keriaing.py. They subclassValueError/RuntimeErrorso existingexceptclauses keep working.Validation
tests/app/test_seeker_repair.py: 29 real-LMDB cases. They cover typed numeric/string/float equality, compound collisions, long (153–1024-byte) strings, issuee-less and optional-attribute schemas, legacy poisoned-index repair and idempotence, interrupted repair at four checkpoints, deletion during repair, missing-schema recovery, permanent-failure retention, bounded scheduler batches, and the HTTP 400/503 responses.make testsuite on ubuntu-latest and macos-15, coverage, and Docker: Fix Seeker indexing and bounded startup recovery kentbull/keria#6.git diff --checkwas clean. Across the seeker-repair, basing, agenting, credentialing, and ipexing test modules, 71 passed. Four TCP-based tests failed withgetpeernameEINVAL; unmodifiedmainfails them the same way in the same sandboxed environment. The fifth failure istest_agency, which hits a pre-existing persistent local test-store collision. I didn't delete local stores to work around it.Compatibility and limits
typedeclarations and the attribute-objectoneOfshape. Attributes with notype, or with a type union, fail visibly; general JSON Schema indexing isn't implemented. A missing schema can stay pending indefinitely, but Seeker doesn't keep re-indexing it.🤖 Generated with Claude Code