Skip to content

Ai 429 - #15

Merged
alex-struk merged 8 commits into
developfrom
AI-429
Dec 18, 2025
Merged

Ai 429#15
alex-struk merged 8 commits into
developfrom
AI-429

Conversation

@alex-struk

@alex-struk alex-struk commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

AI-429: Develop and Deploy Simple UI

Summary

[AI-429](https://citz-do.atlassian.net/browse/AI-429)

This PR implements the core functional loop for the OCR application. It connects the frontend upload interface with the backend processing logic, replaces the stubbed queue service with direct asynchronous processing, and adds a comprehensive UI for managing and viewing documents.

Changes

Frontend

  • Overhauled App.tsx to use Mantine AppShell with navigation for "Upload" and "Processing queue" views.
  • Added DocumentUploadPanel using @mantine/dropzone for drag-and-drop uploads with progress tracking.
  • Added ProcessingQueue to list documents with status filtering, search, and polling support.
  • Implemented DocumentViewer with bounding box overlays to visualize OCR confidence scores on the actual document image.
  • Added hooks useDocumentOcr and updated useDocuments to support polling.

Backend

  • QueueService: Replaced stubbed RabbitMQ calls with in-process asynchronous execution (processOcrForDocument) to trigger OCR immediately upon upload.
  • DocumentController: Added downloadDocument endpoint to serve stored files to the frontend.
  • OcrService: Improved file path resolution and added logic to handle "running" status from Azure.
  • UploadController: Updated to trigger OCR processing asynchronously to prevent blocking the upload response.
  • Added detailed logging throughout the document lifecycle.

Testing

  • Upload: Verified that files (PDF/Images) can be uploaded via the new Dropzone UI.
  • Processing: Confirmed that uploading a file triggers the backend OCR process and updates the document status from pre_ocr to ongoing_ocr to completed_ocr.
  • Visualization: Verified that clicking a completed document opens the viewer and correctly overlays bounding boxes on the text.
  • Download: Tested the download endpoint ensures files are retrieved correctly from the local storage.

Checklist

By submitting this pull request, I acknowledge that I have attempted to meet the following:

  • a self-review of my code
  • commented code particularly in hard-to-understand areas
  • corresponding changes to the documentation where required
  • changes tested to the best of my ability
  • no new errors or non-functional code

Comment thread apps/backend-services/src/queue/queue.service.ts Outdated

@dbarkowsky dbarkowsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few bugs I notice when testing:

  • PDF files will not render
  • No bounding boxes rendering

I'm happy to approve this as the backend code seems sound and saves the data as expected.

I wonder if we should consider the file_type column of the documents table as the actual mime-type instead of an arbitrary enum though. Mostly thinking of cases where we might have to handle jpg/png/etc. differently.
I did this with my file-upload-test branch a while back, although our approaches were a bit different overall.

@alex-struk
alex-struk merged commit e9d7313 into develop Dec 18, 2025
2 checks passed
@alex-struk
alex-struk deleted the AI-429 branch December 18, 2025 23:07
alex-struk added a commit that referenced this pull request Jun 23, 2026
… on early failure

Review findings #14, #15 (PR 4 — try-in-place):
- #14: the activity-output input hash resolves namespaced ctx bindings
  (doc.* -> documentMetadata.*, segment.* -> currentSegment.*) the same way
  execution does, so different doc.* inputs no longer collide to a false cache hit.
  Namespace logic is consolidated into graph-workflow context-utils
  (applyCtxNamespace / resolveCtxBinding) as the single source of truth.
- #15: node-status polling stops on query error, so a run that fails before any
  node executes no longer polls forever.

Note: the related output-snapshot fix (#13) and the bounded run-count cache /
fetchHistory fan-out (#16, #17) live with the temporal and workflow-controller
commits respectively, since they share files there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants