Skip to content

fix(doctor): align Personal shell approval fallback - #1744

Merged
Aaronontheweb merged 2 commits into
devfrom
fix/approval-fallback-contract
Aug 3, 2026
Merged

fix(doctor): align Personal shell approval fallback#1744
Aaronontheweb merged 2 commits into
devfrom
fix/approval-fallback-contract

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

  • Align the doctor with the Personal shell fail-closed runtime rule.
  • Warn only when an exact shell_execute override selects Auto.
  • Correct the approval specifications and the operator runbook.
  • Archive the completed OpenSpec change.

Contract

A clean Personal install writes an exact shell_execute = Approval override.

A missing policy or exact override also resolves to Approval for Personal shell calls.

An exact Auto, Approval, or Deny override remains authoritative.

This pull request does not change shell parsing or the approval matrix.

Validation

  • dotnet test src/Netclaw.Cli.Tests/Netclaw.Cli.Tests.csproj --filter "FullyQualifiedName~ToolAudienceProfilesDoctorCheckTests" passed 18 tests.
  • The init configuration filters passed 15 tests.
  • ToolApprovalGateTests passed 42 tests.
  • dotnet slopwatch analyze found no issues.
  • The file-header check passed.
  • git diff --check passed.
  • openspec validate --all passed 71 items.

Copilot AI review requested due to automatic review settings August 3, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

The updated runbook text can read as if non-shell tools also fail closed when ApprovalPolicy is absent.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This pull request aligns netclaw doctor output with the runtime fail-closed rule for Personal host shell approval. It also updates the OpenSpec contract and the operator runbook to match the shipped behavior.

Changes:

  • Update the doctor check to warn only for an explicit shell_execute = Auto override on Personal with host shell enabled.
  • Update and extend doctor regression tests for missing policy, missing override, and explicit Auto / Approval overrides.
  • Update OpenSpec requirements and archive the completed OpenSpec change.
File summaries
File Description
src/Netclaw.Cli/Doctor/ToolAudienceProfilesDoctorCheck.cs Replace the “missing gate” warning with an “explicit Auto override” warning for Personal host shell.
src/Netclaw.Cli.Tests/Doctor/ToolAudienceProfilesDoctorCheckTests.cs Update test expectations and add coverage for explicit Auto and missing-override cases.
openspec/specs/tool-approval-gates/spec.md Document the Personal shell fail-closed fallback and the exact override precedence.
openspec/specs/netclaw-cli/spec.md Update the doctor requirement and scenarios to match the new warning rule.
openspec/changes/archive/2026-08-03-align-personal-shell-approval-fallback/tasks.md Archive tasks for the completed change.
openspec/changes/archive/2026-08-03-align-personal-shell-approval-fallback/specs/tool-approval-gates/spec.md Store the delta spec for tool approval gates in the archived change.
openspec/changes/archive/2026-08-03-align-personal-shell-approval-fallback/specs/netclaw-cli/spec.md Store the delta spec for CLI doctor behavior in the archived change.
openspec/changes/archive/2026-08-03-align-personal-shell-approval-fallback/proposal.md Archive the proposal for the completed change.
openspec/changes/archive/2026-08-03-align-personal-shell-approval-fallback/design.md Archive the design notes for the completed change.
openspec/changes/archive/2026-08-03-align-personal-shell-approval-fallback/.openspec.yaml Add OpenSpec metadata for the archived change.
docs/runbooks/tool-approval-gates.md Update the operator guidance for existing installs to describe the fail-closed shell fallback.
Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread docs/runbooks/tool-approval-gates.md Outdated
Comment on lines +68 to +74
Existing Personal configs without an exact `shell_execute` override use the
fail-closed `Approval` mode. This rule also applies when `ApprovalPolicy` is
absent or its `DefaultMode` is `Auto`.

Rerun `netclaw init` or add the `Approval` override to make this behavior
explicit. Set an exact `shell_execute` override to `Auto` only when shell
commands must run without approval.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0666f8d. The runbook now states that the fallback applies only to Personal shell_execute calls.

@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) August 3, 2026 17:30
@Aaronontheweb
Aaronontheweb disabled auto-merge August 3, 2026 17:46
Copilot AI review requested due to automatic review settings August 3, 2026 17:47
@Aaronontheweb
Aaronontheweb merged commit 4d7775c into dev Aug 3, 2026
18 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/approval-fallback-contract branch August 3, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready to approve

The change is narrow, matches the runtime resolution logic, and it includes focused regression tests and updated specifications.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@Aaronontheweb Aaronontheweb mentioned this pull request Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants