Skip to content

Externalise verify_commands and verify_errors prompt sections into Markdown templates#78

Merged
vm-mishchenko merged 4 commits into
mainfrom
260514-spec-externalise-verify-sections
May 14, 2026
Merged

Externalise verify_commands and verify_errors prompt sections into Markdown templates#78
vm-mishchenko merged 4 commits into
mainfrom
260514-spec-externalise-verify-sections

Conversation

@vm-mishchenko
Copy link
Copy Markdown
Owner

Summary

  • Moves the ## Verified commands and ## Verified errors section text out of inline Python f-strings in implement_spec/__init__.py and into two new sibling Markdown templates (verify_commands.md, verify_errors.md)
  • Both helpers now load their template via importlib.resources and substitute a single placeholder ({{COMMANDS}} / {{ERRORS}}), matching the pattern already used by original_spec_*.md
  • Rendered output is byte-for-byte identical to the pre-refactor f-strings across all input combinations

Test plan

  • All pre-existing tests in tests/draft/test_code_spec.py pass without modification
  • New tests added to pin: placeholder substitution ({{COMMANDS}}, {{ERRORS}} absent in output), multiple-command ordering, empty-input short-circuit (template file not opened), byte-equivalence assertions, template file presence guard, and correct handling of a command containing a literal {{COMMANDS}} string

vm-mishchenko and others added 4 commits May 14, 2026 15:17
…rkdown templates

Replace the inline string literals for the "Verified commands" and
"Verified errors" sections with dedicated Markdown template files
(`verify_commands.md`, `verify_errors.md`) loaded via `importlib.resources`.

This makes the prompt copy editable without touching Python code and
keeps the logic layer free of presentation concerns.
@vm-mishchenko vm-mishchenko marked this pull request as ready for review May 14, 2026 22:25
@vm-mishchenko vm-mishchenko merged commit 4df6a29 into main May 14, 2026
1 check passed
@vm-mishchenko vm-mishchenko deleted the 260514-spec-externalise-verify-sections branch May 14, 2026 23:13
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