From 2a4d5c8735188e18e2ab2e085b73c48bf7362807 Mon Sep 17 00:00:00 2001 From: Puma Date: Sat, 3 Oct 2026 08:16:19 -0700 Subject: [PATCH] style(rust): apply pinned formatter to repair milestones --- .../src/tests.rs | 8 +-- .../src/node_execution_ledger.rs | 70 ++++++++++--------- .../src/technical_fit_tests.rs | 21 +++--- .../src/graph/inference_validation_state.rs | 8 +-- .../src/scheduler/task_orchestrator.rs | 6 +- .../executable_validation_snapshot.rs | 8 +-- .../src/workflow/session_execution_api.rs | 8 +-- .../src/workflow/session_scheduler_runner.rs | 44 ++++++------ .../src/workflow/task_execution_worker.rs | 22 +++--- .../workflow/tests/task_binding_resolution.rs | 8 +-- .../src/workflow/tests/task_graph.rs | 8 +-- .../2026-10-03-pinned-rustfmt-correction.md | 21 ++++++ 12 files changed, 132 insertions(+), 100 deletions(-) create mode 100644 docs/plans/domain-architecture-and-multimodal/reports/2026-10-03-pinned-rustfmt-correction.md diff --git a/crates/pantograph-diagnostics-ledger/src/tests.rs b/crates/pantograph-diagnostics-ledger/src/tests.rs index 2948baa34..5d8ff19ba 100644 --- a/crates/pantograph-diagnostics-ledger/src/tests.rs +++ b/crates/pantograph-diagnostics-ledger/src/tests.rs @@ -6485,8 +6485,8 @@ fn sample_inference_execution_diagnostic_event() -> DiagnosticEventAppendRequest privacy_class: DiagnosticEventPrivacyClass::SystemMetadata, retention_class: DiagnosticEventRetentionClass::AuditMetadata, payload_ref: None, - payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved( - Box::new(InferenceExecutionDiagnosticObservedPayload { + payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved(Box::new( + InferenceExecutionDiagnosticObservedPayload { request_id: "req-a".to_string(), task_id: "text_generation".to_string(), lifecycle_phase: Some("task_validation".to_string()), @@ -6552,8 +6552,8 @@ fn sample_inference_execution_diagnostic_event() -> DiagnosticEventAppendRequest message: Some("not mapped by this backend boundary".to_string()), }, ], - }), - ), + }, + )), } } diff --git a/crates/pantograph-embedded-runtime/src/node_execution_ledger.rs b/crates/pantograph-embedded-runtime/src/node_execution_ledger.rs index 183fa5f49..9abde039f 100644 --- a/crates/pantograph-embedded-runtime/src/node_execution_ledger.rs +++ b/crates/pantograph-embedded-runtime/src/node_execution_ledger.rs @@ -532,28 +532,30 @@ impl NodeExecutionWorkflowLedgerSink { privacy_class: artifact.privacy_class, retention_class: artifact.retention_class, payload_ref: artifact.payload_ref, - payload: DiagnosticEventPayload::IoArtifactObserved(Box::new(IoArtifactObservedPayload { - artifact_fact_id: Some(artifact.artifact_fact_id), - payload_artifact_id: Some(artifact.payload_artifact_id), - artifact_id: artifact.artifact_id, - artifact_role, - logical_payload_lineage_id: Some(artifact.logical_payload_lineage_id), - producer_node_id, - producer_port_id, - consumer_node_id, - consumer_port_id, - media_type: artifact.media_type, - size_bytes: artifact.size_bytes, - content_hash: artifact.content_hash, - retention_state: Some(artifact.retention_state), - retention_reason: artifact.retention_reason, - payload_kind: artifact.payload_kind, - lifecycle_state: artifact.lifecycle_state, - access_modes: artifact.access_modes, - read_handle: artifact.read_handle, - stream_handle: None, - format: artifact.format, - })), + payload: DiagnosticEventPayload::IoArtifactObserved(Box::new( + IoArtifactObservedPayload { + artifact_fact_id: Some(artifact.artifact_fact_id), + payload_artifact_id: Some(artifact.payload_artifact_id), + artifact_id: artifact.artifact_id, + artifact_role, + logical_payload_lineage_id: Some(artifact.logical_payload_lineage_id), + producer_node_id, + producer_port_id, + consumer_node_id, + consumer_port_id, + media_type: artifact.media_type, + size_bytes: artifact.size_bytes, + content_hash: artifact.content_hash, + retention_state: Some(artifact.retention_state), + retention_reason: artifact.retention_reason, + payload_kind: artifact.payload_kind, + lifecycle_state: artifact.lifecycle_state, + access_modes: artifact.access_modes, + read_handle: artifact.read_handle, + stream_handle: None, + format: artifact.format, + }, + )), }; self.workflow_service @@ -951,8 +953,8 @@ fn build_kv_cache_diagnostic_event_ledger_append_request( privacy_class: DiagnosticEventPrivacyClass::SystemMetadata, retention_class: DiagnosticEventRetentionClass::AuditMetadata, payload_ref: None, - payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved( - Box::new(InferenceExecutionDiagnosticObservedPayload { + payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved(Box::new( + InferenceExecutionDiagnosticObservedPayload { request_id: format!("{task_id}:kv_cache"), task_id: "kv_cache".to_string(), lifecycle_phase: Some("kv_cache".to_string()), @@ -981,8 +983,8 @@ fn build_kv_cache_diagnostic_event_ledger_append_request( .take(MAX_INFERENCE_OPTION_DIAGNOSTICS) .map(kv_cache_option_diagnostic_summary) .collect(), - }), - ), + }, + )), }) } @@ -1047,8 +1049,8 @@ fn build_runtime_settings_diagnostic_event_ledger_append_request( privacy_class: DiagnosticEventPrivacyClass::SystemMetadata, retention_class: DiagnosticEventRetentionClass::AuditMetadata, payload_ref: None, - payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved( - Box::new(InferenceExecutionDiagnosticObservedPayload { + payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved(Box::new( + InferenceExecutionDiagnosticObservedPayload { request_id: format!("{task_id}:runtime_settings"), task_id: "runtime_settings".to_string(), lifecycle_phase: Some("runtime_settings".to_string()), @@ -1075,8 +1077,8 @@ fn build_runtime_settings_diagnostic_event_ledger_append_request( compatibility_issues: Vec::new(), option_support_counts: InferenceOptionSupportCounts::default(), option_diagnostics: Vec::new(), - }), - ), + }, + )), }) } @@ -1146,8 +1148,8 @@ fn build_inference_diagnostic_event_ledger_append_request( privacy_class: DiagnosticEventPrivacyClass::SystemMetadata, retention_class: DiagnosticEventRetentionClass::AuditMetadata, payload_ref: None, - payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved( - Box::new(InferenceExecutionDiagnosticObservedPayload { + payload: DiagnosticEventPayload::InferenceExecutionDiagnosticObserved(Box::new( + InferenceExecutionDiagnosticObservedPayload { request_id: event .request_id .clone() @@ -1196,8 +1198,8 @@ fn build_inference_diagnostic_event_ledger_append_request( .take(MAX_INFERENCE_OPTION_DIAGNOSTICS) .map(option_diagnostic_summary) .collect(), - }), - ), + }, + )), }) } diff --git a/crates/pantograph-runtime-registry/src/technical_fit_tests.rs b/crates/pantograph-runtime-registry/src/technical_fit_tests.rs index ad0971b37..570112317 100644 --- a/crates/pantograph-runtime-registry/src/technical_fit_tests.rs +++ b/crates/pantograph-runtime-registry/src/technical_fit_tests.rs @@ -2563,15 +2563,18 @@ fn selector_reports_resource_accounting_overflow_before_selection() { assert_eq!(decision.selected_candidate_id, None); assert_eq!(decision.device_diagnostics.len(), 1); - assert_eq!(serde_json::to_value(&decision.device_diagnostics[0]).unwrap(), serde_json::json!({ - "code": "resource_accounting_overflow", - "severity": "error", - "message": "technical-fit resource accounting overflowed while summing active ram_bytes claims for runtime 'runtime-overflow'", - "runtime_id": "runtime-overflow", - "backend_key": "pytorch", - "evidence_key": "ram_bytes", - "requested_runtime_key": "pytorch" - })); + assert_eq!( + serde_json::to_value(&decision.device_diagnostics[0]).unwrap(), + serde_json::json!({ + "code": "resource_accounting_overflow", + "severity": "error", + "message": "technical-fit resource accounting overflowed while summing active ram_bytes claims for runtime 'runtime-overflow'", + "runtime_id": "runtime-overflow", + "backend_key": "pytorch", + "evidence_key": "ram_bytes", + "requested_runtime_key": "pytorch" + }) + ); assert_eq!( decision.device_diagnostics[0].code, RuntimeTechnicalFitDeviceDiagnosticCode::ResourceAccountingOverflow diff --git a/crates/pantograph-workflow-service/src/graph/inference_validation_state.rs b/crates/pantograph-workflow-service/src/graph/inference_validation_state.rs index 000e8c783..5b5186a60 100644 --- a/crates/pantograph-workflow-service/src/graph/inference_validation_state.rs +++ b/crates/pantograph-workflow-service/src/graph/inference_validation_state.rs @@ -1467,8 +1467,8 @@ impl CurrentInferenceValidationNodeRecord { message: format!("dependency requirements proof is not current: {error:?}"), }, )?; - return Ok(WorkflowSchedulerInferenceTaskProjection::Ready( - Box::new(WorkflowSchedulerReadyInferenceTaskProjection { + return Ok(WorkflowSchedulerInferenceTaskProjection::Ready(Box::new( + WorkflowSchedulerReadyInferenceTaskProjection { node_id: pantograph_scheduler::SchedulerNodeId::parse(self.node_id.as_str()) .map_err(|error| { CurrentInferenceSchedulerProjectionError::IncompleteNodeState { @@ -1532,8 +1532,8 @@ impl CurrentInferenceValidationNodeRecord { .dependency_override_fingerprint .clone(), }, - }), - )); + }, + ))); } Ok(WorkflowSchedulerInferenceTaskProjection::Blocked( diff --git a/crates/pantograph-workflow-service/src/scheduler/task_orchestrator.rs b/crates/pantograph-workflow-service/src/scheduler/task_orchestrator.rs index 47365ce4b..34c3167df 100644 --- a/crates/pantograph-workflow-service/src/scheduler/task_orchestrator.rs +++ b/crates/pantograph-workflow-service/src/scheduler/task_orchestrator.rs @@ -2115,9 +2115,9 @@ fn dispatch_selected_handoff_from_selection( ) -> Result { if selection.state != SchedulerDispatchSelectionState::Selected { return Err( - WorkflowSchedulerTaskOrchestratorError::RuntimeDispatchSelectionNoSelection( - Box::new(selection), - ), + WorkflowSchedulerTaskOrchestratorError::RuntimeDispatchSelectionNoSelection(Box::new( + selection, + )), ); } let Some(dispatch_decision) = selection.dispatch_decision else { diff --git a/crates/pantograph-workflow-service/src/workflow/executable_validation_snapshot.rs b/crates/pantograph-workflow-service/src/workflow/executable_validation_snapshot.rs index 7c35fa013..ea29b7d88 100644 --- a/crates/pantograph-workflow-service/src/workflow/executable_validation_snapshot.rs +++ b/crates/pantograph-workflow-service/src/workflow/executable_validation_snapshot.rs @@ -491,8 +491,8 @@ impl WorkflowExecutableValidationSnapshotNode { } })?; - Ok(WorkflowSchedulerInferenceTaskProjection::Ready( - Box::new(WorkflowSchedulerReadyInferenceTaskProjection { + Ok(WorkflowSchedulerInferenceTaskProjection::Ready(Box::new( + WorkflowSchedulerReadyInferenceTaskProjection { node_id: scheduler_node_id, descriptor_fingerprint: self.descriptor_fingerprint.clone(), task_type, @@ -504,8 +504,8 @@ impl WorkflowExecutableValidationSnapshotNode { dependency_readiness_source: workflow_scheduler_dependency_readiness_source( snapshot, self, )?, - }), - )) + }, + ))) } } diff --git a/crates/pantograph-workflow-service/src/workflow/session_execution_api.rs b/crates/pantograph-workflow-service/src/workflow/session_execution_api.rs index 8b6727ed0..921c7ef0c 100644 --- a/crates/pantograph-workflow-service/src/workflow/session_execution_api.rs +++ b/crates/pantograph-workflow-service/src/workflow/session_execution_api.rs @@ -1353,8 +1353,8 @@ impl WorkflowService { privacy_class: metadata.privacy_class, retention_class: metadata.retention_class, payload_ref: metadata.payload_ref.clone(), - payload: DiagnosticEventPayload::IoArtifactObserved( - Box::new(IoArtifactObservedPayload { + payload: DiagnosticEventPayload::IoArtifactObserved(Box::new( + IoArtifactObservedPayload { artifact_fact_id: Some(metadata.artifact_fact_id), payload_artifact_id: Some(metadata.payload_artifact_id), artifact_id: metadata.artifact_id, @@ -1391,8 +1391,8 @@ impl WorkflowService { read_handle: metadata.read_handle, stream_handle: metadata.stream_handle, format: metadata.format, - }), - ), + }, + )), }, )?; } diff --git a/crates/pantograph-workflow-service/src/workflow/session_scheduler_runner.rs b/crates/pantograph-workflow-service/src/workflow/session_scheduler_runner.rs index e89b18850..bf65931b2 100644 --- a/crates/pantograph-workflow-service/src/workflow/session_scheduler_runner.rs +++ b/crates/pantograph-workflow-service/src/workflow/session_scheduler_runner.rs @@ -513,16 +513,18 @@ impl<'a> WorkflowSchedulerSessionRunner<'a> { "scheduler non-runtime task completion failed: {error}" )) })?; - self.record_scheduler_task_attempt_terminal(WorkflowSchedulerTaskAttemptTerminalInput { - task: started.task(), - attempt_id: started.attempt_id().as_str(), - started_at_ms: started.started_at_ms(), - transition: SchedulerTaskAttemptLifecycleTransition::Completed, - reason: "scheduler task attempt completed", - error_summary: None, - selected_dispatch: None, - terminal_mutation: None, - })?; + self.record_scheduler_task_attempt_terminal( + WorkflowSchedulerTaskAttemptTerminalInput { + task: started.task(), + attempt_id: started.attempt_id().as_str(), + started_at_ms: started.started_at_ms(), + transition: SchedulerTaskAttemptLifecycleTransition::Completed, + reason: "scheduler task attempt completed", + error_summary: None, + selected_dispatch: None, + terminal_mutation: None, + }, + )?; } Err( crate::scheduler::WorkflowSchedulerTaskOrchestratorError::NonRuntimeTaskAdapter( @@ -541,16 +543,18 @@ impl<'a> WorkflowSchedulerSessionRunner<'a> { &error, ); if failed.is_ok() { - self.record_scheduler_task_attempt_terminal(WorkflowSchedulerTaskAttemptTerminalInput { - task: started.task(), - attempt_id: started.attempt_id().as_str(), - started_at_ms: started.started_at_ms(), - transition: SchedulerTaskAttemptLifecycleTransition::Failed, - reason: "scheduler non-runtime task execution failed", - error_summary: Some(error.to_string()), - selected_dispatch: None, - terminal_mutation: None, - })?; + self.record_scheduler_task_attempt_terminal( + WorkflowSchedulerTaskAttemptTerminalInput { + task: started.task(), + attempt_id: started.attempt_id().as_str(), + started_at_ms: started.started_at_ms(), + transition: SchedulerTaskAttemptLifecycleTransition::Failed, + reason: "scheduler non-runtime task execution failed", + error_summary: Some(error.to_string()), + selected_dispatch: None, + terminal_mutation: None, + }, + )?; } return Err(WorkflowServiceError::InvalidRequest(format!( "scheduler non-runtime task execution failed: {error}" diff --git a/crates/pantograph-workflow-service/src/workflow/task_execution_worker.rs b/crates/pantograph-workflow-service/src/workflow/task_execution_worker.rs index e632a73db..2f2116309 100644 --- a/crates/pantograph-workflow-service/src/workflow/task_execution_worker.rs +++ b/crates/pantograph-workflow-service/src/workflow/task_execution_worker.rs @@ -1124,12 +1124,14 @@ impl WorkflowTaskExecutionWorkerOutcome { response: WorkflowRunResponse, diagnostics: Vec, ) -> Self { - Self::RuntimeBranchCompleted(Box::new(WorkflowTaskExecutionWorkerRuntimeBranchCompletedOutcome { - session_id: command.session_id.clone(), - workflow_run_id: command.workflow_run_id.clone(), - response, - diagnostics, - })) + Self::RuntimeBranchCompleted(Box::new( + WorkflowTaskExecutionWorkerRuntimeBranchCompletedOutcome { + session_id: command.session_id.clone(), + workflow_run_id: command.workflow_run_id.clone(), + response, + diagnostics, + }, + )) } pub(super) fn runtime_branch_failed( @@ -1369,14 +1371,14 @@ async fn claim_and_execute_runtime_branch_event( ) .await { - Ok(response) => WorkflowTaskExecutionWorkerOutcome::RuntimeBranchCompleted( - Box::new(WorkflowTaskExecutionWorkerRuntimeBranchCompletedOutcome { + Ok(response) => WorkflowTaskExecutionWorkerOutcome::RuntimeBranchCompleted(Box::new( + WorkflowTaskExecutionWorkerRuntimeBranchCompletedOutcome { session_id: command.session_id.clone(), workflow_run_id: command.workflow_run_id.clone(), response, diagnostics: Vec::new(), - }), - ), + }, + )), Err(error) => WorkflowTaskExecutionWorkerOutcome::runtime_branch_failed( command, error.to_string(), diff --git a/crates/pantograph-workflow-service/src/workflow/tests/task_binding_resolution.rs b/crates/pantograph-workflow-service/src/workflow/tests/task_binding_resolution.rs index 186d08109..18f14a6a8 100644 --- a/crates/pantograph-workflow-service/src/workflow/tests/task_binding_resolution.rs +++ b/crates/pantograph-workflow-service/src/workflow/tests/task_binding_resolution.rs @@ -33,8 +33,8 @@ fn workflow_run_id() -> WorkflowRunId { fn inference_projection() -> WorkflowSchedulerInferenceTaskProjections { WorkflowSchedulerInferenceTaskProjections::from_records(vec![ - WorkflowSchedulerInferenceTaskProjection::Ready( - Box::new(WorkflowSchedulerReadyInferenceTaskProjection { + WorkflowSchedulerInferenceTaskProjection::Ready(Box::new( + WorkflowSchedulerReadyInferenceTaskProjection { node_id: SchedulerNodeId::parse("infer").expect("node id"), descriptor_fingerprint: InferenceInterfaceFingerprint::parse("iface.binding.v1") .expect("fingerprint"), @@ -50,8 +50,8 @@ fn inference_projection() -> WorkflowSchedulerInferenceTaskProjections { trait_settings: Vec::new(), estimate_hints: resource_estimate_hints(), dependency_readiness_source: dependency_readiness_source("iface.binding.v1"), - }), - ), + }, + )), ]) .expect("projection") } diff --git a/crates/pantograph-workflow-service/src/workflow/tests/task_graph.rs b/crates/pantograph-workflow-service/src/workflow/tests/task_graph.rs index ec9a18eaa..30d8d4611 100644 --- a/crates/pantograph-workflow-service/src/workflow/tests/task_graph.rs +++ b/crates/pantograph-workflow-service/src/workflow/tests/task_graph.rs @@ -44,8 +44,8 @@ fn ready_inference_projection( estimate_hints: Vec, ) -> WorkflowSchedulerInferenceTaskProjections { WorkflowSchedulerInferenceTaskProjections::from_records(vec![ - WorkflowSchedulerInferenceTaskProjection::Ready( - Box::new(WorkflowSchedulerReadyInferenceTaskProjection { + WorkflowSchedulerInferenceTaskProjection::Ready(Box::new( + WorkflowSchedulerReadyInferenceTaskProjection { node_id: SchedulerNodeId::parse("infer").expect("node id"), descriptor_fingerprint: InferenceInterfaceFingerprint::parse("iface.test.v1") .expect("fingerprint"), @@ -70,8 +70,8 @@ fn ready_inference_projection( }], estimate_hints, dependency_readiness_source: dependency_readiness_source("iface.test.v1"), - }), - ), + }, + )), ]) .expect("projection") } diff --git a/docs/plans/domain-architecture-and-multimodal/reports/2026-10-03-pinned-rustfmt-correction.md b/docs/plans/domain-architecture-and-multimodal/reports/2026-10-03-pinned-rustfmt-correction.md new file mode 100644 index 000000000..6ae6c11db --- /dev/null +++ b/docs/plans/domain-architecture-and-multimodal/reports/2026-10-03-pinned-rustfmt-correction.md @@ -0,0 +1,21 @@ +# Pinned rustfmt correction for the reviewed repair stack + +The full PR #39 format audit failed on wrapping and indentation introduced by recent boxed constructors and terminal calls. Reproduced locally with the repository-pinned Rust 1.92.0 toolchain: cargo 1.92.0 (344c4567c 2025-10-21), rustfmt 1.8.0-stable (ded5c06cf2 2025-12-08). Ran the actual `cargo fmt --all -- --check` before and after, rather than treating focused syntax/whitespace checks as format qualification. + +Formatted only the eleven files named by the pre-check (including the subsequent registry test assertion). No other baseline files were changed. The full post-check exits zero. A Rust lexer comparison preserves every non-whitespace token after ignoring optional trailing commas before closing delimiters; string/comment tokens remain exact. The registry test file has exact non-whitespace token equality. These are formatter changes, with no intended behavior or public API change; hosted aggregate qualification remains required. + +Changed source files: + +- `crates/pantograph-diagnostics-ledger/src/tests.rs` +- `crates/pantograph-embedded-runtime/src/node_execution_ledger.rs` +- `crates/pantograph-runtime-registry/src/technical_fit_tests.rs` +- `crates/pantograph-workflow-service/src/graph/inference_validation_state.rs` +- `crates/pantograph-workflow-service/src/scheduler/task_orchestrator.rs` +- `crates/pantograph-workflow-service/src/workflow/executable_validation_snapshot.rs` +- `crates/pantograph-workflow-service/src/workflow/session_execution_api.rs` +- `crates/pantograph-workflow-service/src/workflow/session_scheduler_runner.rs` +- `crates/pantograph-workflow-service/src/workflow/task_execution_worker.rs` +- `crates/pantograph-workflow-service/src/workflow/tests/task_binding_resolution.rs` +- `crates/pantograph-workflow-service/src/workflow/tests/task_graph.rs` + +The accepted registry commit c369cbe4b12b563eb8a5d4419e6e0ed729721137 and PR #39 history remain preserved. Root source review accepted frozen tree 62f3f04d4017d29592cc243167ae46841bcaa901 after checking the file list, pinned formatter/token receipts and representative full constructor/call diffs. The earlier red hosted format runs remain recorded; actual full hosted format and all other aggregate gates still require qualification.