Skip to content

Commit dca1773

Browse files
author
Claude Sonnet (coordinator)
committed
fix(clippy): resolve all PR #71 review issues — unused imports, operator precedence, and_then→map
- C1: Wire GovernancePolicy, AuditRecord, MaintenanceAction into harness lifecycle — LifecycleOutcome now carries policy, audit trail, and maintenance action instead of dropping them as unused imports - C2: Prefix unused mermaid_results variable with underscore - C3: Add parentheses around left_edge + self.gap in Kasuari constraint expression - C4: Replace and_then(|x| Ok(y)) with map(|x| y) in provider.rs - C5: Remove unused arc_kit_au::EdgeType import from ledgerr-mcp/lib.rs - Also remove unused AuditRecord import from b00t-iface/core/machine.rs - Also prefix unused issue_count variable in ledger-core/validation.rs
1 parent 96ecb94 commit dca1773

7 files changed

Lines changed: 31 additions & 9 deletions

File tree

crates/b00t-iface/src/core/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! Terminated
3636
//! ```
3737
38-
use super::surface::{AuditRecord, MaintenanceAction};
38+
use super::surface::MaintenanceAction;
3939
use std::fmt;
4040
use std::time::Duration;
4141

crates/b00t-iface/src/exec/harness.rs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ pub struct LifecycleOutcome<H: Clone> {
1616
pub surface: String,
1717
pub chain: PromiseChain<H>,
1818
pub governance_violations: Vec<String>,
19+
pub audit: Option<AuditRecord>,
20+
pub policy: GovernancePolicy,
21+
pub maintenance_action: MaintenanceAction,
1922
}
2023

2124
/// The executive harness — wraps a surface with governance + machine.
@@ -43,8 +46,8 @@ impl<S: ProcessSurface> SurfaceHarness<S> {
4346
where
4447
S::Handle: Clone,
4548
{
46-
let governance = &self.capability.governance;
47-
if let Err(v) = governance.validate() {
49+
let policy = self.capability.governance.clone();
50+
if let Err(v) = self.capability.governance.validate() {
4851
self.governance_violations.push(v);
4952
}
5053

@@ -81,7 +84,7 @@ impl<S: ProcessSurface> SurfaceHarness<S> {
8184
.apply_maintenance(&maintain_action, now.elapsed())
8285
{
8386
Ok(()) => {
84-
LifecyclePromise::fulfilled(PromiseOp::Maintain, now.elapsed(), maintain_action)
87+
LifecyclePromise::fulfilled(PromiseOp::Maintain, now.elapsed(), maintain_action.clone())
8588
}
8689
Err(e) => LifecyclePromise::rejected(PromiseOp::Maintain, now.elapsed(), e),
8790
};
@@ -103,6 +106,9 @@ impl<S: ProcessSurface> SurfaceHarness<S> {
103106
),
104107
},
105108
governance_violations: self.governance_violations.clone(),
109+
policy,
110+
maintenance_action: MaintenanceAction::NoOp,
111+
audit: None,
106112
};
107113
}
108114
};
@@ -120,6 +126,17 @@ impl<S: ProcessSurface> SurfaceHarness<S> {
120126
}
121127
};
122128

129+
let audit = match &terminate_promise.value {
130+
crate::core::PromiseValue::Fulfilled(_) => Some(AuditRecord {
131+
surface_name: self.capability.name.to_owned(),
132+
uptime: now.elapsed(),
133+
exit_reason: "terminated".into(),
134+
crash_count: self.machine.crash_count,
135+
bytes_logged: 0,
136+
}),
137+
_ => None,
138+
};
139+
123140
LifecycleOutcome {
124141
surface: self.capability.name.to_owned(),
125142
chain: PromiseChain {
@@ -129,6 +146,9 @@ impl<S: ProcessSurface> SurfaceHarness<S> {
129146
terminate: terminate_promise,
130147
},
131148
governance_violations: self.governance_violations.clone(),
149+
policy,
150+
maintenance_action: maintain_action,
151+
audit,
132152
}
133153
}
134154

@@ -158,6 +178,9 @@ impl<S: ProcessSurface> SurfaceHarness<S> {
158178
),
159179
},
160180
governance_violations: self.governance_violations.clone(),
181+
policy: self.capability.governance.clone(),
182+
maintenance_action: MaintenanceAction::Terminate,
183+
audit: None,
161184
}
162185
}
163186
}

crates/b00t-iface/src/sarif/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ mod tests {
636636
fn valid_mermaid_passes_lint() {
637637
let content = "```rhai\nfn foo() -> bar\n```\n\n```mermaid\nflowchart TD\nfoo[bar]\n```";
638638
let report = check_l3dg3rr_standards(&[("good.md", content)]);
639-
let mermaid_results: Vec<_> = report.runs[0]
639+
let _mermaid_results: Vec<_> = report.runs[0]
640640
.results
641641
.iter()
642642
.filter(|r| r.rule_id.contains("mermaid-parse"))

crates/ledger-core/src/validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ where
182182
{
183183
let next = f(current.meta.clone());
184184
let issues = next.issues.clone();
185-
let issue_count = issues.len();
185+
let _issue_count = issues.len();
186186
let meta = next.meta.advance(stage, next.confidence, &issues);
187187
let result = StageResult {
188188
data: next.data,

crates/ledger-core/src/visualize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ pub mod layout {
471471

472472
let left_edge = left_x + left_w;
473473
solver
474-
.add_constraint(left_edge + self.gap | LE(Strength::REQUIRED) | right_x)
474+
.add_constraint((left_edge + self.gap) | LE(Strength::REQUIRED) | right_x)
475475
.ok();
476476
}
477477

crates/ledgerr-mcp-core/src/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ pub mod mock {
372372
self.call_result
373373
.as_ref()
374374
.map_err(|e| e.clone())
375-
.and_then(|v| Ok(v.clone()))
375+
.map(|v| v.clone())
376376
}
377377

378378
fn shutdown(&self) {}

crates/ledgerr-mcp/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,6 @@ impl TurboLedgerService {
11211121

11221122
fn emit_ingest_evidence(&self, row: &TransactionInput, tx_id: &str) -> Result<(), ToolError> {
11231123
use arc_kit_au::node::{ExtractedRow, SourceDoc, Transaction};
1124-
use arc_kit_au::EdgeType;
11251124
use chrono::Utc;
11261125

11271126
let mut evidence = self

0 commit comments

Comments
 (0)