File Registry Persistence #70

Open
opened 2026-02-23 10:04:22 +00:00 by ottomata · 0 comments
Owner

Context

Every file detected by the watcher must be recorded in uploaded_files and linked to the run it triggered, providing a full audit trail of automated job dispatches.

Tasks

  • In HandleFileEvent (Phase 7.3), after dispatching a run:
    • Insert to uploaded_files: filename, path, detected_at, trigger_id, run_id
  • If a file matches multiple triggers, create one uploaded_files record per trigger/run pair
  • If TriggerRun fails for a trigger match: still create uploaded_files record with run_id = NULL, log the error
  • Add sqlc query GetFileByID :one with a JOIN to fetch trigger details and run status in one query

Acceptance Criteria

  • Every detected file has a record in uploaded_files
  • Records are linked to the correct trigger and run IDs
  • Failed run dispatch still creates a file record (with null run_id)
  • GET /files/:id returns trigger and run details in a single response
### Context Every file detected by the watcher must be recorded in `uploaded_files` and linked to the run it triggered, providing a full audit trail of automated job dispatches. ### Tasks - [ ] In `HandleFileEvent` (Phase 7.3), after dispatching a run: - Insert to `uploaded_files`: `filename`, `path`, `detected_at`, `trigger_id`, `run_id` - [ ] If a file matches multiple triggers, create one `uploaded_files` record per trigger/run pair - [ ] If `TriggerRun` fails for a trigger match: still create `uploaded_files` record with `run_id = NULL`, log the error - [ ] Add sqlc query `GetFileByID :one` with a JOIN to fetch trigger details and run status in one query ### Acceptance Criteria - [ ] Every detected file has a record in `uploaded_files` - [ ] Records are linked to the correct trigger and run IDs - [ ] Failed run dispatch still creates a file record (with null run_id) - [ ] `GET /files/:id` returns trigger and run details in a single response
ottomata added this to the Phase 7 project 2026-02-23 10:09:05 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ottomata/acsm#70
No description provided.