Skip to content

Commit 22ad106

Browse files
hyperpolymathclaude
andcommitted
Merge origin/main: Rust compile-blocker PRs + LICENSE update
Reconciles today's V→Zig port work (emergency-button, emergency-room, recovery/ER dedup, volumod duplicate removal) with three origin commits: LICENSE update, PR #24 (PathBuf fix + clinician CLI scaffold), PR #25 (workspace compile blockers swept). Origin's changes landed in clinician/, port-endoscope/, hardware-crash-team/, emergency-{button,room}/rust/, and root .machine_readable/6a2/ STATE.a2ml — disjoint from local's V→Zig paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 parents ab72971 + 042166d commit 22ad106

16 files changed

Lines changed: 89 additions & 112 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# STATE.a2ml — Project state checkpoint
33
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
44
# Converted from STATE.scm on 2026-03-15
5-
# Updated: 2026-03-20 (system log analysis session)
5+
# Updated: 2026-04-16 (compile blockers cleared; V-lang migration to Rust confirmed)
66

77
[metadata]
88
project = "ambientops"
99
version = "0.2.0"
10-
last-updated = "2026-04-04"
10+
last-updated = "2026-04-16"
1111
status = "active"
1212
crg-contracts-rust = "C"
13-
note = "contracts-rust achieved CRG C: 72 tests (15 unit + 12 property + 5 E2E + 12 contract + 13 aspect + 12 benchmarks)"
13+
note = "contracts-rust achieved CRG C: 72 tests (15 unit + 12 property + 5 E2E + 12 contract + 13 aspect + 12 benchmarks). Workspace now green: 195 tests pass across 13 suites, 0 failures."
1414

1515
[project-context]
1616
name = "ambientops"
@@ -335,8 +335,8 @@ update = "Needs service-autopsy integration"
335335

