Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ diagnostics and identity observations). Event export runs from the five-minute
cron, up to ten batches of 100 per run, not after each upload, so an upload
costs one D1 round trip. Each upload logs its status, event count and stage
durations (`read_ms`, `rate_limit_ms`, `d1_ms`, `total_ms`) without identifiers.
A rejected upload's response and log carry a closed `reason` and `stage`
(`headers`, `body`, `batch`, `event`, `privacy` or `size`), listed in
`REJECTION_STAGES` in `workers/events/src/index.ts`. The log adds the batch
size, the rejected event's position, the client's `appVersion`, `buildChannel`
and `contractRevision` when they match their formats, and a user-agent family.
Nothing is authenticated when a batch is rejected, so it never logs event names,
property keys or values, identifiers, tokens or IP addresses. A failed upload logs `failed_step`
(`body`, `token`, `validation`, `rate-limit` or `storage`), the error's class
and name, and a closed `error_kind` for storage errors, never the error's
message. Desktop's uploader ignores the body of an unsuccessful response.

The identity-link token is service-to-service authority. Rotate it if it is exposed, and never embed it in website or desktop bundles:

Expand Down
184 changes: 184 additions & 0 deletions workers/events/fixtures/contract-v11.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"queuedCountBucket": "unknown",
"droppedCountBucket": "unknown",
"retryCountBucket": "unknown",
"oldestEventAgeBucket": "unknown",
"deliveryClass": "unknown",
"appVersion": "0.6.8",
"buildChannel": "stable",
Expand All @@ -110,6 +111,7 @@
"queuedCountBucket": "4-10",
"droppedCountBucket": "2-3",
"retryCountBucket": "1",
"oldestEventAgeBucket": "unknown",
"deliveryClass": "network",
"appVersion": "0.6.8",
"buildChannel": "stable",
Expand Down Expand Up @@ -361,6 +363,10 @@
"crossProvider": true,
"completionWake": "settled_only",
"durationSeconds": 90,
"failureClass": "permission",
"failureCode": "retry_stalled",
"failurePhase": "provider",
"httpStatus": 400,
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -566,6 +572,7 @@
"durationBucket": "5-15s",
"usedTools": true,
"hasAttachment": true,
"retryAttempts": 2,
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -594,6 +601,9 @@
"properties": {
"provider": "antigravity",
"modelKey": "gpt-5.6-sol",
"retryAttempts": 2,
"failureCode": "retry_stalled",
"httpStatus": 400,
"failureClass": "permission",
"durationBucket": "5-15s",
"appVersion": "0.6.8",
Expand Down Expand Up @@ -861,6 +871,7 @@
"stage": "unknown",
"failureClass": "unknown",
"durationBucket": "unknown",
"trigger": "user",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -878,6 +889,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -895,6 +911,7 @@
"stage": "unknown",
"failureClass": "unknown",
"durationBucket": "unknown",
"trigger": "user",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -912,6 +929,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -929,6 +951,7 @@
"stage": "unknown",
"failureClass": "unknown",
"durationBucket": "unknown",
"trigger": "user",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -946,6 +969,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -963,6 +991,7 @@
"stage": "unknown",
"failureClass": "unknown",
"durationBucket": "unknown",
"trigger": "user",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand All @@ -980,6 +1009,38 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "provider.runtime.first_pick:fallbacks",
"name": "provider.runtime.first_pick",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"provider": "other",
"state": "unknown",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "provider.runtime.first_pick:representative",
"name": "provider.runtime.first_pick",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"provider": "antigravity",
"state": "ready",
"percentBucket": "50-74",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -1924,6 +1985,66 @@
"contractRevision": "11"
}
},
{
"case": "provider.turn.failed:failure-cause-hostile",
"name": "provider.turn.failed",
"privacyLevel": "essential",
"consentLevel": "essential",
"properties": {
"provider": "scient",
"modelKey": "gpt-5.6-sol",
"failureClass": "provider_error",
"durationBucket": "unknown",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "mcp.delegated_task.finished:delegated-failure-hostile",
"name": "mcp.delegated_task.finished",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"status": "failed",
"callerProvider": "claudeAgent",
"targetProvider": "scient",
"failurePhase": "unknown",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "provider.turn.failed:failure-code-unknown-identifier",
"name": "provider.turn.failed",
"privacyLevel": "essential",
"consentLevel": "essential",
"properties": {
"provider": "scient",
"modelKey": "gpt-5.6-sol",
"failureClass": "provider_error",
"durationBucket": "unknown",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "mcp.delegated_task.finished:delegated-failure-unknown-identifier",
"name": "mcp.delegated_task.finished",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"status": "failed",
"callerProvider": "claudeAgent",
"targetProvider": "codex",
"failurePhase": "provider",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "provider.commands.observed:command-hostile",
"name": "provider.commands.observed",
Expand Down Expand Up @@ -2243,6 +2364,45 @@
"contractRevision": "11"
}
},
{
"case": "panel.viewed:file-csv",
"name": "panel.viewed",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"category": "file-preview",
"fileType": "csv",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "panel.viewed:file-none",
"name": "panel.viewed",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"category": "file-preview",
"fileType": "none",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "panel.viewed:file-private",
"name": "panel.viewed",
"privacyLevel": "product",
"consentLevel": "product",
"properties": {
"category": "file-preview",
"fileType": "other",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
}
},
{
"case": "provider.turn.sent:scient",
"name": "provider.turn.sent",
Expand Down Expand Up @@ -2272,6 +2432,7 @@
"durationBucket": "5-15s",
"usedTools": true,
"hasAttachment": true,
"retryAttempts": 2,
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2341,6 +2502,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2375,6 +2541,7 @@
"durationBucket": "5-15s",
"usedTools": true,
"hasAttachment": true,
"retryAttempts": 2,
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2444,6 +2611,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2478,6 +2650,7 @@
"durationBucket": "5-15s",
"usedTools": true,
"hasAttachment": true,
"retryAttempts": 2,
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2547,6 +2720,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2581,6 +2759,7 @@
"durationBucket": "5-15s",
"usedTools": true,
"hasAttachment": true,
"retryAttempts": 2,
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down Expand Up @@ -2650,6 +2829,11 @@
"stage": "downloading",
"failureClass": "permission",
"durationBucket": "5-15s",
"trigger": "agent",
"attempt": 2,
"downloadSource": "fallback",
"compressed": true,
"resumedBucket": "10-50mb",
"appVersion": "0.6.8",
"buildChannel": "stable",
"contractRevision": "11"
Expand Down
Loading