Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ To validate terraform changes locally:
2. Run `terraform init` and `terraform validate`
3. If modifying modules, you may also need to run `terraform test` within those module directories if tests are defined (e.g. `terraform test --var="deployment_bundle=..."`)

## JSON Formatting Conventions

Example API response files (under `example-api-responses/original/` and `example-api-responses/sanitized/`) must use **pretty-printed JSON** with the following style:

- **2-space indentation** for nested objects and arrays
- **Space after each colon** in object entries (i.e., `"key": value`, not `"key":value`)
- **Unix line endings** (`\n`)

This matches the default output of Jackson's `DefaultPrettyPrinter` (without the `withoutSpacesInObjectEntries()` option). Tests in `RulesBaseTestCase.testExamples` compare sanitized output against these files after running it through `TestUtils.prettyPrintJson()`, so the files must match that format exactly.

Example of correct formatting:
```json
{
"id": "abc123",
"labelIds": [
"UNREAD",
"INBOX"
],
"sizeEstimate": 1234
}
```

### Java Testing
Java changes are tested across multiple Java versions to ensure compatibility. The GitHub Actions workflows test against Java 17, 21 (LTS), 23, 24, and 25. In practice, testing with Java 21 is sufficient for local development.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
{
"data":[
"data": [
{
"actor":{
"email_address":"t~xDMfdtdRGSrGHouT_RlgtMjJM7WhGaCj1Qwz71dsWIY@emaildomain.com",
"type":"user_actor"
"actor": {
"email_address": "t~xDMfdtdRGSrGHouT_RlgtMjJM7WhGaCj1Qwz71dsWIY@emaildomain.com",
"type": "user_actor"
},
"core_metrics":{
"commits_by_claude_code":8,
"lines_of_code":{
"added":342,
"removed":128
"core_metrics": {
"commits_by_claude_code": 8,
"lines_of_code": {
"added": 342,
"removed": 128
},
"num_sessions":15,
"pull_requests_by_claude_code":2
"num_sessions": 15,
"pull_requests_by_claude_code": 2
},
"customer_type":"api",
"date":"2025-08-08T00:00:00Z",
"model_breakdown":[
"customer_type": "api",
"date": "2025-08-08T00:00:00Z",
"model_breakdown": [
{
"estimated_cost":{
"amount":186,
"currency":"USD"
"estimated_cost": {
"amount": 186,
"currency": "USD"
},
"model":"claude-sonnet-4-20250514",
"tokens":{
"cache_creation":2340,
"cache_read":8790,
"input":45230,
"output":12450
"model": "claude-sonnet-4-20250514",
"tokens": {
"cache_creation": 2340,
"cache_read": 8790,
"input": 45230,
"output": 12450
}
},
{
"estimated_cost":{
"amount":42,
"currency":"USD"
"estimated_cost": {
"amount": 42,
"currency": "USD"
},
"model":"claude-3-5-haiku-20241022",
"tokens":{
"cache_creation":890,
"cache_read":3420,
"input":23100,
"output":5680
"model": "claude-3-5-haiku-20241022",
"tokens": {
"cache_creation": 890,
"cache_read": 3420,
"input": 23100,
"output": 5680
}
}
],
"organization_id":"12345678-1234-5678-1234-567812345678",
"terminal_type":"iTerm.app",
"tool_actions":{
"edit_tool":{
"accepted":25,
"rejected":3
"organization_id": "12345678-1234-5678-1234-567812345678",
"terminal_type": "iTerm.app",
"tool_actions": {
"edit_tool": {
"accepted": 25,
"rejected": 3
},
"multi_edit_tool":{
"accepted":12,
"rejected":1
"multi_edit_tool": {
"accepted": 12,
"rejected": 1
},
"notebook_edit_tool":{
"accepted":5,
"rejected":2
"notebook_edit_tool": {
"accepted": 5,
"rejected": 2
},
"write_tool":{
"accepted":8,
"rejected":0
"write_tool": {
"accepted": 8,
"rejected": 0
}
},
"subscription_type":"enterprise"
"subscription_type": "enterprise"
}
],
"has_more":true,
"next_page":"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
"has_more": true,
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"data":[
"data": [
{
"id":"t~jKM-CaMiqY6bEt5D95tRBB7o1c5rdWPsRoS4cJDvjdQ",
"added_at":"2024-10-30T23:58:27.427722Z",
"email":"t~xDMfdtdRGSrGHouT_RlgtMjJM7WhGaCj1Qwz71dsWIY@emaildomain.com",
"role":"user",
"type":"user"
"id": "t~jKM-CaMiqY6bEt5D95tRBB7o1c5rdWPsRoS4cJDvjdQ",
"added_at": "2024-10-30T23:58:27.427722Z",
"email": "t~xDMfdtdRGSrGHouT_RlgtMjJM7WhGaCj1Qwz71dsWIY@emaildomain.com",
"role": "user",
"type": "user"
}
],
"first_id":"first_id",
"has_more":true,
"last_id":"last_id"
"first_id": "first_id",
"has_more": true,
"last_id": "last_id"
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@
"first_id": "claude_chat_abc123",
"last_id": "claude_chat_abc123"
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
"last_id": "user_abc789",
"next_page": "page_01Dd11ZXp4eZNug9r2UZSuqSzmEQbithz"
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
"first_id": "org_123abc",
"last_id": "org_234bcd"
}

Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"data":[
"data": [
{
"id":"activity_abc123",
"created_at":"2025-06-07T08:09:10Z",
"organization_id":"org_abc123",
"organization_uuid":"abcdef0123-4567-89ab-cdef-0123456789ab",
"actor":{
"type":"user_actor",
"email_address":"t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com",
"user_id":"t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"ip_address":"t~XpDkTQtL4LngyIZ_DpTbQ0VaBteaopfSexGaD_zNGXM",
"user_agent":"Mozilla/5.0..."
"id": "activity_abc123",
"created_at": "2025-06-07T08:09:10Z",
"organization_id": "org_abc123",
"organization_uuid": "abcdef0123-4567-89ab-cdef-0123456789ab",
"actor": {
"type": "user_actor",
"email_address": "t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com",
"user_id": "t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"ip_address": "t~XpDkTQtL4LngyIZ_DpTbQ0VaBteaopfSexGaD_zNGXM",
"user_agent": "Mozilla/5.0..."
},
"type":"claude_chat_created",
"claude_chat_id":"claude_chat_xyz789",
"claude_project_id":null
"type": "claude_chat_created",
"claude_chat_id": "claude_chat_xyz789",
"claude_project_id": null
},
{
"id":"activity_def456",
"created_at":"2025-06-07T09:10:11Z",
"organization_id":"org_abc123",
"organization_uuid":"abcdef0123-4567-89ab-cdef-0123456789ab",
"actor":{
"type":"user_actor",
"email_address":"t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com",
"user_id":"t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"ip_address":"t~XpDkTQtL4LngyIZ_DpTbQ0VaBteaopfSexGaD_zNGXM",
"user_agent":"Mozilla/5.0..."
"id": "activity_def456",
"created_at": "2025-06-07T09:10:11Z",
"organization_id": "org_abc123",
"organization_uuid": "abcdef0123-4567-89ab-cdef-0123456789ab",
"actor": {
"type": "user_actor",
"email_address": "t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com",
"user_id": "t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"ip_address": "t~XpDkTQtL4LngyIZ_DpTbQ0VaBteaopfSexGaD_zNGXM",
"user_agent": "Mozilla/5.0..."
},
"type":"claude_file_uploaded",
"claude_file_id":"claude_file_fgh789",
"claude_chat_id":"claude_chat_cde345"
"type": "claude_file_uploaded",
"claude_file_id": "claude_file_fgh789",
"claude_chat_id": "claude_chat_cde345"
}
],
"has_more":true,
"first_id":"activity_abc123",
"last_id":"activity_def456"
"has_more": true,
"first_id": "activity_abc123",
"last_id": "activity_def456"
}
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"id":"claude_chat_abc123",
"created_at":"2025-06-07T08:09:10Z",
"updated_at":"2025-06-07T08:09:11Z",
"deleted_at":null,
"organization_id":"org_abc123",
"organization_uuid":"abcdef0123-4567-89ab-cdef-0123456789ab",
"project_id":"claude_proj_xyz789",
"user":{
"id":"t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"email_address":"t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com"
"id": "claude_chat_abc123",
"created_at": "2025-06-07T08:09:10Z",
"updated_at": "2025-06-07T08:09:11Z",
"deleted_at": null,
"organization_id": "org_abc123",
"organization_uuid": "abcdef0123-4567-89ab-cdef-0123456789ab",
"project_id": "claude_proj_xyz789",
"user": {
"id": "t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"email_address": "t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com"
},
"chat_messages":[
"chat_messages": [
{
"role":"user",
"created_at":"2025-06-07T08:09:10Z",
"content":[
"role": "user",
"created_at": "2025-06-07T08:09:10Z",
"content": [
{
"type":"text",
"text":"{\"length\":65,\"word_count\":11}"
"type": "text",
"text": "{\"length\":65,\"word_count\":11}"
}
],
"files":[
"files": [
{
"id":"claude_file_xyz789",
"mime_type":"application/pdf"
"id": "claude_file_xyz789",
"mime_type": "application/pdf"
}
]
},
{
"role":"assistant",
"created_at":"2025-06-07T08:09:11Z",
"content":[
"role": "assistant",
"created_at": "2025-06-07T08:09:11Z",
"content": [
{
"type":"text",
"text":"{\"length\":73,\"word_count\":12}"
"type": "text",
"text": "{\"length\":73,\"word_count\":12}"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"data":[
"data": [
{
"id":"claude_chat_abc123",
"created_at":"2025-06-07T08:09:10Z",
"updated_at":"2025-06-07T09:10:11Z",
"deleted_at":null,
"organization_id":"org_abc123",
"organization_uuid":"abcdef0123-4567-89ab-cdef-0123456789ab",
"project_id":"claude_proj_xyz789",
"user":{
"id":"t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"email_address":"t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com"
"id": "claude_chat_abc123",
"created_at": "2025-06-07T08:09:10Z",
"updated_at": "2025-06-07T09:10:11Z",
"deleted_at": null,
"organization_id": "org_abc123",
"organization_uuid": "abcdef0123-4567-89ab-cdef-0123456789ab",
"project_id": "claude_proj_xyz789",
"user": {
"id": "t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"email_address": "t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com"
}
}
],
"has_more":false,
"first_id":"claude_chat_abc123",
"last_id":"claude_chat_abc123"
"has_more": false,
"first_id": "claude_chat_abc123",
"last_id": "claude_chat_abc123"
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"data":[
"data": [
{
"id":"t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"email":"t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com"
"id": "t~hzNx42jBr-4nE9px0Ear3NuRyZW9y0_o7pegL6tNN-Y",
"email": "t~_Mqo2yH0QgDytVpmJhxPaE36fR9YYF4mJyAMtmlLUAY@example.com"
},
{
"id":"t~MT680p8B8HtSIfmVLHXpfEwZri_4xAuLkoHOUnD5ypM",
"email":"t~5TglOcyVGpy0s4iFwMoL-G67Itorwak4J4Nm9CwxRkQ@example.com"
"id": "t~MT680p8B8HtSIfmVLHXpfEwZri_4xAuLkoHOUnD5ypM",
"email": "t~5TglOcyVGpy0s4iFwMoL-G67Itorwak4J4Nm9CwxRkQ@example.com"
}
],
"has_more":true,
"first_id":"user_xyz456",
"last_id":"user_abc789",
"next_page":"page_01Dd11ZXp4eZNug9r2UZSuqSzmEQbithz"
"has_more": true,
"first_id": "user_xyz456",
"last_id": "user_abc789",
"next_page": "page_01Dd11ZXp4eZNug9r2UZSuqSzmEQbithz"
}
Loading
Loading