Add shared docs mutation transport, reuse in CLI/HTTP, and extract maintenance helpers#59
Closed
Intrinsical-AI wants to merge 1 commit into
Closed
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.
Motivation
Description
core.services.docs_mutation_transportprovidingDocsMutationPayload,MutationUpsertPayload,validate_docs_mutation_payload,build_docs_mutation_intent, andbuild_docs_mutation_intent_from_rawusingpydanticfor shared transport validation and intent construction.build_docs_mutation_intentand replace in-module schema duplication withDocsMutateRequestaliasingDocsMutationPayloadandUpsertDocIteminheriting fromMutationUpsertPayload.build_docs_mutation_intent_from_rawand map pydanticValidationError/ValueErrorinto aValueErrorfor consistent error handling._preflight_vector_store_or_resolve_embedderand_delete_vector_rows_or_rebuildand wire them intodelete_documents_multi_storeanddelete_external_ids_multi_storeto centralize preflight checks and rebuild-on-failure logic while preserving behavior.tests/unit/core/services/test_docs_mutation_transport.pycovering normalization, validation, conflict detection, and intent building.Testing
uv run pytest -q -o addopts='' tests/unit/core/use_cases/test_docs_mutation_refactor.py tests/unit/core/services/test_maintenance.py tests/unit/core/services/test_evaluation.py tests/unit/application/services/test_mutation_ports.py tests/unit/cli/test_cli_mutation_boundary.py tests/unit/http/test_docs_index_ports_wiring.pyand observed50 tests passed.tests/unit/core/services/test_docs_mutation_transport.pywhich exercises the new transport validation and intent builder and passed as part of the run.Codex Task