feat(api): cancel interpretation runs via loopback cancel CLI - #442
Conversation
GAP-003A unique slice stacked on cancel HTTP: published
tepp-interpretation-run-cancel cancel mints typed
contextual-orchestrator POST /v1/interpretation-runs/{key}/cancel
onto spawned tepp-orchestrator-loopback TCP. Naruon and
LineageWeave refused. ADR 0074.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
| let exchange = contextual_orchestrator_interpretation_run_cancel_exchange( | ||
| &invocation.origin, | ||
| &invocation.idempotency_key, | ||
| )?; |
There was a problem hiding this comment.
🟡 Long accepted runs cannot be cancelled
For accepted keys over 128 bytes, contextual_orchestrator_interpretation_run_cancel_exchange rejects cancellation before sending the request. Those runs remain registered.
Prompt for agents
Align interpretation-run creation and cancellation identity limits. InterpretationRunRequest validation currently accepts idempotency keys longer than INTERPRETATION_RUN_CANCEL_ID_MAX_LEN, while compose_interpretation_run_cancel_cli_http delegates to contextual_orchestrator_interpretation_run_cancel_exchange, which rejects keys over 128 bytes. Either enforce the same limit when creating runs, with compatibility consideration for existing accepted identities, or extend cancel path handling so every valid created key remains cancellable. Add an end-to-end test covering the boundary and an over-128-byte key.
Was this helpful? React with 👍 or 👎 to provide feedback.
| fn main() -> ExitCode { | ||
| match run() { | ||
| Ok(()) => ExitCode::SUCCESS, | ||
| Err(_) => ExitCode::FAILURE, | ||
| } | ||
| } | ||
|
|
||
| fn run() -> Result<(), OrchestratorLiveError> { | ||
| let args: Vec<String> = std::env::args().skip(1).collect(); | ||
| match args.first().map(String::as_str) { | ||
| Some("cancel") => run_cancel(&args), | ||
| _ => Err(OrchestratorLiveError::InvalidWirePayload), | ||
| } | ||
| } | ||
|
|
||
| fn run_cancel(args: &[String]) -> Result<(), OrchestratorLiveError> { | ||
| let body = read_interpretation_run_cancel_cli_stdin(io::stdin().is_terminal(), io::stdin())?; | ||
| let invocation = InterpretationRunCancelCliInvocation::from_args(args, body)?; | ||
| let response = execute_interpretation_run_cancel_cli(&invocation)?; | ||
| let stdout = render_interpretation_run_cancel_cli_stdout(&invocation, &response)?; | ||
| println!("{stdout}"); | ||
| Ok(()) |
|
Closing with replacement mapping to #174. This CLI only transports #440's unauthenticated destructive mutation; refusing credential-shaped CLI flags does not create an authorization boundary. Preserve CLI parsing/framing/stdout/refusal tests for the future authenticated contextual-orchestrator operations adapter. |
Summary
GAP-003A unique slice stacked on #440: published
tepp-interpretation-run-cancel cancelmints typedcontextual_orchestrator_interpretation_run_cancel_exchangeonto spawnedtepp-orchestrator-loopbackTCP so operators do not write HTTP by hand.contextual-orchestratoronly. Empty stdin admitted; leftover nonempty stdin fail closed.localhost,httporigin, unpublished consumer, pagination flags, and credential-shaped flags fail closed.claim_status=hypothetical,scientific_authority=false,cancelled=true.tepp.scientific_acceptance.v1, RMSE, bias, coverage, SE-gate,evidence_span_ids, andcausal_scorenever appear.liston feat(api): consolidate interpretation-run create and collection adapters #436 and retrieval CLIgeton feat(api): consolidate interpretation-run retrieval GET and CLI #439.NaruonLiveServicestays POST-only for analysis-run and export.Test plan
cargo test -p orchestrator_livecargo clippy -p orchestrator_live --all-targets -- -D warningscargo doc -p orchestrator_live --no-depspython3 scripts/validate_documentation.pypython3 scripts/check_docstrings.py