Commit abd54ab
config: one configuration could produce a grounded answer with no source
`Config(max_passages=0)` returned an answer whose `kind` was "grounded",
whose `to_payload()["grounded"]` was true, and which had no sources and no
text. Composition slices the accepted passages to `accepted[:max_passages]`,
so zero passages were quoted while the trace still said passages had been
accepted — the refusal branch never ran, because retrieval had not failed.
That is the one outcome this project says it does not have, reached through
the constructor instead of through the corpus. `max_passages=-1`, a plausible
spelling of "no limit", was quieter and no better: `[:-1]` drops the last
accepted passage.
`cairn.toml` could not reach either, because `load_config` checked the bounds
after building the object. Nothing else did — and this is a reference
implementation whose whole invitation is that an agency imports it. There were
also no tests over configuration loading at all.
The bounds move onto `Config.__post_init__`, so a file and a caller are held
to the same rules and there is one place they are stated. `load_config`'s
duplicate check is gone. Three tests: the unusable values are refused by both
routes, and every usable configuration still grounds on at least one source or
refuses with none.
No behaviour change for any valid configuration: the bundle re-records
byte-identical and the gate returns the same run id.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PR8WtSFsAW68eGYW13eb8j1 parent fcfcabe commit abd54ab
2 files changed
Lines changed: 100 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
60 | 92 | | |
61 | 93 | | |
62 | 94 | | |
| |||
109 | 141 | | |
110 | 142 | | |
111 | 143 | | |
112 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
113 | 147 | | |
114 | 148 | | |
115 | 149 | | |
| |||
122 | 156 | | |
123 | 157 | | |
124 | 158 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
115 | 179 | | |
116 | 180 | | |
117 | 181 | | |
| |||
0 commit comments