fix(cli): ensure Profile has corresponding CLI flags#1124
Conversation
PR Review SummarySize
Affected crates
Blast radius — ContainedThis PR touches: source code Updated automatically on each push to this PR. |
There was a problem hiding this comment.
Code Review
This pull request introduces CLI overrides for profile-defined security configurations (such as signal, process info, and IPC modes), environment variable rules, and rollback exclusion patterns, along with a new parity test suite (schema_cli_parity.rs) to ensure all profile fields are correctly mapped to CLI flags. Feedback on the changes includes optimizing string cloning in the rollback exclusion merging logic, replacing unstable let_chains syntax with nested if let statements to ensure stable Rust compatibility, and correcting queue operations in the parity tests to perform a true breadth-first search (BFS) instead of a depth-first search (DFS).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
60e56bb to
b941ae9
Compare
b941ae9 to
968f869
Compare
Signed-off-by: CubicYYY <yyy2015c01@gmail.com>
Signed-off-by: CubicYYY <yyy2015c01@gmail.com>
Signed-off-by: CubicYYY <yyy2015c01@gmail.com>
PR always-further#1134 added EnvironmentConfig.set_vars on main while this PR was in flight. The schema_cli_parity test correctly flagged it as uncategorized after the rebase: exactly the failure mode this check was built to catch. Categorized as ProfileOnly: it's a HashMap with shell-style expansion and main's docstring frames it as an "auditable operator decision", arguing for profile-only authoring rather than ad-hoc CLI use. A follow-up PR can add a flag if maintainers want one. Signed-off-by: CubicYYY <yyy2015c01@gmail.com>
968f869 to
645e058
Compare
Linked Issue
Closes #1027
Summary
Profile(or any nested*Configstruct) is added without an explicit categorization.The parity check (
crates/nono-cli/tests/schema_cli_parity.rs) parsescrates/nono-cli/src/profile/mod.rswithsyn, walksProfile's type graph by BFS, and requires every reachable field to have one entry inmapping_table()tagged asFlag("<long-name>"),ProfileOnly("reason"), orDeprecated("reason"). Uncategorized fields fail CI asuncategorized policy field: Foo.bar. The CLI side is alsosyn-parsed (out ofcli.rs's#[arg(...)]attributes) so platform-conditional flags don't produce false negatives.The backsweep adds 7 CLI flags so previously profile-only knobs are reachable per-run:
--signal-mode,--process-info-mode,--ipc-mode- security isolation modes (clapValueEnum-derived from the existing profile enums).--wsl2-proxy-policy- Linux-only; mirrorssecurity.wsl2_proxy_policy.--rollback-exclude-glob- explicit glob-only counterpart to the legacy--rollback-exclude(which auto-routes by shape).--allow-env-var,--deny-env-var- extendenvironment.allow_vars/environment.deny_vars.CLI values override profile values for the mode enums; list-typed flags (env vars, rollback globs) extend rather than replace, with dedup.
Documents the convention on the
Profilestruct doc-comment anddocs/cli/development/index.mdxso contributors see it before hitting CI.Agent Disclosure
Most code in this PR is generated by Claude. Human review is done by myself.
Checklist
CHANGELOG.mdif needed - not added now (should we?)Agent Compliance Check
unwrap_usedclean;expect()appears only in test code, which is gated by#![allow(clippy::expect_used)]on the parity test file with a justification comment)Resultpropagation preserved)