Commit Graph
37 Commits
Author SHA1 Message Date
amirhosein mazaheri 5a4786d0fe docs(presentation): align embedded architecture source 2026-10-14 15:20:28 +03:30
amirhosein mazaheri 7017024d3b docs(presentation): simplify system architecture diagram 2026-10-14 15:20:13 +03:30
amirhosein mazaheri 5337031d80 docs(presentation): normalize guide trailing newline 2026-10-14 15:07:51 +03:30
amirhosein mazaheri e9797309f9 docs(presentation): add system ingestion voice and RAG pipeline diagrams 2026-10-14 15:07:27 +03:30
amirhosein mazaheri 2e8c179efc fix(ingestion): accept observed OCR text alias in partial mode 2026-10-14 14:01:51 +03:30
amirhosein mazaheri 77b8205db6 chore(voice): restore full realtime model with concise delivery 2026-10-14 13:11:22 +03:30
amirhosein mazaheri d7b6d24465 fix(voice): prefer concise complete answers by default 2026-10-14 12:34:36 +03:30
amirhosein mazaheri 1f7c2bd195 fix(voice): decouple cancellation race handling from model and voice 2026-10-14 12:04:08 +03:30
amirhosein mazaheri 15558fd850 fix(voice): attribute provider terminal failures safely 2026-10-13 14:59:48 +03:30
amirhosein mazaheri 1139b31219 fix(voice): accept verified Marin cancellation completion race 2026-10-13 14:41:53 +03:30
amirhosein mazaheri fd4e419e4a chore(config): persist current live stream tuning in env example
Document speech speed 1.30, output budget 2048, event replay capacity 32768 and enabled numeric traces. Preserve provider-specific audio capacity defaults. Local deployment now reads the same settings from .env without a temporary Compose override.
2026-10-13 14:20:06 +03:30
amirhosein mazaheri 90a164f5a6 feat(ingestion): add opt-in best-effort document admission
Freeze temporary partial-extraction admission in new uploads. Bypass manual approval, retain recognition warnings, and accept ambiguous legal references during bounded chunking. Preserve strict defaults, immutable evidence and atomic publication. Expose effective policy and safe failure categories with regression coverage.
2026-10-13 14:09:21 +03:30
amirhosein mazaheri 18e595ac93 fix(voice): preserve interrupted searches and report used sources
Retain and revalidate interrupted searches, resolve abandoned provider calls, recover invalid source reports privately, and expose only declared sources. Improve Persian delivery and provider event replay capacity. Include regression coverage and contract updates.
2026-10-13 14:09:20 +03:30
amirhosein mazaheri 9e6864ae2a fix(voice): expand speech buffer to 60s, handle 2.1 cancellation race, and bound cleanup
- Expand max_input_buffer_bytes to 3,072,000 (64s at 24kHz PCM16) with 65s fixed deadline
- Broaden response_cancel_not_active race classifier to include gpt-realtime-2.1/shimmer
- Add transport abort method and bound cleanup waits during websocket close
- Record repair progress in docs/plans/live-conversation-repair-progress.md
2026-10-12 18:51:06 +03:30
amirhosein mazaheri d493752b81 docs(plan): add live conversation reliability and quality repair plan 2026-10-12 17:56:40 +03:30
amirhosein mazaheri 117fda7cc9 feat(voice): specialize prompt for Isfahan Industrial Parks, emit source excerpts, and bound generation
- Specialize voice assistant identity and agent system prompt for «شرکت شهرک‌های صنعتی اصفهان» (English instructions with Persian proper names)
- Emit bounded chunk text excerpts (up to 2000 chars) and identify primary_source in realtime sources events
- Bound OpenAI output generation via OPENAI_REALTIME_MAX_OUTPUT_TOKENS and add answer_limited event
- Handle old-turn search cancellation safely on turn supersession
- Add end-to-end search tracing pipeline and diagnostic CLI
- Add database organization title and settings update script
2026-10-12 17:35:28 +03:30
amirhosein mazaheri f14166a89f fix(openai): prompt engineering and transcript model 2026-10-11 17:28:22 +03:30
amirhosein mazaheri 21a0ea076a 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.
2026-10-10 17:43:17 +03:30
amirhosein mazaheri a769196bfa fix(voice): correct input accounting and session termination
Separate detected speech limits from continuous microphone silence while preserving transport bounds and absolute commit fencing.

