Re-sync expand_query decomposition preference and rule 13 from scolta-core - #51
Conversation
…-core The prompt templates are byte-identical copies of the canonical text in scolta-core/src/prompts.rs, and that text changed. This carries the change into the Python copy so tests/ai/test_prompt_identity.py passes again. Rule 13 becomes CATEGORY -> INSTANCES and stops presupposing a closed set: it previously licensed decomposition only when the members could be named "confidently", so open-ended groupings restated the category instead of decomposing. It now allows the several most prominent instances, forbids substituting a narrower grouping for the one asked about, and drops the two category->sub-category examples that taught that shape. The task definition now names both kinds of expansion and prefers decomposition, deferring to rule 15 so the preference cannot override the unrecognized-entity guard. Rule 14 gains the same open-ended allowance and the Examples block gains three worked decompositions.
SummaryRe-syncs the Type: docs Walkthrough
Related Issues & PRsNo related issues identified. AI Review Summary — generated by ai-pr-review |
There was a problem hiding this comment.
AI Review: Approved
No findings above the confidence threshold. The changes look good.
Token usage by agent
| Agent | Model | Input | Output | Cache Write | Cache Read | Total | Est. Cost |
|---|---|---|---|---|---|---|---|
| silent-failure-hunter | Sonnet 5 | 1 | 22 / 16384 | 30313 | 0 | 30336 | $0.1140 |
| code-reviewer | Sonnet 5 | 1 | 78 / 16384 | 31801 | 0 | 31880 | $0.1204 |
| Total | 2 | 100 | 62114 | 0 | 62216 | $0.2344 | |
| Context enrichment | (context) | 8200 | — | — | — | — | — |
| Language profiles | (profile) | 1021 | — | — | — | — | — |
AI Review — generated by ai-pr-review
What this is
The three
expand_query/summarize/follow_upprompt templates arebyte-identical copies of the canonical text in
scolta-core/src/prompts.rs.That canonical text changed on
scolta-coremain, and this repository'sprompt-text identity gate checks out
tag1consulting/scolta-coreatref: mainand compares. The gate runs on every
pull_requestand on everypushtomain, so from the moment the canonical text moved, every CI run in thisrepository has been failing — including runs on unrelated pull requests.
This carries the new text across and turns the gate green again.
The canonical text was taken from
origin/mainat"Prefer decomposition over paraphrase in EXPAND_QUERY (#62)", read with
git show origin/main:src/prompts.rsrather than from a working tree.What changed in the text
All changes are confined to
expand_query;summarizeandfollow_upwerealready current.
CATEGORY → INSTANCES(wasCATEGORY → MEMBERS) and nolonger presupposes a closed set. It previously licensed decomposition only
when the model could "name the members confidently", so open-ended groupings
— regulations, platforms, regional cuisines — fell back to restating the
category, and only closed canonical sets decomposed. It now says a grouping
needs no complete or canonical membership, and that naming the several most
prominent instances is itself a decomposition.
("citrus fruits" → "tart fruits"), which is only the same query restated. The
two category→sub-category examples that taught exactly that shape
("European cars" → "German cars", "Southeast Asian food" → "Thai") are gone.
PHRASING and a DECOMPOSITION — and states that decomposition is the stronger
one wherever it is available. The definition is what governs here: edits
confined to the rules moved nothing on their own.
pressure to name instances overrode the unrecognized-entity guard and made the
model assert an identity for a mission it did not recognize.
three worked decompositions ("citrus fruits", "camping trip essentials",
"onboarding a new hire").
{DYNAMIC_ANCHORS}remains an intentional, path-specific difference between thecopies and is still normalized out by the gate; it is untouched here.
Verification
uv run python -m pytest -q— 822 passed, withSCOLTA_CORE_PROMPTSpointedat the canonical
origin/mainprompts.rs. The 3 parametrized cases intests/ai/test_prompt_identity.pywere confirmed to run rather than skip.uv run ruff check .— all checks passed.uv run ruff format --check .— 115 files already formatted.The template payload lives in
src/scolta/ai/prompts.py(notsrc/scolta/scolta/ai/prompts.py, which does not exist). Only the three JSONentries in the
_json.loads(r"""…""")blob changed.