Skip to content

Commit 7f663be

Browse files
committed
fix: sync template rule and golden coverage for schema v2 tables
1 parent f9726a9 commit 7f663be

11 files changed

Lines changed: 72 additions & 13 deletions

File tree

.changeset/sync-template-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@stainless-code/codemap": patch
3+
---
4+
5+
Sync bundled agent rule template with schema v2: add `type_members`, `calls`, and `doc_comment` trigger patterns and query rows. Add golden scenarios and fixture coverage for both new tables.

docs/golden-queries.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ Scenarios live in **`fixtures/golden/scenarios.json`** (Tier A) or optional **`s
6969

7070
## Status
7171

72-
| Area | State |
73-
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
74-
| Tier A runner + CI | **`bun run test:golden`** in `check` |
75-
| Tier A scenario coverage | 13 scenarios across all indexed tables: files, symbols, imports, exports, components, dependencies, markers, CSS vars/classes/keyframes |
76-
| Tier B external + schema | **`test:golden:external`**, Zod in **`scripts/query-golden/schema.ts`** |
77-
| Subset matchers + budgets | **`match`**, **`budgetMs`**, **`--strict-budget`** |
78-
| Optional CI for public corpus | Deferred — [roadmap § Backlog](./roadmap.md#backlog) |
72+
| Area | State |
73+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
74+
| Tier A runner + CI | **`bun run test:golden`** in `check` |
75+
| Tier A scenario coverage | 15 scenarios across all indexed tables: files, symbols, imports, exports, components, dependencies, markers, type_members, calls, CSS vars/classes/keyframes |
76+
| Tier B external + schema | **`test:golden:external`**, Zod in **`scripts/query-golden/schema.ts`** |
77+
| Subset matchers + budgets | **`match`**, **`budgetMs`**, **`--strict-budget`** |
78+
| Optional CI for public corpus | Deferred — [roadmap § Backlog](./roadmap.md#backlog) |
7979

8080
---
8181

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"callee_name": "createClient"
4+
},
5+
{
6+
"callee_name": "now"
7+
}
8+
]

fixtures/golden/minimal/exports-client.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[
2+
{
3+
"name": "ClientConfig",
4+
"kind": "type"
5+
},
26
{
37
"name": "createClient",
48
"kind": "value"

fixtures/golden/minimal/imports-consumer-alias.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"file_path": "src/consumer.ts",
44
"source": "~/api/client",
5-
"specifiers": "[\"createClient\"]",
5+
"specifiers": "[\"createClient\",\"ClientConfig\"]",
66
"is_type_only": 0
77
}
88
]

fixtures/golden/minimal/index-summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"files": 11,
4-
"symbols": 6,
4+
"symbols": 8,
55
"imports": 3,
66
"components": 1,
77
"dependencies": 2
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"name": "baseUrl",
4+
"type": "string",
5+
"is_optional": 0,
6+
"is_readonly": 1
7+
},
8+
{
9+
"name": "timeout",
10+
"type": "number",
11+
"is_optional": 1,
12+
"is_readonly": 0
13+
}
14+
]

fixtures/golden/scenarios.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,15 @@
6363
"id": "components-no-false-positives",
6464
"prompt": "Which components are detected (FormatPrice should not appear)?",
6565
"sql": "SELECT name FROM components ORDER BY name"
66+
},
67+
{
68+
"id": "type-members-client-config",
69+
"prompt": "What fields does ClientConfig have?",
70+
"sql": "SELECT name, type, is_optional, is_readonly FROM type_members WHERE symbol_name = 'ClientConfig' ORDER BY name"
71+
},
72+
{
73+
"id": "calls-consumer",
74+
"prompt": "What does the run function in consumer.ts call?",
75+
"sql": "SELECT DISTINCT callee_name FROM calls WHERE caller_name = 'run' AND file_path = 'src/consumer.ts' ORDER BY callee_name"
6676
}
6777
]

fixtures/minimal/src/api/client.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
export function createClient() {
2-
return { version: 1 };
1+
export interface ClientConfig {
2+
readonly baseUrl: string;
3+
timeout?: number;
4+
}
5+
6+
export function createClient(config?: ClientConfig) {
7+
return { version: 1, config };
38
}

fixtures/minimal/src/consumer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { createClient } from "~/api/client";
1+
import { createClient, type ClientConfig } from "~/api/client";
22

33
import { now } from "./utils/date";
44

55
// FIXME: handle errors
66
export function run() {
7-
createClient();
7+
const config: ClientConfig = { baseUrl: "https://api.example.com" };
8+
createClient(config);
89
return now();
910
}

0 commit comments

Comments
 (0)