fix: address 2025-11-25 conformance audit findings (#951)

* fix: interpret task ttl as milliseconds

* fix: use text/plain for default text mime type

* fix: include resource param in token refresh

* test: align conformance prompt args with runner

* ci: run server conformance suite on PRs

* ci: build client bin and gate pending scenarios
This commit is contained in:
Dale Seo 2026-07-02 22:42:35 -04:00 • committed by GitHub
commit bdf0c32e8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,6 +80,38 @@ async fn rejects_duplicate_operation_ids() {
assert!(format!("{err}").contains("already running"));
}
#[tokio::test]
async fn ttl_is_interpreted_as_milliseconds() {
let mut processor = OperationProcessor::new();
let descriptor = OperationDescriptor::new("slow", "dummy").with_ttl(50);
let future = Box::pin(async {
tokio::time::sleep(Duration::from_millis(500)).await;
Ok(Box::new(DummyTransport {
id: "slow".to_string(),
value: 0,
}) as Box<dyn OperationResultTransport>)
});
processor
.submit_operation(OperationMessage::new(descriptor, future))
.expect("submit operation");
tokio::time::sleep(Duration::from_millis(200)).await;
let results = processor.peek_completed();
assert_eq!(
results.len(),
1,
"50ms ttl should have timed out the operation well within 200ms"
);
match &results[0].result {
Err(err) => assert!(
err.to_string().contains("timed out"),
"unexpected error: {err}"
),
Ok(_) => panic!("expected the operation to time out, but it completed"),
}
}
#[test]
fn task_status_notification_param_preserves_meta() {
let raw = json!({