Skip to content

feat(calendar): inject natural-language preferences into the assistant prompt - #46

Open
Luiz do Valle (luizvalle) wants to merge 2 commits into
luizdovalle/soft-prefs-01-schema-loaderfrom
luizdovalle/soft-prefs-02-prompt-injection
Open

feat(calendar): inject natural-language preferences into the assistant prompt#46
Luiz do Valle (luizvalle) wants to merge 2 commits into
luizdovalle/soft-prefs-01-schema-loaderfrom
luizdovalle/soft-prefs-02-prompt-injection

Conversation

@luizvalle

@luizvalle Luiz do Valle (luizvalle) commented Jul 27, 2026

Copy link
Copy Markdown

Goal

Show the assistant the preference document #45 loads, and tell it what the document is for. A task that sets no document must produce a byte-identical prompt to main.

Summary of changes

The document goes in the user turn, wrapped in <user_preference> tags. format_user_preference_block renders it; the assistant appends it only when preference_md is set, and otherwise runs the existing format_preferences_for_prompt path untouched.

CALENDAR_PREFERENCE_GUIDANCE explains the tag in the system prompt. It states that the block is the only authority on when the principal is bookable, that absolute language is a hard limit, and that stated rankings decide which preference yields when two conflict. This text is the contract the model is graded against, so it is worth reading closely.

No working day is hard-coded. Bookable hours belong to the document, matching legacy behavior, where hours come from the per-assistant preference table rather than a global constant.

How to test

uv run pytest packages/srbench/tests/test_calendar_preference_prompt.py

test_numeric_task_prompt_is_unchanged is the back-compat guard.

Tracked by #50.

…t prompt

When a task carries `preference_md`, the assistant appends the text to its
user turn inside a `<user_preference>` block and appends
`CALENDAR_PREFERENCE_GUIDANCE` to its system prompt. The guidance is the
contract the model is graded against: absolute phrasings are hard
constraints, inclinations are soft preferences, and an unsatisfiable request
should be declined rather than forced.

Tasks without `preference_md` are untouched — numeric preferences still go
through `format_preferences_for_prompt` and no guidance is added. A
regression test reproduces the pre-change prompt byte for byte.

Nothing grades these preferences yet; that arrives with the scoring engine.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4709c4ae-3295-4bbb-866b-dff62e7ad4d3
The guidance said to pick the time that honors the most preferences,
which is a count. Preference documents rank their soft preferences
against each other, and the verifier scores them by that rank, so an
assistant following the guidance literally would optimize the wrong
thing: two minor preferences would beat the one its principal called
most important.

The bullet now says to follow the ranking the block gives, quoting the
phrasing documents use for it, and falls back to counting only when no
ranking is stated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4709c4ae-3295-4bbb-866b-dff62e7ad4d3
@luizvalle
Luiz do Valle (luizvalle) force-pushed the luizdovalle/soft-prefs-02-prompt-injection branch from e249a81 to 5333cfb Compare July 28, 2026 00:16
@luizvalle
Luiz do Valle (luizvalle) marked this pull request as ready for review July 28, 2026 16:23
"they pull in different directions, follow the ranking the block gives them "
'("matters most", "second to that", "least important") and honor the higher '
"one; if it ranks none of them, pick the time that honors the most.\n"
"- Preferences are your principal's, not the requestor's. If the requested time "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Throughout the benchmark we've refrained from telling the model "how to" go about advocating for the principal. We didn't want the benchmark to become an "instruction following" benchmark. I think we should remove any statements telling the model how to translate preferences into scheduling actions.

"principal's standing scheduling preferences, written about them in the third "
'person ("User prefers…", "User never…"). Treat that block as a standing '
"instruction that applies to every meeting you schedule on their behalf:\n"
"- The block is the only authority on when your principal is bookable. Any hours "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I find this statement more confusing than helpful. Because the calendar itself is another authority on when the principal is bookable, right?

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.

2 participants