Commit 1f075ef
committed
fix(corpus): camelCase dateStart/dateEnd dual-accept + obs_type key routing
Two defects in build_corpus path silently narrowed result sets:
1. CorpusRoutes destructured only snake_case (date_start, date_end) from the
request body, but the MCP tool surface advertises camelCase
(dateStart, dateEnd). Zod's .passthrough() let the unknown keys through
but the handler never read them — date filters were silently dropped.
Fix: declare both casings in the Zod schema and read either at the
destructure site.
2. CorpusBuilder set searchArgs.type = filter.types.join(',') — but `type`
is the search-router discriminator (observations|sessions|prompts),
NOT the observation-type filter. Passing 'bugfix,decision' to that key
matched zero rows; a downstream array hydrate masked the failure and
returned only entries that survived a different filter pass.
Fix: route the joined types through searchArgs.obs_type (the correct
observation-type filter key).1 parent 8463689 commit 1f075ef
2 files changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
82 | | - | |
83 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | | - | |
92 | | - | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
0 commit comments