Handle verified OpenAI cancellation races and terminal items, preserve causal close outcomes, and share bounded cleanup ownership with safe diagnostics.

Add regression coverage and align the API contract and frontend handoff. Validation: 61 focused unit tests passed; staged diff whitespace checks passed. Live browser acceptance remains outstanding.
2026-10-10 17:41:11 +03:30
amirhosein mazaheri 07245cd5ca chore(dev): add standalone voice stream mock harness
Add an isolated FastAPI mock with synthetic PCM, fixture transcripts
and sources, simulated sessions and a browser reference client.
Preserve the supplied development harness unchanged; it does not establish
production voice, real-provider or browser acceptance.

Validation: Python AST parse and CLI help passed. Staged whitespace check
reports four existing whitespace-only lines in the embedded HTML.
2026-10-08 18:08:03 +03:30
amirhosein mazaheri 6f0561c490 docs(voice): freeze OpenAI Realtime Phase 0 contracts
Align voice specifications and the MVP plan with OpenAI Realtime.
Document audio admission, bounded playback, cancellation ownership,
turn correlation, cleanup barriers and calibration prerequisites.
Preserve historical checkpoints and record unrun acceptance gates.
2026-10-08 18:07:38 +03:30
amirhosein mazaheri 9dac244590 feat(voice): add bounded Realtime knowledge runtime
Connect OpenAI Realtime to the existing async StructuredTool and shared
SearchToolRunner with backend-owned authority and per-turn source references.
Add an operator-only smoke harness with persisted actor and provider opt-in.

Enforce confirmed readiness delivery, strict function identity, canonical
results and once-only continuations. Bound and pace generated audio, preserve
turn correlation, and require acknowledged cleanup before response release.
Handle Unicode arguments, UTF-8 replay budgets and user-ASR completion replays.

Validate with 318 voice/runner/shutdown tests and 1563 provider-free tests.
Three Windows symlink tests skip; 311 PostgreSQL tests are deselected.
Real-provider, browser playback and PostgreSQL acceptance remain unrun.
2026-10-08 18:06:03 +03:30
amirhosein mazaheri b50c920bfc chore(dev): add standalone mock authentication server
Add an isolated development dashboard and illustrative authentication endpoints using mock tokens. This script is not the production identity implementation.
2026-10-08 13:00:13 +03:30
amirhosein mazaheri 2c64a69506 docs(agent): add phased OpenAI Realtime MVP plan
Define backend phases, English implementation prompts, frontend handoff, validation gates, and local-first defaults for connecting Realtime to canonical knowledge search.
2026-10-08 12:59:00 +03:30
amirhosein mazaheri 8ebdefb7f8 chore(voice): add standalone OpenAI Realtime proof
Preserve the Persian voice browser proof, audio relay, transcription, and interruption flow. Knowledge responses remain illustrative placeholders pending real backend integration.
2026-10-08 12:59:00 +03:30
amirhosein mazaheri bde43efab8 build(docker): add API and ingestion worker stack
Add container builds and Compose services for PostgreSQL/pgvector, migrations, API, and a separate worker with persistent storage.
2026-10-08 12:58:59 +03:30
amirhosein mazaheri fef381c41b feat(search): add calibrated retrieval and LangChain knowledge tool
Add exact and semantic evidence admission, measured calibration, bounded tool execution, and independent held-out evaluation preparation with regression coverage and operator guides. Real-provider quality gates remain pending.

Validation: 1300 provider-free tests passed; 3 Windows symlink skips. PostgreSQL acceptance not rerun because TEST_DATABASE_URL is unset.
2026-10-08 12:58:59 +03:30
amirhosein mazaheri 4d36f2ba35 docs(search): add Word document retrieval report
Record the supplied DOCX retrieval results, source locators, cosine distances and proposed follow-up search work.
2026-10-07 17:33:32 +03:30
amirhosein mazaheri 7fa1c2dcc1 feat(search): implement Phase 1 scoped search vertical slice
Resolve persisted enabled actors and atomically replace knowledge selection with revision checks, removal epochs, stable locking and audit updates.

Reuse compatible query embeddings for scoped pgvector cosine retrieval, revalidate authority after remote work, and expose opt-in operator inspection with uncalibrated candidates.

Validation: 37 targeted tests passed (14 unit, 23 PostgreSQL); provider-free inactive-to-active demonstration passed. Real-provider demonstration remains pending ingestion database connectivity. Applied migrations are unchanged.
2026-10-07 17:31:59 +03:30
amirhosein mazaheri ff9c32823c feat(ingestion): add Phase 6 operator tooling, smoke validation, and verification tests
- Add app/ingest.py CLI command for standalone document ingestion
- Add app/ingestion_smoke.py opt-in real-provider smoke test harness with redacted diagnostics
- Add unit and integration tests for Phase 6 operator tooling and audit import coverage
- Update tests/README.md with Phase 5/6 acceptance test results
2026-10-07 16:21:52 +03:30
amirhosein mazaheri 9663caf48e feat(ingestion): implement Phase 5 background worker, orchestration, and publication
- Add background worker daemon for job lease acquisition and heartbeat maintenance
- Implement atomic document publication, failed job retry backoff, and review resume
- Add WorkerRepository for atomic database claims and lease fencing
- Add migration 0002_worker_artifact for extraction state tracking
- Add extensive unit and integration test coverage for worker orchestration and review resumes
2026-10-07 16:21:34 +03:30
amirhosein mazaheri 39ed0422c5 feat(ingestion): implement Phase 4 chunking and vector embedding generation
- Add heading and paragraph-preserving chunking algorithms with bounded overlap
- Implement OpenAI embeddings client adapter with explicit token limits and batching
- Implement stage_document pipeline with strict operational limits and memory protections
- Add unit and integration tests covering chunking boundaries, timeouts, and vector generation
2026-10-07 16:21:17 +03:30
amirhosein mazaheri 5ef02d39a9 feat(ingestion): implement Phase 3 text extraction, OCR, and human review
- Add direct text, DOCX, and PDF text extraction with visual OCR fallback
- Implement Gemini and OpenRouter vision adapters with strict bounded retry
- Implement extraction envelopes, artifacts, and Unicode/Persian normalization
- Add human review workflow, candidate staging, and review repositories
- Add migration 0003_extraction_review for audit events and review tracking
- Add comprehensive unit and integration tests covering extraction and review contracts
2026-10-07 16:21:01 +03:30
amirhosein mazaheri b036912293 feat(ingestion): implement Phase 2 multi-format intake and raw storage
- Add format validation and inspection for PDF, DOCX, Markdown, Text, HTML, and images
- Implement secure decompression defenses (zip bombs, ratio checks) and image dimension limits
- Implement FileStore with content-addressable storage and intake repositories
- Add unit and integration tests for document intake, format sniffing, and storage roots
- Include sample acceptance document fixtures in data/documents/
2026-10-07 16:20:41 +03:30
amirhosein mazaheri 0a998ac94a feat(ingestion): extend domain types, ports, and configuration for ingestion pipeline
- Add ExtractedBlock, ExtractionEnvelope, and StagedDocument data models in types.py
- Define ingestion repository, file store, vision, and extraction ports in ports.py
- Extend IngestionSettings with limits, policies, vision, and embedding configuration
- Update database compatibility verification to support worker and review schema revisions
- Add PyMuPDF, Pillow, defusedxml, and tiktoken dependencies to pyproject.toml
2026-10-07 16:20:19 +03:30
amirhosein mazaheri ca8833dd2f docs: restructure documentation hierarchy and update agent reference map
- Organize architecture, specifications, plans, and guides into dedicated subdirectories under docs/
- Remove legacy and duplicate documents from data/documents/
- Update AGENTS.md, README.md, and agent skills to target canonical docs paths
2026-10-07 16:19:24 +03:30
amirhosein mazaheri baf58da562 feat(ingestion): add Phase 1 database and application foundation
Add the scoped PostgreSQL/pgvector schema, independent ingestion settings and ports, embedding profile checks, and trusted administrator bootstrap.

Include repository contracts and guidance, organized provider-free and PostgreSQL tests, deployment setup, and byte-preserving migration attributes.

Validation: 163 tests passed; all 48 PostgreSQL cases passed with pgvector Python 0.5.0 and 0.3.6. No production schema or historical metadata was changed.
2026-10-05 16:38:28 +03:30