Skip to content

feat(api): consolidate interpretation-run stored-request GET and CLI - #454

Closed
seonghobae wants to merge 2 commits into
feat/interpretation-run-retrieval-get-gap-003afrom
feat/interpretation-run-stored-request-cli-gap-003a
Closed

feat(api): consolidate interpretation-run stored-request GET and CLI#454
seonghobae wants to merge 2 commits into
feat/interpretation-run-retrieval-get-gap-003afrom
feat/interpretation-run-stored-request-cli-gap-003a

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Superseded by fold into #467

Strict ancestry was verified before closure: #454 exact head c911fbcd6e13046358cc7f3692775ed4b008dadd is the merge base of #467, and #467 was one commit ahead with zero commits behind. #467 was retargeted to this PR's former base, so the complete stored-request GET/CLI implementation, tests, RED/GREEN lineage and review history remain in the surviving Analysis Run landing vehicle. This PR is closed only to reduce duplicate WIP; its discussion remains immutable evidence.

Consolidated landing vehicle history

This PR previously folded predecessor #453 into one Analysis Run / contextual-orchestrator stored-request application-adapter vehicle. The head contains #453 as its direct ancestor and preserves /v1/interpretation-runs/{idempotency_key}/request, hostile identity/header/credential refusals, empty-body and cancel-route refusal, scientific_authority=false, and the published tepp-interpretation-run-request get CLI with fail-closed bind/origin/consumer/input behavior.

This is an application/adapter lineage record, not independent bounded-context or per-route ADR authority. Current landing work continues on #467 under queue-authority policy.

…nt GET

Publish GET /v1/interpretation-runs/{idempotency_key}/request so operators
fetch the accepted create request without POST replay. scientific_authority
stays false. Naruon and LineageWeave are refused. NaruonLiveService stays
POST-only. Cancel extra-segment stays refused. ADR 0085.
…d CLI

Publish tepp-interpretation-run-request get so operators retrieve the stored
create request on spawned tepp-orchestrator-loopback TCP without POST replay.
scientific_authority stays false. Empty stdin is admitted. Naruon and
LineageWeave are refused. NaruonLiveService stays POST-only. Cancel extra-
segment stays refused. ADR 0086.
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 7ac97fd8-575e-47bc-b8b1-a1ed689e72e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 6 new potential issues.

Devin Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Coverage evidence remains incomplete

The new CLI leaves response parsing, rendering, size-limit, transport, header, and flag branches untested. Repository rules require 100% production line and branch coverage.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +70 to +76
let idempotency_key = decode_path_segment(encoded_id)?;
require_nonempty(&idempotency_key)?;
if idempotency_key.contains('/') || idempotency_key.contains('\0') {
return Err(OrchestratorLiveError::InvalidWirePayload);
}
if idempotency_key.len() > INTERPRETATION_RUN_RETRIEVAL_ID_MAX_LEN {
return Err(OrchestratorLiveError::LimitExceeded);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Accepted request keys become unretrievable

interpretation_run_stored_request_path_id rejects slashes, controls, and keys over 128 bytes, but POST validation accepts them. Those accepted requests cannot be retrieved.

Prompt for agents
Align interpretation-run POST identity validation with every retrieval path. InterpretationRunRequest::validate currently accepts slash-containing, control-containing, and arbitrarily long idempotency keys, while interpretation_run_stored_request_path_id and its exchange reject those identities. Either reject unsupported identities before storing a POST or define one reversible bounded path encoding accepted consistently by POST, collection, GET-by-id, stored-request GET, and both CLIs. Add integration tests that create each boundary identity and then retrieve its stored request.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +191 to +192
if is_interpretation_run_stored_request_path(path) {
return self.get_interpretation_run_stored_request(path, &headers, body);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Oversized paths return the wrong status

is_interpretation_run_stored_request_path discards every parse error, so an oversized stored-request path reaches the wrong parser. The service returns 400 instead of 413.

Prompt for agents
Preserve stored-request path parser errors during dispatch. Route based on the endpoint shape without converting interpretation_run_stored_request_path_id errors into false, then let get_interpretation_run_stored_request return LimitExceeded for an oversized identity. Keep unrelated extra-segment paths on the invalid-route path, and add a service-level test asserting HTTP 413 for a stored-request identity over the documented limit.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +96 to +104
require_nonempty(origin)?;
if !origin.starts_with("https://") || origin.ends_with('/') {
return Err(OrchestratorLiveError::InvalidWirePayload);
}
let rest = origin
.strip_prefix("https://")
.ok_or(OrchestratorLiveError::InvalidWirePayload)?;
if rest.contains('@') || rest.contains('?') || rest.contains('#') || rest.contains('\\') {
return Err(OrchestratorLiveError::InvalidWirePayload);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Origins with paths break CLI requests

contextual_orchestrator_interpretation_run_stored_request_exchange accepts an origin containing a path, then appends the endpoint beneath it. CLI composition rejects the resulting route, so the invocation cannot execute.

Prompt for agents
Validate origin as an HTTPS origin rather than a string prefix. Reject any path, query, fragment, userinfo, empty authority, or malformed authority before constructing target_url, while retaining valid host and port forms. Add tests showing that an origin such as https://tepp.example.test/base fails during invocation or exchange validation rather than producing a route rejected later by loopback_http1_from_interpretation_run_stored_request_exchange.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +333 to +334
let bytes = read_bounded(&mut stream, MAXIMUM_HTTP_RESPONSE_BYTES)?;
parse_http_response(&bytes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Response framing assumes connection close

execute_interpretation_run_stored_request_cli reads until EOF instead of stopping at Content-Length. A future keep-alive listener would turn complete responses into timeouts.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +154 to +175
fn refuse_metrics_on_json(value: &serde_json::Value) -> Result<(), OrchestratorLiveError> {
match value {
serde_json::Value::Object(object) => {
if FORBIDDEN_STORED_REQUEST_KEYS
.iter()
.any(|key| object.contains_key(*key))
{
return Err(OrchestratorLiveError::InvalidWirePayload);
}
for nested in object.values() {
refuse_metrics_on_json(nested)?;
}
Ok(())
}
serde_json::Value::Array(items) => {
for nested in items {
refuse_metrics_on_json(nested)?;
}
Ok(())
}
_ => Ok(()),
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Metric filter preserves valid requests

The recursive forbidden-key check cannot reject accepted content. InterpretationRunRequest has fixed fields, and user-provided evidence identifiers remain string values rather than object keys.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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