Skip to content

feat: Classify prose/empty LLM output as ProseOutputError before architecture gate (#1649)#1665

Open
prompt-driven-github[bot] wants to merge 4 commits into
mainfrom
change/issue-1649
Open

feat: Classify prose/empty LLM output as ProseOutputError before architecture gate (#1649)#1665
prompt-driven-github[bot] wants to merge 4 commits into
mainfrom
change/issue-1649

Conversation

@prompt-driven-github

Copy link
Copy Markdown
Contributor

Summary

Adds a ProseOutputError classification gate that fires before the architecture conformance check when an LLM returns prose or an empty/whitespace-only response instead of source code. This prevents prose/planning responses from being misreported as architecture-conformance failures.

Closes #1649

Changes Made

Prompts Modified

  • pdd/prompts/code_generator_main_python.prompt — Added ProseOutputError(click.UsageError) typed exception and Requirement 5a: prose/empty-output classification gate that fires before architecture/public-surface checks when generated_code_content is blank; includes repair_directive property returning the output-shape instruction; escape hatch via PDD_ALLOW_EMPTY_GENERATION=1
  • pdd/prompts/agentic_sync_runner_python.prompt — Added _parse_prose_output_failure helper (checked first, before conformance/surface/churn), limited to 1 prose retry (2 total attempts); added build_prose_output_hard_failure_from_error export; added === generation output extraction failure === hard-failure block

Documentation Updated

  • README.md — Added "Prose/empty-output classification gate" bullet; updated "On failure" sentence to mention ProseOutputError prose retry and the new hard-failure block name
  • CHANGELOG.md — Added feat bullet for ProseOutputError classification gate, prose retry limit, hard-failure block, and escape hatch

Architecture Metadata

  • architecture.json — Synced with ProseOutputError additions (normalized special character encoding)

User Stories

  • Policy: warn
  • user_stories/story__agentic_sync_runner_code_generator_main.md — issue-derived story linked to: agentic_sync_runner_python.prompt, code_generator_main_python.prompt
  • user_stories/contracts/agentic_sync_runner_code_generator_main.contract.md — generated machine-checkable contract
  • Validation: ❌ 1 of 1 linked story check(s) failed: user_stories/story__agentic_sync_runner_code_generator_main.md
  • ⚠️ Warning (non-blocking): failing linked story check(s): user_stories/story__agentic_sync_runner_code_generator_main.md

Review Checklist

  • Prompt syntax is valid
  • PDD conventions followed
  • Documentation is up to date

Next Steps After Merge

  1. Regenerate code from modified prompts in dependency order:
    pdd sync code_generator_main
    pdd sync agentic_sync_runner
    pdd sync one_session_sync
    pdd sync pre_checkup_gate
    pdd sync durable_sync_runner
    pdd sync prompts
    pdd sync sync_main
    pdd sync agentic_sync
    pdd sync checkup
    pdd sync ci_drift_heal
    pdd sync maintenance
    pdd sync agentic_checkup
    pdd sync generate
    pdd sync pin_example_hack
    pdd sync sync_orchestration
    
  2. Run tests to verify functionality
  3. Deploy if applicable

Created by pdd change workflow

pdd-bot and others added 4 commits June 18, 2026 23:48
…1649)

- prompts/code_generator_main_python.prompt: add ProseOutputError to
  pdd-interface CLI block; add Requirement 5a for prose/empty-output
  classification gate (raises before architecture conformance gate when
  extractor returns no code); add Deliverable 8 for the new exception class
- prompts/agentic_sync_runner_python.prompt: add
  build_prose_output_hard_failure_from_error to pdd-interface; update
  Requirement 9b to check prose failures first with 1-attempt cap;
  update 9c short-circuit with ("prose",) sentinel; update 9d with
  === generation output extraction failure === block; add
  _parse_prose_output_failure and build_prose_output_hard_failure_from_error
  helper specs
- README.md: add Prose/empty-output classification gate bullet before
  Empty-generation guard; update On-failure sentence with ProseOutputError
  and new structured failure block name
- CHANGELOG.md: add feat bullet for sync ProseOutputError classification

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add build_prose_output_hard_failure_from_error to agentic_sync_runner
interface; update description to reflect four repairable failure types
including prose-output detection, 1-attempt cap, and the new hard-failure
block name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Convert literal em-dash and multiplication sign characters to their JSON
Unicode escape sequences (\u2014, \u00d7) for consistent encoding.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add issue-derived user story and machine-checkable contract for
agentic_sync_runner and code_generator_main prompt changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Classify prose/empty LLM generation output separately from architecture regressions

2 participants