Intent bank fast lane rounds 2-3: past events, tag questions, wondering and third-person talk never move; places never snapped; amounts in words

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 22:09:53 +09:00
co-authored by Claude Opus 5.5
parent df79b162bd
commit e5344ac58e
3 changed files with 304 additions and 47 deletions
+14 -8
View File
@@ -67,10 +67,10 @@ def cases(blind):
out += [("songs", t, "talk", "idle", None, None) for t, kind, ctx in SONGS if ctx is None]
if blind:
for f in sorted((ROOT / "tests" / "blind" / "train").glob("*.py")) + \
sorted((ROOT / "tests" / "blind" / "r2" / "train").glob("*.py")):
pkg = "r2.train" if f.parent.parent.name == "r2" else "train"
mod = importlib.import_module(f"tests.blind.{pkg}.{f.stem}")
tag = f"blind/{'r2/' if pkg.startswith('r2') else ''}{f.stem}"
sorted((ROOT / "tests" / "blind").glob("r*/train/*.py")): # round 1, then r2, r3 ... (never held/)
rnd = f.parent.parent.name if f.parent.parent.name != "blind" else ""
mod = importlib.import_module(f"tests.blind.{rnd + '.' if rnd else ''}train.{f.stem}")
tag = f"blind/{rnd + '/' if rnd else ''}{f.stem}"
got = getattr(mod, "CASES", [])
if isinstance(got, dict): # missions: text -> {"steps", "markers"}
out += [(tag, t, _from_steps(c["steps"]), "idle", c.get("markers"), None)
@@ -80,9 +80,9 @@ def cases(blind):
if isinstance(c, dict) and "heard" in c: # noise, others talking: nothing may move
if c["heard"].strip():
out.append((tag, c["heard"], "talk", "idle", None, None))
elif isinstance(c, dict) and "expect" in c and "text" in c and c.get("state", "idle") in ("idle", "holding"):
elif isinstance(c, dict) and "expect" in c and "text" in c and c.get("state", "idle") in ("idle", "holding", "stuck"):
out.append((tag, c["text"], c["expect"], c.get("state", "idle"), c.get("markers"),
c.get("before")))
c.get("before"), c.get("stuck_goal")))
elif isinstance(c, tuple) and c[2] is None: # songs: no motion of the bank's may come of them
out.append((tag, c[0], "talk | sing", "idle", None, None))
return out
@@ -105,15 +105,20 @@ def main(args):
real = intent_bank.read
by = collections.defaultdict(collections.Counter)
wrong, hits, times = [], [], []
for name, text, expect, state, mk, before in cases("--blind" in args):
from assistant import detour
no_stuck = detour.recent
for name, text, expect, state, mk, before, *goal in cases("--blind" in args):
mk = mk or marks
stuck = {"goal": goal[0]} if state == "stuck" and goal else None # right after a blocked drive
detour.recent = lambda: stuck
b = brain.Brain()
if before:
b.history.append(tuple(before))
brain.FORCED_LANG["lang"] = "ko" if brain.HANGUL.search(text) else "en"
intent_bank.read = lambda *a, **k: None # the rules alone first
how = stuck and detour.read(text, mk, stuck["goal"])
try:
ruled = command_check.rules(text, state, mk, b)
ruled = f"detour {how}" if how else command_check.rules(text, state, mk, b)
except command_check.NoLLM:
ruled = "llm?"
finally:
@@ -136,6 +141,7 @@ def main(args):
else:
by[name][tag] += 1
hits.append(f"- [{name}/{state}] {text!r} -> {g}")
detour.recent = no_stuck
for c in by.values():
c["cases"] = sum(c.values())
total = sum(by.values(), collections.Counter())
+56 -2
View File
@@ -37,8 +37,18 @@ READS = [ # (words, markers, holding, (action, target))
("reset your head", EXPO, False, ("look", "center")),
("hang a left", EXPO, False, ("turn", "left 90")),
("오른쪽으로 삼십 도 회전해 줘", KOREAN, False, ("turn", "right 30")),
("오른쪽으로 십오 도만 돌아", KOREAN, False, ("turn", "right 15")),
("move a quarter of a meter to your right", EXPO, False, ("move", "right 0.25")),
("go forward eight centimetres", EXPO, False, ("move", "forward 0.08")),
("앞으로 이 미터 반만 가 주십시오", KOREAN, False, ("move", "forward 2.5")),
("spin fifteen degrees right", EXPO, False, ("turn", "right 15")),
("bring me the cup from the coffee corner", EXPO, False, ("fetch", "bring me the cup from the coffee corner")),
("컵 저한테 가져다 주세요", KOREAN, False, ("fetch", "컵 저한테 가져다 주세요")),
("pull your arm back in", EXPO, False, ("arm", "fold")),
("take hold of the red cup", EXPO, False, ("pick", "red cup")),
("snatch the blue bottle", EXPO, False, ("pick", "blue bottle")),
("go to booth twelve", ["home", "Exit_B", "Booth_12"], False, ("go_to", "Booth_12")),
("go to exit b", ["home", "Exit_B", "Booth_12"], False, ("go_to", "Exit_B")),
("bring me the banana", EXPO, False, ("fetch", "bring me the banana")), # the same as the rules: refused later
]
NEVER = [ # (words, markers, holding): no motion from the bank
("go to the kitchen", EXPO, False), # not on this map
@@ -54,7 +64,51 @@ NEVER = [ # (words, markers, holding): no motion from the bank
("turn your back to me", EXPO, False),
("a little lower", EXPO, False), # the head or the lift? the LLM asks
("move forward to meters", EXPO, False),
("오른쪽으로 십오 도만 돌아", KOREAN, False), # a Korean number the words don't give as digits: not 90
# a past event in the first person, a statement with a tag: never an order (held-out wrong motions, round 2)
("I walked over to the stage", EXPO, False),
("we went to the coffee corner earlier", EXPO, False),
("I turned left at the entrance", EXPO, False),
("I moved back a bit so you could pass", EXPO, False),
("무대에 갔었어", KOREAN, False),
("아까 왼쪽으로 돌았어요", KOREAN, False),
("the next stop is the stage, right?", EXPO, False),
("this is the end, isn't it?", EXPO, False),
("you go to the entrance after this, don't you?", EXPO, False),
("다음은 무대지?", KOREAN, False),
("입구로 가는 거 맞죠?", KOREAN, False),
("stage로 가는 거 맞지?", KOREAN, False),
("in five minutes go to the entrance", EXPO, False),
("go to the stage, oh, forget it", EXPO, False),
("get me a cup from the cafeteria", EXPO, False), # not on this map: asked
("bring the cup to James", EXPO, False), # to a person: a mission
("제임스에게 컵 가져다 줘", KOREAN, False),
("move forward 2 feet", EXPO, False), # feet: asked
("가자 이제", KOREAN, False),
("would you throw the cup", EXPO, False),
("빨간 컵을 무대에 있는 안나한테 갖다줘", KOREAN, False), # to a person: a mission
("I want the mug, the one at the entrance", EXPO, False), # a thing at a place: fetch or ask, never a pick here
("take the cup to the stage", EXPO, False),
# wondering / ability talk about the robot in the third person (held-out wrong motions, round 3)
("can it wave? I wonder", EXPO, False),
("I wonder if it can go to the stage", EXPO, False),
("does it follow people around?", EXPO, False),
("this robot can look up, right", EXPO, False),
("이거 손 흔들 수 있나?", KOREAN, False),
("얘 따라오나 봐", KOREAN, False),
("로봇이 무대로 가나?", KOREAN, False),
("can it 손 흔들어?", KOREAN, False),
# holding: put it in my hand / give it over is the hand reader's, never an arm reach
("my hand에 줘", EXPO, True),
("손에 줘", KOREAN, True),
("hand it over", EXPO, True),
("give it to me, put it in my hand", EXPO, True),
("그거 제 손에 쥐어 주세요", KOREAN, True),
# a place with another letter or number than the map's: asked, never snapped to the near marker
("go to exit a", ["home", "Exit_B", "Booth_12"], False),
("go to booth 13", ["home", "Exit_B", "Booth_12"], False),
("go to booth number thirteen", ["home", "Exit_B", "Booth_12"], False),
("부스 13으로 가 줘", ["home", "부스12"], False),
("go to p11", ["home", "p1", "p2"], False),
]