feat: add conversation materialization - #1
Open
Amidwestnoob wants to merge 1 commit into
Open
Conversation
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.
PR draft 2: conversation materialization
Tracks VectifyAI#224
Status
This change is stacked on VectifyAI#223. It is independent of VectifyAI#179.
Summary
Add a small transport-neutral conversation package.
The package converts caller-supplied closed conversation windows into immutable source documents. It keeps source, speaker, authority, time, and evidence identifiers. It writes content hashes, closed-window fingerprints, and a replay-safe manifest.
The caller remains the source of truth. The wiki remains a read-only projection.
Changes
(conversation_id, turn_id).Scope boundaries
This change does not depend on VectifyAI#179. It does not copy the ingest-bundle pipeline.
This change does not add source-specific rules, live input, source data, scheduler wiring, or model calls.
A future VectifyAI#179 adapter can call this materializer.
Tests
The synthetic tests cover cleaning, hook order, explicit truncation, rendered limits, first-turn fit failure, exact split coverage, duplicate handling, UTC ordering, equal-time caller order, empty-window identity, changed segment sets, collision-resistant paths, manifest validation, corrupt UTF-8 text, custom manifest selection, compile receipts, concurrent manifest updates, concurrent claim updates, recovery identity, recovery no-mutation failure, stale-file removal, budget checks, verified authority, and claim idempotence.
Verification receipt
python -m pytest: PASS (1,320 passed; 2 warnings in existing removal tests)python -m ruff check .: PASSpython -m ruff format --check .: PASS (130 files already formatted)python -m mypyon all new modules: PASSgit diff --check: PASStests/test_file_size.py: PASS (5 passed)uv build: PASS (source archive and wheel)Review notes
The package uses shared OpenKB lock, atomic write, frontmatter, and claims helpers. It does not modify
openkb/claims.pyoropenkb/agent/compiler.pyfrom VectifyAI#223.The deployment values in the public document are examples. They are not code defaults.
Residual risk: A process stop after a recovery file write and before the manifest write can leave an untracked recovery file. It is not selectable. Automatic cleanup is outside this change.