Fix a misread phrase
Your finance team counts quarters from its fiscal year, which starts on 1 July, so “vouchers
entered in Q1” means July to September. The active prompt, plan-writer.v7, reads Q1 as January
to March. This guide follows the fix, from a draft prompt to a release, including a mistake the
test set catches on the way.
You’ll use: the Prompt Store, the test set, and the service’s plan and test commands.
Draft the change
Section titled “Draft the change”In a working copy of the service’s files, such as ~/nlsearch-next, copy plan-writer.v7.txt to
plan-writer.v8.txt, and rewrite its date rule for fiscal quarters. Never edit a version that’s
been released: the audit log records which version made each plan, so a version must always mean
the same text.
- Resolve relative dates from today's date. Quarters are fiscal quarters, and the fiscal year starts on 1 July.Then add a test for the change to tests/find_vouchers.yaml, so the test set checks it from now on:
- question: Vouchers entered in Q1 today: 2026-10-01 expect: intent: find_vouchers filters: - field: entered op: between value: [2026-07-01, 2026-09-30]Test the draft
Section titled “Test the draft”Run the test set against the draft, with test --prompt-version 8:
Prompt plan-writer v8, Intent Store 2026.10.151 of 53 questions produced the expected plan
tests/find_requisitions.yaml, "Laptops ordered since June" expected ordered after 2026-05-31 got ordered after 2026-06-01
tests/find_vouchers.yaml, "Vouchers entered since Monday" expected entered after 2026-09-27 got entered after 2026-09-28The new test passes, but two old ones fail, in the same way: after doesn’t include the date
itself, so since June has to be after 2026-05-31. The draft’s plans would leave out anything
ordered on 1 June, or entered on Monday.
Reproduce it
Section titled “Reproduce it”Ask for one of the plans with the service’s plan command, which prints the plan and the summary
that users would see:
podman run --rm \ -v ~/nlsearch-next:/etc/aipeoplesoft:ro,Z \ --secret aips_llm_api_key,type=env,target=AIPS_LLM_API_KEY \ aipeoplesoft-nlsearch:1.0 plan --prompt-version 8 \ --today 2026-10-01 "Laptops ordered since June"Intent find_requisitionsText notebookFilters ordered after 2026-06-01Summary Requisitions · “notebook” · Ordered: after 1 June 2026Version 7 read since correctly without being told how; the rewritten date rule changed how the LLM reads it. A user would have seen after 1 June 2026 in the summary, but few would notice that it leaves out 1 June.
Fix it with a rule
Section titled “Fix it with a rule”Say how to read since, rather than relying on the LLM to guess. Save the draft as a new version,
plan-writer.v9.txt, with one more rule:
- Resolve relative dates from today's date. Quarters are fiscal quarters, and the fiscal year starts on 1 July.- "Since" or "from" a date includes that date, so use after with the day before it: since June is after May 31.Compare it with the version in use
Section titled “Compare it with the version in use”Run the test set against the new version, and against the active one:
Prompt plan-writer v9, Intent Store 2026.10.153 of 53 questions produced the expected planPrompt plan-writer v7, Intent Store 2026.10.152 of 53 questions produced the expected plan
tests/find_vouchers.yaml, "Vouchers entered in Q1" expected entered between 2026-07-01 and 2026-09-30 got entered between 2026-01-01 and 2026-03-31Version 9 does everything version 7 does, and reads quarters the way your finance team does.
Release it
Section titled “Release it”-
Copy the prompt and the tests from the working copy to
~/nlsearch. Leaveplan-writer.v8.txtout, or keep it for the record: nothing uses a version that isn’t active. -
Make version 9 active. In
nlsearch.yaml, setplan-writerunderprompts.activeto9, and restart the service withsystemctl --user restart aipeoplesoft-nlsearch. -
Watch the audit log. New entries show
plan-writer.v9as their prompt version. Check the questions with quarters and since in them for the next few days. -
Roll back if you need to by setting
plan-writerback to7, and restarting the service.