336336
[next-actions]
337337
priority-1 = [
338-
"Fix HCT main.rs to compile (in progress — other bot)",
339338
"Wire cross-component Evidence Envelope flow end-to-end",
339+
"Expand clinician main.rs: re-wire full subcommand surface (process/network/disk/service/security/mesh/satellite) via clap Subcommand wrappers over tools::*Action enums",
340340
]
341341
priority-2 = [
342342
"WirePlumber BT sentinel — implement D-Bus monitoring (stub exists)",
@@ -346,3 +346,18 @@ priority-3 = [
346346
"ServiceAutopsy → BundleIngestion integration",
347347
"Add clinician auto-remediation rules to live supervision tree",
348348
]
349+
350+
# ============================================================================
351+
# SESSION: 2026-04-16 — Compile Blocker Clearance
352+
# ============================================================================
353+
354+
[session-2026-04-16]
355+
summary = "Cleared compile blockers + swept all workspace warnings; workspace now fully green."
356+
changes = [
357+
"emergency-button/rust/src/main.rs: added .display() to two PathBuf format calls (lines 82, 104)",
358+
"clinician/src/main.rs: rewritten as minimal working dispatcher — imports modules from crate, uses real enum names, stubs non-wired subcommands. Full CLI surface tracked as P1 follow-up.",
359+
"Warning sweep: deleted unused `verbose` field/flag from emergency-button + emergency-room; deleted unused `inode`/`cmdline` fields and 4 unused pub utility functions from port-endoscope; deleted dead `events` binding in hardware-crash-team analyzer; cfg-gated Screen enum in hardware-crash-team/tui to `any(feature = \"tui\", test)`; dropped unused imports in clinician/lib.rs and contracts-rust property_tests; removed stray parens in proptest strategy.",
360+
"Cargo.toml: moved [profile.release] from clinician/Cargo.toml to workspace root (clears 'profiles for the non root package will be ignored' warning).",
361+
]
362+
test-baseline = "cargo test --workspace: 195 passed, 0 failed (13 suites); cargo test -p hardware-crash-team --features tui: 76 passed, 0 failed. ZERO warnings under both builds."
363+
build-status = "cargo build --workspace: clean; cargo build -p hardware-crash-team --features tui: clean."

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ resolver = "2"
1414
[workspace.dependencies]
1515
proptest = "1.4"
1616
criterion = "0.5"
17+
18+
[profile.release]
19+
lto = true
20+
codegen-units = 1
21+
strip = true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SPDX-License-Identifier: MPL-2.0
1+
SPDX-License-Identifier: PMPL-1.0-or-later
22
SPDX-FileCopyrightText: 2024-2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33

44
------------------------------------------------------------------------

clinician/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,5 @@ anomaly = ["ndarray"] # ESN/LSM anomaly detection
8080
bluetooth = ["bluer"] # Bluetooth device monitoring (BT Sentinel)
8181
all = ["storage", "cache", "ai", "p2p", "search", "forum", "anomaly", "bluetooth"]
8282

83-
[profile.release]
84-
lto = true
85-
codegen-units = 1
86-
strip = true
83+
# NOTE: release-profile tuning lives in the workspace root Cargo.toml so it
84+
# applies consistently across all member crates.

clinician/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ pub mod tools; // Task-specific administrative utilities.
3232

3333
/// SYSTEM PATHS: Standardized cross-platform directory resolution.
3434
pub mod dirs {
35-
use directories::ProjectDirs;
3635
use std::path::PathBuf;
3736

38-
/// RESOLUTION: Dispatches to the OS-appropriate storage locations
37+
/// RESOLUTION: Dispatches to the OS-appropriate storage locations
3938
/// using the `directories` crate.
4039
pub fn config_dir() -> PathBuf {
4140
// ... [Path resolution implementation]

clinician/src/main.rs

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,33 @@
22

33
//! Personal Sysadmin (PSA) — AI-Assisted System Administration Toolkit (CLI).
44
//!
5-
//! This binary implements the "Clinician" logic for Linux environments.
6-
//! It provides a comprehensive suite of administrative tools combined with
5+
//! This binary implements the "Clinician" logic for Linux environments.
6+
//! It provides a comprehensive suite of administrative tools combined with
77
//! neurosymbolic reasoning to automate problem detection and resolution.
88
//!
99
//! CORE CAPABILITIES:
10-
//! 1. **Resource Auditing**: Real-time management of processes, networks,
10+
//! 1. **Resource Auditing**: Real-time management of processes, networks,
1111
//! disks, and services.
12-
//! 2. **AI-Diagnostics**: Uses local SLMs (Small Language Models) with
12+
//! 2. **AI-Diagnostics**: Uses local SLMs (Small Language Models) with
1313
//! cloud LLM fallback to diagnose complex system incidents.
14-
//! 3. **Knowledge Ingestion**: Learns from solutions using miniKanren
14+
//! 3. **Knowledge Ingestion**: Learns from solutions using miniKanren
1515
//! logical reasoning, building a verified administrative knowledge base.
16-
//! 4. **Distributed Tracing**: Uses a global `correlation_id` to link
16+
//! 4. **Distributed Tracing**: Uses a global `correlation_id` to link
1717
//! events across the satellite tool fleet.
18-
//! 5. **P2P Mesh**: Securely shares administrative insights and solutions
18+
//! 5. **P2P Mesh**: Securely shares administrative insights and solutions
1919
//! across a decentralized mesh of PSA nodes.
20+
//!
21+
//! NOTE: This binary is a minimal dispatcher. The rich CLI surface described
22+
//! in the module-level docs is scaffolded in `lib.rs`; wiring each
23+
//! sub-command through clap is tracked as follow-up work.
2024
25+
use ambientops_clinician::{ai, cache, correlation, storage};
2126
use clap::{Parser, Subcommand};
2227
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
23-
// ... [other imports]
2428

2529
/// CLI SCHEMA: Defines the subcommand space for the Personal Sysadmin.
2630
#[derive(Parser)]
27-
#[command(name = "psa")]
31+
#[command(name = "psa", version)]
2832
struct Cli {
2933
#[command(subcommand)]
3034
command: Commands,
@@ -36,44 +40,61 @@ struct Cli {
3640

3741
#[derive(Subcommand)]
3842
enum Commands {
39-
/// RESOURCE MANAGEMENT: Process, Network, Disk, and Service audits.
40-
Process { #[command(subcommand)] action: ProcessActionCli },
41-
Network { #[command(subcommand)] action: NetworkActionCli },
42-
Disk { #[command(subcommand)] action: DiskActionCli },
43-
Service { #[command(subcommand)] action: ServiceActionCli },
44-
45-
/// SECURITY: Scanning, permission auditing, and rootkit detection.
46-
Security { #[command(subcommand)] action: SecurityActionCli },
47-
48-
/// REASONING: AI-assisted diagnosis and autonomous learning.
49-
Diagnose { problem: String, local_only: bool },
50-
Learn { category: String, solution: Option<String> },
51-
52-
/// ORCHESTRATION: P2P mesh control and incident analysis.
53-
Mesh { #[command(subcommand)] action: MeshActionCli },
54-
Crisis { incident: String, correlation_id: Option<String> },
55-
Satellite { #[command(subcommand)] action: SatelliteActionCli },
43+
/// REASONING: AI-assisted diagnosis.
44+
Diagnose {
45+
/// Natural-language description of the problem.
46+
problem: String,
47+
/// Restrict diagnosis to the local SLM (no cloud fallback).
48+
#[arg(long)]
49+
local_only: bool,
50+
},
51+
/// REASONING: Record a solution under a category.
52+
Learn {
53+
/// Category label for the solution (e.g. "disk", "network").
54+
category: String,
55+
/// Optional free-form solution text.
56+
solution: Option<String>,
57+
},
58+
/// Show protocol and binary version.
59+
Version,
5660
}
5761

58-
/// MAIN ENTRY: Boots the async runtime, initializes global state,
62+
/// MAIN ENTRY: Boots the async runtime, initializes global state,
5963
/// and dispatches to tool handlers.
6064
#[tokio::main]
6165
async fn main() -> anyhow::Result<()> {
66+
tracing_subscriber::registry()
67+
.with(tracing_subscriber::EnvFilter::try_from_default_env()
68+
.unwrap_or_else(|_| "info".into()))
69+
.with(tracing_subscriber::fmt::layer())
70+
.init();
71+
6272
let cli = Cli::parse();
6373

6474
// PROVENANCE: Initialize the correlation context for distributed tracing.
65-
let corr_id = correlation::init(cli.correlation_id.clone());
75+
let _corr_id = correlation::init(cli.correlation_id.clone());
6676

6777
// STORAGE: Establish links to the local knowledge base and state cache.
6878
let storage = storage::Storage::new().await?;
6979
let cache = cache::Cache::new().await?;
7080

71-
// DISPATCH: Executes the requested administrative workflow.
7281
match cli.command {
7382
Commands::Diagnose { problem, local_only } => {
7483
ai::diagnose(&problem, local_only, &storage, &cache).await?;
7584
}
76-
// ... [Remaining handlers]
85+
Commands::Learn { category, solution } => {
86+
println!(
87+
"learn: category={category} solution={}",
88+
solution.as_deref().unwrap_or("(none)")
89+
);
90+
}
91+
Commands::Version => {
92+
println!(
93+
"ambientops-clinician {} (protocol {})",
94+
env!("CARGO_PKG_VERSION"),
95+
ambientops_clinician::PROTOCOL_VERSION
96+
);
97+
}
7798
}
7899
Ok(())
79100
}

contracts-rust/tests/property_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use ambientops_contracts::*;
99
use chrono::Utc;
1010
use proptest::prelude::*;
11-
use serde_json::json;
1211
use uuid::Uuid;
1312

1413
// =============================================================================
@@ -152,7 +151,7 @@ fn arb_receipt() -> impl Strategy<Value = Receipt> {
152151
Just(Uuid::new_v4()),
153152
Just(Uuid::new_v4()),
154153
prop::collection::vec(
155-
("[a-z0-9_]{1,20}"),
154+
"[a-z0-9_]{1,20}",
156155
step_count as usize,
157156
),
158157
)

emergency-button/rust/src/incident.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub const SCHEMA_VERSION: &str = "1.0.0";
1313
pub struct Config {
1414
pub quick_backup_dest: Option<String>,
1515
pub dry_run: bool,
16-
pub verbose: bool,
1716
}
1817

1918
pub struct Incident {

emergency-button/rust/src/main.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ struct TriggerArgs {
3737
/// Preview actions without executing
3838
#[arg(short = 'n', long)]
3939
dry_run: bool,
40-
41-
/// Verbose output
42-
#[arg(short = 'V', long)]
43-
verbose: bool,
4440
}
4541

4642
fn main() {
@@ -56,7 +52,6 @@ fn run_trigger(args: TriggerArgs) {
5652
let cfg = incident::Config {
5753
quick_backup_dest: args.quick_backup.clone(),
5854
dry_run: args.dry_run,
59-
verbose: args.verbose,
6055
};
6156

6257
println!();
@@ -79,7 +74,7 @@ fn run_trigger(args: TriggerArgs) {
7974
}
8075
};
8176

82-
println!("\x1b[32m[OK]\x1b[0m Created incident bundle: {}", inc.path);
77+
println!("\x1b[32m[OK]\x1b[0m Created incident bundle: {}", inc.path.display());
8378
println!("\x1b[34m[INFO]\x1b[0m Correlation ID: {}", inc.correlation_id);
8479
println!();
8580

@@ -101,7 +96,7 @@ fn run_trigger(args: TriggerArgs) {
10196

10297
println!();
10398
println!("\x1b[32m════════════════════════════════════════════\x1b[0m");
104-
println!("\x1b[32m[DONE]\x1b[0m Incident bundle ready: {}", inc.path);
99+
println!("\x1b[32m[DONE]\x1b[0m Incident bundle ready: {}", inc.path.display());
105100
println!("\x1b[32m════════════════════════════════════════════\x1b[0m");
106101
}
107102

@@ -118,7 +113,6 @@ fn print_help() {
118113
println!("\x1b[1mOPTIONS (for trigger):\x1b[0m");
119114
println!(" -b, --quick-backup <path> Run quick backup to destination (opt-in)");
120115
println!(" -n, --dry-run Preview actions without executing");
121-
println!(" -V, --verbose Verbose output");
122116
println!();
123117
println!("\x1b[1mSAFETY:\x1b[0m");
124118
println!(" Default action is non-destructive and offline-first");

emergency-room/rust/src/incident.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub const SCHEMA_VERSION: &str = "1.0.0";
1313
pub struct Config {
1414
pub quick_backup_dest: Option<String>,
1515
pub dry_run: bool,
16-
pub verbose: bool,
1716
}
1817

1918
pub struct Incident {

0 commit comments

Comments
 (0)