Skip to content

Re-sync expand_query decomposition preference and rule 13 from scolta-core - #51

Merged
jeremyandrews merged 1 commit into
mainfrom
sync-prompt-text/decomposition-and-category-instances
Aug 6, 2026
Merged

Re-sync expand_query decomposition preference and rule 13 from scolta-core#51
jeremyandrews merged 1 commit into
mainfrom
sync-prompt-text/decomposition-and-category-instances

Conversation

@jeremyandrews

Copy link
Copy Markdown
Member

What this is

The three expand_query / summarize / follow_up prompt templates are
byte-identical copies of the canonical text in
scolta-core/src/prompts.rs.
That canonical text changed on scolta-core main, and this repository's
prompt-text identity gate checks out tag1consulting/scolta-core at ref: main
and compares. The gate runs on every pull_request and on every push to
main, so from the moment the canonical text moved, every CI run in this
repository 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/main at
"Prefer decomposition over paraphrase in EXPAND_QUERY (#62)", read with
git show origin/main:src/prompts.rs rather than from a working tree.

What changed in the text

All changes are confined to expand_query; summarize and follow_up were
already current.

  • Rule 13 becomes CATEGORY → INSTANCES (was CATEGORY → MEMBERS) and no
    longer 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.
  • Rule 13 forbids substituting a narrower grouping for the one asked about
    ("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.
  • The task definition now names both kinds of expansion — an alternate
    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.
  • That preference defers explicitly to rule 15. Without the deference, the
    pressure to name instances overrode the unrecognized-entity guard and made the
    model assert an identity for a mission it did not recognize.
  • Rule 14 gains the same open-ended allowance, and the Examples block gains
    three worked decompositions ("citrus fruits", "camping trip essentials",
    "onboarding a new hire").

{DYNAMIC_ANCHORS} remains an intentional, path-specific difference between the
copies and is still normalized out by the gate; it is untouched here.

Verification

  • uv run python -m pytest -q — 822 passed, with SCOLTA_CORE_PROMPTS pointed
    at the canonical origin/main prompts.rs. The 3 parametrized cases in
    tests/ai/test_prompt_identity.py were 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 (not
src/scolta/scolta/ai/prompts.py, which does not exist). Only the three JSON
entries in the _json.loads(r"""…""") blob changed.

…-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.
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Re-syncs the expand_query prompt template in the Python package with an updated version from the canonical scolta-core source. Rule 13 is renamed from "CATEGORY → MEMBERS" to "CATEGORY → INSTANCES," relaxing its requirement that grouping members be confidently and completely nameable, and forbidding substitution of a narrower category. Rule 14 gains the same open-ended allowance, the task definition now explicitly names and prioritizes decomposition over alternate phrasing (deferring to rule 15's unrecognized-entity guard), and three new worked examples are added.

Type: docs
Effort: 1/5 — single-file text/prompt-string update plus a changelog entry, no logic or schema changes

Walkthrough

File Change Summary
src/scolta/ai/prompts.py Modified Updated expand_query prompt text: rule 13 reworded to CATEGORY → INSTANCES, rule 14 open-ended allowance, task definition preference for decomposition, three new examples
CHANGELOG.md Modified Added changelog entry documenting the prompt re-sync and rationale

Related Issues & PRs

No related issues identified.


AI Review Summary — generated by ai-pr-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jeremyandrews
jeremyandrews merged commit 47acf83 into main Aug 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant