Attribute command executions to trusted plugin scripts (#35020)

## What changed

- Resolve shell and unified-exec commands against the trusted plugin roots loaded for each turn.
- Add optional `pluginId` and safe plugin-relative `scriptPath` fields to command execution items and legacy execution events, and propagate them through app-server notifications.
- Include the attribution in command execution analytics while rejecting absolute, unsafe, and unattributed script paths.

## Testing

- Cover attribution for cached curated and remote plugin scripts from command execution through core and app-server events.
- Verify analytics serialization and unsafe-path filtering.

GitOrigin-RevId: 02fac3a233284ccfc6642fa502a95f1881dba83d
This commit is contained in:
Kyle Brown authored and copyberry committed 2026-07-23 22:31:53 +00:00
1 parent 5bdbd3ee90
commit 84fa68b429
52 files changed
+858 -32

No files matched your search

@@ -1355,6 +1355,8 @@ async fn start_command_execution_item(
started_at_ms: now_unix_timestamp_ms(),
item: ThreadItem::CommandExecution {
id: item_id,
plugin_id: None,
script_path: None,
command,
cwd,
process_id: None,
@@ -1399,6 +1401,8 @@ async fn complete_command_execution_item(
let item = ThreadItem::CommandExecution {
id: item_id,
plugin_id: None,
script_path: None,
command,
cwd,
process_id,
@@ -2537,6 +2541,8 @@ mod tests {
payload.item,
ThreadItem::CommandExecution {
id: "cmd-1".to_string(),
plugin_id: None,
script_path: None,
command: completion_item.command.clone(),
cwd: completion_item.cwd.clone(),
process_id: None,