Run file names, audit-list fix, and named query row types - #225
Merged
Conversation
cursor_list_workspace_files builds its count and item-fetch queries separately; the count filtered file_kind IN (original, redacted) but the fetch query omitted it, so audit (and would-be artifact) rows were returned in the list even though the total count excluded them. After running detection this showed up as `analysis.audit` rows in listFiles. Reapply the document-kind filter to the fetch query. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Runs exposed only input_file_id/output_file_id (raw UUIDs). Resolve and return the file display names so a run can be rendered without a separate lookup: - listRuns joins the input file (one LEFT JOIN per query) and returns its name; both list queries now return a named PipelineRunListRow instead of a growing tuple. - Single-run responses (get / create / replay / redact) resolve input and output names via a run_file_names query method (indexed lookups). - PipelineRun gains inputFileName / outputFileName (omitted when absent). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
imported_files_for_connection returned Vec<(String, Uuid, String)> and
files_due_for_expiry Vec<(Uuid, String, String)> — same-typed positional
fields a caller could transpose (e.g. source_key vs storage_path). Give
them Queryable structs ImportedFileRef { source_key, file_id, storage_path }
and ExpiredFileRef { id, storage_path, storage_bucket }; the select tuples
are unchanged, and the retention sweep and sync reconciliation callers now
read fields by name.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three related changes to the run/file query layer, one commit each.
1. Fix: audit/artifact files leaking into the file list
cursor_list_workspace_filesbuilds its count and item-fetch queries separately; the count filteredfile_kind IN (original, redacted)but the fetch query omitted it. Soaudit(and would-beartifact) rows were returned in the list even though the total count excluded them — after running detection this showed up asanalysis.auditrows inlistFiles. Reapplies the document-kind filter to the fetch query.(Read-path only; existing audit rows stop appearing as soon as the server runs this — no migration, no data change.)
2. Feat: show input/output file names on runs
Runs exposed only
inputFileId/outputFileId(raw UUIDs). Now the file display names are resolved so a run renders without a follow-up lookup:LEFT JOINper query) and returns its name.run_file_namesquery method (indexed lookups; output only when present).PipelineRungainsinputFileName/outputFileName(omitted when absent, e.g. a file removed by retention).3. Refactor: name the query row types instead of positional tuples
PipelineRunListRow { run, account, pipeline_slug, input_file_name }instead of a growing(WithAccountRef, Handle, Option<String>)tuple (also clears clippy's very complex type).imported_files_for_connection→Vec<ImportedFileRef { source_key, file_id, storage_path }>andfiles_due_for_expiry→Vec<ExpiredFileRef { id, storage_path, storage_bucket }>— previously(String, Uuid, String)/(Uuid, String, String), same-typed positional fields a caller could transpose.#[derive(Queryable)]keeps the select tuples unchanged; the retention sweep and sync-reconciliation callers now read fields by name.Testing
Full gate green (check / fmt / clippy / doc / test).
🤖 Generated with Claude Code