Track artifact operations from trusted plugin markers (#38057)

## What changed

- Recognize validated create and edit marker commands from the trusted presentations, documents, spreadsheets, and PDF plugins.
- Emit a `codex_artifact_operation` analytics event plus started-count and expected-output-count metrics when a recognized marker starts through unified exec.
- Attribute remote executor commands only when their plugin cache path and script contents match a trusted local plugin, including primary-runtime plugins.

## Testing

- Cover supported marker combinations and reject mismatched plugins, paths, arguments, counts, and output formats.
- Cover local, relocated remote, and Windows-style plugin attribution, including rejection of modified remote scripts.

GitOrigin-RevId: 475cc1689aa7f371a24dec0a8bdb6f7fd5a2e922
This commit is contained in:
edwardysun3 authored and copyberry committed 2026-08-11 19:26:41 +00:00
1 parent 285abc0368
commit 44d992c14e
18 files changed
+971 -60

No files matched your search

+15
View File
@@ -61,6 +61,7 @@ use crate::events::ToolItemTerminalStatus;
use crate::events::TrackEventRequest;
use crate::events::WebSearchActionKind;
use crate::events::codex_app_metadata;
use crate::events::codex_artifact_operation_event_request;
use crate::events::codex_compaction_event_params;
use crate::events::codex_goal_event_params;
use crate::events::codex_hook_run_metadata;
@@ -74,6 +75,7 @@ use crate::facts::AnalyticsFact;
use crate::facts::AnalyticsJsonRpcError;
use crate::facts::AppMentionedInput;
use crate::facts::AppUsedInput;
use crate::facts::ArtifactOperationInput;
use crate::facts::CodeModeToolCallFact;
use crate::facts::CodeModeToolCallStatus;
use crate::facts::CodexCompactionEvent;
@@ -550,6 +552,9 @@ impl AnalyticsReducer {
self.ingest_server_request_aborted(completed_at_ms, request_id, out);
}
AnalyticsFact::Custom(input) => match input {
CustomAnalyticsFact::ArtifactOperation(input) => {
self.ingest_artifact_operation(input, out);
}
CustomAnalyticsFact::CodeModeToolCall(input) => {
self.ingest_code_mode_tool_call(input, out);
}
@@ -614,6 +619,16 @@ impl AnalyticsReducer {
}
}
fn ingest_artifact_operation(
&mut self,
input: ArtifactOperationInput,
out: &mut Vec<TrackEventRequest>,
) {
out.push(TrackEventRequest::ArtifactOperation(
codex_artifact_operation_event_request(input.tracking, input.operation),
));
}
fn ingest_code_mode_tool_call(
&mut self,
input: CodeModeToolCallFact,