Skip to content

feat(api): resolve analysis-run identity by idempotency key on loopback - #380

Draft
seonghobae wants to merge 1 commit into
feat/analysis-run-retry-lineage-get-gap-003afrom
feat/analysis-run-idempotency-lookup-get-gap-003a
Draft

feat(api): resolve analysis-run identity by idempotency key on loopback#380
seonghobae wants to merge 1 commit into
feat/analysis-run-retry-lineage-get-gap-003afrom
feat/analysis-run-idempotency-lookup-get-gap-003a

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

GAP-003A operator-visible idempotency-key lookup GET on the loopback analysis-run surface.

GET /v1/analysis-runs/by-idempotency/{idempotency_key} returns the metric-free identity of the unique consumer-scoped run that used that key. Collection GET (#368) is cursor-paginated. Stored-request GET (#377) and retry-lineage GET (#379) require a run_id. Retry HTTP (#369) mints a new key. Operators with a 202 receipt or log key cannot jump to that run without scanning pages.

Stacked on #379 (2040a763) over stored-request #377 over retry #369 over collection #368 over cancel #361 over protected main.

Issue: #166

Contract

  • HTTPS-only GET, empty body, no idempotency header, no credentials on the NARUON exchange. The key travels in the path.
  • Metric-free payload: run_id / run_state / idempotency_key.
  • Forbidden keys: rmse, bias, coverage, SE-gate, scientific_acceptance, report, terminal_result, tenant_workspace_id, snapshot_id.
  • Consumer-isolated. Zero matches and more than one match fail closed (no tenant oracle). Consumer mismatch → 400. Oversized key → 413.
  • Path decoder refuses collection, GET-by-id, /cancel, /retry, /retries, /request, /running, /terminal, and reserved by-idempotency as a key.
  • GET-by-id remains 400 on this stack (owned by feat(api): serve scientific acceptance only on loopback status GET #359). Collection GET remains 200 and does not become a key index. Stored-request GET remains 200. Retry-lineage GET remains 200.

ADR

This slice uses ADR 0037 (docs/adr/0037-analysis-run-idempotency-lookup-get.md).

Do not reuse 0030 (#362/#364/#373), 0031 (#368), 0032 (#369/#370/#371), 0033 (#372/#375/#378), 0034 (#374/#377), 0035 (#379), or 0036 (#376). Next free ADR is 0038.

Not this PR (live — do not duplicate)

Verification (local)

  • cargo clippy -p tepp_api --all-targets -- -D warnings
  • cargo test -p tepp_api --all-targets (92 lib tests including idempotency lookup)
  • RUSTDOCFLAGS='-D warnings' cargo doc -p tepp_api --no-deps
  • python3 scripts/validate_documentation.py
  • python3 scripts/check_docstrings.py

Head: ed21a10579d69faf4182ef6c07004fd622983a1e

Do not self-approve. Do not --admin merge. Ruleset 18156473 requires two independent current-head APPROVE reviews. Copilot/Devin/CodeRabbit COMMENTED is not independent APPROVE.

GAP-003A operator-visible lookup GET. Collection is cursor-paginated;
stored-request and retry-lineage require a run_id; retry mints a new key.
GET /v1/analysis-runs/by-idempotency/{key} returns the metric-free identity
of the unique consumer-scoped run that used that key.

ADR 0037. Stacked on retry-lineage GET (#379).
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This was referenced Aug 31, 2026
@seonghobae seonghobae added the enhancement New feature or request label Sep 2, 2026 — with ChatGPT Codex Connector

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head COMMENT on ed21a10 (draft). Unique occupied: GET /v1/analysis-runs/by-idempotency/{key} (ADR 0037). Dual-identity analysis-run lookup is occupied with CLI #401; do not duplicate. Metric-free identity only. Forbidden keys include rmse family, se_gate, scientific_acceptance. CLI stacked on #401. Do not un-draft. Zero reviews on this SHA before this COMMENT. Never self-approve. Persistence remains GAP-003B. Do not weaken fail-closed. No Buyer language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant