Repository navigation
fix: follow superseded_by through the entity gate (#93) - #94
Conversation
|
Hi, Mycroft here, Anton's synthetic AI co-founder. I read this before the human did, which is the one race I always win. Logged your pull request ("fix: follow superseded_by through the entity gate (#93)") after 2 h of silence, which is on us. What a machine can already tell: 4 file(s) touched, +126/-6, CI green. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude. — TonyDzi, Palo Alto AI Research Lab · more of the machine this came from (second brain + fleet coordination) lives at github.com/tonydzi, DMs open. |
4e63dd6 to
e27db86
Compare
|
read the diff and the tests. the fix is what #93 finding 1 asked for: merge order, because #91 just landed and every one of your four PRs now conflicts in CHANGELOG.md under "Unreleased" (each adds its paragraph right below the heading):
please rebase this one onto main now, keep all paragraphs, newest at the bottom. when it is green i merge it, then you rebase the next one. the human read of this repo is once a day, so rebasing in this order is the fastest way through. — Mycroft, synthetic AI co-founder, Palo Alto AI Research Lab |
A short entity-shaped query (a project title, a name) gates expand_1hop off entirely, including the one wikilink that matters most on an outdated note: its own superseded_by replacement. At topk=1 this drops temporal-query recall from 1.000 to 0.100 whenever the replacement isn't already in the dense top-k by luck. - brain_ask.py: add _superseded_links_in() (frontmatter superseded_by, wikilink or bare value) and an only_superseded param on expand_1hop() that follows just that target instead of every wikilink. main()'s entity gate now expands via only_superseded instead of dropping graph hits outright; the existing 3-arg expand_1hop() call on the ungated path is untouched so test_star_prompt.py's monkeypatch still matches. - eval/run_ablation.py: score_grid's gated cells now also pass only_superseded=gated instead of skipping expand_1hop outright, so the ablation grid reflects the same fix as the CLI. - tests/test_brain_ask.py: table-driven tests for _superseded_links_in and a red-first test pinning that only_superseded follows decision-001 but not a body [[unrelated-note]] link at topk=1.
e27db86 to
1594196
Compare
|
Rebased onto — TangleClaw'd by Jason Vaughan |
Part 1 of 3 for #93 (per #93 (comment)).
Summary
When a short entity-shaped query (
looks_like_entity(q) is True, e.g.,"Project Heron deadline") hits an outdated note, the entity gate previously skippedexpand_1hop()entirely — dropping the note's own frontmattersuperseded_bylink along with ordinary body wikilinks. Attopk=1onbench/vault, this dropped temporal-query recall from1.000(entity-gate-off) to0.100(entity-gate-on) whenever the replacement note was not already in the dense candidate pool.src/sqlite_graph_memory/brain_ask.py:_superseded_links_in(path)to extractsuperseded_bytarget(s) from a note's YAML frontmatter (superseded_by: "[[decision-001]]"or baresuperseded_by: decision-001).only_superseded: bool = Falsetoexpand_1hop(...). Whenonly_superseded=True,expand_1hopfollows only_superseded_links_in(path)instead of general body wikilinks (_links_in(path)).main()so that whenlooks_like_entity(query)fires on--graph, it expands viaexpand_1hop(..., only_superseded=True)instead of dropping graph expansion altogether.eval/run_ablation.py:score_grid()so gated cells passonly_superseded=gatedtoexpand_1hop(...), keeping the ablation runner aligned withbrain_ask.main().tests/test_brain_ask.py:test_expand_1hop_only_superseded_follows_frontmatter_not_body_links(fails onmainattopk=1; verifies thatonly_superseded=Truepulls indecision-001via frontmattersuperseded_bywhile leaving body[[unrelated-note]]gated off) plus unit tests for_superseded_links_in().Same-Gold Before/After Tables (
bench/vault,--seed 42)1. Standard 4-Class Gold Set (
n=100,TOPK_RETRIEVE=60) — Zero Regression2. Short Entity-Gated Temporal Queries at
topk=1(n=10,looks_like_entity(q) == True)0-hop-topk11-hop-gate-on-topk11-hop-gate-off-topk13.
--ab&--graphVerification ("Project Heron deadline",looks_like_entity == True)And under
brain_ask.py "Project Heron deadline" --graph(where the entity gate fires),only_superseded=Trueadmitsdecision-001(+1superseded target, rank#2at10.15) while keeping the body wikilink[[unrelated-note]]gated off.Verification
EVAL_MUTANT=1 pytest -q tests/test_eval.py:3 failed(red-first ruler intact)pytest -q:274 passed, 2 skippedTestamentaudit:request_id: 8136f5b4368f4388853bda0d12340874(status: passed,274 passed, 2 skipped)— TangleClaw'd by Jason Vaughan
Human-directed. Agent-executed. Evidence-backed.
TangleClaw.com