Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
38cb07d
refactor(permission): remove confirmation-time input mutation
wsp1911 Jul 18, 2026
3cc6c6c
feat(permission): add v2 rule contracts and evaluator
wsp1911 Jul 18, 2026
5de0c4f
feat(permission): add pending requests and project grant store
wsp1911 Jul 18, 2026
269afe8
feat(permission): add response API and UI projection
wsp1911 Jul 18, 2026
6c3d392
feat(permission): enforce v2 policy for file tools
wsp1911 Jul 18, 2026
bca941c
feat(permission): enforce command and integration tools
wsp1911 Jul 18, 2026
9d3e2af
feat(permission): enforce extensions and retire legacy gate
wsp1911 Jul 18, 2026
9a28f13
fix(permission): complete V2 permission request projection
wsp1911 Jul 19, 2026
79fd68d
feat(permission): add policy and interaction config contracts
wsp1911 Jul 19, 2026
a5785b9
feat(permission): scope project rules to workspaces
wsp1911 Jul 19, 2026
15e62d2
feat(permission): add auto approve ask runtime policy
wsp1911 Jul 19, 2026
96f01e9
feat(permission): add desktop permission modes
wsp1911 Jul 19, 2026
220ce3d
feat(permission): add grant management surfaces
wsp1911 Jul 19, 2026
577c1cb
feat(permission): align tui and remote permission control
wsp1911 Jul 19, 2026
626078c
feat(permission): improve permission mode controls and approval defaults
wsp1911 Jul 19, 2026
305f0e2
feat(permission): add subagent delegation context contract
wsp1911 Jul 19, 2026
a6c9699
feat(permission): project subagent lineage into permission requests
wsp1911 Jul 19, 2026
9cc85ae
feat(permission): route subagent requests through parent chat
wsp1911 Jul 19, 2026
ff19851
feat(cli): route subagent permission requests to parent sessions
wsp1911 Jul 19, 2026
4766c55
feat(permission): enforce runtime ceilings for subagents
wsp1911 Jul 19, 2026
b9d16b8
feat(permission): complete subagent approval propagation
wsp1911 Jul 19, 2026
78e52a7
fix(permission): scope V2 rejects to individual requests
wsp1911 Jul 20, 2026
b8090fd
feat(permission): add round-aware request ordering
wsp1911 Jul 20, 2026
a376d45
feat(permission): pre-register ordered V2 permission requests
wsp1911 Jul 20, 2026
9642f88
feat(permission): add aggregated batch approvals
wsp1911 Jul 20, 2026
e48d202
feat(permission): refine V2 approval panel
wsp1911 Jul 20, 2026
5f88842
fix(permission): route subagent continuation requests to parent chats
wsp1911 Jul 20, 2026
c587121
feat(permissions): add project permission controls
wsp1911 Jul 20, 2026
89a9900
refactor(permission): remove v2 terminology
wsp1911 Jul 20, 2026
cf01c2f
feat(permissions): add global tool rule management
wsp1911 Jul 21, 2026
1f6a8e8
fix(cli): improve permission prompt readability
wsp1911 Jul 21, 2026
05c9e90
fix(permissions): distinguish policy denials from user rejections
wsp1911 Jul 21, 2026
a1bda85
Merge upstream/main into refactor/permission
wsp1911 Jul 21, 2026
ff97a3f
fix(permissions): register manager for desktop session runtime
wsp1911 Jul 21, 2026
9d22840
Merge upstream/main into pr/permission
wsp1911 Jul 21, 2026
7b120b2
fix: resolve CI validation failures
wsp1911 Jul 21, 2026
b4f04f6
Merge remote-tracking branch 'upstream/main' into pr/permission
wsp1911 Jul 21, 2026
2749514
Merge upstream/main into pr/permission
wsp1911 Jul 21, 2026
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
1 change: 0 additions & 1 deletion scripts/core-boundaries/rules/crate-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const lightweightBoundaryRules = [
'bitfun-services-integrations',
'bitfun-agent-tools',
'bitfun-tool-packs',
'bitfun-product-domains',
'bitfun-transport',
'terminal-core',
'tool-runtime',
Expand Down
8 changes: 8 additions & 0 deletions scripts/core-boundaries/rules/feature-rules.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Boundary rules for feature assembly and optional dependency ownership.

export const optionalDependencyFeatureOwnerRules = [
{
crateName: 'runtime-ports',
reason:
'runtime-ports may expose product-domain permission ports only through the explicit permission contract slice',
dependencies: [
{ depName: 'bitfun-product-domains', ownerFeatures: ['permission'] },
],
},
{
crateName: 'core',
reason:
Expand Down
6 changes: 3 additions & 3 deletions scripts/core-boundaries/rules/source/forbidden-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1770,12 +1770,12 @@ export const forbiddenContentRules = [
{
regex: /\bpub enum ConfirmationResponse\b/,
message:
'core tool pipeline must not own confirmation channel responses; use bitfun-agent-runtime tool_confirmation',
'core tool pipeline must not reintroduce legacy confirmation channel responses; use permission requests',
},
{
regex: /\boneshot::Sender<\s*ConfirmationResponse\s*>/,
message:
'core tool pipeline must not own confirmation wait-channel storage; use bitfun-agent-runtime tool_confirmation',
'core tool pipeline must not reintroduce legacy confirmation wait-channel storage; use permission requests',
},
{
regex: /\bArc<DashMap<String,\s*CancellationToken>>\b/,
Expand Down Expand Up @@ -2508,7 +2508,7 @@ export const forbiddenContentRules = [
{
regex: /ToolConfirmationOutcome::(?:Rejected|ChannelClosed|Timeout)/,
message:
'core tool pipeline must not own confirmation wait-result mapping; use bitfun-agent-runtime',
'core tool pipeline must not reintroduce legacy confirmation wait-result mapping; use permission requests',
},
],
},
Expand Down
130 changes: 6 additions & 124 deletions scripts/core-boundaries/rules/source/required-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,69 +1822,6 @@ export const requiredContentRules = [
},
],
},
{
path: 'src/crates/execution/agent-runtime/src/tool_confirmation.rs',
reason:
'agent-runtime must own portable tool confirmation planning, failure mapping, and wait-channel lifecycle state',
patterns: [
{
regex: /\bpub struct ToolConfirmationRequestFacts\b/,
message: 'missing tool confirmation request facts',
},
{
regex: /\bpub struct ToolConfirmationGateFacts\b/,
message: 'missing tool confirmation gate facts',
},
{
regex: /\bpub enum ToolConfirmationGatePlan\b/,
message: 'missing tool confirmation gate plan',
},
{
regex: /\bpub enum ToolConfirmationPlan\b/,
message: 'missing tool confirmation plan contract',
},
{
regex: /\bpub enum ToolConfirmationOutcome\b/,
message: 'missing tool confirmation outcome contract',
},
{
regex: /\bpub enum ToolConfirmationWaitResult\b/,
message: 'missing tool confirmation wait-result contract',
},
{
regex: /\bpub enum ToolConfirmationResponse\b/,
message: 'missing tool confirmation channel response',
},
{
regex: /\bpub enum ConfirmationFailureKind\b/,
message: 'missing tool confirmation failure kind',
},
{
regex: /\bpub struct ToolConfirmationChannelStore\b/,
message: 'missing tool confirmation channel store',
},
{
regex: /\bpub fn resolve_tool_confirmation_plan\b/,
message: 'missing tool confirmation plan resolver',
},
{
regex: /\bpub fn resolve_tool_confirmation_gate\b/,
message: 'missing tool confirmation gate resolver',
},
{
regex: /\bpub fn resolve_confirmation_failure\b/,
message: 'missing tool confirmation failure resolver',
},
{
regex: /\bpub fn resolve_confirmation_wait_result\b/,
message: 'missing tool confirmation wait-result resolver',
},
{
regex: /\bconfirmation_channel_store_delivers_confirmation_once\b/,
message: 'missing confirmation channel delivery regression',
},
],
},
{
path: 'src/crates/execution/agent-runtime/src/checkpoint.rs',
reason:
Expand All @@ -1908,37 +1845,6 @@ export const requiredContentRules = [
},
],
},
{
path: 'src/crates/execution/agent-runtime/tests/tool_confirmation_contracts.rs',
reason:
'agent-runtime tool confirmation owner must keep behavior-equivalence contracts for legacy permission planning and failures',
patterns: [
{
regex: /\bconfirmation_plan_requires_permission_only_when_both_flags_are_true\b/,
message: 'missing tool confirmation gate regression',
},
{
regex: /\bconfirmation_gate_preserves_skip_policy_precedence\b/,
message: 'missing tool confirmation skip-policy regression',
},
{
regex: /\bconfirmation_gate_requires_confirmation_only_for_permissioned_tools\b/,
message: 'missing tool confirmation permissioned-tool regression',
},
{
regex: /\bconfirmation_plan_preserves_legacy_no_timeout_one_year_deadline\b/,
message: 'missing tool confirmation no-timeout regression',
},
{
regex: /\bconfirmation_failure_mapping_preserves_legacy_reasons_and_errors\b/,
message: 'missing tool confirmation failure mapping regression',
},
{
regex: /\bconfirmation_wait_result_mapping_preserves_legacy_timeout_and_rejection\b/,
message: 'missing tool confirmation wait-result mapping regression',
},
],
},
{
path: 'src/crates/execution/agent-runtime/src/scheduler.rs',
reason:
Expand Down Expand Up @@ -2791,27 +2697,15 @@ export const requiredContentRules = [
{
path: 'src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs',
reason:
'core tool pipeline must delegate portable confirmation planning, failure mapping, and channel ownership to agent-runtime while retaining state/event/tool execution wiring',
'core tool pipeline must delegate portable cancellation and retry policy while retaining state/event/tool execution wiring',
patterns: [
{
regex: /\bresolve_tool_confirmation_plan\b/,
message: 'missing tool confirmation plan delegation',
},
{
regex: /\bresolve_confirmation_failure\b/,
message: 'missing tool confirmation failure mapping delegation',
},
{
regex: /\bresolve_confirmation_wait_result\b/,
message: 'missing tool confirmation wait-result mapping delegation',
regex: /\bremote_workspace_route_root_isolated_from_same_local_path\b/,
message: 'missing remote workspace permission identity isolation regression',
},
{
regex: /\bToolConfirmationPlan::Await\b/,
message: 'missing tool confirmation await-plan handling',
},
{
regex: /\bToolConfirmationChannelStore\b/,
message: 'missing tool confirmation channel owner delegation',
regex: /\bonce_and_always_replies_control_execution_and_remembered_grants\b/,
message: 'missing permission project and remote grant isolation regression',
},
{
regex: /\bToolCancellationTokenStore\b/,
Expand Down Expand Up @@ -5354,10 +5248,6 @@ export const requiredContentRules = [
regex: /\bpub fn get_tool_spec_is_concurrency_safe\b/,
message: 'missing pure GetToolSpec concurrency metadata contract',
},
{
regex: /\bpub fn get_tool_spec_needs_permissions\b/,
message: 'missing pure GetToolSpec permission metadata contract',
},
{
regex: /\bpub fn validate_get_tool_spec_input\b/,
message: 'missing pure GetToolSpec input validation contract',
Expand Down Expand Up @@ -6627,10 +6517,6 @@ export const requiredContentRules = [
regex: /\bremote_poll_handler_preserves_missing_workspace_error\b/,
message: 'missing remote poll missing-workspace regression',
},
{
regex: /\bremote_interaction_handler_preserves_default_reject_reason\b/,
message: 'missing remote interaction default reject regression',
},
],
},
{
Expand Down Expand Up @@ -6950,12 +6836,8 @@ export const requiredContentRules = [
{
path: 'src/crates/assembly/core/src/agentic/coordination/scheduler.rs',
reason:
'core scheduler keeps remote queue policy semantics until agent-runtime migration is reviewed',
'core scheduler must keep dialog lifecycle and requester-aware cancellation adapters',
patterns: [
{
regex: /\bremote_queue_policy_preserves_confirmation_boundary\b/,
message: 'missing remote queue policy regression',
},
{
regex: /\bimpl AgentDialogTurnPort for DialogScheduler\b/,
message: 'missing dialog lifecycle port implementation',
Expand Down
39 changes: 2 additions & 37 deletions scripts/core-boundaries/self-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1999,25 +1999,6 @@ export function runManifestParserSelfTest({
path: 'src/crates/execution/agent-runtime/tests/post_call_hook_execution_contracts.rs',
contracts: ['successful_tool_post_call_executor_runs_deep_review_measurement_route'],
},
{
path: 'src/crates/execution/agent-runtime/src/tool_confirmation.rs',
contracts: [
'ToolConfirmationRequestFacts',
'ToolConfirmationGateFacts',
'ToolConfirmationGatePlan',
'ToolConfirmationPlan',
'ToolConfirmationOutcome',
'ToolConfirmationWaitResult',
'ToolConfirmationResponse',
'ToolConfirmationChannelStore',
'ConfirmationFailureKind',
'resolve_tool_confirmation_gate',
'resolve_tool_confirmation_plan',
'resolve_confirmation_failure',
'resolve_confirmation_wait_result',
'confirmation_channel_store_delivers_confirmation_once',
],
},
{
path: 'src/crates/execution/agent-runtime/src/user_questions.rs',
contracts: [
Expand Down Expand Up @@ -2154,17 +2135,6 @@ export function runManifestParserSelfTest({
'ShellType::Custom(name)',
],
},
{
path: 'src/crates/execution/agent-runtime/tests/tool_confirmation_contracts.rs',
contracts: [
'confirmation_gate_preserves_skip_policy_precedence',
'confirmation_gate_requires_confirmation_only_for_permissioned_tools',
'confirmation_plan_requires_permission_only_when_both_flags_are_true',
'confirmation_plan_preserves_legacy_no_timeout_one_year_deadline',
'confirmation_failure_mapping_preserves_legacy_reasons_and_errors',
'confirmation_wait_result_mapping_preserves_legacy_timeout_and_rejection',
],
},
{
path: 'src/crates/execution/agent-runtime/src/checkpoint.rs',
contracts: [
Expand Down Expand Up @@ -2630,10 +2600,8 @@ export function runManifestParserSelfTest({
{
path: 'src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs',
contracts: [
'resolve_tool_confirmation_plan',
'resolve_confirmation_failure',
'resolve_confirmation_wait_result',
'ToolConfirmationPlan::Await',
'remote_workspace_route_root_isolated_from_same_local_path',
'once_and_always_replies_control_execution_and_remembered_grants',
'should_retry_tool_attempt',
'retry_delay_ms',
'build_tool_call_truncation_recovery_notice',
Expand Down Expand Up @@ -2734,7 +2702,6 @@ export function runManifestParserSelfTest({
'render_get_tool_spec_tool_use_message',
'get_tool_spec_is_readonly',
'get_tool_spec_is_concurrency_safe',
'get_tool_spec_needs_permissions',
'validate_get_tool_spec_input',
'build_get_tool_spec_assistant_detail',
'build_get_tool_spec_duplicate_load_result',
Expand Down Expand Up @@ -3032,7 +2999,6 @@ export function runManifestParserSelfTest({
'remote_poll_handler_preserves_missing_workspace_error',
'RemoteInteractionRuntimeHost',
'handle_remote_interaction_command',
'remote_interaction_handler_preserves_default_reject_reason',
'RemoteDefaultModelsConfig',
'RemoteModelConfig',
'RemoteModelCatalog',
Expand Down Expand Up @@ -3104,7 +3070,6 @@ export function runManifestParserSelfTest({
{
path: 'src/crates/assembly/core/src/agentic/coordination/scheduler.rs',
contracts: [
'remote_queue_policy_preserves_confirmation_boundary',
'AgentDialogTurnPort',
'AgentLifecycleDeliveryPort',
'AgentTurnCancellationPort',
Expand Down
26 changes: 26 additions & 0 deletions src/apps/cli/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub(crate) enum ActionHandler {
Init,
History,
Usage,
ToggleAutoApprove,
Exit,
Login,
Logout,
Expand Down Expand Up @@ -444,6 +445,21 @@ static ACTION_SPECS: &[ActionSpec] = &[
shortcut_label: None,
slash_on_startup: true,
},
ActionSpec {
id: "toggle_auto_approve",
name: "Auto mode",
aliases: &["/auto"],
description: "Toggle Auto mode for the current session",
contexts: CHAT,
availability: ActionAvailability::Idle,
handler: ActionHandler::ToggleAutoApprove,
default_bindings: &[],
fallback_bindings: &[],
shortcut_field: None,
palette: palette("Session", false),
shortcut_label: None,
slash_on_startup: false,
},
ActionSpec {
id: "exit",
name: "Exit the app",
Expand Down Expand Up @@ -1694,6 +1710,16 @@ mod tests {
);
}

#[test]
fn auto_mode_is_chat_only_and_idle_only() {
assert!(action_for_alias("/auto", ActionContext::Startup).is_none());

let action = action_for_alias("/auto", ActionContext::Chat).unwrap();
assert_eq!(action.handler, ActionHandler::ToggleAutoApprove);
assert!(action.available(ActionState::chat(false, false)));
assert!(!action.available(ActionState::chat(true, false)));
}

#[test]
fn extension_management_uses_capability_entries_instead_of_external_commands() {
let tools = action_for_alias("/tools", ActionContext::Chat).unwrap();
Expand Down
Loading
Loading