Engineering/AI documentation
Document Upload
Upload controls import project files and documents into Istara for downstream reading, chat, and evidence workflows.
Concepts: rag
Implementation Summary
Upload controls import project files and documents into Istara for downstream reading, chat, and evidence workflows.
Clean text uploads now register raw source evidence units immediately. Upload does not create trusted Atomic Research artifacts; it creates a Document raw source, hybrid-search chunks, source evidence units, and content-free extraction telemetry so later coding, reliability, reconciliation, task review, and report gates can operate on original source spans.
Frontend Surface
frontend/src/components/documents/DocumentsView.tsxbackend/app/api/routes/files.pybackend/app/core/upload_security.py
State, API, And Backend Contracts
Stores
frontend/src/stores/documentStore.ts
API And Backend
backend/app/api/routes/files.pybackend/app/api/routes/documents.py- Clean uploaded text returns
doc_idandevidence_units_created. These units aresource_spanrows linked to the uploadedDocument, not accepted nuggets/findings. - Quarantined uploads stay blocked for security review and are not indexed or converted into source evidence units.
- Audio uploads create source evidence units only after transcription succeeds and the document reaches
ready.
Architecture Notes
- The feature is mounted through
frontend/src/components/documents/DocumentsView.tsxand the UI navigation path recorded in the inventory. - Document-heavy benchmarks and simulations use
tests/document_corpus/canonical/throughtests/document_corpus/shared-corpus.mjsas their corpus contract. Agentic research, task execution, Findings, and Reports tests should use at least 120 long-form canonical sources unless they are explicitly narrow parser/unit checks. - Upload and folder-sync ingestion are Research Spine entry points: raw source -> evidence units -> independent extraction/coding -> reliability/reconciliation -> accepted atoms/findings -> Done tasks -> reports.
- Product-level tests can request manifest-backed slices such as
interview-heavy,survey-heavy,usability-heavy,accessibility-heavy,findings-reporting,multilingual,malformed-edge-case,upload-smoke,coding-reliability,graph-synthesis,low-consensus-review, orfull-end-to-end. Tiny generated fixtures are reserved for parser/unit tests and should not receive representative corpus credit. - The frontmatter and manifest entries are the durable contract for agents updating this page after code changes.
- When the referenced component, store, route, agent, skill, or test behavior changes, regenerate and validate the feature documentation.
Agents, Skills, LLM, MCP, And Permissions
- RAG-related behavior depends on project context, documents, memory, or retrieval material referenced by the cited stores and routes.
Tests And Verification
tests/document_corpus/shared-corpus.mjstests/document_corpus/canonical/manifest.jsontests/test_files.py::test_text_upload_registers_raw_source_evidence_unitstests/test_documents.py::test_documents_sync_registers_raw_source_evidence_unitstests/real_user_benchmark/run.mjs
Related Features
Related Concepts
Compass Evidence
- Spec/task: CF-SPEC-53 / CF-657; CF-SPEC-122; CF-SPEC-123 / CF-1581; CF-SPEC-131
- Inventory source:
docs/features/inventory.json
When To Update
- Update this page whenever the listed UI components, stores, routes, model behavior, permissions, or tests change.
- Regenerate the site and machine manifests with
python scripts/feature_docs.py --seed-missing --generate-site --check.