Enforce the ask_instruction sentence-initial contract

Review on #576 caught document.md:71 splicing {{ask_instruction}} after
"then", which is the same defect this branch set out to fix. Rendered for
Codex it produced "Show the user the existing file, then STOP and use Codex's
structured user-input/question tool...". The line now starts a new sentence.

The comment added to PROVIDER_PLACEHOLDERS asserted the contract without
enforcing it, which is exactly how four reference files shipped the splice in
the first place. validateAskInstructionSites() in build.js now checks every
call site and fails the build on a mid-sentence interpolation, and the comment
points at the gate instead of asking authors to remember.

Prepared with AI assistance (Claude Code).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-08-13 13:24:29 -04:00
co-authored by Claude Opus 5
parent 0e5c6cbe17
commit d4e1b0902f
3 changed files with 61 additions and 4 deletions
+4 -2
View File
@@ -477,8 +477,10 @@ export const PROVIDER_PLACEHOLDERS = {
'codex': {
model: 'GPT',
config_file: 'AGENTS.md',
// Every {{ask_instruction}} call site is sentence-initial, so each value is a
// complete capitalized sentence. Keep it that way when adding a provider.
// Each value is a complete capitalized sentence, because every
// {{ask_instruction}} call site is sentence-initial. That is enforced by
// validateAskInstructionSites() in scripts/build.js, not left to authors:
// four reference files had already spliced the placeholder mid-sentence.
ask_instruction: "STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.",
command_prefix: '$'
},