Matrix intake: frame parse with team roster so a teammate isn't read as the prospect
Local-smoke found "jonathan is chatting with wyoming" extracted the teammate, not the prospect. Feed the parser an optional team roster (INTAKE_TEAM_ROSTER) via a build_system(roster) outreach frame: roster names/initials are the people doing outreach and are never extracted; the other party is the investor/prospect. Same framing on the revise leg. Unset roster = prior behavior.
This commit is contained in:
@@ -34,6 +34,9 @@ async def main():
|
||||
nudge = matrix_io.make_reply(client)
|
||||
store = proposals.ProposalStore()
|
||||
intake_room = mx["intake_room"]
|
||||
roster = settings.team_roster() # frames the parse: teammates do outreach, aren't prospects
|
||||
if roster:
|
||||
print(f"matrix-intake: team roster loaded ({len(roster)} names)", flush=True)
|
||||
|
||||
async def handle_intake(room_id, root, text):
|
||||
# A bare yes/no/approve typed in the MAIN timeline (not inside a proposal's thread) is
|
||||
@@ -44,7 +47,7 @@ async def main():
|
||||
"and reply there — the note is in the thread.", root)
|
||||
return
|
||||
try:
|
||||
proposal = await asyncio.to_thread(parse.parse_message, text)
|
||||
proposal = await asyncio.to_thread(parse.parse_message, text, roster=roster)
|
||||
except Exception as exc: # Spark/Qwen unreachable or bad response
|
||||
await say(room_id, f"⚠️ couldn't reach the local parser: {str(exc)[:200]}", root)
|
||||
return
|
||||
@@ -121,7 +124,7 @@ async def main():
|
||||
# re-run it through local Qwen (no Claude, no scrub). The human still approves the
|
||||
# revised card, so the draft→approve gate holds.
|
||||
try:
|
||||
revised = await asyncio.to_thread(parse.revise, proposal, text)
|
||||
revised = await asyncio.to_thread(parse.revise, proposal, text, roster=roster)
|
||||
except Exception as exc:
|
||||
store.put(root, proposal)
|
||||
await say(room_id, f"⚠️ couldn't apply that change ({str(exc)[:200]}).\n\nReply **yes** "
|
||||
|
||||
Reference in New Issue
Block a user