feat(api): add the steward dataset listing route (P39) #246
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #246"
general
weight: 0.35
abendrothj
What and why
Plan item P39 (
docs/V1_PLAN.md). Closes #218. Definition-of-done item 1 ends with the steward able to "see it stored as ciphertext", and the publish form (#221) and dataset deletion (#219) need the steward's datasets by id. No route listed a tenant's research datasets:GET /api/v1/drive/objectslists drive objects only, andGET /api/v1/catalogonly published listings. This is the "Upload" step of the dataset lifecycle indocs/PROJECT_SCOPE.md.GET /api/v1/datasets, beside the upload route indatasets.rs, behind the same access-token middleware. The tenant comes from the token only. Like uploads, it needs only the vault and the configuration, so it answers where the query and research services are not configured.tenants/{tid}/connectors/: uploads, connector syncs and the datasetdevstackseeds. One function,snapshot::newest_committed, now picks the newest committed snapshot forholds(whichpublish_listingcalls) and for the newsnapshot::held_datasetsandsnapshot::held_dataset, so the list is exactly what publishing accepts.versionis the newest manifest's, read from its path.written_atcomes from the version (RFC 3339, to the millisecond).objects,object_countandciphertext_bytescover the objects stored at that version, so superseded snapshots awaiting pruning and uploads that have not committed are not counted.suiteis what the snapshot's plaintext record names (newsnapshot::recorded_suite). Nothing beyond what ADR 0012 makes operator-visible appears; the declared schema and row cap stay out.snapshot::held_dataset, one listing of its own paths), and described as it is then: a newer snapshot with its own record's suite, or, at the same version, with"suite": null. A dataset no longer held is left out.MAX_LISTED_OBJECTS(1000, the drive listing's cap from P41, #172) bounds both the datasets and the objects across them. More than that is refused with 422 rather than listed in part. A storage failure is 503 (transient, withRetry-After) or 502, never an empty list.data.access"ok" event (list_datasets count=N), or "denied" over the cap.TenantPaths::connectors_root, andTenantPaths::connector_of, which finds the dataset a path belongs to.docs/ARCHITECTURE.md(Steward upload, Catalog, and the capture-test list),docs/THREAT_MODEL.md(forged or rolled-back snapshots: the listing reports storage as it finds it),docs/PROJECT_SCOPE.md,README.md(the route, and acurlin the local-stack steps),CHANGELOG.md.For reviewers:
p52(#243), withp52merged in, so the base isp52and the diff is only this work. Retarget tomainonce #243 merges. The overlap with it is inCHANGELOG.md,docs/ARCHITECTURE.md,docs/PROJECT_SCOPE.md,docs/THREAT_MODEL.md,platform-api/src/lib.rs,audit_coverage.rsandplatform-storage/src/lib.rs.holds()for each dataset, which would cost one more storage listing per dataset. Both go throughnewest_committedon the same manifest paths, and tests check that every listed dataset can be published and that an unlisted one cannot.research.rsandresearch_api.rs. The route sits with the upload route instead: it is the same resource, and it works without the research service, which holds the vault only for the publish check. Its tests go in that route's test file,dataset_upload_api.rs, asdocs/TESTING.mdasks.list_entries, the same metadataVaultStore::usagesums) rather than separateusagecalls, so the ids, count and bytes always agree."suite": null. It is not dropped, because the list must matchholdsand #219's delete needs it, and it does not fail the whole listing either. Dropping every entry whose record is missing, as the drive listing drops a manifest deleted mid-listing, would hide a dataset that is still held after a re-upload; for drive, a missing manifest means the object is gone.humantime,chronoandchrono-tzunmaintained (RUSTSEC-2026-0542, -0543 and -0555), with no fixed release, and arrow, DataFusion 55 and object_store 0.13 depend on them.e973173adds an exception for each tobackend/deny.toml, saying why it does not apply and when it is revisited, plus a Security line inCHANGELOG.md, so this PR's audit passes.mainneeds the same exceptions before #243 and the other PRs pass; if they land there first, this PR takesmain's copy.backend/deny.toml(AxolDad, abendrothj, angelina0i0); no other changed path has one.How it was tested
New tests:
platform-api/tests/dataset_upload_api.rs:-
the_listing_shows_each_upload_as_the_current_snapshot: an empty list first; one entry after an upload, with every field checked; still one entry, at the new snapshot, after a re-upload; no other fields, so no declared column names;-
a_partial_upload_is_never_listed: a first upload that stops before its manifest lists nothing and cannot be published; one that stops after a committed upload leaves that upload listed;-
a_superseded_snapshots_objects_are_not_counted: an earlier snapshot's manifest and object back in storage, as after a failed prune;-
another_tenants_datasets_are_never_listed: the same status and body as a tenant that stored nothing; datasets of the same name in two tenants;-
synced_and_seeded_datasets_are_listed_as_publishing_sees_them: thedevstackseed, and two QuickBooks syncs plus an upload; sizes match storage; every listed dataset can be published and an unlisted one cannot;-
a_dataset_whose_record_is_unreadable_is_listed_without_a_suite: a malformed record, then a missing one;-
listing_without_an_access_token_is_401: no token,preauth,refresh;-
a_listing_over_the_cap_is_422: at the cap it lists; one dataset or one object more is refused;-
a_storage_failure_fails_the_listing: the listing or the record read fails, transiently (503 withRetry-After) or permanently (502);-
a_re_upload_during_a_listing_is_listed_as_the_new_snapshot: a real re-upload (commit_upload) commits and prunes between the listing and the record read; the entry is the new snapshot with its suite;-
a_dataset_removed_during_a_listing_is_not_listed: every object of the dataset is deleted at that point; the listing is empty and publishing agrees;-
a_storage_failure_while_reading_a_dataset_again_is_503: the record is pruned and the second read meets an outage.platform-api/tests/audit_coverage.rs:dataset_listing_is_audited(ok for 0 and 1 datasets, denied over the cap, with exact details and tenant).platform-connectors(snapshot.rs):held_datasets_lists_exactly_the_datasets_held(agreement betweenholds, the listing andheld_dataset, and another tenant),held_datasets_describe_only_the_current_snapshot,recorded_suite_reads_only_a_valid_record(a missing record told apart from an unreadable one).platform-storage:every_dataset_path_names_its_dataset_and_tenant;listing_is_isolated_per_tenant_prefixnow coversconnectors_root.platform-api(datasets.rs):write_times_cover_every_version, up to the largest version.Also run by hand on
devstack: the steward gets the seededhealthdataset, the researcher gets{"datasets":[]}, and a request without a token gets 401.Checklist
scripts/check.shpasses locally (its secret-scan step was skipped: gitleaks is not installed locally)SECURITY_AUDIT_EVENTcovered byaudit_coverage.rsdocs/DATA_POLICY.md): test data is generated in the testsCHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made (none: covered by ADR 0012 and ADR 0003, as the issue says)