Commit aed6ad3
refactor(plausibility): grounding-based rules + R3 transcript contradiction
The plausibility prompt previously instructed the judge with "lexical
patterns" and "no judgment calls" and listed five drop rules as exact
token enumerations: R3 role-leak token list, R4 unresolved-placeholder
regex tied to the constrained {Person|City|Country|Org|Thing}
vocabulary, R5 sentinel-object token list, R6 dot-separated HA-style
identifier.
Two pivots applied here:
* Drop R4. The constrained-prefix regex became incoherent with the
open-vocabulary anonymizer pivot (commit d8de45c) and was already
structurally redundant with _strip_residual_placeholders running
inside _apply_bindings before the deanon-stage plausibility judge.
* Add R3 transcript contradiction. The transcript was rendered into
the prompt but no rule referenced it. The judge now drops facts
whose object contradicts the transcript on the same
(subject, predicate). Live probe confirms deterministic catch
across 3 runs at temp=0.
* Soften R3 (Role leak → Conversation-role reference), R4 (Empty /
sentinel object → Content-free object), R5 (System entity ID →
Namespaced system identifier) from "Subject or object is exactly
one of: ..." token enumerations to grounding-flavoured category
descriptions with the original tokens kept as illustrative
parentheticals. The rule examples are retained verbatim.
The structure of the prompt is preserved exactly: KEEP / DROP / Input /
Output sections; numbered R-rules with bold name + description +
`Example: [N] {...} → DROP (Rk) — include N` line; Input section
rendering transcript and indexed facts. The _DEFAULT_PLAUSIBILITY_PROMPT
inline default is kept byte-equivalent to the file (parity-gated by
tests/test_prompts_contract.py::test_inline_default_matches_file).
Empirical baseline (probe at /tmp/probe_plausibility_grounding.py,
10-fact synthetic input on local Mistral 7B): deterministic
{"drop": [3, 6, 8, 9]} across 3 runs. Catches R1 (self-loop), R2
(name-swap pair, both indices), R3 (transcript contradiction). Misses
on this probe: R4 (Assistant), R5 (Unknown), R6 (system identifier).
The misses share a pattern - Mistral 7B's KEEP-bias on ambiguous cases
overrides the rule when the fact reads as plausible content
(Assistant could be a name; Unknown could be a noun; controls
media_player.X sounds like a smart-home claim). Strengthening these
rules without regressing the structural KEEP-default behaviour is
tracked as an open optimization in the project memory; revisit
condition is whether SOTA enrichment in production actually emits
these failure modes.
Pre-existing miss: R6 system identifier was missed by the original
lexical prompt on the same probe input. Pattern-match wording vs.
semantic-judgment wording made no difference for the specific fact
shape "Person_1 controls media_player.X" - Mistral reads it as a
legitimate smart-home claim regardless. The miss is a Mistral 7B
capability gap, not a prompt bug.
Pytest CI-parity scope (-m "not gpu", --timeout=60): 3656 passed,
26 deselected, 0 failed in 11:19.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent d8de45c commit aed6ad3
3 files changed
Lines changed: 48 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
23 | | - | |
| 20 | + | |
| 21 | + | |
24 | 22 | | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
27 | 25 | | |
28 | | - | |
| 26 | + | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
| 29 | + | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1810 | 1810 | | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
| 1813 | + | |
| 1814 | + | |
1816 | 1815 | | |
1817 | 1816 | | |
1818 | 1817 | | |
1819 | 1818 | | |
1820 | | - | |
1821 | | - | |
| 1819 | + | |
| 1820 | + | |
1822 | 1821 | | |
1823 | 1822 | | |
1824 | 1823 | | |
1825 | 1824 | | |
1826 | 1825 | | |
1827 | 1826 | | |
1828 | | - | |
| 1827 | + | |
1829 | 1828 | | |
1830 | 1829 | | |
1831 | 1830 | | |
| |||
1835 | 1834 | | |
1836 | 1835 | | |
1837 | 1836 | | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
1847 | 1840 | | |
1848 | | - | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
1849 | 1845 | | |
1850 | | - | |
1851 | | - | |
| 1846 | + | |
| 1847 | + | |
1852 | 1848 | | |
1853 | 1849 | | |
1854 | | - | |
1855 | | - | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
1856 | 1854 | | |
1857 | 1855 | | |
1858 | 1856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
180 | 195 | | |
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
184 | 199 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
189 | 204 | | |
190 | 205 | | |
191 | 206 | | |
| |||
0 commit comments