Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.
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 docs/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
| [public.subscription_plans](public.subscription_plans.md) | 7 | | BASE TABLE |
| [public.user_subscriptions](public.user_subscriptions.md) | 9 | | BASE TABLE |
| [public.behavior_caches](public.behavior_caches.md) | 4 | | BASE TABLE |
| [public.classification_caches](public.classification_caches.md) | 7 | | BASE TABLE |

## Enums

Expand Down Expand Up @@ -328,6 +329,15 @@ erDiagram
text converted_description
timestamp_with_time_zone created_at
}
"public.classification_caches" {
uuid id
bytea content_hash
varchar_10_ language
varchar_100_ model_id
jsonb phase1_output
jsonb test_index_map
timestamp_with_time_zone created_at
}
```

---
Expand Down
51 changes: 51 additions & 0 deletions docs/schema/public.classification_caches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# public.classification_caches

## Description

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description for this new table is missing. Adding a description will help others understand its purpose. Based on the pull request description, you could add the following:

"Caches Phase 1 test classification results to support incremental diff calculation. Corresponds to behavior_caches (Phase 2) as the Phase 1 cache layer."

Suggested change
Cache Phase 1 test classification results to support incremental diff calculation. Corresponds to `behavior_caches` (Phase 2) as the Phase 1 cache layer.

## Columns

| Name | Type | Default | Nullable | Children | Parents | Comment |
| -------------- | ------------------------ | ----------------- | -------- | -------- | ------- | ------- |
| id | uuid | gen_random_uuid() | false | | | |
| content_hash | bytea | | false | | | |
| language | varchar(10) | | false | | | |
| model_id | varchar(100) | | false | | | |
| phase1_output | jsonb | | false | | | |
| test_index_map | jsonb | | false | | | |
Comment on lines +10 to +14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Comment field for several columns is empty, which makes it harder to understand their purpose. Adding comments would improve schema clarity. Based on the pull request description and the table structure, here are some suggested comments:

  • content_hash: SHA-256 hash of test file set
  • language: The programming language of the test files being classified.
  • model_id: The identifier of the model used for classification.
  • phase1_output: Classification result with Domain → Feature → TestIndices structure
  • test_index_map: TestIdentity → index mapping for diff calculation
Suggested change
| content_hash | bytea | | false | | | |
| language | varchar(10) | | false | | | |
| model_id | varchar(100) | | false | | | |
| phase1_output | jsonb | | false | | | |
| test_index_map | jsonb | | false | | | |
| content_hash | bytea | | false | | | SHA-256 hash of test file set |
| language | varchar(10) | | false | | | The programming language of the test files being classified. |
| model_id | varchar(100) | | false | | | The identifier of the model used for classification. |
| phase1_output | jsonb | | false | | | Classification result with Domain → Feature → TestIndices structure |
| test_index_map | jsonb | | false | | | TestIdentity → index mapping for diff calculation |

| created_at | timestamp with time zone | now() | false | | | |

## Constraints

| Name | Type | Definition |
| ---------------------------- | ----------- | ----------------------------------------- |
| classification_caches_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| uq_classification_caches_key | UNIQUE | UNIQUE (content_hash, language, model_id) |

## Indexes

| Name | Definition |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| classification_caches_pkey | CREATE UNIQUE INDEX classification_caches_pkey ON public.classification_caches USING btree (id) |
| uq_classification_caches_key | CREATE UNIQUE INDEX uq_classification_caches_key ON public.classification_caches USING btree (content_hash, language, model_id) |
| idx_classification_caches_created_at | CREATE INDEX idx_classification_caches_created_at ON public.classification_caches USING btree (created_at) |

## Relations

```mermaid
erDiagram


"public.classification_caches" {
uuid id
bytea content_hash
varchar_10_ language
varchar_100_ model_id
jsonb phase1_output
jsonb test_index_map
timestamp_with_time_zone created_at
}
```

---

> Generated by [tbls](https://github.com/k1LoW/tbls)
81 changes: 81 additions & 0 deletions docs/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2465,6 +2465,87 @@
"columns": ["cache_key_hash"]
}
]
},
{
"name": "public.classification_caches",
"type": "BASE TABLE",
"columns": [
{
"name": "id",
"type": "uuid",
"nullable": false,
"default": "gen_random_uuid()"
},
{
"name": "content_hash",
"type": "bytea",
"nullable": false
},
{
"name": "language",
"type": "varchar(10)",
"nullable": false
},
{
"name": "model_id",
"type": "varchar(100)",
"nullable": false
},
{
"name": "phase1_output",
"type": "jsonb",
"nullable": false
},
{
"name": "test_index_map",
"type": "jsonb",
"nullable": false
},
{
"name": "created_at",
"type": "timestamp with time zone",
"nullable": false,
"default": "now()"
}
],
"indexes": [
{
"name": "classification_caches_pkey",
"def": "CREATE UNIQUE INDEX classification_caches_pkey ON public.classification_caches USING btree (id)",
"table": "public.classification_caches",
"columns": ["id"]
},
{
"name": "uq_classification_caches_key",
"def": "CREATE UNIQUE INDEX uq_classification_caches_key ON public.classification_caches USING btree (content_hash, language, model_id)",
"table": "public.classification_caches",
"columns": ["content_hash", "language", "model_id"]
},
{
"name": "idx_classification_caches_created_at",
"def": "CREATE INDEX idx_classification_caches_created_at ON public.classification_caches USING btree (created_at)",
"table": "public.classification_caches",
"columns": ["created_at"]
}
],
"constraints": [
{
"name": "classification_caches_pkey",
"type": "PRIMARY KEY",
"def": "PRIMARY KEY (id)",
"table": "public.classification_caches",
"referenced_table": "",
"columns": ["id"]
},
{
"name": "uq_classification_caches_key",
"type": "UNIQUE",
"def": "UNIQUE (content_hash, language, model_id)",
"table": "public.classification_caches",
"referenced_table": "",
"columns": ["content_hash", "language", "model_id"]
}
]
}
],
"relations": [
Expand Down