Skip to content

feat(api): inspect analysis-run retry parent on loopback - #384

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

feat(api): inspect analysis-run retry parent on loopback#384
seonghobae wants to merge 1 commit into
feat/analysis-run-idempotency-lookup-get-gap-003afrom
feat/analysis-run-retry-parent-get-gap-003a

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

GAP-003A operator-visible retry-parent GET on the loopback analysis-run surface.

GET /v1/analysis-runs/{run_id}/parent returns the metric-free parent identity of a listed run. Retry-lineage GET (#379) lists children of a parent. Collection GET (#368) does not leak retried_from. Idempotency-key lookup GET (#380) resolves a key to a run_id without linkage. Operators looking at a retry child cannot see which parent it came from.

Stacked on #380 (ed21a105) over retry-lineage #379 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.
  • Metric-free payload: run_id / run_state / idempotency_key / parent ({run_id, run_state, idempotency_key} or JSON null). The parent key is always present.
  • Original (never-retried) run: 200 with "parent": null.
  • Retry child: 200 with parent identity from LiveAnalysisRun.retried_from_run_id.
  • Forbidden keys: rmse, bias, coverage, SE-gate, scientific_acceptance, report, terminal_result, tenant_workspace_id. Response JSON also refuses snapshot_id / retried_from leak.
  • Consumer-isolated. Consumer mismatch / unknown / missing parent identity → 400. Oversized id → 413.
  • Path decoder refuses collection, GET-by-id, /cancel, /retry, /retries, /request, /running, /terminal, /by-idempotency.
  • 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 leak retried_from. Retry-lineage GET remains 200. Stored-request GET remains 200. Idempotency lookup remains 200.

ADR

This slice uses ADR 0038 (docs/adr/0038-analysis-run-retry-parent-get.md).

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

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 (97 lib tests including retry-parent GET)
  • RUSTDOCFLAGS='-D warnings' cargo doc -p tepp_api --no-deps
  • python3 scripts/validate_documentation.py
  • python3 scripts/check_docstrings.py

Head: c12ea6005c808fad36e782f5d175f7d85a28170e

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 parent GET. Retry-lineage lists children of a
parent; collection does not leak retried_from; idempotency lookup returns
a run_id without linkage. GET /v1/analysis-runs/{run_id}/parent returns
the metric-free parent identity, or null when the run was never retried.

ADR 0038. Stacked on idempotency-key lookup GET (#380).
@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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant