chore(backend): save remaining API and deployment changes
Expose frozen factual review policy, update API descriptions and Swagger settings, and adjust local deployment and embedding connectivity. Include the requested extraction candidates and review-policy regression coverage. Validation: 31 OCR policy tests passed; staged diff whitespace checks passed.
This commit is contained in:
@@ -10,6 +10,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_valida
|
||||
from .chunking import chunk_extraction, factual_context_units
|
||||
from .embeddings import validate_database_string
|
||||
from .extraction import ExtractionError, PLACEHOLDER, REVIEW_CHECKS
|
||||
from .extraction_artifacts import factual_review_required
|
||||
|
||||
FACTUAL_CHECKS = ("factual_authority", "whole_pair_association", "behavioral_separation", "placeholders")
|
||||
|
||||
@@ -105,7 +106,14 @@ def prepare_chunks(envelope, processing_profile, state, artifact_sha256):
|
||||
"""One boundary for worker staging and publication; faithful artifact stays whole."""
|
||||
if not factual_groups(envelope):
|
||||
return chunk_extraction(envelope, processing_profile)
|
||||
included = included_groups(envelope, state.get("factual_inclusion"), artifact_sha256)
|
||||
if not factual_review_required(processing_profile) and state.get("factual_inclusion") is None:
|
||||
groups = factual_groups(envelope)
|
||||
included = {group for group, blocks, _ in factual_context_units(envelope.blocks)
|
||||
if not any(PLACEHOLDER.search(b.text) for b in blocks) and group in groups}
|
||||
if not included:
|
||||
raise ExtractionError("No eligible factual groups")
|
||||
else:
|
||||
included = included_groups(envelope, state.get("factual_inclusion"), artifact_sha256)
|
||||
return chunk_extraction(envelope, processing_profile, corpus_purpose="approved_factual",
|
||||
included_group_ids=included)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user