Repository navigation
feat: expose document processing history and cross-namespace listing - #421
Draft
Frankie-Xu wants to merge 4 commits into
Draft
Frankie-Xu wants to merge 4 commits into
Frankie-Xu wants to merge 4 commits into
Conversation
Record maintainer ownership rules from Ontos-AI#232/Ontos-AI#231 so a later API change does not revive namespace or job-listing shortcuts. Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
This was referenced Sep 14, 2026
Frankie-Xu
marked this pull request as ready for review
September 14, 2026 18:54
…e-Xu/document-centric-list-history-rfc
Frankie-Xu
marked this pull request as draft
October 7, 2026 10:47
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.
Summary
Clients can inspect a document's processing attempts without treating the job ledger as a file registry.
GET /api/v1/documents/{document_id}/jobs(also v2) returns a paged ledger summary, including failed/running retries and older revisions. Private document history remains readable after archive. Authorization checks both the materialized document owner and each job owner; canonical result links take priority over metadata provenance.GET /documents?all_namespaces=trueexplicitly pages across the credential owner's non-archived private documents so clients can derive labels from documents. Existing omitted/blank namespace calls keep selectingdefault; an explicit namespace andall_namespaces=trueconflict with HTTP 400INVALID_ARGUMENT. Shared demo documents retain explicit namespace listing and expose an empty processing history.This implements the document-centric direction discussed in #231 and #232. Namespace remains client-owned, documents remain the corpus resource, and jobs remain the processing ledger. Those PR branches are unchanged. No namespace registry, namespace-filtered job listing or job deletion is added.
Draft design choices for review: the
all_namespacesparameter and null envelope namespace; history summary fields; canonical-result/metadata association precedence; empty shared-demo history. Initial uploads with no materialized document still require retaining the returned job ID. Counts/pages are separate reads with existing offset pagination semantics.Verification
30 actual HTTP/PostgreSQL history/document/job-read contracts passed (7 new history/list cases). These include v1/v2 old revision selection using the result ID returned by history, both before and after archive, tenant isolation, canonical-link precedence, shared demo privacy, namespace defaults and pagination. Synthetic fixtures use task-local storage directories.
Repository Ruff (
ruff check apps packages) and scoped Pyright passed for all changed/new Python files; registered history/list parameters verified in the actual v1/v2 OpenAPI schema.Full API/worker/shared Pyright in the API-only environment did not pass: 57 missing worker/optional imports, 2 diagnostics in unchanged worker files and 1 source-resolution warning. No changed API file had a diagnostic; full worker dependency validation remains unverified.
Independent source/spec review passed, including shared demo boundaries and consuming an older history result through the existing chunks selector before/after archive; Python parsing and
git diff --checkpassed.Worker parsing, model calls and deployment were not exercised for this read-only API change.
Current-head GitHub PR CI, Secret Scan and CodeQL workflows report
action_required; the PR has no reported check rollup. Remote CI has not passed.Deployment Notes
Checklist