Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/nono-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ nono run --profile my-claude -- claude

- **Lists** (filesystem paths, security groups, rollback patterns): appended and deduplicated
- **HashMaps** (credentials, hooks): merged, child wins on same key
- **Booleans** (`network.block`, `interactive`): OR — either activates
- **Booleans** (`network.block`): OR — either activates
- **Scalars** (`meta`): child overrides
- **Nullable scalars** (`network_profile`): absent inherits, `null` clears, string overrides

Expand Down
5 changes: 0 additions & 5 deletions crates/nono-cli/data/nono-profile.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@
],
"description": "Opt-in gate for GPU access (Metal/IOKit on Apple Silicon macOS, render nodes on Linux). Intel Macs are not yet supported. Must be paired with the CLI flag --allow-gpu. Set to null to inherit from the base profile."
},
"interactive": {
"type": "boolean",
"description": "Deprecated. Parsed for backward compatibility but ignored. Supervised mode preserves TTY by default.",
"deprecated": true
},
"packs": {
"type": "array",
"items": { "type": "string" },
Expand Down
27 changes: 9 additions & 18 deletions crates/nono-cli/data/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,7 @@
]
},
"network": { "block": false },
"workdir": { "access": "none" },
"interactive": false
"workdir": { "access": "none" }
},
"linux-host-compat": {
"extends": "default",
Expand All @@ -715,8 +714,7 @@
},
"filesystem": {},
"network": { "block": false },
"workdir": { "access": "none" },
"interactive": false
"workdir": { "access": "none" }
},
"mise-dev": {
"extends": "default",
Expand All @@ -734,8 +732,7 @@
},
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
},
"python-dev": {
"extends": "default",
Expand All @@ -754,8 +751,7 @@
},
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
},
"node-dev": {
"extends": "default",
Expand All @@ -773,8 +769,7 @@
},
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
},
"bun-dev": {
"extends": "default",
Expand All @@ -792,8 +787,7 @@
},
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
},
"go-dev": {
"extends": "default",
Expand All @@ -811,8 +805,7 @@
},
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
},
"java-dev": {
"extends": "default",
Expand All @@ -833,8 +826,7 @@
],
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
},
"rust-dev": {
"extends": "default",
Expand All @@ -852,8 +844,7 @@
},
"filesystem": {},
"network": { "block": false, "network_profile": "developer" },
"workdir": { "access": "readwrite" },
"interactive": false
"workdir": { "access": "readwrite" }
}
}
}
3 changes: 0 additions & 3 deletions crates/nono-cli/src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ pub struct ProfileDef {
#[serde(default)]
pub allow_gpu: Option<bool>,
#[serde(default)]
pub interactive: bool,
#[serde(default)]
pub packs: Vec<String>,
#[serde(default)]
pub command_args: Vec<String>,
Expand Down Expand Up @@ -181,7 +179,6 @@ impl ProfileDef {
allow_launch_services: self.allow_launch_services,
allow_gpu: self.allow_gpu,
allow_parent_of_protected: None,
interactive: self.interactive,
skipdirs: Vec::new(),
packs: self.packs.clone(),
binary: None,
Expand Down
1 change: 0 additions & 1 deletion crates/nono-cli/src/profile/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ mod tests {
let profile = get_builtin("default").expect("Profile not found");
assert_eq!(profile.meta.name, "default");
assert_eq!(profile.workdir.access, WorkdirAccess::None);
assert!(!profile.interactive);
assert!(!profile.network.block);
}

Expand Down
45 changes: 13 additions & 32 deletions crates/nono-cli/src/profile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2471,10 +2471,6 @@ pub struct Profile {
/// rules protect `~/.nono`. Ignored on Linux. Default is `false`.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_parent_of_protected: Option<bool>,
/// Deprecated: Parsed for backward compatibility but ignored.
/// Supervised mode preserves TTY by default, making this unnecessary.
#[serde(default)]
pub interactive: bool,
/// Directory names to skip during trust scanning and rollback preflight.
/// Treated like built-in heavy directories (for example `target`).
#[serde(default)]
Expand Down Expand Up @@ -2622,8 +2618,6 @@ struct ProfileDeserialize {
allow_gpu: Option<bool>,
allow_parent_of_protected: Option<bool>,
#[serde(default)]
interactive: bool,
#[serde(default)]
skipdirs: Vec<String>,
#[serde(default)]
packs: Vec<String>,
Expand Down Expand Up @@ -2663,7 +2657,6 @@ impl From<ProfileDeserialize> for Profile {
allow_launch_services: raw.allow_launch_services,
allow_gpu: raw.allow_gpu,
allow_parent_of_protected: raw.allow_parent_of_protected,
interactive: raw.interactive,
skipdirs: raw.skipdirs,
packs: raw.packs,
binary: raw.binary,
Expand Down Expand Up @@ -3957,7 +3950,6 @@ fn merge_profiles(base: Profile, child: Profile) -> Profile {
allow_parent_of_protected: child
.allow_parent_of_protected
.or(base.allow_parent_of_protected),
interactive: base.interactive || child.interactive,
skipdirs: dedup_append(&base.skipdirs, &child.skipdirs),
packs: dedup_append(&base.packs, &child.packs),
binary: child.binary.or(base.binary),
Expand Down Expand Up @@ -7003,7 +6995,6 @@ mod tests {
allow_launch_services: Some(false),
allow_gpu: Some(false),
allow_parent_of_protected: None,
interactive: false,
skipdirs: vec!["vendor".to_string()],
packs: vec![],
binary: None,
Expand Down Expand Up @@ -7095,7 +7086,6 @@ mod tests {
allow_launch_services: Some(true),
allow_gpu: Some(true),
allow_parent_of_protected: Some(true),
interactive: false,
skipdirs: vec!["dist".to_string()],
packs: vec![],
binary: None,
Expand Down Expand Up @@ -7960,25 +7950,6 @@ mod tests {
assert!(merged.env_credentials.mappings.contains_key("child_key"));
}

#[test]
fn test_merge_profiles_interactive_or_semantics() {
// base=false, child=false -> false
let merged = merge_profiles(base_profile(), child_profile());
assert!(!merged.interactive);

// base=true, child=false -> true
let mut base = base_profile();
base.interactive = true;
let merged = merge_profiles(base, child_profile());
assert!(merged.interactive);

// base=false, child=true -> true
let mut child = child_profile();
child.interactive = true;
let merged = merge_profiles(base_profile(), child);
assert!(merged.interactive);
}

#[test]
fn test_merge_profiles_extends_consumed() {
let child = child_profile(); // has extends = Some(vec!["base"])
Expand Down Expand Up @@ -8360,7 +8331,6 @@ mod tests {
workdir: WorkdirConfig {
access: WorkdirAccess::Read,
},
interactive: false,
..Default::default()
};

Expand All @@ -8373,7 +8343,6 @@ mod tests {
workdir: WorkdirConfig {
access: WorkdirAccess::ReadWrite,
},
interactive: true,
..Default::default()
};

Expand All @@ -8389,7 +8358,6 @@ mod tests {
WorkdirAccess::ReadWrite,
"later base should override workdir"
);
assert!(merged.interactive, "interactive should be OR'd");
}

#[test]
Expand Down Expand Up @@ -8679,6 +8647,19 @@ mod tests {
);
}

#[test]
fn test_removed_interactive_field_is_rejected() {
let json = r#"{
"meta": { "name": "removed-interactive" },
"interactive": true
}"#;
let result: std::result::Result<Profile, _> = serde_json::from_str(json);
assert!(
result.is_err(),
"removed top-level field 'interactive' must be rejected"
);
}

// Note: legacy `policy` patch deserialization (the full set of
// `add_allow_*`, `add_deny_*`, `override_deny`, `exclude_groups`)
// draining into canonical sections is covered by integration tests in
Expand Down
1 change: 0 additions & 1 deletion crates/nono-cli/tests/schema_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ fn test_schema_top_level_profile_matches_rust_model() {
"allow_launch_services",
"allow_gpu",
"allow_parent_of_protected",
"interactive",
"skipdirs",
"packs",
"binary",
Expand Down
18 changes: 2 additions & 16 deletions crates/nono-proxy/src/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,20 +588,6 @@ impl CredentialStore {
})
}

/// Deprecated wrapper around [`Self::load_with_diagnostics`].
#[deprecated(
since = "0.64.0",
note = "Use `load_with_diagnostics` instead. Will be removed in 1.0.0."
)]
pub async fn load(
routes: &[RouteConfig],
tls_connector: &TlsConnector,
) -> Result<CredentialStore> {
Self::load_with_diagnostics(routes, tls_connector, None)
.await
.map(|outcome| outcome.store)
}

/// Create an empty credential store (no credential injection).
#[must_use]
pub fn empty() -> Self {
Expand Down Expand Up @@ -1215,7 +1201,7 @@ mod tests {
#[test]
fn test_is_empty_false_with_only_oauth2_routes() {
// Simulate a store with only OAuth2 routes by constructing directly.
// We can't call load() with a real OAuth2 config (no token server),
// We cannot load a real OAuth2 route here (there is no token server),
// so we build the struct manually to test the is_empty/len logic.
use std::time::Duration;

Expand Down Expand Up @@ -1401,7 +1387,7 @@ mod tests {

let outcome = CredentialStore::load_with_diagnostics(&routes, &tls, None).await;

// load() should succeed (route skipped, not hard error)
// The load should succeed (route skipped, not hard error).
assert!(
outcome.is_ok(),
"load should not fail on unreachable OAuth2 endpoint"
Expand Down
62 changes: 1 addition & 61 deletions crates/nono/src/diagnostic/codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::capability::AccessMode;
use crate::diagnostic::NonoDiagnosticDetail;
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use std::path::PathBuf;

/// Severity of a structured diagnostic.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -64,66 +64,6 @@ pub enum NonoRemediation {
DisableRollback,
}

/// Map structured remediation to the legacy CLI flag string shape.
///
/// Kept for backwards compatibility with code that read
/// [`crate::IpcDenialRecord::suggested_flag`]. New code should use
/// [`NonoRemediation`] and render flags in the CLI/bindings layer.
#[deprecated(
since = "0.64.0",
note = "Use `NonoRemediation` instead. Legacy flag strings will be removed in 1.0.0."
)]
#[must_use]
pub fn suggested_flag_for_remediation(rem: &NonoRemediation) -> Option<String> {
match rem {
NonoRemediation::GrantPath {
path,
access,
is_file,
} => {
let (flag, target) = suggested_flag_parts(path, *access, *is_file);
Some(format!("{flag} {}", target.display()))
}
NonoRemediation::GrantUnixSocket { path, bind } => {
let flag = if *bind {
"--allow-unix-socket-bind"
} else {
"--allow-unix-socket"
};
Some(format!("{flag} {}", path.display()))
}
NonoRemediation::AllowCwd => Some("--allow-cwd".to_string()),
NonoRemediation::DisableRollback => Some("--no-rollback".to_string()),
NonoRemediation::GrantNetwork => Some("--allow-net".to_string()),
NonoRemediation::RunDiscovery
| NonoRemediation::CheckPolicy
| NonoRemediation::AuthenticateCredentialProvider { .. }
| NonoRemediation::AdjustRollbackBudget { .. } => None,
}
}

fn suggested_flag_parts(
path: &Path,
requested: AccessMode,
is_file: bool,
) -> (&'static str, PathBuf) {
if is_file {
let flag = match requested {
AccessMode::Read => "--read-file",
AccessMode::Write => "--write-file",
AccessMode::ReadWrite => "--allow-file",
};
return (flag, path.to_path_buf());
}

let flag = match requested {
AccessMode::Read => "--read",
AccessMode::Write => "--write",
AccessMode::ReadWrite => "--allow",
};
(flag, path.to_path_buf())
}

/// One structured diagnostic entry.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct NonoDiagnostic {
Expand Down
Loading