feat(api): consolidate export idempotency lookup and quarantine-parity adapters - #466
Conversation
GAP-003A unique slice: AnalysisRunLiveService serves naruon-only
GET /v1/exports/by-idempotency/{idempotency_key} as a metric-free
export_id lookup. NaruonLiveService stays POST-only. ADR 0093.
Publish tepp-export-lookup lookup so operators can resolve a 200 naruon export authorization receipt to export_id on spawned tepp-loopback TCP without writing raw HTTP. Metric-free identity stdout. Empty stdin admitted. LineageWeave refused. NaruonLiveService stays POST-only.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No force-push. Stack stays on feat/export-idempotency-lookup-get-gap-003a.
Publish GET /v1/exports/by-idempotency/{idempotency_key}/request so
operators who hold a 200 authorization receipt can recover the stored
create without a second hop through export_id stored-request.
Metric-free. Zero and ambiguous matches fail closed. LineageWeave
refused. NaruonLiveService stays POST-only.
Publish tepp-export-lookup-request get as ADR 0099 parity. Valid origin and key still fail closed with authorization_denied. The CLI never prints a stored export-authorization request or tenant/principal fields. LineageWeave refused. NaruonLiveService stays POST-only.
Module and compose docs no longer promise stored-create stdout. The typed exchange remains authorization_denied after origin/key validation.
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head COMMENT on 71f34b890bbd096eee152947c5e22d9778d323e8 (not APPROVE; author COMMENT is not an independent approval under ruleset 18156473). Predecessor Checks/reviews do not transfer. Do not un-draft. Do not unstack onto main. Do not add GET to NaruonLiveService.
Fail-closed read at this SHA:
naruon_export_idempotency_lookup_stored_request_exchangevalidates origin/key syntax (slash, NUL, reservedby-idempotencyprefix, max length) then returnsApiError::AuthorizationDeniedwithout minting a disclosure exchange (export_idempotency_lookup_stored_request_http.rs).FORBIDDEN_STORED_REQUEST_KEYSincludestenant_workspace_idandprincipal_idplus scientific/terminal keys.tepp-export-lookup-requestdocuments that compose stays quarantined and never prints a stored export-authorization request; CLI contractcompose_stays_quarantined_and_never_discloses_stored_createassertsAuthorizationDeniedeven after a matching POST exists.- LineageWeave consumer and non-loopback hosts fail closed in
from_args.
Keep ADR 0099 quarantine. An idempotency key is replay identity, not a bearer credential. Reactivation still requires a versioned authenticated tenant-and-principal binding plus proven cross-tenant/cross-principal denial. Do not un-quarantine stored-request-by-client-key disclosure. Unique tepp-export-lookup / tepp-export-lookup-request plus ADR 0093+0094+0099+0100 remain occupied here (folded #465/#471/#474). mergeable_state=unstable — not merge-ready.
Consolidated Analysis Run / export lookup landing vehicle
This Draft is the surviving naruon-facing Analysis Run / export lookup application-adapter vehicle. It folds strict-ancestor one-operation PRs instead of keeping them as parallel WIP. #465 was folded first, #471 was folded after its cross-tenant disclosure defect was repaired and quarantined, and #474 has now been fast-forward folded after verifying
#466@12e8337d68d3263feab21c63cf66a8578e997d07was exactly #474's merge base and #474 was two commits ahead with no divergence. #465/#471/#474 remain immutable review and RED/GREEN history; their source is preserved on this branch.Preserved metric-free lookup behavior
GET /v1/exports/by-idempotency/{idempotency_key}dispatches before GET-by-id so the route prefix is not parsed as a server-assignedexport_id;tepp-export-lookup lookupexposes only the metric-free identity (export_id,decision_code,idempotency_key);by-idempotencyremains valid data after the route prefix.Stored-request-by-idempotency quarantine
The first stored-request GET implementation searched Naruon tenant namespaces using consumer + client key and could serialize
tenant_workspace_idandprincipal_idwithout authenticated tenant/principal scope. This vehicle therefore keepsGET /v1/exports/by-idempotency/{idempotency_key}/requestquarantined until a versioned authenticated tenant-and-principal authority binding exists and proves cross-tenant/cross-principal denial. An idempotency key is replay identity, never a bearer credential.The folded #474 CLI is quarantine parity, not disclosure:
tepp-export-lookup-request getvalidates its local inputs and calls the typed exchange builder, which returnsauthorization_denied; it does not print the stored authorization request or tenant/principal identity. This preserves fail-closed behavior instead of creating a separate supported route.DDD / queue authority
These GET/CLI mechanics are adapters inside the Analysis Run application context, not bounded contexts. Operation-specific ADR 0093/0094/0099/0100 records are implementation lineage pending repository-wide normalization under #437; one route, refusal, or CLI verb does not create architecture authority. Further compatible export-lookup mechanics must fold here or into a coherent successor rather than mint another micro-PR.
Reusable psychometric arithmetic remains outside this adapter. HTTP success/failure is never ADR 0014 scientific acceptance.
NaruonLiveServicestays POST-only.Current exact head:
71f34b890bbd096eee152947c5e22d9778d323e8.Merge gate
The latest fold invalidates predecessor-head hosted evidence as landing authority. Reacquire fresh exact-head Rust/documentation/security/SAST and 100% owned production line/branch coverage, re-fetch current reviews/threads, and obtain qualifying independent current-head approval under live organization rules. Keep the stored-request-by-idempotency resource quarantined unless authenticated scope is implemented and tested. No predecessor-head evidence transfer, force push, fail-open change, self-approval, or routine protection bypass.