chore: update convert_pitch_to_markdown.py#4
Merged
Conversation
preceeded -> preceded
Member
|
thank you |
neoneye
added a commit
that referenced
this pull request
May 15, 2026
…y a code review
Self-review of compress_report_section.py found a dozen real (not cosmetic) issues. Net effect: -113/+67 lines; cleaner and more consistent.
Substantive fixes:
1. Resolved the source_quote word-limit self-contradiction: the schema field said ≤12, the SCORING_DISCIPLINE opening said ≤12, and its closing paragraph said ≤8. Unified on ≤12 everywhere — the LLM no longer sees two different numbers in the same prompt.
2. Replaced the broken __main__ block. It pointed at Ollama Llama 3.1 (16K context) and execute_from_file (single-file shape), neither of which matches the production pipeline (Gemini Flash Lite, multi-file Luigi blobs). Now it raises with a one-line pointer to the run_compress_full driver.
3. SectionSummaryOnly's field description duplicated SECTION_SUMMARY_BUCKET_PROMPT word-for-word. Replaced with a shared minimal stub that matches the other five bucket schemas.
4. The five bucket-only schemas had three different description styles ('full sentence', 'See system prompt for the required line format and scoring.', 'See system prompt.'). Unified all six on a single _BUCKET_FIELD_DESC constant.
5. NumericValuesOnly's description referenced 'the required line format' — but 'line' was split into line_english/line_original previously. Dead reference removed via fix #4.
6. The 'Output exactly one JSON OBJECT with key X' shape-reminder paragraph appeared in all five list-bucket prompts. The JSON schema already names the field; the duplicated paragraph was the same redundancy class as the previously-removed 'produce ONLY the X' opener. Five copies removed.
7. format_scored_item_line's docstring referenced 'v10 inline-tag convention'. Versions are not retained; reference now describes the tag's purpose instead.
8. The bucket loop used 'if i == 0:' to attach the section wrapper to the first turn. Renamed to 'turn_index' and added a comment so the 'first turn gets section context' intent is explicit, not numeric coincidence.
9. The 'line' reference is fully gone (handled in #4).
10. The missing-data bucket prompt leaked implementation: '...keeps the assistant turn the model sees in the chat history honest.' Same pattern flagged earlier with 'the Python pipeline'. Removed.
11. infer_section_type_from_path docstring named 'PlanExe'; the function is generic. Generic docstring.
12. execute_from_file's title fallback was 'path.stem.replace("_", " ").title()' — fine for premortem.md, nonsense for compress_premortem_raw.json.md. Now: explicit title wins; if the stem is a recognised section, derive from it; else fall back to 'Compressed Section'.
Bonus: CompressedReportSection had Field(description=...) calls but the class docstring explicitly said 'the LLM never sees this model directly'. Those descriptions were dead documentation aimed at no audience. Dropped the descriptions; field types and class docstring are now the documentation.
11 unit tests pass. End-to-end premortem post-cleanup still has 6/6 stress_test on risks_and_shocks.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
preceeded -> preceded