feat(api): wire research access without key release (P43) #204
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 492 lines diff across 6 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.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #204"
general
weight: 0.35
abendrothj
What and why
Implements P43 in
docs/V1_PLAN.md("Wire research access in the production binary, independently of key release"). It moves toward definition-of-done items 2 and 3 indocs/PROJECT_SCOPE.md.Catalog, access requests, grants and budgets need no key material. They lived on
ConnectorQueryService, though, and the binary builds that only when key release is configured. So in the shipped binary every catalog, access-request, grant and budget route answered 503, and nothing in the research portal past sign-in could run against it.research::ResearchServiceholds the grant, budget and catalog stores, the default budget andk. It is its ownAppStatefield (AppState::research). The catalog, access-request, grant and budget handlers depend only on it, and answer 503 "research access not configured" when it is missing.ConnectorQueryService::with_researchtakes the sameArc<ResearchService>, andresearch_querychecks and charges grants through it, so the grant a route creates is the one a research query checks and charges. The query service also takeskfrom it, soRESEARCH_MIN_COHORT_SIZEstill reaches own-data ZK queries.main()intoplatform_api::wiring::build_state, which tests call to run the binary's exact wiring. It always builds research access fromconfig.researchover in-memory stores, and logs a startup warning that they are lost on restart (P62 makes them durable). The query, research-query and attestation routes still need key release and still answer 503 without it. Attestation stays required, and no dev key provider is used.approved_budget,create_unless_revokedand theretry=true/deniedaudit events move toResearchServiceas they were.DevResearchStack::query_serviceandquery_service_with_attestationnow take theArc<ResearchService>in place of the cohort size and default budget. Devstack and the test builders create oneArcand give it to both the query service andAppState.How it was tested
New tests in
platform-api/tests/research_wiring.rsrun against the binary's own wiring (build_statewith onlyJWT_HS256_SECRETset):the_binary_wires_research_access_without_a_query_service: research access is wired and the query service is not.research_routes_answer_while_queries_stay_fail_closed: publish, browse, request, list requests, approve (with the listing's budget) and a direct grant all answer 200.POST /api/v1/research/queryandPOST /api/v1/queryanswer 503 "confidential query not available", and the refused research query charges nothing.research_routes_refuse_without_a_research_layer: with no research service, all twelve catalog, access-request, grant and budget routes answer 503 "research access not configured".Existing tests changed only in setup: they set the new field, and the research-enabled builders share one
Arc. No assertions changed. The approval-retry tests,research_catalog_is_auditedand the rest ofaudit_coverage.rspass through the new path.scripts/check.shpasses in full: fmt, check and clippy (-D warnings, workspace, all targets,--locked), 447 Rust tests, the wasm and frontend steps (164 frontend tests), and the guards.platform-apialso checks and lints cleanly without thedevfeature.Checklist
scripts/check.shpasses locallySECURITY_AUDIT_EVENTcovered byaudit_coverage.rsdocs/DATA_POLICY.md)CHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made