feat: add refine command to improve drafts against SeoBrief #14
+1,309
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
metaandtranslate.--section,--intensity, and--evidenceoptions.Description
scribae refine(registered insrc/scribae/main.py) implemented insrc/scribae/refine_cli.pywith flags matching the design (--in,--brief,--note,--feedback,--section,--intensity,--evidence,--out,--dry-run,--apply-feedback,--changelog,--preserve-anchors,--save-prompt).src/scribae/refine.pyincluding draft parsing (parse_draft), section mapping to theSeoBriefoutline, snippet selection viasnippets.build_snippet_block, LLM invocation, evidence handling, intensity modes, prompt artifact saving, and optional changelog generation.src/scribae/prompts/refine.pywithSYSTEM_PROMPT, per-section user prompt builder, and changelog prompt builder; updatesrc/scribae/prompts/__init__.pyaccordingly.tests/fixtures/draft.mdandtests/unit/refine_cli_test.pyexercising full refine flow, section-range behavior, evidence handling, dry-run feedback inclusion, and changelog output.Testing
uv run ruff checkand fixed style issues; result: passed.uv run pytestand observed all tests passing:121 passed.uv run mypywhich reported type-check failures due to missingtorchstubs insrc/scribae/translate/mt.pyand is therefore not green.scribae refine --in draft.md --brief brief.json --out refined.mdproduces refined markdown and respects--section,--intensity,--evidence,--dry-run, and--changelogoptions.Codex Task