Fix short-intent discovery and publish verified browser provider guidance
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a13690-1c84-77a2-aeee-7f517ec60f5d
This commit is contained in:
parent
9042dec5ed
commit
50077c9bea
22 changed files with 736 additions and 87 deletions
|
|
@ -147,7 +147,14 @@ def match_query(
|
|||
tokens = _tokens(blob)
|
||||
if not tokens:
|
||||
continue
|
||||
score = len(query.tokens & tokens) / len(query.tokens | tokens)
|
||||
# Score the name independently: descriptive summaries must not dilute
|
||||
# a direct short-intent match (e.g. "headless browser"). Keep the full
|
||||
# blob score for longer intents and summary/tag-only matches.
|
||||
name_tokens = _tokens(item.get("name", ""))
|
||||
score = max(
|
||||
len(query.tokens & tokens) / len(query.tokens | tokens),
|
||||
len(query.tokens & name_tokens) / len(query.tokens | name_tokens),
|
||||
)
|
||||
if score <= 0:
|
||||
continue
|
||||
scored.append(
|
||||
|
|
@ -340,7 +347,7 @@ def format_plan_check_markdown(result: dict[str, Any]) -> str:
|
|||
|
||||
verdict = result["verdict"]
|
||||
if verdict == "reuse":
|
||||
lines.append("**Verdict: REUSE** — an existing capability already covers this; link it instead of building new.")
|
||||
lines.append("**Verdict: REUSE** — a close lexical match exists; review its consumption contract and availability before adopting it.")
|
||||
elif verdict == "extend":
|
||||
lines.append("**Verdict: EXTEND** — scope overlaps closely enough that extending the top match is likely cheaper than a new capability.")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue