Commit b51261b
committed
fix: make entity_registry.research() local-only by default
research() previously called _wikipedia_lookup() unconditionally,
sending entity names to en.wikipedia.org on every uncached lookup.
This violates the project's local-first and privacy-by-architecture
principles documented in CLAUDE.md.
Changes:
- research() now returns "unknown" for uncached words by default
- New allow_network=True parameter required for Wikipedia lookups
- Wikipedia 404 now returns "unknown" instead of asserting "person"
with 0.70 confidence, preventing entity registry poisoning
- Added privacy warning docstring to _wikipedia_lookup()
- Added tests for local-only default, opt-in network, 404 handling,
and cache-not-persisted-on-local-only behaviour
Refs: #8091 parent b060171 commit b51261b
2 files changed
Lines changed: 100 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| |||
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
247 | | - | |
| 253 | + | |
| 254 | + | |
248 | 255 | | |
249 | | - | |
250 | | - | |
| 256 | + | |
| 257 | + | |
251 | 258 | | |
252 | 259 | | |
253 | | - | |
| 260 | + | |
254 | 261 | | |
255 | 262 | | |
256 | 263 | | |
| |||
502 | 509 | | |
503 | 510 | | |
504 | 511 | | |
505 | | - | |
| 512 | + | |
506 | 513 | | |
507 | | - | |
508 | | - | |
509 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
510 | 525 | | |
511 | 526 | | |
512 | 527 | | |
513 | 528 | | |
514 | 529 | | |
515 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
516 | 542 | | |
517 | 543 | | |
518 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
217 | 251 | | |
218 | 252 | | |
219 | 253 | | |
| 254 | + | |
220 | 255 | | |
221 | 256 | | |
222 | 257 | | |
| |||
228 | 263 | | |
229 | 264 | | |
230 | 265 | | |
231 | | - | |
| 266 | + | |
232 | 267 | | |
233 | 268 | | |
234 | 269 | | |
| |||
240 | 275 | | |
241 | 276 | | |
242 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
243 | 287 | | |
244 | 288 | | |
245 | 289 | | |
| |||
251 | 295 | | |
252 | 296 | | |
253 | 297 | | |
254 | | - | |
| 298 | + | |
255 | 299 | | |
256 | 300 | | |
257 | 301 | | |
258 | 302 | | |
259 | 303 | | |
260 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
261 | 324 | | |
262 | 325 | | |
263 | 326 | | |
| |||
0 commit comments